:root {
  color-scheme: dark;
  --ink: #071519;
  --ink-2: #0b2228;
  --panel: #102d34;
  --panel-2: #153a42;
  --paper: #f5f0e6;
  --muted: #9fb5b5;
  --line: rgba(220, 239, 231, .14);
  --mint: #8ee1bd;
  --gold: #efca7b;
  --coral: #f39b83;
  --blue: #8dc8df;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% -20%, #184853 0, transparent 45%), var(--ink); color: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 10px 14px; background: var(--paper); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.eyebrow, .kicker { margin: 0 0 8px; color: var(--mint); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(480px, 100%); padding: clamp(30px, 6vw, 56px); background: rgba(16, 45, 52, .92); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.login-card h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 10vw, 5.2rem); font-weight: 500; letter-spacing: -.055em; }
.login-thesis { margin: 14px 0 34px; color: #c7d6d3; font-size: 1.05rem; line-height: 1.65; }
label { color: #c4d2d0; font-size: .82rem; font-weight: 700; }
input, select, textarea { width: 100%; margin: 7px 0 20px; border: 1px solid var(--line); border-radius: 12px; background: #0a2026; color: var(--paper); outline: none; }
input, select { min-height: 46px; padding: 0 14px; }
textarea { min-height: 100px; padding: 13px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(142, 225, 189, .12); }
.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-weight: 800; transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { background: var(--mint); color: var(--ink); }
.button.secondary { border-color: var(--line); background: var(--panel); color: var(--paper); }
.button.wide { width: 100%; margin-top: 6px; }
.security-note { margin: 22px 0 0; color: var(--muted); font-size: .76rem; text-align: center; }
.form-error { min-height: 1.2em; margin: 12px 0 0; color: var(--coral); font-size: .85rem; }
.secondary-login-form { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }

.app-shell { width: min(1500px, 100%); margin: 0 auto; padding: 0 36px 72px; }
.topbar { min-height: 96px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 1.75rem; text-decoration: none; letter-spacing: -.035em; }
.topbar-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .82rem; }
.topbar-status form { margin: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 18px var(--mint); }
.text-button { padding: 5px 0 5px 12px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--paper); cursor: pointer; }
.section-nav { display: flex; gap: 8px; padding: 22px 0; }
.nav-item { padding: 9px 15px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.nav-item.active { border-color: var(--line); background: var(--panel); color: var(--paper); }

.view { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hero-row { min-height: 250px; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding: 56px 0 38px; }
.hero-row.compact { min-height: 190px; }
.hero-row h1 { max-width: 780px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem, 6vw, 5.6rem); font-weight: 400; line-height: .98; letter-spacing: -.055em; }
.hero-row.compact h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); }
.lede { max-width: 700px; margin: 20px 0 0; color: #b9cac7; font-size: 1.03rem; line-height: 1.6; }
.human-gate { min-width: 230px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(16, 45, 52, .55); }
.human-gate span { display: block; margin-bottom: 6px; color: var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.human-gate strong { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 500; }
.hyper-hero { border-bottom: 1px solid var(--line); }
.ppt-lenses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 30px; }
.ppt-lenses > div { min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(16, 45, 52, .55); }
.ppt-lenses span { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 9px; border-radius: 50%; background: rgba(142, 225, 189, .12); color: var(--mint); font-weight: 900; }
.ppt-lenses strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.ppt-lenses p { margin: 16px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.hyper-list { display: grid; gap: 18px; }
.hyper-card { padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(21, 58, 66, .92), rgba(12, 37, 43, .92)); }
.hyper-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.hyper-card h2 { max-width: 820px; margin: 8px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 500; line-height: 1.05; letter-spacing: -.035em; }
.hyper-card .insight { max-width: 1000px; margin: 0; color: #c7d6d3; line-height: 1.65; }
.trigger { flex: 0 0 auto; padding: 8px 11px; border-radius: 8px; background: rgba(239, 202, 123, .12); color: var(--gold); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.trigger.act { background: rgba(243, 155, 131, .12); color: var(--coral); }
.trigger.monitor { background: rgba(141, 200, 223, .12); color: var(--blue); }
.ppt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0; }
.ppt-block { padding: 18px; border-top: 1px solid var(--line); }
.ppt-block h3 { margin: 0 0 8px; color: var(--mint); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.ppt-block p { margin: 0; color: #b9cac7; font-size: .85rem; line-height: 1.55; }
.hyper-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hyper-bottom > div { padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.hyper-bottom h3, .apa-section h3 { margin: 0 0 8px; color: var(--gold); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.hyper-bottom p { margin: 0; color: #c5d3d1; font-size: .86rem; line-height: 1.55; }
.apa-section { margin-top: 22px; }
.apa-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: .78rem; line-height: 1.6; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.metric { min-height: 108px; padding: 20px 22px; background: rgba(16, 45, 52, .55); border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-value { display: block; margin-bottom: 4px; color: var(--paper); font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.metric-label { color: var(--muted); font-size: .78rem; }
.toolbar { display: grid; grid-template-columns: 1fr 210px; gap: 14px; margin-top: 28px; }
.toolbar input, .toolbar select { margin: 0; }
.select-field { display: grid; grid-template-columns: 1fr; gap: 0; color: var(--muted); font-size: .7rem; }
.select-field select { margin-top: 4px; }
.lane-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.filter-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: .76rem; }
.filter-chip.active { border-color: var(--mint); background: rgba(142, 225, 189, .1); color: var(--mint); }
.signal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.signal-card { min-height: 330px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(21, 58, 66, .92), rgba(12, 37, 43, .92)); cursor: pointer; transition: transform .2s ease, border-color .2s ease; }
.signal-card:hover, .signal-card:focus-visible { transform: translateY(-3px); border-color: rgba(142, 225, 189, .5); outline: none; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.score { color: var(--gold); }
.signal-card h2 { margin: 22px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 500; line-height: 1.08; letter-spacing: -.025em; }
.summary { margin: 0; color: #bfd0cd; font-size: .92rem; line-height: 1.55; }
.card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 24px; }
.disposition { padding: 7px 10px; border-radius: 7px; background: rgba(239, 202, 123, .1); color: var(--gold); font-size: .72rem; font-weight: 800; }
.authority { color: var(--mint); font-size: .75rem; }
.empty-state { padding: 50px 24px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }

.notice { margin-bottom: 24px; padding: 16px 18px; border-radius: 12px; font-size: .86rem; line-height: 1.5; }
.notice.warning { border: 1px solid rgba(239, 202, 123, .25); background: rgba(239, 202, 123, .08); color: #ead9b4; }
.research-meta { margin: 0 0 16px; color: var(--muted); font-size: .8rem; }
.research-actions { min-width: 260px; display: grid; gap: 8px; }
.research-actions label { color: var(--muted); font-size: .72rem; }
.research-actions select { margin: 5px 0 4px; }
.research-list, .run-list { display: grid; gap: 10px; }
.research-item, .run-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(16, 45, 52, .6); }
.research-item h2, .run-item h2 { margin: 5px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 500; }
.research-item h2 a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.research-item p, .run-item p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.source-badge, .run-status { align-self: start; padding: 6px 9px; border-radius: 7px; background: rgba(142, 225, 189, .1); color: var(--mint); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.run-status.failed { background: rgba(243, 155, 131, .1); color: var(--coral); }

.signal-dialog { width: min(920px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--ink-2); color: var(--paper); box-shadow: var(--shadow); }
.signal-dialog::backdrop { background: rgba(1, 9, 11, .78); backdrop-filter: blur(6px); }
.dialog-close { position: sticky; z-index: 2; top: 16px; float: right; margin: 16px 16px 0 0; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--paper); cursor: pointer; font-size: 1.5rem; }
.detail { padding: 52px clamp(24px, 6vw, 68px) 64px; }
.detail h1 { margin: 14px 50px 22px 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.25rem, 6vw, 4.5rem); font-weight: 400; line-height: 1; letter-spacing: -.045em; }
.detail-score { color: var(--gold); font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 34px 0; }
.detail-block { padding-top: 16px; border-top: 1px solid var(--line); }
.detail-block.full { grid-column: 1 / -1; }
.detail-block h2 { margin: 0 0 8px; color: var(--mint); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.detail-block p { margin: 0; color: #c4d2d0; line-height: 1.65; }
.source-list { display: grid; gap: 9px; margin: 10px 0 0; padding: 0; list-style: none; }
.source-list a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: #d9e6e3; text-decoration: none; }
.source-list a:hover { border-color: var(--mint); }
.source-list small { display: block; margin-top: 4px; color: var(--muted); }
.editorial-form { margin-top: 34px; padding: 24px; border: 1px solid rgba(239, 202, 123, .25); border-radius: 16px; background: rgba(239, 202, 123, .05); }
.editorial-form h2 { margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; font-weight: 500; }
.editorial-form > p { margin: 0 0 18px; color: var(--muted); font-size: .85rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editorial-form input, .editorial-form select, .editorial-form textarea { margin-bottom: 14px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: min(420px, calc(100% - 48px)); padding: 14px 18px; border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 850px) {
  .app-shell { padding-inline: 18px; }
  .hero-row { align-items: flex-start; flex-direction: column; min-height: auto; padding-top: 38px; }
  .human-gate { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .signal-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-block.full { grid-column: auto; }
  .ppt-lenses, .ppt-grid, .hyper-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; padding: 20px 0; }
  .topbar .eyebrow { display: none; }
  .topbar-status > span:not(.status-dot) { display: none; }
  .section-nav { overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .toolbar, .form-row { grid-template-columns: 1fr; }
  .research-item, .run-item { grid-template-columns: 1fr; gap: 12px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 85px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
