* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', -apple-system, sans-serif;
  background: #0f1117;
  color: #e4e4e7;
  line-height: 1.6;
}

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem;
  background: #1a1b23;
  border-bottom: 1px solid #2a2b35;
}
.header-left h1 { font-size: 1.3rem; color: #f4f4f5; }
.title-link { color: inherit; text-decoration: none; }
.title-link:hover { color: #818cf8; }
.subtitle { font-size: 0.8rem; color: #71717a; margin-top: 2px; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.lang-switch { display: flex; gap: 2px; font-size: 0.75rem; }
.lang-switch a { padding: 0.25rem 0.5rem; color: #71717a; text-decoration: none; border-radius: 4px; }
.lang-switch a:hover { color: #e4e4e7; }
.lang-switch a.active { color: #818cf8; font-weight: 600; background: #27283a; }

.btn {
  padding: 0.45rem 1rem;
  background: #27283a;
  border: 1px solid #3a3b4a;
  border-radius: 6px;
  color: #e4e4e7;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #3a3b4a; }
.btn-accent { background: #2563eb; border-color: #3b82f6; color: #fff; }
.btn-accent:hover { background: #1d4ed8; }
.btn-danger { background: #7f1d1d; border-color: #991b1b; color: #fca5a5; }
.btn-danger:hover { background: #991b1b; }

.stats-row {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  padding: 1rem 2rem;
  background: #13141c;
}
.stat-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.6rem 1.2rem;
  background: #1a1b23;
  border-radius: 8px;
  min-width: 90px;
}
.stat-label { font-size: 0.7rem; color: #71717a; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #f4f4f5; }
.stat-value.published { color: #22c55e; }
.stat-value.hold { color: #f59e0b; }
.stat-value.date { font-size: 1rem; color: #a1a1aa; }
.grade-text-S { color: #fbbf24; }
.grade-text-A { color: #60a5fa; }
.grade-text-B { color: #4ade80; }
.grade-text-C { color: #a1a1aa; }

.filters {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.75rem 2rem;
  background: #1a1b23;
  border-bottom: 1px solid #2a2b35;
}
.filters select, .filters input {
  padding: 0.45rem 0.75rem;
  background: #27283a;
  border: 1px solid #3a3b4a;
  border-radius: 6px;
  color: #e4e4e7;
  font-size: 0.85rem;
}
.filter-count { margin-left: auto; color: #71717a; font-size: 0.85rem; }

.grade-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
}
.grade-S { background: #fbbf24; color: #1a1b23; }
.grade-A { background: #60a5fa; color: #1a1b23; }
.grade-B { background: #4ade80; color: #1a1b23; }
.grade-C { background: #a1a1aa; color: #1a1b23; }
.grade-D { background: #52525b; color: #d4d4d8; }

.profile-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}
.profile-badge.senior { background: #c084fc; color: #1a1b23; }

.idea-list {
  padding: 1rem 2rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}

.loading, .empty {
  text-align: center;
  padding: 3rem;
  color: #71717a;
  font-size: 1.1rem;
}

.idea-card {
  background: #1a1b23;
  border: 1px solid #2a2b35;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.2s;
}
.idea-card:hover { border-color: #4a4b5a; }
.card-published { border-left: 3px solid #22c55e; }
.card-hold { border-left: 3px solid #f59e0b; }
.card-rejected { border-left: 3px solid #ef4444; opacity: 0.5; }

.idea-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.idea-header h3 { flex: 1; font-size: 1.05rem; }
.score { font-size: 1.1rem; font-weight: 700; color: #fbbf24; }

.idea-body { margin-bottom: 0.6rem; }
.field { font-size: 0.88rem; color: #d4d4d8; padding: 0.15rem 0; }

/* ── Option A: Icon Mini-Cards ── */
.mini-cards { display: flex; flex-direction: column; gap: 0.5rem; }
.mini-card {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: #16171f;
  border-radius: 8px;
  border-left: 3px solid #3a3b4a;
}
.mini-card p { font-size: 0.86rem; color: #d4d4d8; margin: 0; line-height: 1.45; }
.mini-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; line-height: 1.4; }
.mini-label {
  display: block; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #71717a; margin-bottom: 0.15rem;
}
.mini-problem { border-left-color: #ef4444; }
.mini-solution { border-left-color: #22c55e; }
.mini-target { border-left-color: #3b82f6; }
.mini-revenue { border-left-color: #f59e0b; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

details {
  border-top: 1px solid #2a2b35;
  padding: 0.4rem 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: #a1a1aa;
  padding: 0.2rem 0;
}
.api-list { padding-left: 1.5rem; font-size: 0.85rem; color: #a1a1aa; }
.api-list li { padding: 0.1rem 0; }

.scores-row { display: flex; gap: 0.5rem; padding: 0.3rem 0; }
.score-chip {
  background: #27283a;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #d4d4d8;
}

.idea-actions {
  display: flex; gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid #2a2b35;
}
.idea-actions button {
  padding: 0.3rem 0.8rem;
  background: #27283a;
  border: 1px solid #3a3b4a;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #a1a1aa;
  transition: all 0.15s;
}
.idea-actions button:hover { background: #3a3b4a; color: #e4e4e7; }
.idea-actions button.active { background: #166534; border-color: #22c55e; color: #22c55e; }
.idea-actions button.hold-active { background: #713f12; border-color: #f59e0b; color: #f59e0b; }
.idea-actions button.reject-active { background: #7f1d1d; border-color: #ef4444; color: #ef4444; }
.btn-feedback { font-size: 0.75rem; }

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #27283a;
  border: 1px solid #3a3b4a;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #e4e4e7;
  cursor: pointer;
  z-index: 1000;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; } }

/* ═══════════════════════════════════════════════
   v7.2 Dashboard Detail Overhaul
   ═══════════════════════════════════════════════ */

/* ── Ecosystem Role Badge ── */
.role-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}
.role-supplier { background: #3b82f6; color: #fff; }
.role-consumer { background: #22c55e; color: #1a1b23; }
.role-infra { background: #f59e0b; color: #1a1b23; }
.role-regulation { background: #ef4444; color: #fff; }
.role-education { background: #c084fc; color: #1a1b23; }

/* ── MVP Badge ── */
.mvp-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
}
.mvp-2_weeks { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid #22c55e; }
.mvp-1_month { background: rgba(96, 165, 250, 0.15); color: #60a5fa; border: 1px solid #60a5fa; }
.mvp-3_months { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid #f59e0b; }
.mvp-6_months_plus { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid #ef4444; }

/* ── Meta Strip ── */
.meta-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid #2a2b35;
  flex-wrap: wrap;
}
.chain {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.chain-label {
  font-size: 0.7rem;
  color: #71717a;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.2rem;
}
.chain-step {
  font-size: 0.75rem;
  color: #a1a1aa;
  background: #27283a;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.chain-step-last { color: #e4e4e7; border: 1px solid #4a4b5a; }
.chain-arrow { color: #52525b; font-size: 0.65rem; }
.depth-badge {
  font-size: 0.6rem;
  background: #3a3b4a;
  color: #a1a1aa;
  padding: 0 0.3rem;
  border-radius: 3px;
  font-weight: 700;
}

/* ── Competitor Badge ── */
.competitor-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.comp-none { background: #27283a; color: #71717a; }
.comp-unknown { background: #27283a; color: #52525b; }
.comp-blue { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.comp-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.comp-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ── Score Gauges ── */
.score-gauges {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  margin-bottom: 0.3rem;
}
.gauge {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.gauge-label {
  font-size: 0.75rem;
  color: #71717a;
  font-weight: 600;
  min-width: 36px;
}
.gauge-track {
  flex: 1;
  height: 6px;
  background: #27283a;
  border-radius: 3px;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.gauge-green { background: #22c55e; }
.gauge-amber { background: #f59e0b; }
.gauge-red { background: #ef4444; }
.gauge-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d4d4d8;
  min-width: 50px;
  text-align: right;
}

/* ── NUMR-V Visual Bars ── */
.numrv-bars { padding: 0.3rem 0; }
.numrv-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
}
.numrv-key {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d4d4d8;
  width: 14px;
  text-align: center;
}
.numrv-track {
  width: 80px;
  height: 8px;
  background: #27283a;
  border-radius: 4px;
  overflow: hidden;
}
.numrv-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.numrv-high { background: #22c55e; }
.numrv-mid { background: #f59e0b; }
.numrv-low { background: #ef4444; }
.numrv-val {
  font-size: 0.75rem;
  font-weight: 600;
  color: #d4d4d8;
  min-width: 24px;
}
.numrv-label {
  font-size: 0.7rem;
  color: #71717a;
}

/* ── Breakdown Bars (feasibility + validation) ── */
.breakdown-bars { padding: 0.3rem 0; }
.breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
}
.bd-label {
  font-size: 0.75rem;
  color: #a1a1aa;
  min-width: 90px;
  white-space: nowrap;
}
.bd-track {
  flex: 1;
  height: 6px;
  background: #27283a;
  border-radius: 3px;
  overflow: hidden;
  max-width: 120px;
}
.bd-fill {
  height: 100%;
  background: #60a5fa;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.bd-val {
  font-size: 0.72rem;
  color: #71717a;
  min-width: 48px;
  text-align: right;
}

/* ── Tech Requirements Chips ── */
.tech-chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.3rem 0;
}
.tech-chip {
  background: #1f2029;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  border-left: 3px solid #3a3b4a;
}
.complexity-low { border-left-color: #22c55e; }
.complexity-medium { border-left-color: #f59e0b; }
.complexity-high { border-left-color: #ef4444; }
.tech-comp {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e4e4e7;
}
.tech-cx {
  font-size: 0.7rem;
  color: #71717a;
  margin-left: 0.3rem;
}
.tech-desc {
  font-size: 0.78rem;
  color: #a1a1aa;
  margin-top: 0.15rem;
  line-height: 1.4;
}

/* ── Data Source Chips ── */
.ds-chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.3rem 0;
}
.ds-chip {
  background: #1f2029;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #2a2b35;
}
.ds-required { border-color: #3b82f6; }
.ds-optional { border-color: #3a3b4a; border-style: dashed; opacity: 0.7; }
.ds-type {
  font-size: 0.78rem;
  font-weight: 700;
  color: #60a5fa;
}
.ds-priority {
  font-size: 0.65rem;
  color: #71717a;
  margin-left: 0.4rem;
  text-transform: uppercase;
}
.ds-desc {
  font-size: 0.78rem;
  color: #a1a1aa;
  margin-top: 0.15rem;
  line-height: 1.4;
}

/* ── Collapsible Chain (full display) ── */
.chain-full { padding: 0.4rem 0; }
.chain-full .chain-step {
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}
.chain-flow {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

/* ── API score chip ── */
.api-score-chip {
  font-size: 0.7rem;
  background: #27283a;
  padding: 0 0.3rem;
  border-radius: 3px;
  color: #71717a;
  margin-left: 0.3rem;
}

/* ── Details section scoping ── */
.details-section details {
  border-top: 1px solid #2a2b35;
  padding: 0.3rem 0;
}
.details-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  color: #a1a1aa;
  padding: 0.2rem 0;
  user-select: none;
}
.details-section summary:hover { color: #e4e4e7; }

/* ── Info Tooltip ── */
.info-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  width: 18px; height: 18px;
  font-size: 0.72rem;
  color: #71717a;
  background: rgba(113,113,122,0.12);
  border: 1px solid #3a3b4a;
  border-radius: 50%;
  margin-left: 0.4rem;
  vertical-align: middle;
  line-height: 1;
  transition: all 0.15s;
}
.info-trigger:hover {
  color: #e4e4e7;
  background: rgba(113,113,122,0.25);
  border-color: #52525b;
}

.info-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 540px;
  max-width: 92vw;
  background: #16171f;
  border: 1px solid #2e2f3e;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: #d4d4d8;
  line-height: 1.5;
  z-index: 600;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
.info-trigger:hover .info-tooltip { display: block; }
.info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 16px;
  border: 7px solid transparent;
  border-top-color: #2e2f3e;
}

/* Title */
.info-tooltip .tt-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f4f4f5;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #2a2b38;
  letter-spacing: -0.01em;
}

/* Table */
.info-tooltip table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 0.6rem;
}
.info-tooltip .tt-key {
  width: 120px;
  white-space: nowrap;
  color: #e4e4e7;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem 0.35rem 0;
  vertical-align: top;
  border-bottom: 1px solid #1e1f2e;
}
.info-tooltip .tt-letter {
  display: inline-block;
  width: 18px; height: 18px;
  line-height: 18px;
  text-align: center;
  font-weight: 800;
  font-size: 0.72rem;
  color: #fbbf24;
  background: rgba(251,191,36,0.12);
  border-radius: 4px;
  margin-right: 0.3rem;
}
.info-tooltip .tt-score {
  width: 44px;
  color: #a78bfa;
  font-weight: 700;
  font-size: 0.78rem;
  text-align: center;
  padding: 0.35rem 0.25rem;
  vertical-align: top;
  border-bottom: 1px solid #1e1f2e;
}
.info-tooltip .tt-desc {
  color: #a1a1aa;
  font-size: 0.76rem;
  line-height: 1.45;
  padding: 0.35rem 0 0.35rem 0.4rem;
  vertical-align: top;
  border-bottom: 1px solid #1e1f2e;
}

/* Footer */
.info-tooltip .tt-footer {
  font-size: 0.75rem;
  color: #71717a;
  padding-top: 0.4rem;
  border-top: 1px solid #2a2b38;
}
.info-tooltip .tt-footer b { color: #d4d4d8; }

/* Weights row */
.info-tooltip .tt-weights {
  display: flex;
  gap: 1rem;
  font-size: 0.73rem;
  color: #60a5fa;
  margin-top: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: rgba(96,165,250,0.07);
  border: 1px solid rgba(96,165,250,0.12);
  border-radius: 6px;
}
.info-tooltip .tt-weights b { color: #93c5fd; }

/* ── Filters: wrap on narrow viewports ── */
.filters { flex-wrap: wrap; }

/* ═══════════════════════════════════════════════
   W2: Auth, Engine, Modal, Mobile Responsive
   ═══════════════════════════════════════════════ */

/* ── Trend Chart ── */
.trend-section {
  margin: 1rem 0;
  padding: 1rem 1.5rem;
  background: #1a1b23;
  border: 1px solid #2e2f3e;
  border-radius: 10px;
}
.trend-title {
  font-size: 0.95rem;
  color: #a1a1aa;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

/* ── Ad Slot ── */
.ad-slot {
  padding: 0.5rem;
  background: rgba(26, 27, 35, 0.5);
  border-bottom: 1px dashed #2a2b35;
  text-align: center;
  color: #52525b;
  font-size: 0.7rem;
}

/* ── Idea Permalink Link ── */
.idea-link {
  color: inherit;
  text-decoration: none;
}
.idea-link:hover {
  color: #818cf8;
  text-decoration: underline;
}

/* ── Header Auth Controls ── */
.header-divider {
  width: 1px; height: 24px;
  background: #3a3b4a;
  margin: 0 0.3rem;
}
.auth-user {
  font-size: 0.82rem;
  font-weight: 600;
  color: #60a5fa;
  padding: 0.3rem 0.6rem;
  background: rgba(96, 165, 250, 0.1);
  border-radius: 6px;
}
.btn-ghost {
  background: transparent; border: 1px solid #3a3b4a;
  color: #a1a1aa; font-size: 0.82rem;
}
.btn-ghost:hover { background: #27283a; color: #e4e4e7; }
.btn-primary {
  background: #2563eb; border: 1px solid #3b82f6;
  color: #fff; font-size: 0.85rem;
}
.btn-primary:hover { background: #1d4ed8; }

/* ── Engine Button & Banner ── */
.btn-engine {
  background: #065f46; border: 1px solid #059669; color: #34d399;
}
.btn-engine:hover { background: #047857; }
.btn-engine:disabled {
  opacity: 0.6; cursor: not-allowed;
  background: #27283a; border-color: #3a3b4a; color: #71717a;
}

.engine-banner {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 2rem;
  background: rgba(6, 95, 70, 0.3);
  border-bottom: 1px solid #059669;
  font-size: 0.85rem; color: #34d399;
}
.engine-banner.engine-done {
  background: rgba(22, 101, 52, 0.2);
  border-bottom-color: #22c55e;
  color: #4ade80;
}
.engine-banner.engine-error {
  background: rgba(127, 29, 29, 0.3);
  border-bottom-color: #ef4444;
  color: #fca5a5;
}
.archive-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.7rem 2rem;
  background: rgba(129, 140, 248, 0.12);
  border-bottom: 1px solid rgba(129, 140, 248, 0.32);
  color: #d4d4d8;
  font-size: 0.84rem;
}
.archive-banner strong {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.18);
  color: #c7d2fe;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.archive-link {
  color: #c7d2fe;
  font-weight: 700;
}
.archive-link:hover {
  color: #e0e7ff;
}
.engine-run-id { font-size: 0.75rem; color: #71717a; }

.engine-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #34d399;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}
.modal-card {
  background: #1a1b23;
  border: 1px solid #2e2f3e;
  border-radius: 12px;
  padding: 2rem;
  width: 360px;
  max-width: 92vw;
}
.modal-card h2 {
  font-size: 1.2rem; margin-bottom: 1.2rem;
  color: #f4f4f5;
}
.modal-card input {
  display: block; width: 100%;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.75rem;
  background: #27283a;
  border: 1px solid #3a3b4a;
  border-radius: 8px;
  color: #e4e4e7;
  font-size: 0.9rem;
}
.modal-card input:focus {
  outline: none; border-color: #3b82f6;
}
.modal-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: #fca5a5;
}
.modal-actions {
  display: flex; gap: 0.5rem; justify-content: flex-end;
  margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════
   Mobile Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    align-items: flex-start;
  }
  .header-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }
  .header-divider { display: none; }

  .stats-row {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .stat-card {
    min-width: 70px;
    padding: 0.5rem 0.8rem;
  }
  .stat-value { font-size: 1.2rem; }

  .filters {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }
  .filters select, .filters input {
    min-width: 0;
    flex: 1 1 120px;
    font-size: 0.8rem;
  }

  .idea-list { padding: 0.75rem 1rem; }

  .idea-card { padding: 0.8rem; }
  .idea-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .idea-header h3 { font-size: 0.95rem; width: 100%; order: 5; }

  .meta-strip { gap: 0.4rem; }
  .chain-step { max-width: 120px; }

  .score-gauges { flex-direction: column; gap: 0.4rem; }
  .mini-grid { grid-template-columns: 1fr; }

  /* Tooltip: full-width on mobile */
  .info-tooltip {
    position: fixed;
    left: 4px; right: 4px;
    bottom: auto; top: 60px;
    width: auto;
    max-width: 100vw;
  }
  .info-tooltip::after { display: none; }

  .engine-banner { padding: 0.5rem 1rem; font-size: 0.8rem; }

  .idea-actions { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .header-left h1 { font-size: 1rem; }
  .btn { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
  .stat-card { padding: 0.4rem 0.5rem; }
  .stat-value { font-size: 1rem; }
  .stat-label { font-size: 0.6rem; }
  .idea-header h3 { font-size: 0.88rem; }
  .field { font-size: 0.82rem; }
}

/* ═══════════════════════════════════════════════
   Theme Toggle Button
   ═══════════════════════════════════════════════ */
.btn-theme {
  background: transparent;
  border: 1px solid #3a3b4a;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.btn-theme:hover { background: #3a3b4a; }

/* ═══════════════════════════════════════════════
   Light Theme
   ═══════════════════════════════════════════════ */
[data-theme="light"] body {
  background: #f8f9fa;
  color: #212529;
}
[data-theme="light"] header {
  background: #ffffff;
  border-bottom-color: #dee2e6;
}
[data-theme="light"] .header-left h1 { color: #212529; }
[data-theme="light"] .title-link { color: inherit; }
[data-theme="light"] .title-link:hover { color: #6366f1; }
[data-theme="light"] .subtitle { color: #6c757d; }
[data-theme="light"] .btn {
  background: #f1f3f5;
  border-color: #dee2e6;
  color: #212529;
}
[data-theme="light"] .btn:hover { background: #dee2e6; }
[data-theme="light"] .btn-accent { background: #3b82f6; border-color: #2563eb; color: #fff; }
[data-theme="light"] .btn-accent:hover { background: #2563eb; }
[data-theme="light"] .btn-danger { background: #fef2f2; border-color: #ef4444; color: #dc2626; }
[data-theme="light"] .btn-danger:hover { background: #fee2e2; }
[data-theme="light"] .btn-theme { border-color: #dee2e6; color: #212529; }
[data-theme="light"] .btn-theme:hover { background: #f1f3f5; }
[data-theme="light"] .btn-ghost { border-color: #dee2e6; color: #6c757d; background: transparent; }
[data-theme="light"] .btn-ghost:hover { background: #f1f3f5; color: #212529; }
[data-theme="light"] .btn-primary { background: #3b82f6; border-color: #2563eb; color: #fff; }
[data-theme="light"] .btn-primary:hover { background: #2563eb; }
[data-theme="light"] .btn-engine { background: #ecfdf5; border-color: #059669; color: #059669; }
[data-theme="light"] .btn-engine:hover { background: #d1fae5; }
[data-theme="light"] .btn-engine:disabled { background: #f1f3f5; border-color: #dee2e6; color: #6c757d; }
[data-theme="light"] .header-divider { background: #dee2e6; }
[data-theme="light"] .auth-user { color: #3b82f6; background: rgba(59, 130, 246, 0.08); }

[data-theme="light"] .stats-row { background: #f1f3f5; }
[data-theme="light"] .stat-card { background: #ffffff; }
[data-theme="light"] .stat-label { color: #6c757d; }
[data-theme="light"] .stat-value { color: #212529; }
[data-theme="light"] .stat-value.date { color: #6c757d; }

[data-theme="light"] .filters {
  background: #ffffff;
  border-bottom-color: #dee2e6;
}
[data-theme="light"] .filters select,
[data-theme="light"] .filters input {
  background: #f1f3f5;
  border-color: #dee2e6;
  color: #212529;
}
[data-theme="light"] .filter-count { color: #6c757d; }

[data-theme="light"] .idea-card {
  background: #ffffff;
  border-color: #dee2e6;
}
[data-theme="light"] .idea-card:hover { border-color: #adb5bd; }
[data-theme="light"] .idea-header h3 { color: #212529; }
[data-theme="light"] .score { color: #d97706; }
[data-theme="light"] .field { color: #495057; }

[data-theme="light"] details { border-top-color: #dee2e6; }
[data-theme="light"] summary { color: #6c757d; }
[data-theme="light"] .details-section details { border-top-color: #dee2e6; }
[data-theme="light"] .details-section summary { color: #6c757d; }
[data-theme="light"] .details-section summary:hover { color: #212529; }

[data-theme="light"] .idea-actions { border-top-color: #dee2e6; }
[data-theme="light"] .idea-actions button {
  background: #f1f3f5;
  border-color: #dee2e6;
  color: #6c757d;
}
[data-theme="light"] .idea-actions button:hover { background: #dee2e6; color: #212529; }

[data-theme="light"] .meta-strip { border-bottom-color: #dee2e6; }
[data-theme="light"] .chain-step { background: #f1f3f5; color: #495057; }
[data-theme="light"] .chain-step-last { color: #212529; border-color: #adb5bd; }
[data-theme="light"] .chain-label { color: #6c757d; }
[data-theme="light"] .chain-arrow { color: #adb5bd; }
[data-theme="light"] .depth-badge { background: #dee2e6; color: #6c757d; }

[data-theme="light"] .gauge-track { background: #e9ecef; }
[data-theme="light"] .gauge-value { color: #495057; }
[data-theme="light"] .gauge-label { color: #6c757d; }
[data-theme="light"] .numrv-track { background: #e9ecef; }
[data-theme="light"] .numrv-key { color: #495057; }
[data-theme="light"] .numrv-val { color: #495057; }
[data-theme="light"] .numrv-label { color: #6c757d; }
[data-theme="light"] .bd-track { background: #e9ecef; }
[data-theme="light"] .bd-label { color: #6c757d; }
[data-theme="light"] .bd-val { color: #6c757d; }

[data-theme="light"] .tech-chip { background: #f8f9fa; border-left-color: #dee2e6; }
[data-theme="light"] .tech-comp { color: #212529; }
[data-theme="light"] .tech-cx { color: #6c757d; }
[data-theme="light"] .tech-desc { color: #6c757d; }
[data-theme="light"] .ds-chip { background: #f8f9fa; border-color: #dee2e6; }
[data-theme="light"] .ds-type { color: #3b82f6; }
[data-theme="light"] .ds-priority { color: #6c757d; }
[data-theme="light"] .ds-desc { color: #6c757d; }
[data-theme="light"] .api-list { color: #6c757d; }
[data-theme="light"] .api-score-chip { background: #f1f3f5; color: #6c757d; }

[data-theme="light"] .toast {
  background: #ffffff;
  border-color: #dee2e6;
  color: #212529;
}

[data-theme="light"] .trend-section {
  background: #ffffff;
  border-color: #dee2e6;
}
[data-theme="light"] .trend-title { color: #6c757d; }
[data-theme="light"] .ad-slot { background: rgba(248, 249, 250, 0.5); border-bottom-color: #dee2e6; color: #adb5bd; }

[data-theme="light"] .engine-banner { background: rgba(209, 250, 229, 0.5); border-bottom-color: #059669; color: #059669; }
[data-theme="light"] .engine-banner.engine-done { background: rgba(209, 250, 229, 0.3); color: #16a34a; }
[data-theme="light"] .engine-banner.engine-error { background: rgba(254, 226, 226, 0.5); border-bottom-color: #ef4444; color: #dc2626; }
[data-theme="light"] .archive-banner {
  background: rgba(224, 231, 255, 0.62);
  border-bottom-color: rgba(99, 102, 241, 0.24);
  color: #4338ca;
}
[data-theme="light"] .archive-banner strong {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}
[data-theme="light"] .archive-link { color: #4338ca; }
[data-theme="light"] .archive-link:hover { color: #312e81; }
[data-theme="light"] .engine-run-id { color: #6c757d; }

[data-theme="light"] .modal-overlay { background: rgba(0, 0, 0, 0.3); }
[data-theme="light"] .modal-card { background: #ffffff; border-color: #dee2e6; }
[data-theme="light"] .modal-card h2 { color: #212529; }
[data-theme="light"] .modal-card input { background: #f1f3f5; border-color: #dee2e6; color: #212529; }
[data-theme="light"] .modal-card input:focus { border-color: #3b82f6; }

[data-theme="light"] .loading,
[data-theme="light"] .empty { color: #6c757d; }

[data-theme="light"] .info-tooltip {
  background: #ffffff;
  border-color: #dee2e6;
  color: #495057;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);
}
[data-theme="light"] .info-tooltip::after { border-top-color: #dee2e6; }
[data-theme="light"] .info-tooltip .tt-title { color: #212529; border-bottom-color: #dee2e6; }
[data-theme="light"] .info-tooltip .tt-key { color: #212529; border-bottom-color: #f1f3f5; }
[data-theme="light"] .info-tooltip .tt-score { color: #7c3aed; border-bottom-color: #f1f3f5; }
[data-theme="light"] .info-tooltip .tt-desc { color: #6c757d; border-bottom-color: #f1f3f5; }
[data-theme="light"] .info-tooltip .tt-footer { color: #6c757d; border-top-color: #dee2e6; }
[data-theme="light"] .info-tooltip .tt-footer b { color: #212529; }
[data-theme="light"] .info-tooltip .tt-weights { color: #3b82f6; background: rgba(59,130,246,0.05); border-color: rgba(59,130,246,0.1); }
[data-theme="light"] .info-tooltip .tt-weights b { color: #2563eb; }
[data-theme="light"] .info-tooltip .tt-letter { color: #d97706; background: rgba(217,119,6,0.1); }
[data-theme="light"] .info-trigger { color: #6c757d; background: rgba(108,117,125,0.08); border-color: #dee2e6; }
[data-theme="light"] .info-trigger:hover { color: #212529; background: rgba(108,117,125,0.15); border-color: #adb5bd; }

[data-theme="light"] .score-chip { background: #f1f3f5; color: #495057; }
[data-theme="light"] .comp-none { background: #f1f3f5; color: #6c757d; }
[data-theme="light"] .comp-unknown { background: #f1f3f5; color: #adb5bd; }

/* ── Light theme: Mini-Cards ── */
[data-theme="light"] .mini-card { background: #f8f9fa; }
[data-theme="light"] .mini-card p { color: #495057; }
[data-theme="light"] .mini-label { color: #6c757d; }

/* ═══════════════════════════════════════════════
   Task 13: Mobile UX Polish
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .btn { min-height: 44px; min-width: 44px; }
  .idea-actions button { padding: 0.5rem 1rem; }
  .filters { flex-wrap: wrap; gap: 0.5rem; }
  .filters select { flex: 1 1 45%; }
}

/* ═══════════════════════════════════════════════
   W7: Bookmark, Tier Badge, Bookmark Filter
   ═══════════════════════════════════════════════ */

/* ── Bookmark Button ── */
.btn-bookmark { background: none; border: 1px solid #3a3b4a; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 1.2rem; color: #a1a1aa; transition: all 0.2s; }
.btn-bookmark:hover { color: #fbbf24; border-color: #fbbf24; }
.btn-bookmark.bookmarked { color: #fbbf24; border-color: #fbbf24; background: rgba(251,191,36,0.1); }

/* ── Tier Badge ── */
.tier-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.tier-free { background: #27283a; color: #a1a1aa; border: 1px solid #3a3b4a; }
.tier-premium { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1a2e; }

/* ── Bookmark Filter ── */
.bookmark-filter { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; color: #a1a1aa; cursor: pointer; }
.bookmark-filter input[type="checkbox"] { accent-color: #fbbf24; }

/* ── Feedback Leaderboard ── */
.feedback-section { margin: 1.5rem 1rem; }
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; color: #e4e4e7; }
.leaderboard { display: flex; flex-direction: column; gap: 0.5rem; }
.lb-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; background: #1a1b23; border-radius: 8px; border: 1px solid #2a2b35; }
.lb-rank { font-weight: 700; color: #71717a; min-width: 2rem; }
.grade-badge.sm { font-size: 0.65rem; padding: 1px 6px; }
.lb-name { flex: 1; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-votes { display: flex; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; }
.lb-positive { color: #4ade80; }
.lb-negative { color: #f87171; }

/* ── Per-idea feedback count ── */
.feedback-count { display: inline-flex; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; margin-left: 0.3rem; }
.fc-up { color: #4ade80; }
.fc-down { color: #f87171; }

/* ── Light theme overrides for W7 ── */
[data-theme="light"] .btn-bookmark { border-color: #dee2e6; color: #6c757d; }
[data-theme="light"] .btn-bookmark:hover { color: #d97706; border-color: #d97706; }
[data-theme="light"] .btn-bookmark.bookmarked { color: #d97706; border-color: #d97706; background: rgba(217,119,6,0.08); }
[data-theme="light"] .tier-free { background: #f1f3f5; color: #6c757d; border-color: #dee2e6; }
[data-theme="light"] .bookmark-filter { color: #6c757d; }
[data-theme="light"] .section-title { color: #212529; }
[data-theme="light"] .lb-item { background: #ffffff; border-color: #dee2e6; }
[data-theme="light"] .lb-rank { color: #6c757d; }
[data-theme="light"] .lb-name { color: #212529; }

/* ═══════════════════════════════════════════════
   Pagination
   ═══════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  padding: 1.2rem 2rem;
  flex-wrap: wrap;
}
.page-btn {
  padding: 0.4rem 0.8rem;
  background: #27283a;
  border: 1px solid #3a3b4a;
  border-radius: 6px;
  color: #a1a1aa;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 38px;
  text-align: center;
}
.page-btn:hover:not(:disabled) { background: #3a3b4a; color: #e4e4e7; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.page-active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  font-weight: 700;
}
.page-ellipsis {
  color: #71717a;
  font-size: 0.85rem;
  padding: 0 0.3rem;
}
.page-size-select { min-width: 80px; }

/* Light theme pagination */
[data-theme="light"] .page-btn {
  background: #f1f3f5;
  border-color: #dee2e6;
  color: #6c757d;
}
[data-theme="light"] .page-btn:hover:not(:disabled) { background: #dee2e6; color: #212529; }
[data-theme="light"] .page-btn.page-active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #fff;
}
[data-theme="light"] .page-ellipsis { color: #6c757d; }

/* ═══════════════════════════════════════════════
   Site Footer
   ═══════════════════════════════════════════════ */
.site-footer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid #2a2b35;
  margin-top: 1rem;
  font-size: 0.8rem;
}
.site-footer a {
  color: #71717a;
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer a:hover { color: #a1a1aa; }

[data-theme="light"] .site-footer { border-top-color: #dee2e6; }
[data-theme="light"] .site-footer a { color: #6c757d; }
[data-theme="light"] .site-footer a:hover { color: #212529; }
