:root {
  --paper: #f2efe7;
  --paper-deep: #e8e2d5;
  --white: #fffdf7;
  --ink: #11242b;
  --ink-soft: #405159;
  --muted: #788287;
  --line: #cfc9bb;
  --line-dark: #9ca5a4;
  --signal: #e65332;
  --signal-dark: #bc361d;
  --sea: #176b64;
  --lime: #c7d76d;
  --gold: #d9a441;
  --danger: #ad3426;
  --shadow: 0 24px 60px rgba(17, 36, 43, 0.14);
  --sans: "Instrument Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.wordmark { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 18px; font-stretch: condensed; font-weight: 700; letter-spacing: -0.03em; text-decoration: none; }
.wordmark-mark { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 700; letter-spacing: -0.06em; }
.wordmark-light { color: var(--paper); }
.eyebrow { margin: 0 0 12px; color: var(--signal-dark); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.eyebrow-light { color: var(--lime); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 2px; padding: 10px 18px; font-weight: 650; line-height: 1; text-decoration: none; cursor: pointer; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.button-small { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.button-wide { width: 100%; }
.button-signal { color: #fff; background: var(--signal); border-color: var(--signal); }
.button-signal:hover { background: var(--signal-dark); border-color: var(--signal-dark); }
.button-ink { color: var(--white); background: var(--ink); border-color: var(--ink); }
.button-ink:hover { background: #213941; }
.button-outline { color: var(--ink); background: transparent; border-color: var(--line-dark); }
.button-outline:hover { border-color: var(--ink); background: rgba(255,255,255,0.55); }
.text-link, .text-button { border: 0; padding: 0; color: var(--ink); background: none; font-size: 14px; font-weight: 650; text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 5px; cursor: pointer; }

/* Public site */
.site-shell { background-color: var(--paper); background-image: radial-gradient(circle at 15% 10%, rgba(230,83,50,0.08), transparent 26%), linear-gradient(rgba(17,36,43,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(17,36,43,0.04) 1px, transparent 1px); background-size: auto, 48px 48px, 48px 48px; }
.site-header { position: relative; z-index: 5; display: flex; width: min(1440px, 100%); height: 82px; align-items: center; justify-content: space-between; margin: auto; padding: 0 5vw; border-bottom: 1px solid rgba(17,36,43,0.18); }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 2.5vw, 38px); }
.site-nav > a:not(.button) { font-size: 13px; font-weight: 600; text-decoration: none; }
.site-nav > a:not(.button):hover { color: var(--signal-dark); }
.hero { display: grid; min-height: 700px; grid-template-columns: minmax(0, 1.32fr) minmax(330px, 0.68fr); gap: 7vw; align-items: center; width: min(1440px, 100%); margin: auto; padding: 90px 7vw 100px; }
.hero-copy { max-width: 820px; }
.hero h1 { max-width: 850px; margin: 0; font-family: var(--serif); font-size: clamp(58px, 7.3vw, 110px); font-weight: 500; letter-spacing: -0.06em; line-height: 0.88; }
.hero h1 em { color: var(--signal); font-weight: 450; }
.hero-deck { max-width: 700px; margin: 34px 0 0; color: var(--ink-soft); font-size: clamp(18px, 1.6vw, 23px); line-height: 1.45; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 38px; }
.hero-field { position: relative; overflow: hidden; min-height: 480px; align-self: stretch; padding: 48px 38px 34px; color: var(--white); background: var(--ink); box-shadow: var(--shadow); }
.hero-field::before { position: absolute; top: -160px; right: -160px; width: 390px; height: 390px; border: 1px solid rgba(199,215,109,0.5); border-radius: 50%; box-shadow: 0 0 0 46px rgba(199,215,109,0.06), 0 0 0 92px rgba(199,215,109,0.04); content: ""; }
.field-label { position: relative; color: var(--lime); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.field-number { position: relative; margin-top: 60px; font-family: var(--serif); font-size: clamp(64px, 6.5vw, 98px); font-weight: 500; letter-spacing: -0.07em; line-height: 0.9; }
.field-caption { position: relative; margin-top: 12px; color: #b9c3c3; font-size: 14px; }
.coverage-lines { display: grid; gap: 8px; margin: 54px 0 42px; }
.coverage-lines span { display: block; width: var(--w); height: 3px; background: linear-gradient(90deg, var(--signal), var(--lime)); transform-origin: left; animation: grow-line 1s 500ms both ease-out; }
.field-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.2); }
.field-stats div { display: flex; flex-direction: column; }
.field-stats dt { order: 2; margin-top: 5px; color: #94a3a5; font-size: 10px; text-transform: uppercase; }
.field-stats dd { margin: 0; font-family: var(--serif); font-size: 25px; }
.proof-strip { display: flex; overflow: hidden; align-items: center; justify-content: space-around; gap: 36px; padding: 17px 4vw; color: var(--paper); background: var(--signal); font-size: 11px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; white-space: nowrap; }
.proof-strip span::before { margin-right: 36px; content: "+"; }
.editorial-section, .plans-section { width: min(1320px, calc(100% - 10vw)); margin: auto; padding: 125px 0; }
.section-index { padding-bottom: 18px; border-bottom: 1px solid var(--line-dark); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.section-heading { display: grid; grid-template-columns: 0.36fr 1fr; gap: 36px; align-items: start; margin: 65px 0 75px; }
.section-heading h2 { max-width: 900px; margin: 0; font-family: var(--serif); font-size: clamp(45px, 5.5vw, 78px); font-weight: 500; letter-spacing: -0.05em; line-height: 0.98; }
.feature-ledger { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.feature-ledger article { min-height: 330px; padding: 32px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ledger-number { color: var(--signal); font-family: var(--serif); font-size: 18px; }
.feature-ledger h3 { margin: 90px 0 18px; font-size: 24px; letter-spacing: -0.035em; }
.feature-ledger p { margin: 0; color: var(--ink-soft); line-height: 1.65; }
.intelligence-panel { display: grid; grid-template-columns: 1fr minmax(380px, 0.72fr); gap: 10vw; align-items: center; padding: 115px max(6vw, calc((100vw - 1320px)/2)); color: var(--paper); background: var(--ink); }
.intelligence-copy h2 { max-width: 700px; margin: 0; font-family: var(--serif); font-size: clamp(48px, 5.6vw, 78px); font-weight: 500; letter-spacing: -0.055em; line-height: 0.95; }
.intelligence-copy > p:last-child { max-width: 620px; margin: 30px 0 0; color: #bcc6c6; font-size: 18px; }
.query-card { border: 1px solid rgba(255,255,255,0.25); background: #193239; box-shadow: 20px 20px 0 rgba(230,83,50,0.8); }
.query-card-head { display: flex; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,0.18); color: #bec9ca; font-size: 12px; }
.status-dot { color: var(--lime); }
.status-dot::before { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--lime); content: ""; }
.query-card ul { margin: 0; padding: 10px 22px; list-style: none; }
.query-card li { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 13px; }
.query-card li span { color: #8fa0a2; }
.query-result { display: flex; align-items: baseline; gap: 12px; padding: 26px 22px 32px; }
.query-result strong { color: var(--lime); font-family: var(--serif); font-size: 50px; font-weight: 500; letter-spacing: -0.05em; }
.query-result span { color: #a8b5b6; font-size: 12px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan-card { min-height: 310px; padding: 32px; border: 1px solid var(--line-dark); background: rgba(255,255,255,0.35); }
.plan-card.plan-featured { color: var(--paper); background: var(--sea); border-color: var(--sea); transform: translateY(-18px); }
.plan-kicker { color: var(--signal-dark); font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; }
.plan-featured .plan-kicker { color: var(--lime); }
.plan-card h3 { margin: 84px 0 18px; font-family: var(--serif); font-size: 35px; font-weight: 500; letter-spacing: -0.04em; }
.plan-card p { margin: 0; color: var(--ink-soft); }
.plan-featured p { color: #d5dfdc; }
.plans-cta { display: flex; align-items: center; justify-content: flex-end; gap: 24px; margin-top: 42px; }
.site-footer { display: grid; grid-template-columns: 1fr auto auto; gap: 35px; align-items: center; padding: 55px 5vw; color: #acb9ba; background: #0b1b20; font-size: 12px; }
.reveal { animation: reveal-up 700ms both cubic-bezier(.2,.75,.3,1); }
.reveal-delay { animation-delay: 120ms; }

/* Authentication */
.auth-shell { min-height: 100vh; color: var(--paper); background: var(--ink); background-image: radial-gradient(circle at 70% 18%, rgba(199,215,109,0.12), transparent 24%), linear-gradient(120deg, transparent 0 65%, rgba(230,83,50,0.08) 65% 100%); }
.auth-wordmark { position: absolute; top: 30px; left: 4vw; z-index: 2; color: var(--paper); }
.auth-main { display: grid; min-height: calc(100vh - 60px); grid-template-columns: 1.1fr 0.9fr; }
.auth-context { display: flex; flex-direction: column; justify-content: center; padding: 130px 8vw 90px 7vw; }
.auth-context h1 { max-width: 760px; margin: 0; font-family: var(--serif); font-size: clamp(56px, 7vw, 98px); font-weight: 500; letter-spacing: -0.06em; line-height: 0.9; }
.auth-context > p:not(.eyebrow) { max-width: 620px; margin: 32px 0 0; color: #b2c0c1; font-size: 18px; }
.auth-proof { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 44px; }
.auth-proof span { padding: 8px 12px; border: 1px solid rgba(255,255,255,0.2); color: #d2dddd; font-size: 11px; text-transform: uppercase; }
.auth-card { align-self: center; width: min(560px, calc(100% - 60px)); margin: 80px auto; padding: clamp(32px, 5vw, 62px); color: var(--ink); background: var(--paper); box-shadow: 26px 26px 0 var(--signal); }
.auth-step, .card-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.auth-card h2 { margin: 14px 0 35px; font-family: var(--serif); font-size: 42px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.auth-card label, .action-modal label { display: block; font-size: 13px; font-weight: 650; }
.secret-input { position: relative; margin-top: 9px; }
.secret-input input { width: 100%; height: 54px; padding: 12px 74px 12px 14px; border: 1px solid var(--line-dark); border-radius: 0; background: var(--white); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.secret-input button { position: absolute; top: 1px; right: 1px; height: 52px; border: 0; padding: 0 16px; background: transparent; color: var(--sea); font-size: 12px; font-weight: 700; cursor: pointer; }
.field-help { margin: 10px 0 24px; color: var(--muted); font-size: 11px; }
.form-error { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--danger); color: var(--danger); background: rgba(173,52,38,0.08); font-size: 12px; }
.auth-support { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.auth-support strong { font-size: 12px; }
.auth-support p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.auth-support a { color: var(--sea); font-weight: 700; text-underline-offset: 3px; }
.auth-card-wide { width: min(620px, calc(100% - 60px)); }
.auth-card-copy { margin: -16px 0 28px; color: var(--muted); font-size: 13px; }
.stacked-form { display: grid; gap: 18px; }
.stacked-form label input { display: block; width: 100%; height: 49px; margin-top: 7px; border: 1px solid var(--line-dark); border-radius: 0; padding: 10px 12px; background: var(--white); outline: none; }
.stacked-form label input:focus { border-color: var(--sea); box-shadow: 0 0 0 2px rgba(23,107,100,0.12); }
.stacked-form .field-help { margin: -3px 0 2px; }
.plan-choice { display: grid; gap: 7px; margin: 2px 0 0; border: 0; padding: 0; }
.plan-choice legend { margin-bottom: 8px; font-size: 13px; font-weight: 650; }
.plan-choice label { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; border: 1px solid var(--line); padding: 11px 12px; background: rgba(255,255,255,0.45); cursor: pointer; }
.plan-choice label:has(input:checked) { border-color: var(--sea); background: #e3eee9; }
.plan-choice input { width: 16px; height: 16px; accent-color: var(--sea); }
.plan-choice strong, .plan-choice small { display: block; text-transform: capitalize; }
.plan-choice small { margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: none; }
.auth-notice, .form-success { border-left: 3px solid var(--sea); padding: 13px 15px; background: rgba(23,107,100,0.09); }
.auth-notice strong { font-size: 13px; }
.auth-notice p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.form-success { margin-bottom: 2px; color: var(--sea); font-size: 12px; }
.key-result > p:not(.eyebrow, .copy-status) { color: var(--muted); font-size: 13px; }
.revealed-key { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 24px 0 8px; border: 1px solid var(--sea); background: var(--white); }
.revealed-key code { overflow-wrap: anywhere; padding: 15px; color: var(--sea); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.revealed-key button { border: 0; border-left: 1px solid var(--line); padding: 0 14px; color: var(--sea); background: #e3eee9; font-size: 11px; font-weight: 700; cursor: pointer; }
.copy-status { min-height: 20px; margin: 0 0 18px; color: var(--sea); font-size: 11px; }
.auth-footer { display: flex; height: 60px; align-items: center; justify-content: space-between; padding: 0 4vw; border-top: 1px solid rgba(255,255,255,0.13); color: #7f9295; font-size: 10px; text-transform: uppercase; }

/* Subscriber workspace */
.portal-shell { min-width: 320px; background: #ece9e1; }
.portal-loading { position: fixed; z-index: 100; inset: 0; display: grid; place-content: center; justify-items: center; color: var(--paper); background: var(--ink); transition: opacity 250ms ease, visibility 250ms ease; }
.portal-loading.is-hidden { visibility: hidden; opacity: 0; }
.loading-mark { display: grid; width: 64px; height: 64px; place-items: center; border: 1px solid var(--lime); border-radius: 50%; color: var(--lime); font-weight: 700; animation: pulse-ring 1.2s infinite ease-in-out; }
.portal-loading p { margin-top: 18px; color: #a9b6b8; font-size: 12px; letter-spacing: 0.08em; }
.portal-header { position: sticky; z-index: 30; top: 0; display: grid; height: var(--header-height); grid-template-columns: 240px 1fr 240px; align-items: center; padding: 0 26px; border-bottom: 1px solid #bfc3bc; background: rgba(242,239,231,0.94); backdrop-filter: blur(14px); }
.workspace-nav { display: flex; height: 100%; align-items: stretch; justify-content: center; gap: 36px; }
.nav-tab { position: relative; border: 0; padding: 0 4px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 650; cursor: pointer; }
.nav-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--signal); content: ""; transform: scaleX(0); transition: transform 160ms ease; }
.nav-tab.is-active { color: var(--ink); }
.nav-tab.is-active::after { transform: scaleX(1); }
.account-menu { display: flex; align-items: center; justify-content: flex-end; gap: 13px; }
.plan-badge { padding: 5px 9px; border: 1px solid var(--line-dark); border-radius: 20px; color: var(--sea); font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.avatar-button { display: grid; width: 37px; height: 37px; place-items: center; border: 0; border-radius: 50%; color: var(--paper); background: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; }
.portal-main { min-height: calc(100vh - var(--header-height)); }
.workspace-view { display: none; }
.workspace-view.is-active { display: block; animation: view-in 250ms both ease-out; }
.explore-view.is-active { display: grid; grid-template-columns: 330px minmax(0, 1fr); }
.filter-panel { position: sticky; top: var(--header-height); overflow-y: auto; height: calc(100vh - var(--header-height)); border-right: 1px solid #bbc0ba; background: var(--paper); scrollbar-width: thin; }
.filter-panel-head { display: flex; align-items: start; justify-content: space-between; padding: 26px 24px 20px; border-bottom: 1px solid var(--line); }
.filter-panel-head h1 { margin: 0; font-family: var(--serif); font-size: 34px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.filter-panel .eyebrow { margin-bottom: 7px; }
.filter-panel form > .search-field { display: block; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.filter-panel label > span, .filter-group-body > label { color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.filter-panel input:not([type="checkbox"]), .filter-panel select, .sort-control select, .action-modal input, .action-modal select, .action-modal textarea { width: 100%; border: 1px solid #b6bbb5; border-radius: 0; background: var(--white); outline: none; }
.filter-panel input:not([type="checkbox"]), .filter-panel select:not([multiple]) { height: 39px; margin-top: 6px; padding: 7px 9px; font-size: 12px; }
.filter-panel input::placeholder { color: #8d9798; font-weight: 400; opacity: 1; }
.filter-panel input:focus, .filter-panel select:focus, .action-modal input:focus, .action-modal select:focus, .action-modal textarea:focus { border-color: var(--sea); box-shadow: 0 0 0 2px rgba(23,107,100,0.12); }
.filter-panel select[multiple] { margin-top: 6px; padding: 3px; font-size: 12px; }
.filter-panel select[multiple] option { padding: 5px 7px; }
.filter-panel select[multiple] option:checked { color: #fff; background: var(--sea) linear-gradient(0deg, var(--sea), var(--sea)); }
.filter-group { border-bottom: 1px solid var(--line); }
.filter-group summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; padding: 0 24px; font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after { color: var(--signal-dark); content: "+"; font-size: 18px; font-weight: 400; }
.filter-group[open] summary::after { content: "−"; }
.summary-count { display: none; margin-left: auto; margin-right: 10px; padding: 1px 6px; border-radius: 12px; color: #fff; background: var(--signal); font-size: 9px; }
.summary-count:not(:empty) { display: inline-block; }
.filter-group-body { display: grid; gap: 15px; padding: 3px 24px 22px; }
.filter-help { margin: 0; padding: 10px 11px; border-left: 3px solid var(--gold); color: var(--ink-soft); background: rgba(217,164,65,0.1); font-size: 10px; line-height: 1.5; }
.range-field { display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; align-items: center; margin: 0; border: 0; padding: 0; }
.range-field legend { float: left; width: 100%; margin-bottom: 5px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.range-field span { color: var(--muted); font-size: 10px; }
.check-row { display: flex !important; align-items: center; gap: 9px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--sea); }
.filter-actions { position: sticky; bottom: 0; padding: 18px 24px 20px; border-top: 1px solid var(--line); background: rgba(242,239,231,0.96); backdrop-filter: blur(8px); }
.filter-actions .text-button { display: block; margin: 14px auto 0; font-size: 11px; }
.results-workspace { min-width: 0; padding: 30px clamp(22px, 3vw, 52px) 60px; }
.results-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding-bottom: 24px; border-bottom: 1px solid #afb6b1; }
.results-context { margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.results-toolbar h2 { margin: 0; font-family: var(--serif); font-size: 43px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.toolbar-actions { display: flex; align-items: flex-end; gap: 9px; }
.sort-control { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.sort-control select { display: block; width: 150px; height: 44px; margin-top: 4px; padding: 7px 9px; font-size: 12px; text-transform: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 15px; }
.active-filters:empty { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid #c1c5bd; border-radius: 20px; color: var(--ink-soft); background: rgba(255,255,255,0.5); font-size: 10px; }
.market-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0; border: 1px solid #c3c5bd; background: rgba(255,255,255,0.35); }
.summary-stat { min-height: 85px; padding: 15px 17px; border-right: 1px solid #c3c5bd; }
.summary-stat:last-child { border-right: 0; }
.summary-stat span { display: block; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.summary-stat strong { display: block; overflow: hidden; margin-top: 8px; font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: -0.04em; text-overflow: ellipsis; white-space: nowrap; }
.agency-table-wrap, .export-table-wrap { overflow-x: auto; border: 1px solid #bdc1bb; background: var(--white); }
.agency-table, .management-table { width: 100%; border-collapse: collapse; }
.agency-table th, .management-table th { padding: 12px 14px; border-bottom: 1px solid #bdc1bb; color: var(--muted); background: #e6e4dc; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
.agency-table td, .management-table td { padding: 15px 14px; border-bottom: 1px solid #dcddd6; vertical-align: middle; font-size: 12px; }
.agency-table tbody tr { transition: background 120ms ease; }
.agency-table tbody tr:hover { background: #f2f4eb; }
.agency-table tbody tr:last-child td, .management-table tbody tr:last-child td { border-bottom: 0; }
.agency-name { max-width: 330px; }
.agency-name strong { display: block; overflow: hidden; font-size: 14px; letter-spacing: -0.02em; text-overflow: ellipsis; white-space: nowrap; }
.agency-name span, .cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.record-signal { display: block; width: max-content; max-width: 100%; margin-top: 7px !important; padding: 3px 6px; color: var(--sea) !important; background: #dcece5; font-size: 8px !important; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.record-signal.signal-stale, .record-signal.signal-review { color: #815e12 !important; background: #f0e7c8; }
.record-signal.signal-unknown { color: var(--muted) !important; background: #e2e1dc; }
[hidden] { display: none !important; }
.signal-tags { display: flex; max-width: 280px; flex-wrap: wrap; gap: 4px; }
.signal-tag { max-width: 120px; overflow: hidden; padding: 3px 6px; color: var(--sea); background: #e1eee8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quality-cell { min-width: 96px; }
.quality-meter { display: flex; align-items: center; gap: 7px; }
.quality-track { width: 45px; height: 5px; background: #dddcd4; }
.quality-track span { display: block; width: var(--quality); height: 100%; background: var(--sea); }
.row-action { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #bdc1bb; background: transparent; cursor: pointer; }
.row-action:hover { color: #fff; background: var(--ink); }
.results-state { margin: 18px 0; padding: 16px; border-left: 3px solid var(--signal); background: #fff7ee; color: var(--ink-soft); font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; padding-top: 22px; }
.page-button { min-width: 34px; height: 34px; border: 1px solid #b9beb8; background: transparent; font-size: 11px; cursor: pointer; }
.page-button.is-active { color: #fff; background: var(--ink); border-color: var(--ink); }
.page-button:disabled { opacity: 0.35; }
.collection-view, .account-view { width: min(1320px, calc(100% - 8vw)); margin: auto; padding: 54px 0 90px; }
.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding-bottom: 30px; border-bottom: 1px solid #aeb5af; }
.view-header h1 { margin: 0; font-family: var(--serif); font-size: clamp(48px, 6vw, 76px); font-weight: 500; letter-spacing: -0.055em; line-height: 0.9; }
.view-header p:not(.eyebrow) { margin: 14px 0 0; color: var(--muted); }
.collection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 28px; }
.segment-card { position: relative; min-height: 250px; padding: 24px; border: 1px solid #b8bdb7; background: var(--white); }
.segment-card h2 { margin: 45px 0 9px; font-family: var(--serif); font-size: 29px; font-weight: 500; letter-spacing: -0.04em; }
.segment-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.segment-card-meta { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 14px; border-top: 1px solid #dddcd5; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.segment-card-actions { display: flex; gap: 7px; margin-top: 18px; }
.empty-collection { grid-column: 1 / -1; padding: 80px 30px; border: 1px dashed #abb2ac; text-align: center; }
.empty-collection h2 { margin: 0; font-family: var(--serif); font-size: 34px; font-weight: 500; }
.empty-collection p { color: var(--muted); }
.usage-ribbon { display: grid; grid-template-columns: repeat(3, 1fr); margin: 28px 0 18px; border: 1px solid #b9bdb7; background: var(--white); }
.usage-ribbon .summary-stat { min-height: 96px; }
.status-pill { display: inline-flex; align-items: center; width: max-content; padding: 4px 8px; border-radius: 20px; color: var(--sea); background: #dcece5; font-size: 9px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.status-pill.status-failed, .status-pill.status-canceled { color: var(--danger); background: #f4ded8; }
.status-pill.status-processing, .status-pill.status-queued { color: #815e12; background: #f0e7c8; }
.status-pill.status-expired { color: var(--muted); background: #e2e1dc; }
.download-link { color: var(--sea); font-weight: 700; text-underline-offset: 3px; }
.account-layout { display: grid; grid-template-columns: 1.1fr 1.1fr 0.8fr; gap: 15px; margin-top: 28px; }
.account-card { min-height: 320px; padding: 27px; border: 1px solid #b8bdb7; background: var(--white); }
.subscription-card { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.subscription-card .card-label { color: #91a1a3; }
.subscription-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 68px; }
.subscription-title h2 { margin: 0; font-family: var(--serif); font-size: 49px; font-weight: 500; text-transform: capitalize; }
.subscription-card > p:not(.card-label) { color: #aebbbc; font-size: 12px; }
.subscription-card .button { margin-top: 20px; color: var(--ink); background: var(--lime); border-color: var(--lime); }
.billing-note { max-width: 420px; }
.usage-stack { display: grid; gap: 24px; margin-top: 38px; }
.usage-item-head { display: flex; justify-content: space-between; gap: 20px; font-size: 11px; }
.usage-item-head span { color: var(--muted); }
.usage-bar { height: 7px; margin-top: 8px; background: #e2e1d9; }
.usage-bar span { display: block; width: var(--usage); height: 100%; background: var(--signal); }
.account-details dl { margin: 35px 0 0; }
.account-details dl div { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid #e1e0d8; }
.account-details dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.account-details dd { overflow-wrap: anywhere; margin: 0; font-size: 12px; font-weight: 650; }
.upgrade-section { margin-top: 70px; padding-top: 28px; border-top: 1px solid #adb4ae; }
.upgrade-section > div:first-child { display: flex; align-items: flex-end; justify-content: space-between; }
.upgrade-section h2 { max-width: 670px; margin: 0; font-family: var(--serif); font-size: 43px; font-weight: 500; letter-spacing: -0.045em; }
.upgrade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 27px; }
.upgrade-card { padding: 22px; border: 1px solid #b8bdb7; background: rgba(255,255,255,0.5); }
.upgrade-card.is-current { border: 2px solid var(--sea); background: var(--white); }
.upgrade-card h3 { margin: 45px 0 8px; font-family: var(--serif); font-size: 28px; font-weight: 500; text-transform: capitalize; }
.upgrade-card p { min-height: 54px; margin: 0 0 20px; color: var(--muted); font-size: 11px; }
.mobile-filter-button, .mobile-filter-close { display: none; }
.icon-button { border: 0; background: transparent; font-size: 24px; cursor: pointer; }

/* Dialogs */
.modal { width: min(680px, calc(100% - 30px)); max-height: calc(100vh - 40px); overflow-y: auto; border: 0; padding: clamp(26px, 4vw, 48px); color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(7, 22, 27, 0.7); backdrop-filter: blur(4px); }
.modal-close { position: absolute; top: 16px; right: 18px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line-dark); background: transparent; font-size: 20px; cursor: pointer; }
.modal h2 { margin: 0 0 25px; font-family: var(--serif); font-size: 43px; font-weight: 500; letter-spacing: -0.045em; line-height: 1; }
.detail-modal { width: min(920px, calc(100% - 30px)); }
.detail-hero { margin: -48px -48px 30px; padding: 55px 48px 35px; color: var(--paper); background: var(--ink); }
.detail-hero h2 { max-width: 720px; margin: 42px 0 10px; color: var(--paper); font-size: 52px; }
.detail-hero p { color: #acbabc; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-meta span { padding: 5px 8px; border: 1px solid rgba(255,255,255,0.2); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-dark); border-left: 1px solid var(--line-dark); }
.detail-stat { min-height: 110px; padding: 15px; border-right: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.detail-stat span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.detail-stat strong { display: block; margin-top: 13px; font-family: var(--serif); font-size: 22px; font-weight: 500; overflow-wrap: anywhere; }
.detail-section { margin-top: 30px; }
.detail-section h3 { padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.detail-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.detail-list li { padding: 6px 9px; color: var(--sea); background: #dcebe5; font-size: 11px; }
.intelligence-section { margin-top: 38px; padding-top: 24px; border-top: 2px solid var(--ink); }
.intelligence-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.intelligence-heading .eyebrow { margin-bottom: 4px; }
.intelligence-heading h3 { margin: 0; border: 0; padding: 0; font-family: var(--serif); font-size: 31px; font-weight: 500; letter-spacing: -0.04em; text-transform: none; }
.intelligence-heading > span { max-width: 260px; color: var(--muted); font-size: 10px; text-align: right; }
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.score-card { display: flex; min-height: 285px; flex-direction: column; padding: 18px; color: var(--paper); background: var(--ink); }
.score-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.score-card-head span { max-width: 180px; color: var(--lime); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.score-card-head strong { font-family: var(--serif); font-size: 42px; font-weight: 500; line-height: 0.85; }
.score-track { height: 4px; margin: 15px 0; background: rgba(255,255,255,0.14); }
.score-track span { display: block; width: var(--score); height: 100%; background: linear-gradient(90deg, var(--signal), var(--lime)); }
.score-card > p { min-height: 47px; margin: 0 0 14px; color: #b8c2c2; font-size: 10px; }
.score-card dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; margin: 0; }
.score-card dl div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.12); padding: 4px 0; }
.score-card dt { color: #9eaaaa; font-size: 9px; }
.score-card dd { margin: 0; font-size: 10px; font-weight: 700; }
.score-card footer { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; color: #8fa0a2; font-size: 8px; }
.family-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-dark); }
.family-summary > div { min-height: 90px; padding: 13px; border-right: 1px solid var(--line); background: var(--white); }
.family-summary > div:last-child { border-right: 0; }
.family-summary span, .family-member > span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.family-summary strong { display: block; margin-top: 10px; font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.1; }
.family-member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; max-height: 360px; overflow-y: auto; margin-top: 10px; }
.family-member { padding: 13px; border: 1px solid var(--line); background: rgba(255,255,255,0.5); }
.family-member.is-root { border-color: var(--sea); box-shadow: inset 3px 0 var(--sea); }
.family-member strong { display: block; margin: 9px 0 4px; font-size: 11px; }
.family-member p { margin: 2px 0; color: var(--muted); font-size: 9px; }
.detail-subheading { margin: 20px 0 8px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.provenance-table-wrap { overflow-x: auto; border: 1px solid var(--line-dark); background: var(--white); }
.provenance-table { width: 100%; border-collapse: collapse; }
.provenance-table th { padding: 8px 10px; color: var(--muted); background: #e6e4dc; font-size: 8px; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
.provenance-table td { padding: 10px; border-top: 1px solid var(--line); font-size: 10px; vertical-align: top; }
.provenance-table td strong, .provenance-table td span { display: block; }
.provenance-table td span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.provenance-table a { color: var(--sea); font-weight: 700; text-underline-offset: 3px; }
.location-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.location-item { padding: 15px; border: 1px solid var(--line); background: var(--white); font-size: 11px; }
.location-item strong { display: block; margin-bottom: 6px; }
.action-modal label + label { margin-top: 17px; }
.action-modal input, .action-modal select, .action-modal textarea { display: block; min-height: 43px; margin-top: 7px; padding: 9px 10px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.column-picker { margin: 24px 0 0; border: 0; padding: 0; }
.column-picker legend { margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.column-picker > div { display: grid; max-height: 260px; overflow-y: auto; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.column-check { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; padding: 9px; background: var(--white); font-size: 10px !important; cursor: pointer; }
.column-check input { width: auto; min-height: 0; margin: 0; accent-color: var(--sea); }
.toast { position: fixed; z-index: 80; right: 24px; bottom: 24px; max-width: 390px; padding: 13px 17px; color: #fff; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(15px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: var(--danger); }

@keyframes reveal-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes grow-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 14px rgba(199,215,109,0.08); transform: scale(1.03); } }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr 380px; gap: 4vw; padding-inline: 5vw; }
  .hero h1 { font-size: clamp(58px, 7vw, 82px); }
  .portal-header { grid-template-columns: 190px 1fr 150px; }
  .explore-view.is-active { grid-template-columns: 300px minmax(0,1fr); }
  .results-workspace { padding-inline: 22px; }
  .results-toolbar { align-items: flex-start; flex-direction: column; }
  .market-summary { grid-template-columns: repeat(2, 1fr); }
  .summary-stat:nth-child(2) { border-right: 0; }
  .summary-stat:nth-child(-n+2) { border-bottom: 1px solid #c3c5bd; }
  .account-layout { grid-template-columns: 1fr 1fr; }
  .account-details { grid-column: 1 / -1; min-height: auto; }
}

@media (max-width: 820px) {
  .site-header { height: 72px; }
  .site-nav > a:not(.button) { display: none; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 70px 6vw; }
  .hero-field { min-height: 430px; }
  .field-number { font-size: 78px; }
  .proof-strip { justify-content: flex-start; }
  .editorial-section, .plans-section { width: calc(100% - 12vw); padding: 85px 0; }
  .section-heading { grid-template-columns: 1fr; margin: 45px 0 55px; }
  .feature-ledger, .plan-grid { grid-template-columns: 1fr; }
  .feature-ledger article { min-height: 250px; }
  .feature-ledger h3 { margin-top: 55px; }
  .intelligence-panel { grid-template-columns: 1fr; padding: 85px 6vw; }
  .query-card { margin-right: 16px; }
  .plan-card.plan-featured { transform: none; }
  .site-footer { grid-template-columns: 1fr; }
  .auth-main { grid-template-columns: 1fr; padding: 100px 0 60px; }
  .auth-context { padding: 40px 7vw 10px; }
  .auth-context h1 { font-size: 60px; }
  .auth-card { margin: 45px auto; }
  .portal-header { grid-template-columns: 1fr auto; padding: 0 16px; backdrop-filter: none; }
  .workspace-nav { position: fixed; z-index: 35; right: 0; bottom: 0; left: 0; height: 61px; justify-content: space-around; gap: 0; border-top: 1px solid #b8bdb7; background: var(--paper); }
  .nav-tab { flex: 1; font-size: 11px; }
  .account-menu .plan-badge { display: none; }
  .explore-view.is-active { display: block; }
  .filter-panel { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(360px, 92vw); height: 100vh; box-shadow: var(--shadow); transform: translateX(-105%); transition: transform 220ms ease; }
  .filter-panel.is-open { transform: translateX(0); }
  .mobile-filter-close, .mobile-filter-button { display: inline-flex; }
  .results-workspace { padding: 24px 16px 90px; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .toolbar-actions .sort-control { flex: 1 0 100%; }
  .sort-control select { width: 100%; }
  .agency-table thead { display: none; }
  .agency-table, .agency-table tbody, .agency-table tr, .agency-table td { display: block; }
  .agency-table tbody { padding: 0 14px; }
  .agency-table tr { position: relative; padding: 17px 44px 17px 0; border-bottom: 1px solid #d5d7d0; }
  .agency-table td { border: 0; padding: 4px 0; }
  .agency-table td:last-child { position: absolute; top: 18px; right: 0; }
  .agency-name { max-width: none; }
  .signal-tags { max-width: none; }
  .collection-view, .account-view { width: calc(100% - 32px); padding: 40px 0 90px; }
  .collection-grid { grid-template-columns: 1fr 1fr; }
  .account-layout, .upgrade-grid { grid-template-columns: 1fr; }
  .account-details { grid-column: auto; }
}

@media (max-width: 560px) {
  .wordmark { font-size: 16px; }
  .wordmark-mark { width: 32px; height: 32px; }
  .hero h1 { font-size: 54px; }
  .hero-deck { font-size: 17px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-field { min-height: 390px; padding: 34px 25px; }
  .field-number { margin-top: 55px; font-size: 62px; }
  .field-stats { gap: 7px; }
  .field-stats dd { font-size: 21px; }
  .section-heading h2, .intelligence-copy h2 { font-size: 45px; }
  .query-card { box-shadow: 10px 10px 0 var(--signal); }
  .query-result strong { font-size: 40px; }
  .plans-cta { align-items: stretch; flex-direction: column; }
  .auth-context h1 { font-size: 50px; }
  .auth-card { width: calc(100% - 30px); padding: 30px 22px; box-shadow: 10px 10px 0 var(--signal); }
  .auth-card h2 { font-size: 36px; }
  .market-summary { grid-template-columns: 1fr 1fr; }
  .summary-stat { padding: 12px; }
  .summary-stat strong { font-size: 21px; }
  .results-toolbar h2 { font-size: 36px; }
  .toolbar-actions .button { flex: 1; padding-inline: 9px; font-size: 11px; }
  .collection-grid { grid-template-columns: 1fr; }
  .view-header { align-items: stretch; flex-direction: column; }
  .view-header h1 { font-size: 50px; }
  .usage-ribbon { grid-template-columns: 1fr; }
  .usage-ribbon .summary-stat { border-right: 0; border-bottom: 1px solid #c3c5bd; }
  .management-table th:nth-child(3), .management-table td:nth-child(3), .management-table th:nth-child(5), .management-table td:nth-child(5) { display: none; }
  .account-card { min-height: 280px; padding: 22px; }
  .subscription-title { margin-top: 50px; }
  .subscription-title h2 { font-size: 42px; }
  .upgrade-section h2 { font-size: 36px; }
  .detail-hero { margin: -26px -26px 25px; padding: 45px 26px 28px; }
  .detail-hero h2 { font-size: 39px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .score-grid, .family-member-grid { grid-template-columns: 1fr; }
  .family-summary { grid-template-columns: repeat(2, 1fr); }
  .family-summary > div:nth-child(2) { border-right: 0; }
  .family-summary > div { border-bottom: 1px solid var(--line); }
  .intelligence-heading { align-items: start; flex-direction: column; gap: 7px; }
  .intelligence-heading > span { text-align: left; }
  .location-list, .export-options, .column-picker > div { grid-template-columns: 1fr; }
  .modal-actions { align-items: stretch; flex-direction: column-reverse; }
  .toast { right: 15px; bottom: 75px; left: 15px; }
}

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