/* ============================================================
   IndustryPulse Analytics — Instrument-grade design system
   Design TOKENS now live in shared/tokens.css (single source of truth,
   brandbook palette) and are linked BEFORE this file in index.html.
   The :root / [data-theme] token blocks that used to sit here were removed
   to kill the hard-coded duplicate — do not re-add them. This file holds
   only base element styling + customer-app component CSS.
   ============================================================ */

/* ---- Base ------------------------------------------------ */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  background:var(--bg); color:var(--ink);
  font-family:var(--fs-body); font-size:15px; line-height:1.55;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  transition:background .3s var(--ease);
}
h1,h2,h3,h4,h5{font-family:var(--fs-display);font-weight:600;letter-spacing:-.018em;line-height:1.08;margin:0;color:var(--ink)}
p{margin:0}
a{color:inherit;text-decoration:none;cursor:pointer}
button{font-family:inherit;color:inherit}/* inherit the themed text color so button-contained text never falls back to UA black in dark (QA root-cause fix; styled buttons override via their own class) */
::selection{background:color-mix(in srgb,var(--cyan) 30%,transparent)}
.mono{font-family:var(--fs-mono);font-feature-settings:"tnum" 1,"zero" 1}
.muted{color:var(--muted)} .dim{color:var(--dim)} .faint{color:var(--faint)}
.pos{color:var(--pos)} .neg{color:var(--neg)} .wch{color:var(--watch)}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 32px}
/* Gradient text fill — SITE-WIDE, never one page's. Landing and about both use it, and so do
   portal-saved.jsx and routes-auth.jsx. An earlier agent-os/tools/split_page_css.py run moved it into
   pages/about.css, where it was invisible-but-wrong: every page sheet is linked site-wide, so it kept
   working, and it would have left the site the day the about page was re-homed. Restored 2026-08-02 to
   its original line (git f2524c9c^), which keeps its cascade position relative to everything below. */
.grad-text{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}

/* PL-05 (S12): letter-spaced uppercase microtype gets an explicit multi-line
   line-height — two-line kickers ("TRANSPARENT PRICING") were overlapping.
   Eyebrows are single-phrase labels: nowrap so font-metric variance
   (screenshot/PDF pipelines, font fallback) can never wrap them into an
   overlap; kickers keep wrap allowed but with a safe line-height. */
.kicker{font-family:var(--fs-mono);font-size:11px;letter-spacing:.2em;text-transform:uppercase;color:var(--dim);font-weight:500;line-height:1.5}
.eyebrow{display:inline-flex;align-items:center;gap:9px;font-family:var(--fs-mono);font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);line-height:1.5;white-space:nowrap}
.eyebrow::before{content:"";width:18px;height:1px;background:var(--grad)}
/* MEASURED, NOT ASSUMED. The nowrap above is the one genuinely shared rule on every public route, so
   it was worth driving rather than arguing about. Chromium, 2026-08-04: the longest eyebrow on the
   site is "Free report · no account needed" at 286px. Against the 350px content width of a 390px
   phone it clears by 55px — nowrap is harmless there, and every other route's longest eyebrow is
   shorter still (261px on pricing, 228px on methodology). Against the 280px content width of a 320px
   phone it does NOT: it reached x=335 and was the sole remaining origin of the landing route's 15px
   document overflow once the grid collapses were repaired. Wrapping is only unsafe without a
   multi-line line-height, and PL-05 already gave this selector line-height:1.5 — the same allowance
   .kicker keeps. So the guard stays where it earns its keep and is released at the one width where
   the string cannot fit. */
@media (max-width:560px){
  .eyebrow{white-space:normal}
}

/* ---- Buttons --------------------------------------------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--fs-body);font-weight:600;font-size:14px;cursor:pointer;border-radius:var(--r-sm);padding:10px 17px;border:1px solid transparent;transition:.18s var(--ease);white-space:nowrap;line-height:1}
.btn svg{width:16px;height:16px}
/* ROUND 4 (site walk, BUILD_PLAN.md 8.4): the coloured glow drops sitewide, keeping only the 1px
   inner highlight (a token color-mix, never a literal colour — the previous rgba(255,255,255,.18)
   was one). */
.btn-primary{color:var(--on-accent);background:var(--grad-cta);box-shadow:inset 0 1px 0 color-mix(in srgb,var(--on-accent) 18%,transparent)}
.btn-primary:hover{filter:brightness(1.07)}
.btn-ghost{color:var(--ink);background:var(--surface);border-color:var(--border2)}
.btn-ghost:hover{border-color:var(--azure);color:var(--ink)}
.btn-quiet{color:var(--muted);background:transparent;border-color:transparent}
.btn-quiet:hover{color:var(--ink);background:var(--chip)}
.btn-sm{padding:7px 12px;font-size:13px}
.btn-lg{padding:13px 24px;font-size:15.5px}
.btn-block{width:100%}
.btn[disabled]{opacity:.5;pointer-events:none}

/* ---- Surfaces -------------------------------------------- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);box-shadow:var(--shadow-sm)}
.card-pad{padding:22px}
.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow)}
.hair{height:1px;background:var(--border);border:0;margin:0}

/* ---- Tags / badges --------------------------------------- */
.tag{display:inline-flex;align-items:center;gap:5px;font-family:var(--fs-mono);font-size:10px;font-weight:500;letter-spacing:.12em;text-transform:uppercase;border-radius:6px;padding:4px 8px;background:var(--chip);color:var(--muted)}
.tag.brand{background:var(--grad-soft);color:var(--accent-ink)}
.tag.pos{background:var(--posbg);color:var(--pos)}
.tag.watch{background:var(--watchbg);color:var(--watch)}
.tag.neg{background:var(--negbg);color:var(--neg)}
.tag.lock{background:var(--chip);color:var(--dim)}
.dot{width:7px;height:7px;border-radius:50%;display:inline-block;background:var(--pos);box-shadow:0 0 0 3px color-mix(in srgb,var(--pos) 18%,transparent)}
.dot.watch{background:var(--watch);box-shadow:0 0 0 3px var(--watchbg)}
.dot.dim{background:var(--dim);box-shadow:none}

.pill{display:inline-flex;align-items:center;gap:4px;font-family:var(--fs-mono);font-size:12px;font-weight:500;border-radius:20px;padding:3px 9px;line-height:1}
.pill.up{background:var(--posbg);color:var(--pos)}
.pill.dn{background:var(--negbg);color:var(--neg)}
.pill.flat{background:var(--chip);color:var(--muted)}

/* ---- Fresh / governance line ----------------------------- */
.fresh{display:inline-flex;align-items:center;gap:8px;font-family:var(--fs-mono);font-size:11px;color:var(--muted);border:1px solid var(--border);border-radius:20px;padding:5px 11px;background:var(--surface)}

/* ---- Layered freshness (PL-07 / G-14) ---------------------
   The portal index detail carries the same screen ≠ data run ≠ source ≠
   cadence split the internal shell shows — stacked rows (side-panel width),
   so layers can never collide. */
.fresh-layers{display:flex;flex-direction:column;font-family:var(--fs-mono);font-size:11px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface2);overflow:hidden}
.fresh-layers .fl{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 14px;padding:8px 12px;border-bottom:1px solid var(--line);line-height:1.5}
.fresh-layers .fl:last-child{border-bottom:0}
.fresh-layers .fl b{font-weight:500;font-size:9.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--dim);white-space:nowrap}
.fresh-layers .fl .v{color:var(--ink2);text-align:right;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;margin-left:auto}
.fresh-layers .fl.live .dot{width:7px;height:7px;border-radius:50%;background:var(--pos);flex-shrink:0}

/* scrollbar */
*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-thumb{background:var(--border2);border-radius:20px;border:3px solid transparent;background-clip:padding-box}
*::-webkit-scrollbar-thumb:hover{background:var(--dim);background-clip:padding-box}

/* ---- Lock / teaser --------------------------------------- */
.locked{position:relative;overflow:hidden;cursor:pointer}
.locked .veil-content{filter:blur(5px);opacity:.55;pointer-events:none;user-select:none}
.lock-scrim{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:18px;
  background:linear-gradient(180deg, color-mix(in srgb,var(--surface) 30%,transparent), color-mix(in srgb,var(--surface) 78%,transparent));
  transition:.2s var(--ease)}
.locked:hover .lock-scrim{background:linear-gradient(180deg, color-mix(in srgb,var(--surface) 40%,transparent), color-mix(in srgb,var(--surface) 86%,transparent))}
.lock-badge{display:inline-flex;align-items:center;gap:7px;font-family:var(--fs-mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--on-accent);background:var(--grad-cta);border-radius:20px;padding:6px 13px;box-shadow:0 8px 20px -10px var(--cyan)}

/* ---- Modal ----------------------------------------------- */
.modal-scrim{position:fixed;inset:0;z-index:200;background:var(--scrim);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;padding:24px;animation:fade .2s var(--ease)}
.modal{width:100%;max-width:460px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow-lg);animation:pop .26s var(--ease)}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes pop{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}

/* ---- Inputs ---------------------------------------------- */
.field{display:flex;flex-direction:column;gap:7px}
.field label{font-size:12.5px;font-weight:600;color:var(--ink2)}
.input{font-family:var(--fs-body);font-size:14.5px;color:var(--ink);background:var(--surface2);border:1px solid var(--border2);border-radius:var(--r-sm);padding:11px 13px;transition:.15s;width:100%}
.input::placeholder{color:var(--faint)}
.input:focus{outline:none;border-color:var(--azure);box-shadow:0 0 0 3px color-mix(in srgb,var(--azure) 16%,transparent)}

/* ---- Segmented control ----------------------------------- */
.seg{display:inline-flex;background:var(--chip);border:1px solid var(--border);border-radius:var(--r-sm);padding:3px;gap:2px}
.seg button{font-family:var(--fs-body);font-size:13px;font-weight:500;border:0;background:transparent;color:var(--muted);padding:7px 14px;border-radius:7px;cursor:pointer;transition:.15s var(--ease);white-space:nowrap;display:inline-flex;align-items:center;gap:7px}
.seg button.on{background:var(--raise);color:var(--ink);box-shadow:var(--shadow-sm);font-weight:600}
.seg button:not(.on):hover{color:var(--ink)}

/* ---- Animations / reveal --------------------------------- */
/* Content is always fully visible — no entrance animation holds a
   hidden frame (capture/preview envs can freeze animations at t=0). */
.reveal{opacity:1}

.divider-label{display:flex;align-items:center;gap:16px;color:var(--dim)}
.divider-label::before,.divider-label::after{content:"";flex:1;height:1px;background:var(--border)}
