/* Undercurrent — standalone stylesheet (extracted from the claude.ai artifact). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }

/* Layout: a field-instrument sheet. Briefing + radar scope up top, cross-currents and horizon dates, then three lanes of signals by stage. */
:root {
  --bg: #edf0f3;
  --surface: #f8fafb;
  --ink: #121c26;
  --ink-2: #4a5866;
  --ink-3: #74818e;
  --rule: #d2d9e0;
  --grid: #c3ccd5;
  --surge: #c2410c;
  --emerge: #2b5f94;
  --bubble: #4f7d77;
  --surge-wash: #f6e4da;
  --chip: #e3e8ed;
  --crit: #b42318;
  --warn: #b54708;
  --ok: #067647;
  --uk: #1f3a8a;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d141b; --surface: #141e27; --ink: #e4e9ee; --ink-2: #a8b4c0; --ink-3: #7c8996;
    --rule: #24313d; --grid: #2c3b49; --surge: #f08a4b; --emerge: #7aaad9; --bubble: #8cb5ae;
    --surge-wash: #3a2418; --chip: #1c2833; --crit: #f97066; --warn: #fdb022; --ok: #47cd89; --uk: #9db4f0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d141b; --surface: #141e27; --ink: #e4e9ee; --ink-2: #a8b4c0; --ink-3: #7c8996;
  --rule: #24313d; --grid: #2c3b49; --surge: #f08a4b; --emerge: #7aaad9; --bubble: #8cb5ae;
  --surge-wash: #3a2418; --chip: #1c2833; --crit: #f97066; --warn: #fdb022; --ok: #47cd89; --uk: #9db4f0; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: 1240px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.12; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--emerge); outline-offset: 2px; border-radius: 3px; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }

/* masthead */
.mast {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-block: 14px; border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.brand .tag { color: var(--ink-3); font-size: var(--step--1); font-style: italic; }
.scanstat { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--bubble); box-shadow: 0 0 0 0 var(--bubble); animation: pulse 2.4s infinite; }
.pulse.stale { background: var(--ink-3); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bubble) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; padding-block: 36px 28px; align-items: start; }
.hero > * { min-width: 0; }
.briefing .label { margin-bottom: 10px; display: block; }
.briefing h2 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 16px; }
.briefing p.overview { font-size: var(--step-1); line-height: 1.6; color: var(--ink-2); max-width: 62ch; margin: 0 0 22px; }
.tally { display: flex; gap: 22px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 14px; }
.tally div { display: flex; flex-direction: column; gap: 2px; }
.tally b { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.tally span { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.surging { background: var(--surge); }
.dot.emerging { background: var(--emerge); }
.dot.bubbling { background: transparent; border: 2px solid var(--bubble); }

.scope { position: relative; }
.scope svg { width: 100%; max-width: 620px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.scope .ringlbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; fill: var(--ink-3); text-transform: uppercase; }
.scope .seclbl { font-family: var(--font-display); font-size: 13px; font-weight: 700; fill: var(--ink-2); }
.scope .sweep { transform-origin: 300px 300px; animation: sweep 9s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.blip { cursor: pointer; }
.blip circle.hit { fill: transparent; }
.blip:hover circle.mark, .blip:focus-visible circle.mark, .blip.on circle.mark { stroke: var(--ink); stroke-width: 2; }
.blip.dim { opacity: 0.18; }
.tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
  padding: 8px 10px; font-size: var(--step--1); max-width: 240px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.12); z-index: 3;
}
.tip b { font-family: var(--font-display); display: block; line-height: 1.25; margin-bottom: 2px; }
.scope-key { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 6px; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-2); }
.scope-key span { display: flex; align-items: center; gap: 6px; }

/* sections */
section.block { padding-block: 28px; border-top: 1px solid var(--rule); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.block-head h2 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.015em; }
.block-head p { margin: 0; color: var(--ink-3); font-size: var(--step--1); max-width: 60ch; }

.patterns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--surface); }
.pattern { padding: 18px 20px 20px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.pattern h3 { font-size: var(--step-1); font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.pattern p { margin: 0 0 12px; color: var(--ink-2); font-size: 0.9375rem; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.sigchip {
  border: 1px solid var(--rule); background: var(--bg); border-radius: 999px; padding: 3px 10px 3px 8px; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.71875rem; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-align: left;
}
.sigchip:hover { border-color: var(--ink-3); color: var(--ink); }

/* horizon */
.horizon { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 0; overflow-x: auto; border-top: 2px solid var(--ink); padding-bottom: 6px; }
.hz { padding: 12px 14px 4px 0; position: relative; min-width: 0; }
.hz::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); }
.hz .when { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; display: block; margin: 6px 0 4px; }
.hz .when small { color: var(--ink-3); font-weight: 400; }
.hz p { margin: 0; font-size: 0.875rem; color: var(--ink-2); line-height: 1.45; padding-right: 8px; }
.hz.past .when { color: var(--ink-3); text-decoration: line-through; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.fbtn { border: 1px solid var(--rule); background: var(--surface); border-radius: 6px; padding: 6px 11px; cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); }
.fbtn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { margin-left: auto; position: relative; min-width: 0; flex: 0 1 240px; }
.search input { width: 100%; border: 1px solid var(--rule); background: var(--surface); border-radius: 6px; padding: 7px 10px; font: inherit; font-size: 0.875rem; color: var(--ink); }

.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.lane { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.lane-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.lane-head h3 { font-size: var(--step-0); font-weight: 700; }
.lane-head .n { margin-left: auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-3); }
.lane-head + p { margin: -4px 0 2px; font-size: 0.8125rem; color: var(--ink-3); font-style: italic; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 8px; width: 100%; transition: border-color .15s;
}
.card:hover { border-color: var(--ink-3); }
.card.surging { border-left: 3px solid var(--surge); }
.card .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.card h4 { margin: 0; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; line-height: 1.22; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 0.9rem; color: var(--ink-2); line-height: 1.5; }
.meter { display: flex; align-items: center; gap: 10px; }
.meter .bar { flex: 1; height: 4px; background: var(--chip); border-radius: 2px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 2px; }
.meter .num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); min-width: 2ch; text-align: right; }
.badge { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--chip); color: var(--ink-2); }
.badge.new { background: var(--surge-wash); color: var(--ink); }
.empty-lane { color: var(--ink-3); font-size: 0.875rem; font-style: italic; padding: 8px 0; }

/* ask */
.ask { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 20px; }
.ask form { display: flex; gap: 8px; flex-wrap: wrap; }
.ask input { flex: 1 1 280px; min-width: 0; border: 1px solid var(--rule); background: var(--bg); border-radius: 6px; padding: 10px 12px; font: inherit; color: var(--ink); }
.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: 6px; padding: 9px 16px; cursor: pointer; font-family: var(--font-display); font-weight: 700; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.answer { margin-top: 16px; white-space: pre-wrap; max-width: 72ch; color: var(--ink); line-height: 1.6; }
.answer:empty { display: none; }
.note { font-size: var(--step--1); color: var(--ink-3); margin-top: 10px; }

/* scan log */
.log { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.log-row .mono { font-size: 0.75rem; color: var(--ink-3); }

/* sheet */
.veil { position: fixed; inset: 0; background: rgb(8 14 20 / 0.42); z-index: 20; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 21; background: var(--surface);
  border-left: 1px solid var(--rule); overflow-y: auto; box-shadow: -10px 0 40px rgb(0 0 0 / 0.18);
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) 22px;
}
.sheet .close { position: sticky; top: 0; float: right; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem; }
.sheet h2 { font-size: var(--step-2); margin: 12px 0 10px; letter-spacing: -0.015em; }
.sheet h5 { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin: 20px 0 6px; font-weight: 600; }
.sheet p { margin: 0; color: var(--ink-2); }
.sheet .facts { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.sheet .facts div { display: flex; flex-direction: column; }
.sheet .facts b { font-family: var(--font-display); font-size: 1.25rem; }
.sheet ul.sources { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sheet ul.sources a { font-size: 0.9rem; text-underline-offset: 3px; text-decoration-color: var(--grid); }
.sheet ul.sources a:hover { text-decoration-color: var(--ink); }
.sheet ul.sources small { display: block; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-3); }

.status { padding: 48px 0; text-align: center; color: var(--ink-2); max-width: 54ch; margin: 0 auto; }
.status h2 { font-size: var(--step-2); margin-bottom: 8px; color: var(--ink); }
footer { padding-top: 28px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: var(--step--1); display: grid; gap: 8px; max-width: 80ch; }

/* UK lens */
.mast-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.uk-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 6px; cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); }
.uk-toggle .knob { width: 28px; height: 16px; border-radius: 999px; background: var(--chip); position: relative; transition: background .15s; flex: none; }
.uk-toggle .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); transition: transform .15s, background .15s; }
.uk-toggle[aria-pressed="true"] { border-color: var(--uk); color: var(--ink); }
.uk-toggle[aria-pressed="true"] .knob { background: var(--uk); }
.uk-toggle[aria-pressed="true"] .knob::after { transform: translateX(12px); background: var(--surface); }
.ukbox { border-left: 3px solid var(--uk); padding: 4px 0 4px 16px; margin: 0 0 22px; max-width: 62ch; }
.ukbox .label { display: block; margin-bottom: 4px; }
.ukbox p { margin: 0; color: var(--ink); font-size: 1.0625rem; line-height: 1.6; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge.uk { background: transparent; border: 1px solid var(--uk); color: var(--ink); }
.badge.flag { background: transparent; border: 1px dashed var(--warn); color: var(--ink); }
.uknote { font-size: 0.875rem !important; color: var(--ink) !important; border-left: 2px solid var(--uk); padding-left: 10px; }

/* claims */
.cfilters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.claims { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.claim { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.claim .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.verdict i { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 0.6875rem; color: var(--surface); flex: none; }
.verdict.crit i { background: var(--crit); }
.verdict.warn i { background: var(--warn); }
.verdict.ok i { background: var(--ok); }
.verdict.neutral i { background: var(--ink-3); }
.verdict.pending i { background: transparent; border: 2px dashed var(--ink-3); color: var(--ink-3); }
.claim blockquote { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.01em; }
.claim blockquote::before { content: "\201C"; } .claim blockquote::after { content: "\201D"; }
.claim p { margin: 0; font-size: 0.9rem; color: var(--ink-2); }
.claim .meta { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-3); line-height: 1.6; }
.claim .src { display: flex; flex-direction: column; gap: 4px; font-size: 0.8125rem; }
.claim .src a { text-underline-offset: 3px; text-decoration-color: var(--grid); }
.submit { margin-top: 22px; background: var(--surface); border: 1px dashed var(--grid); border-radius: 8px; padding: 18px; display: grid; gap: 10px; }
.submit h3 { font-size: var(--step-0); }
.submit p { margin: 0; color: var(--ink-3); font-size: var(--step--1); }
.submit textarea, .submit input { width: 100%; border: 1px solid var(--rule); background: var(--bg); border-radius: 6px; padding: 10px 12px; font: inherit; color: var(--ink); }
.submit textarea { min-height: 72px; resize: vertical; }
.submit .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.submit .row input { flex: 1 1 260px; min-width: 0; }
.submit .msg { font-size: var(--step--1); color: var(--ink-2); }
.sigchip .verdict { white-space: nowrap; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .lanes { grid-template-columns: minmax(0, 1fr); }
  .search { margin-left: 0; flex: 1 1 100%; }
  .log-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .scope .sweep, .pulse { animation: none; }
}

.more { display: flex; justify-content: center; margin-top: 16px; }
