:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #10161e;
  --panel-2: #161f29;
  --panel-3: #1c2934;
  --line: #2b3947;
  --line-soft: #202c38;
  --text: #f4f7fb;
  --muted: #c0cad5;
  --dim: #a5b2bf;
  --green: #54e19a;
  --amber: #f2bc67;
  --red: #ff8188;
  --blue: #88b7ff;
  --purple: #d5b6ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 84% -8%, rgba(42, 86, 132, .2), transparent 31rem), linear-gradient(180deg, #0e1721 0, var(--bg) 460px); color: var(--text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.shell { width: min(1540px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 60px; }

.hero { padding: 0 2px 22px; }
.brand-row, .list-head, .filters, .tabs, .legend, .hero-title-row, .section-heading, .profile-form { display: flex; align-items: center; }
.brand-row { justify-content: space-between; gap: 18px; min-height: 40px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: #d9e4ee; font-size: 12px; font-weight: 850; letter-spacing: .14em; }
.brand-home { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand-logo { width: 40px; height: 40px; object-fit: cover; border-radius: 9px; flex: 0 0 auto; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-state { white-space: nowrap; padding: 5px 8px; border: 1px solid #43576a; border-radius: 4px; color: var(--dim); font-size: 10px; letter-spacing: .08em; }
.brand-side { display: flex; align-items: center; gap: 18px; min-width: 0; }
.social-links { display: flex; align-items: center; gap: 15px; }
.social-links a, .footer a { color: var(--muted); font-size: 13px; font-weight: 750; text-decoration: none; }
.social-links a:hover, .footer a:hover { color: var(--text); }
.freshness { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(84, 225, 154, .13); }

.hero-title-row { align-items: flex-end; justify-content: space-between; gap: 42px; padding: 42px 0 25px; }
.hero-copy { min-width: 0; }
.kicker, .section-kicker { color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .15em; }
h1 { max-width: 760px; margin: 10px 0 12px; font-size: clamp(36px, 5.2vw, 66px); line-height: .98; letter-spacing: -.06em; }
h2 { margin: 5px 0 0; font-size: 22px; line-height: 1.15; letter-spacing: -.03em; }
h3 { margin: 0; }
.subtitle { max-width: 720px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.hero-principles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 21px; }
.hero-principles span { padding: 6px 9px; border: 1px solid #32495d; border-radius: 4px; color: #d3dfeb; font-size: 12px; }
.agent-card { width: min(370px, 100%); flex: 0 0 370px; padding: 18px; border: 1px solid #35536d; border-radius: 10px; background: linear-gradient(145deg, rgba(22, 42, 61, .98), rgba(16, 23, 31, .98)); box-shadow: 0 13px 35px rgba(0, 0, 0, .16); }
.agent-card-kicker { color: var(--cyan, #70dfed); font-size: 11px; font-weight: 850; letter-spacing: .15em; }
.agent-card strong { display: block; margin-top: 9px; font-size: 17px; line-height: 1.3; }
.agent-card p { margin: 9px 0 13px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.agent-card code { display: block; overflow: auto; padding: 9px; border: 1px solid #39536a; border-radius: 5px; background: #0b1118; color: #bcd8fa; font-size: 11px; white-space: nowrap; }
.copy-btn { margin-top: 10px; padding: 7px 10px; border: 1px solid #4a6882; border-radius: 4px; background: transparent; color: #d6e5f5; font-size: 12px; }
.copy-btn:hover { border-color: var(--blue); color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.stat { min-height: 78px; padding: 13px 15px; border: 1px solid var(--line-soft); border-radius: 7px; background: rgba(16, 22, 30, .9); }
.stat .value { color: var(--text); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.stat .label { margin-top: 6px; color: var(--muted); font-size: 13px; }

.panel { border: 1px solid var(--line); border-radius: 10px; background: rgba(16, 22, 30, .96); }
.optimizer { padding: 19px 20px 20px; margin-top: 4px; }
.section-heading { justify-content: space-between; gap: 20px; }
.optimizer-note { max-width: 430px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: right; }
.profile-form { flex-wrap: wrap; gap: 12px 15px; margin-top: 18px; }
.profile-form label, .filters label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.field-wrap { display: inline-flex; align-items: center; gap: 6px; }
.field-wrap > span { color: var(--dim); font-size: 12px; }
input, select { min-height: 39px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: var(--panel-2); color: var(--text); font-size: 14px; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(136, 183, 255, .14); }
#capital { width: 112px; }
#risk-tolerance { min-width: 183px; }
.check-label { min-height: 39px; padding: 0 9px; border: 1px solid var(--line-soft); border-radius: 5px; background: #121b24; white-space: nowrap; }
.check-label input { width: 16px; min-height: 16px; accent-color: var(--blue); }
.primary-btn { min-height: 39px; padding: 8px 15px; border: 1px solid #77aaff; border-radius: 5px; background: #315d9d; color: #fff; font-size: 14px; font-weight: 800; }
.primary-btn:hover { background: #3c70ba; }

.recommendations { margin-top: 30px; }
.recommendation-head { align-items: flex-end; margin: 0 2px 11px; }
.recommendation-summary { color: var(--muted); font-size: 13px; text-align: right; }
.coverage-warnings { margin: 0 0 11px; padding: 10px 12px; border: 1px solid #604a29; border-radius: 7px; background: rgba(59, 42, 20, .48); color: #f0d09b; font-size: 13px; line-height: 1.55; }
.warning-line { display: flex; gap: 8px; }
.warning-line + .warning-line { margin-top: 4px; }
.warning-line span { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: 0 0 auto; border: 1px solid #b78643; border-radius: 50%; color: var(--amber); font-size: 11px; font-weight: 800; }
.recommendation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.recommendation-card { min-height: 300px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(155deg, rgba(21, 30, 40, .98), rgba(14, 19, 26, .98)); }
.recommendation-card.is-recommend { border-color: #346c54; }
.recommendation-card.is-watch { border-color: #634f31; }
.recommendation-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.recommendation-rank { color: var(--blue); font-size: 15px; font-weight: 850; font-variant-numeric: tabular-nums; }
.decision-pill, .family-badge, .status, .link-quality, .action-badge, .risk-badge, .tag { display: inline-block; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 11px; line-height: 1.1; white-space: nowrap; }
.decision-pill.recommend { border-color: #286647; color: var(--green); }
.decision-pill.watch, .decision-pill.evidence_gap { border-color: #76552b; color: var(--amber); }
.family-badge { border-color: #51426a; color: var(--purple); }
.recommendation-card h3 { margin-top: 13px; font-size: 17px; line-height: 1.35; }
.recommendation-meta { min-height: 20px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.recommendation-numbers { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 7px; margin-top: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.recommendation-numbers span { display: block; color: var(--dim); font-size: 11px; }
.recommendation-numbers strong { display: block; margin-top: 4px; font-size: 16px; font-variant-numeric: tabular-nums; }
.recommendation-numbers small { color: var(--dim); font-size: 11px; }
.why-block, .blocker-block { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.blocker-block { color: #e5c48e; }
.mini-label { margin-bottom: 4px; color: var(--dim); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.why-block ul, .blocker-block ul { margin: 0; padding-left: 17px; }
.recommendation-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.recommendation-actions a { color: var(--blue); font-size: 12px; text-decoration: none; }
.secondary-btn, .details-btn, .official { padding: 7px 9px; border: 1px solid #405365; border-radius: 4px; background: transparent; color: #d8e4ee; font-size: 12px; text-decoration: none; white-space: nowrap; }
.secondary-btn:hover, .details-btn:hover, .official:hover { border-color: var(--blue); color: var(--text); }

.controls { margin-top: 30px; padding: 18px 14px 12px; }
.compact-heading { padding: 0 7px 13px; }
.tabs { gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line-soft); }
.tab { padding: 13px 14px 11px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--blue); color: var(--text); }
.filters { flex-wrap: wrap; gap: 9px 15px; padding: 13px 7px 0; }
#search { min-width: 250px; }
.notice { display: flex; align-items: flex-start; gap: 9px; margin: 15px 2px 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.notice strong { color: var(--text); }
.notice-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; border: 1px solid #5a7490; border-radius: 50%; color: var(--blue); font-size: 11px; }
.catalog-head { justify-content: space-between; margin: 17px 2px 9px; color: var(--muted); font-size: 14px; }
.list-title { display: flex; align-items: baseline; gap: 10px; }
.list-title strong { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.legend { gap: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.updated-label { padding-left: 13px; border-left: 1px solid var(--line); color: var(--dim); }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }

.ranking { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.ranking-table { width: 100%; min-width: 1240px; border-collapse: collapse; table-layout: fixed; }
.ranking-table th { padding: 12px; border-bottom: 1px solid var(--line); background: #141e28; color: var(--dim); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.ranking-table td { padding: 13px 12px; border-top: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
.ranking-table tbody tr:hover { background: #17222d; }
.ranking-table th:nth-child(1), .ranking-table td:nth-child(1) { width: 50px; }
.ranking-table th:nth-child(2), .ranking-table td:nth-child(2) { width: 30%; }
.ranking-table th:nth-child(3), .ranking-table td:nth-child(3) { width: 11%; }
.ranking-table th:nth-child(4), .ranking-table td:nth-child(4) { width: 13%; }
.ranking-table th:nth-child(5), .ranking-table td:nth-child(5) { width: 11%; }
.ranking-table th:nth-child(6), .ranking-table td:nth-child(6) { width: 8%; }
.ranking-table th:nth-child(7), .ranking-table td:nth-child(7) { width: 10%; }
.ranking-table th:nth-child(8), .ranking-table td:nth-child(8) { width: 14%; }
.ranking-table th:nth-child(9), .ranking-table td:nth-child(9) { width: 68px; }
.rank-col, .rank-cell { text-align: center !important; }
.rank-number { color: var(--dim); font-size: 15px; font-weight: 850; font-variant-numeric: tabular-nums; }
.rank-number.top { color: var(--blue); }
.opportunity-cell { min-width: 280px; }
.opportunity-title { display: flex; align-items: flex-start; gap: 8px; }
.signal { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(84, 225, 154, .1); }
.signal.discovery { background: var(--amber); box-shadow: 0 0 0 3px rgba(242, 188, 103, .1); }
.opportunity-link, .opportunity-title strong { display: -webkit-box; overflow: hidden; color: var(--text); font-size: 15px; font-weight: 700; line-height: 1.35; text-decoration: none; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.opportunity-link:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.opportunity-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.opportunity-meta .status.ready { border-color: #286647; color: var(--green); }
.opportunity-meta .status.discovery { border-color: #76552b; color: var(--amber); }
.activity-explanation { display: -webkit-box; overflow: hidden; margin-top: 7px; color: #d1dbe5; font-size: 13px; line-height: 1.45; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.platform-name { color: var(--text); font-weight: 750; }
.cell-note { overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.action-badge { color: #d1dce6; }
.number-col { text-align: right !important; }
.number-cell { text-align: right; }
.number-cell strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.value-green { color: var(--green); }
.value-red { color: var(--red); }
.value-amber { color: var(--amber); }
.date-cell { font-variant-numeric: tabular-nums; }
.eligibility { display: flex; flex-wrap: wrap; gap: 4px; }
.risk-badge { background: #1a242e; }
.risk-badge.warn, .tag.warn { border-color: #76552b; color: var(--amber); }
.action-col { text-align: right !important; }
.state-row td { padding: 44px 12px; color: var(--muted); text-align: center; }
.empty { padding: 42px; color: var(--muted); font-size: 14px; text-align: center; }
.load-more { display: block; margin: 13px auto; padding: 9px 22px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); font-size: 13px; }
.load-more:hover { border-color: var(--blue); }
.hidden { display: none !important; }
.footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 29px; padding: 17px 2px 0; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 12px; }

dialog { width: min(780px, calc(100% - 28px)); max-height: 88vh; padding: 0; border: 1px solid #456078; border-radius: 12px; background: #111a23; color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .76); }
.close { position: absolute; top: 9px; right: 13px; border: 0; background: transparent; color: var(--muted); font-size: 29px; }
.detail-body { padding: 30px; }
.eyebrow { margin-bottom: 10px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.detail-body h2 { padding-right: 28px; font-size: 25px; line-height: 1.28; }
.subline { margin-top: 7px; color: var(--muted); font-size: 14px; }
.decision-banner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 17px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #17232e; }
.decision-banner.recommend { border-color: #327253; }
.decision-banner.watch, .decision-banner.evidence_gap { border-color: #73532c; }
.decision-banner span { display: block; color: var(--dim); font-size: 11px; }
.decision-banner strong { display: block; margin-top: 5px; font-size: 17px; font-variant-numeric: tabular-nums; }
.decision-banner small { color: var(--dim); font-size: 11px; }
.what-is-it { margin-top: 17px; padding: 14px; border: 1px solid #3d5d79; border-radius: 7px; background: #172635; color: #e5edf5; font-size: 14px; line-height: 1.6; }
.what-is-it-label { margin-bottom: 5px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.detail-section { margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.reason-list, .plan-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.blocker-copy { margin-top: 13px; color: #f0d09b; }
.check-list { margin-top: 11px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.formula { margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #0b1118; color: #cdd9e5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.evidence { color: var(--muted); font-size: 12px; line-height: 1.6; }
.evidence li { margin: 4px 0; }
.evidence a { color: var(--blue); }
.evidence span { margin-left: 7px; color: var(--dim); }
.official { display: inline-block; margin-top: 6px; }

@media (max-width: 1000px) {
  .hero-title-row { align-items: flex-start; flex-direction: column; }
  .agent-card { width: 100%; flex-basis: auto; }
  .recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1540px); padding-top: 15px; }
  .brand-state, .social-links { display: none; }
  .freshness { font-size: 11px; }
  .hero-title-row { padding-top: 32px; }
  h1 { font-size: 39px; }
  .subtitle { font-size: 15px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 23px; }
  .section-heading, .recommendation-head, .catalog-head { align-items: flex-start; flex-direction: column; }
  .optimizer-note, .recommendation-summary { max-width: none; text-align: left; }
  .profile-form label, .profile-form label:not(.check-label) { width: 100%; justify-content: space-between; }
  .profile-form input, .profile-form select, .profile-form .field-wrap { flex: 1; }
  .check-label { width: 100%; justify-content: flex-start !important; }
  .primary-btn { width: 100%; }
  .recommendation-grid { grid-template-columns: 1fr; }
  .filters label { width: 100%; justify-content: space-between; }
  .filters input, .filters select { flex: 1; }
  #search { min-width: 0; }
  .legend { flex-wrap: wrap; }
  .updated-label { display: none; }
  .footer { align-items: flex-start; flex-direction: column; }
  .detail-body { padding: 23px 17px; }
  .decision-banner { grid-template-columns: 1fr; }
}
