:root {
  --navy-950: #071a31;
  --navy-900: #0b2545;
  --navy-800: #123a68;
  --teal: #2aa7a1;
  --teal-pale: #d9f2ee;
  --paper: #f4f1ea;
  --paper-deep: #e8e3d8;
  --white: #fff;
  --ink: #132232;
  --muted: #607080;
  --line: rgba(11, 37, 69, 0.14);
  --warning: #ad6f14;
  --danger: #a63232;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--navy-950); }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 8px 12px; background: white; color: var(--navy-900); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--navy-900); font-weight: 750; letter-spacing: -.04em; text-decoration: none; }
.wordmark em { color: var(--teal); font-style: normal; }
.wordmark-mark { display: grid; width: 38px; height: 42px; border: 1px solid currentColor; border-radius: 50% 50% 46% 54% / 44% 42% 58% 56%; font-family: var(--display); font-size: 1.5rem; font-weight: 400; place-items: center; transform: rotate(-5deg); }
.kicker { margin: 0 0 12px; color: var(--teal); font-size: .7rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: var(--display); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
h1 { margin-bottom: 16px; font-size: clamp(2.6rem, 5vw, 5rem); }
h2 { margin-bottom: 10px; color: var(--navy-900); font-size: clamp(1.65rem, 2.6vw, 2.6rem); }
.button { min-height: 44px; padding: 10px 17px; border: 1px solid var(--navy-900); border-radius: 2px; background: var(--navy-900); color: white; cursor: pointer; font-size: .78rem; font-weight: 800; letter-spacing: .025em; transition: transform 180ms var(--ease), background 180ms ease; }
.button:hover:not(:disabled) { border-color: var(--teal); background: var(--teal); color: var(--navy-950); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button--quiet { background: transparent; color: var(--navy-900); }
.button--danger { border-color: var(--danger); background: var(--danger); }

.access { display: grid; min-height: 100svh; background: var(--paper); grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); }
.access-card { display: flex; padding: clamp(40px, 8vw, 120px); flex-direction: column; align-items: flex-start; justify-content: center; }
.access-card .wordmark { margin-bottom: clamp(70px, 12vh, 150px); }
.access-card h1 { max-width: 700px; color: var(--navy-950); }
.access-card > p:not(.kicker, .access-note, .notice) { max-width: 620px; margin-bottom: 32px; color: var(--muted); font-size: 1.05rem; }
.access-note { margin: 18px 0 0; color: var(--muted); font-size: .73rem; }
.notice { min-height: 22px; margin: 12px 0 0; color: var(--danger); font-size: .78rem; }
.access-proof { display: flex; padding: clamp(36px, 5vw, 72px); background: var(--navy-950); color: white; flex-direction: column; justify-content: space-between; }
.access-proof > p { color: var(--teal); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.access-proof dl { margin: 0; }
.access-proof dl div { padding: 24px 0; border-top: 1px solid rgba(255,255,255,.16); }
.access-proof dt { color: rgba(255,255,255,.55); font-size: .74rem; }
.access-proof dd { margin: 6px 0 0; font-family: var(--display); font-size: 1.65rem; }

.app { display: grid; min-height: 100svh; grid-template-columns: 250px minmax(0, 1fr); opacity: 0; animation: app-in 500ms var(--ease) forwards; }
@keyframes app-in { to { opacity: 1; } }
.rail { position: sticky; top: 0; display: flex; height: 100svh; padding: 28px 18px 20px; background: var(--navy-950); color: rgba(255,255,255,.74); flex-direction: column; }
.wordmark--rail { padding: 0 10px 30px; border-bottom: 1px solid rgba(255,255,255,.13); color: white; }
.wordmark--rail .wordmark-mark { width: 32px; height: 35px; font-size: 1.2rem; }
.rail-nav { display: grid; margin-top: 24px; gap: 2px; }
.rail-nav button { display: grid; min-height: 44px; padding: 10px 9px; border: 0; border-left: 2px solid transparent; background: transparent; color: rgba(255,255,255,.58); cursor: pointer; font-size: .77rem; text-align: left; grid-template-columns: 25px 1fr auto; align-items: center; }
.rail-nav button span { color: rgba(255,255,255,.28); font-size: .62rem; }
.rail-nav button b { display: grid; min-width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.1); font-size: .65rem; place-items: center; }
.rail-nav button:hover, .rail-nav button.is-active { border-left-color: var(--teal); background: rgba(255,255,255,.055); color: white; }
.rail-footer { display: grid; margin-top: auto; padding: 19px 8px 0; border-top: 1px solid rgba(255,255,255,.13); color: rgba(255,255,255,.55); font-size: .65rem; grid-template-columns: auto 1fr; gap: 3px 8px; overflow-wrap: anywhere; }
.presence-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(42,167,161,.13); }
.rail-footer button { padding: 3px 0; border: 0; background: transparent; color: white; cursor: pointer; font-size: .68rem; text-align: left; grid-column: 2; }

.workspace { min-width: 0; padding: 0 clamp(22px, 4vw, 62px) 60px; background: var(--paper); }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; min-height: 120px; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(244,241,234,.93); backdrop-filter: blur(16px); }
.topbar h1 { margin: 0; color: var(--navy-950); font-size: clamp(2.1rem, 3.8vw, 3.8rem); }
.topbar .kicker { margin-bottom: 7px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.mode-pill { padding: 8px 11px; border: 1px solid rgba(173,111,20,.3); background: rgba(173,111,20,.08); color: #7b4c08; font-size: .67rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mode-pill.is-live { border-color: rgba(42,167,161,.4); background: var(--teal-pale); color: var(--navy-900); }
.pause-banner { display: flex; margin-top: 20px; padding: 14px 18px; border-left: 3px solid var(--danger); background: rgba(166,50,50,.07); color: var(--danger); gap: 12px; font-size: .78rem; }
.view { display: none; padding-top: 30px; }
.view.is-active { display: block; animation: view-in 350ms var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(9px); } }

.metrics { display: grid; margin-bottom: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.metric { min-height: 108px; padding: 18px; background: rgba(255,255,255,.52); }
.metric small { display: block; margin-bottom: 11px; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric strong { color: var(--navy-900); font-family: var(--display); font-size: 2rem; font-weight: 500; }
.metric em { display: block; color: var(--muted); font-size: .67rem; font-style: normal; }
.panel { border: 1px solid var(--line); background: rgba(255,255,255,.64); box-shadow: 0 20px 55px rgba(7,26,49,.045); }
.panel-heading { display: flex; min-height: 105px; padding: 24px 26px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 2rem; }
.panel-heading .kicker { margin-bottom: 8px; }
.panel-count { display: grid; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--navy-900); font-family: var(--display); font-size: 1.2rem; place-items: center; }
.split-layout { display: grid; grid-template-columns: minmax(360px, .75fr) minmax(440px, 1.25fr); gap: 18px; align-items: start; }

.queue-list { max-height: calc(100svh - 292px); min-height: 420px; overflow: auto; }
.queue-item { display: grid; width: 100%; padding: 21px 25px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; transition: background 160ms ease; gap: 7px; }
.queue-item:hover, .queue-item.is-active { background: white; }
.queue-item.is-active { box-shadow: inset 3px 0 var(--teal); }
.queue-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .66rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.queue-item strong { color: var(--navy-900); font-family: var(--display); font-size: 1.25rem; font-weight: 500; }
.queue-item p { margin: 0; color: var(--muted); font-size: .75rem; }
.score { color: var(--teal); }
.inspector { position: sticky; top: 138px; max-height: calc(100svh - 164px); overflow: auto; }
.inspector-empty { display: grid; min-height: 520px; padding: 60px; text-align: center; place-content: center; }
.inspector-empty > span { display: grid; width: 58px; height: 58px; margin: 0 auto 25px; border: 1px solid var(--teal); border-radius: 50%; color: var(--teal); font-size: 1.4rem; place-items: center; }
.inspector-empty p { max-width: 380px; color: var(--muted); }
.inspector-content { padding: 28px; }
.inspector-header { display: flex; margin-bottom: 25px; justify-content: space-between; gap: 22px; }
.inspector-header h2 { margin: 0; font-size: 2.15rem; }
.status-tag { align-self: flex-start; padding: 5px 8px; background: var(--teal-pale); color: var(--navy-900); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.evidence-note { margin: 0 0 24px; padding: 15px; border-left: 2px solid var(--teal); background: rgba(42,167,161,.07); color: var(--muted); font-size: .75rem; }
.evidence-note strong { color: var(--navy-900); }
.evidence-links { display: grid; margin: 0 0 26px; padding: 0; list-style: none; gap: 8px; }
.evidence-links a { color: var(--navy-800); font-size: .73rem; font-weight: 700; }
.editor label { display: block; margin-bottom: 7px; color: var(--navy-900); font-size: .7rem; font-weight: 800; }
.editor input, .editor textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); }
.editor textarea { min-height: 300px; margin-bottom: 4px; resize: vertical; line-height: 1.55; }
.editor input { margin-bottom: 17px; }
.editor-meta { display: flex; margin-bottom: 22px; justify-content: space-between; color: var(--muted); font-size: .65rem; }
.approval-check { display: flex; margin: 0 0 18px; padding: 13px; border: 1px solid var(--line); align-items: flex-start; gap: 10px; color: var(--muted); font-size: .72rem; }
.approval-check input { margin-top: 3px; }
.inspector-actions { display: flex; justify-content: flex-end; gap: 9px; }

.empty-state { padding: 70px 24px; color: var(--muted); text-align: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: .72rem; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .61rem; letter-spacing: .08em; text-transform: uppercase; }
td strong { color: var(--navy-900); }
td a { color: var(--navy-800); }
.card-grid { display: grid; padding: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.data-card { min-height: 170px; padding: 20px; border: 1px solid var(--line); background: rgba(255,255,255,.65); }
.data-card h3 { margin: 0 0 8px; color: var(--navy-900); font-family: var(--display); font-size: 1.3rem; font-weight: 500; }
.data-card p { margin-bottom: 10px; color: var(--muted); font-size: .72rem; }
.data-card .tag { display: inline-block; margin-bottom: 14px; padding: 4px 7px; background: var(--teal-pale); color: var(--navy-900); font-size: .59rem; font-weight: 800; text-transform: uppercase; }
.data-card .button { margin-top: 7px; }
.results-layout { display: grid; grid-template-columns: 1.5fr .5fr; gap: 18px; }
.metrics--results { grid-template-columns: repeat(3, 1fr); margin: 0; }
.outcome-panel { padding: 30px; background: var(--navy-950); color: white; }
.outcome-panel blockquote { margin: 30px 0; font-family: var(--display); font-size: 2rem; line-height: 1.05; }
.outcome-panel > p:last-child { color: rgba(255,255,255,.57); font-size: .74rem; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; padding: 17px 25px; border-bottom: 1px solid var(--line); grid-template-columns: 150px 1fr auto; gap: 16px; font-size: .72rem; }
.timeline time, .timeline small { color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card { min-height: 260px; padding: 30px; }
.settings-card h2 small { color: var(--muted); font-family: var(--sans); font-size: .7rem; letter-spacing: 0; }
.settings-card > p:last-child { color: var(--muted); font-size: .77rem; }
.switch-row { display: flex; margin: 27px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); align-items: center; justify-content: space-between; gap: 18px; }
.switch-row span { display: grid; }
.switch-row small { color: var(--muted); }
.switch-row input { width: 42px; height: 22px; accent-color: var(--teal); }
.spend-track { height: 6px; margin: 26px 0 15px; overflow: hidden; background: var(--paper-deep); }
.spend-track span { display: block; width: 0; height: 100%; background: var(--teal); transition: width 500ms var(--ease); }
.toast { position: fixed; z-index: 50; right: 28px; bottom: 24px; max-width: 420px; margin: 0; padding: 13px 17px; background: var(--navy-950); color: white; box-shadow: 0 14px 40px rgba(7,26,49,.3); font-size: .75rem; }

@media (max-width: 1120px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .split-layout { grid-template-columns: 1fr; }
  .inspector { position: static; max-height: none; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-layout { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .access { grid-template-columns: 1fr; }
  .access-proof { min-height: 380px; }
  .app { display: block; }
  .rail { position: static; height: auto; padding: 18px; }
  .rail-nav { display: flex; padding-bottom: 8px; overflow-x: auto; }
  .rail-nav button { min-width: 150px; }
  .rail-footer { display: none; }
  .workspace { padding-inline: 16px; }
  .topbar { position: static; padding: 24px 0; align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid, .settings-grid { grid-template-columns: 1fr; }
  .split-layout { display: block; }
  .inspector { margin-top: 16px; }
  .timeline li { grid-template-columns: 1fr; gap: 3px; }
}

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