/* Tessera Analytics: theme tokens (light / dark / glass / tessera / tessera-dark), fonts, page chrome. Shared by every section and the login page.
   Fonts: Archivo (text) and IBM Plex Mono (numbers) from Google Fonts, linked in each page head; system fallbacks. */
:root {
  color-scheme: light;
  --bg: #F5F7F8; --surface: #FFFFFF; --sunken: #F8FAFB;
  --ink: #10181D; --ink-2: #3A4750; --muted: #63727D;
  --hair: #E1E6E9; --grid: #EAEEF0;
  --s1: #0B6E99; --s2: #B45309;
  --s1-soft: rgba(11,110,153,.13); --s1-soft-0: rgba(11,110,153,0);
  --band: rgba(84,99,110,.075); --band-edge: rgba(84,99,110,.28);
  --chip: #F1F4F6; --hl: rgba(11,110,153,.09);
  --tk-oai: #4a3aa7; --tk-kal: #1baf7a; --tk-spx: #eda100; --tk-and: #0891b2; --tk-dbx: #e8442e; --tk-other: #8E9DA8;
  --up: var(--tk-kal); --down: var(--warn);
  --err: #B42318; --err-soft: rgba(180,35,24,.08);
  --warn: #8A5300; --warn-soft: rgba(237,161,0,.12); --warn-line: rgba(237,161,0,.45);
  --shadow: 0 1px 2px rgba(16,24,29,.05), 0 8px 24px rgba(16,24,29,.05);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D1418; --surface: #141D23; --sunken: #10181D;
    --ink: #E9EEF1; --ink-2: #BAC6CE; --muted: #8E9DA8;
    --hair: #23303A; --grid: #1D2932;
    --s1: #3D92C0; --s2: #C4802B;
    --s1-soft: rgba(61,146,192,.18); --s1-soft-0: rgba(61,146,192,0);
    --band: rgba(160,176,188,.07); --band-edge: rgba(160,176,188,.25);
    --chip: #1B262E; --hl: rgba(61,146,192,.14);
    --tk-oai: #9085e9; --tk-kal: #199e70; --tk-spx: #c98500; --tk-and: #22b8d6; --tk-dbx: #f0644f; --tk-other: #63727D;
    --err: #F97066; --err-soft: rgba(249,112,102,.1);
    --warn: #F5B94A; --warn-soft: rgba(245,185,74,.12); --warn-line: rgba(245,185,74,.4);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.28);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1418; --surface: #141D23; --sunken: #10181D;
  --ink: #E9EEF1; --ink-2: #BAC6CE; --muted: #8E9DA8;
  --hair: #23303A; --grid: #1D2932;
  --s1: #3D92C0; --s2: #C4802B;
  --s1-soft: rgba(61,146,192,.18); --s1-soft-0: rgba(61,146,192,0);
  --band: rgba(160,176,188,.07); --band-edge: rgba(160,176,188,.25);
  --chip: #1B262E; --hl: rgba(61,146,192,.14);
  --tk-oai: #9085e9; --tk-kal: #199e70; --tk-spx: #c98500; --tk-and: #22b8d6; --tk-dbx: #f0644f; --tk-other: #63727D;
  --err: #F97066; --err-soft: rgba(249,112,102,.1);
  --warn: #F5B94A; --warn-soft: rgba(245,185,74,.12); --warn-line: rgba(245,185,74,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.28);
}
/* Glass (2026-10-30, the approved concept; replaces the 2026-10-29 experiment): dark ink on frosted white panels over
   a fixed, blurred "warm interior" of CSS gradients. Tokens here; backdrop, panels, solid surfaces and the chrome at the
   end of this file. Every token the dark block sets is set here too, so system dark never leaks into Glass. */
:root[data-theme="glass"] {
  color-scheme: light;
  --bg: #b9a48c; --surface: rgba(255,255,255,.28); --sunken: rgba(255,255,255,.5);
  --ink: #0f1a2b; --ink-2: #3d4756; --muted: #3d4756;
  --hair: rgba(15,26,43,.12); --grid: rgba(15,26,43,.09);
  --s1: #1d4ed8; --s2: #B45309;
  --s1-soft: rgba(29,78,216,.14); --s1-soft-0: rgba(29,78,216,0);
  --band: rgba(15,26,43,.05); --band-edge: rgba(15,26,43,.25);
  --chip: rgba(255,255,255,.55); --hl: rgba(29,78,216,.08);
  --tk-oai: #4a3aa7; --tk-kal: #1baf7a; --tk-spx: #eda100; --tk-and: #0891b2; --tk-dbx: #e8442e; --tk-other: #8E9DA8;
  --up: #047857; --down: #9a3412;
  --err: #B42318; --err-soft: rgba(180,35,24,.1);
  --warn: #8A5300; --warn-soft: rgba(237,161,0,.16); --warn-line: rgba(237,161,0,.5);
  --shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 18px 40px rgba(60,40,20,.14);
  --glass: rgba(255,255,255,.28); --glass-line: rgba(255,255,255,.55); --glass-blur: blur(32px) saturate(150%);
  --solid: rgba(255,255,255,.75); --solid-line: rgba(255,255,255,.7); --solid-opaque: #f8f5f1;
  --link-hover: #1e3a8a; --live: #059669;
}

/* Tessera and Tessera dark (2026-11-24, opt-in): the main app's brand. Every token the dark block sets is set here too, mapped
   onto shared/brand.css's --tc-* values (which follow tessera / tessera-dark, never the system), so system dark never leaks
   into Tessera and system light never into Tessera dark. Token chart colours come from brand.css's --tc-chart-* (the same
   values as the other themes' --tk-*); --s1 is a chart blue that reads on cream and on #070706 and is never a button colour
   here. Numbers use Outfit with tabular figures (--mono is Outfit here; Geist Mono isn't loaded). Chrome, type and
   surfaces (tessera.pe's sizes, dash/BRAND.md "Copied from tessera.pe"): the Tessera section below. */
:root[data-theme="tessera"], :root[data-theme="tessera-dark"] {
  color-scheme: light;
  --bg: var(--tc-cream); --surface: var(--tc-surface); --sunken: var(--tc-cream-deep);
  --ink: var(--tc-ink); --ink-2: var(--tc-graphite); --muted: var(--tc-muted);
  --hair: var(--tc-hairline); --grid: var(--tc-hairline-faint);
  --s1: #2F5F8F; --s2: #B45309;
  --s1-soft: rgba(47,95,143,.13); --s1-soft-0: rgba(47,95,143,0);
  --band: var(--tc-fill-subtle); --band-edge: var(--tc-hairline-strong);
  --chip: var(--tc-fill); --hl: var(--tc-lime-wash);
  --tk-oai: var(--tc-chart-oai); --tk-kal: var(--tc-chart-kal); --tk-spx: var(--tc-chart-spx); --tk-and: var(--tc-chart-and);
  --tk-dbx: var(--tc-chart-dbx); --tk-other: #8E9DA8;
  --up: var(--tc-green); --down: var(--tc-warning);
  --err: var(--tc-danger); --err-soft: var(--tc-danger-soft);
  --warn: var(--tc-warning); --warn-soft: var(--tc-warning-soft); --warn-line: rgba(183,132,30,.45);
  --shadow: none;
  --font: var(--tc-font); --mono: var(--tc-font);
  --link: var(--tc-green);
}
:root[data-theme="tessera-dark"] {
  color-scheme: dark;
  --s1: #8DB4DE; --s2: #C4802B;
  --s1-soft: rgba(141,180,222,.18); --s1-soft-0: rgba(141,180,222,0);
  --tk-other: #63727D;
  --warn-line: rgba(230,184,90,.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* top nav */
.topnav { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--hair); }
.topnav .in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; gap: 18px; }
.brand { font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--s1); margin-right: 8px; vertical-align: 0; }
.tabs { display: flex; gap: 4px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; height: 100%; padding: 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--s1); }
.navright { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.iconbtn { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 9px; cursor: pointer; white-space: nowrap; }
.iconbtn:hover { border-color: var(--hair); background: var(--chip); }
.iconbtn:focus-visible, .tabs a:focus-visible { outline: 2px solid var(--s1); outline-offset: 1px; }
.navright form { margin: 0; }
.whoami { font-size: 13px; color: var(--muted); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .whoami { display: none; } }
/* phones outside Glass (2026-10-31): Theme and Sign out move into the avatar menu, the tabs get the width */
.navav { display: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--hair); background: var(--chip); color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; flex: none; }
.navav:focus-visible { outline: 2px solid var(--s1); outline-offset: 1px; }
@media (max-width: 640px) { #themebtn, .navright form { display: none; } .navav { display: inline-flex; align-items: center; justify-content: center; } }
@media (max-width: 480px) { .topnav .in { gap: 10px; } .brand span.long { display: none; } }
/* the Links menu (2026-11-24): the other Tessera tools (links.py), last in the top bar's tabs row; opens a popover */
.linksbtn { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 100%; padding: 0 10px; border: 0; background: transparent;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
.linksbtn:hover, .linksbtn[aria-expanded="true"] { color: var(--ink); }
.linksbtn:focus-visible { outline: 2px solid var(--s1); outline-offset: -2px; }
.linksbtn span { font-size: 10px; }
.infopop .ilinks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.infopop .ilinks a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px; color: var(--ink);
  font-weight: 600; text-decoration: none; }
.infopop .ilinks a:hover { background: var(--chip); }
.infopop .ilinks svg { flex: none; color: var(--muted); }
.ext { color: var(--muted); font-size: .85em; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* page */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 16px 56px; display: flex; flex-direction: column; gap: 18px; }
.eyebrow { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
h1 { font-size: clamp(24px, 4.2vw, 34px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; margin: 6px 0 0; text-wrap: balance; }
.sub { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.lbl { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.note { color: var(--muted); font-size: 13px; margin: 0; }

.card { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px 12px; }
@media (max-width: 480px) { .card { padding: 12px 12px 10px; } }

.chip { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--chip); border: 1px solid transparent; border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.chip:hover { border-color: var(--hair); }
.chip:focus-visible, .seg button:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.chip[aria-pressed="true"] { background: var(--surface); border-color: var(--hair); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.chip .swatch { width: 11px; height: 11px; border-radius: 3px; background: var(--muted); flex: none; }

.seg { display: inline-flex; background: var(--chip); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-radius: 7px; padding: 5px 12px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; margin: 0; }
.stat { background: var(--surface); padding: 14px 16px; min-width: 0; }
.stat dt { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
.stat dd { margin: 4px 0 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(16px, 2.4vw, 21px); font-weight: 500; letter-spacing: -.01em; }
.stat dd small { display: block; font-family: var(--font); font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 2px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0,1fr)); } .stat { padding: 12px 12px; } }
/* fewer tiles than four (2026-10-31: Volume's vs PreStocks has 3, a one-day range 1): no empty grid cells */
.stats[data-n="3"] { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stats[data-n="1"] { grid-template-columns: minmax(0,1fr); max-width: 340px; }
@media (max-width: 480px) { .stats[data-n="3"] { grid-template-columns: minmax(0,1fr); } }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.btn-sum { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 5px 10px; border: 1px solid var(--hair); border-radius: 7px; background: var(--surface); display: inline-block; }
.table-scroll { overflow-x: auto; margin-top: 12px; max-height: 420px; }
table { border-collapse: collapse; font-size: 13px; width: 100%; }
th, td { text-align: right; padding: 5px 12px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; position: sticky; top: 0; background: var(--surface); }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* loading / error states */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px; text-align: center; color: var(--muted); font-size: 14px; padding: 24px 12px; }
.state.err { color: var(--err); }
.state .spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--hair); border-top-color: var(--s1); animation: spin .8s linear infinite; }
.state button { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--chip); border: 1px solid var(--hair); border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.banner { font-size: 13px; color: var(--err); background: var(--err-soft); border: 1px solid var(--hair); border-radius: 8px; padding: 8px 11px; }
.banner.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); padding: 6px 11px; margin: 0 0 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .state .spin { animation-duration: 2.4s; } }

/* small charts (shared/mini.js): Organic share card, Memes "What to watch", Home */
.mini { position: relative; }
.mini svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.mini-grid { stroke: var(--grid); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.mini-l1, .mini-l2 { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.mini-l1 { stroke: var(--s1); stroke-width: 1.25; opacity: .55; }
.mini-l2 { stroke: var(--s1); stroke-width: 2.25; }
.mini-cursor { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mini-tip { position: absolute; top: -6px; transform: translateY(-100%); background: var(--surface); border: 1px solid var(--hair);
            box-shadow: var(--shadow); border-radius: 7px; padding: 3px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 2; }
.mini-tip .dim { color: var(--muted); }
.oscard { background: var(--surface); border: 1px solid var(--hair); border-radius: 10px; padding: 12px 14px 10px; min-width: 0; }
.os-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.os-axis { font-size: 11.5px; color: var(--muted); }
.os-num { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 6px; flex-wrap: wrap; }
.os-big { font-size: clamp(18px, 2.4vw, 22px); font-weight: 500; letter-spacing: -.01em; }
.os-sub { font-size: 12px; color: var(--muted); }
.os-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 4px; font-family: var(--mono); }
.os-key { font-family: var(--font); }
.os-key i { display: inline-block; width: 12px; height: 0; border-top: 2px solid var(--s1); vertical-align: 3px; margin: 0 4px 0 6px; }
.os-key i.k1 { border-top-width: 1.25px; opacity: .55; }
/* Volume: the four stat tiles and the Organic share card share one row */
.statsrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 12px; align-items: stretch; }
.statsrow .stats { align-content: stretch; }
.statsrow:has(> .oscard[hidden]) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .statsrow { grid-template-columns: minmax(0, 1fr); } }

/* ---- Glass chrome elements exist on every page (common.js); only Glass shows them ---- */
.gl-head, .glnav { display: none; }
/* ---- Tessera chrome (the left sidebar, common.js) exists on every page; only the Tessera themes show it ---- */
.tsb, .tsb-mbar, .tsb-scrim { display: none; }

/* ---- (i) buttons and their popover (2026-10-30, every theme): definitions and methodology out of the default view ---- */
.ib { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; padding: 0; border-radius: 50%; cursor: pointer;
  font: italic 700 11px/1 Georgia, "Times New Roman", serif; color: var(--ink-2); background: transparent; border: 1px solid var(--hair); vertical-align: 1px;
  text-transform: none; letter-spacing: 0; position: relative; }
.ib::after { content: ""; position: absolute; inset: -12px; }                  /* a 44 px tap target around the 20 px mark */
.ib:hover, .ib[aria-expanded="true"] { color: var(--s1); border-color: var(--s1); }
.ib:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.infopop { position: absolute; z-index: 60; background: var(--surface); color: var(--ink); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 14px; font-size: 13px; line-height: 1.5; max-height: 70vh; overflow: auto; }
.infopop:focus { outline: none; }
.infopop p { margin: 0 0 8px; } .infopop p:last-child { margin-bottom: 0; }
.infopop .ilead { font-weight: 700; color: var(--ink); }
.infopop .isub { margin: 8px 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.infopop .inote { color: var(--muted); font-size: 12.5px; }
.infopop .idl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.infopop .idl dt { font-weight: 600; color: var(--ink-2); } .infopop .idl dd { margin: 0; }
.infopop .ithemes { display: flex; flex-wrap: wrap; gap: 6px; }
.infopop .itheme, .infopop .isignout button { font: inherit; font-size: 13px; font-weight: 600; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hair); background: var(--chip); color: var(--ink); }
.infopop .itheme[aria-pressed="true"] { background: var(--s1); border-color: var(--s1); color: #fff; }
.infopop .isignout { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--grid); }
.infopop .isignout button { width: 100%; }

/* per-person features (permissions.py): the page says what this person has, so nothing flashes in first */
html:not([data-flags~="data.internal"]) .needs-internal,
html:not([data-flags~="data.export"]) .needs-export { display: none !important; }

/* ---- Tessera and Tessera dark (2026-11-24): left sidebar, flat cards, pill buttons, Outfit / Geist Mono type ----
   Sizes are tessera.pe's (dash/BRAND.md, "Copied from tessera.pe"); the sidebar and the 1200 px dashboard width are its one-offs.
   The sidebar: 256 px expanded, a 56 px icon rail with html[data-sb="rail"] (the person's "sidebar" pref, set by the head
   script before first paint), a slide-over under 860 px. No blur, no backdrop, no warm shadows. */
:root[data-theme^="tessera"] { --sb-w: 256px; }
:root[data-theme^="tessera"] body { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--tc-graphite); }
/* only pages with the Hub chrome (the static .topnav) make room for the sidebar; the sign-in and Creator Program pages don't */
:root[data-theme^="tessera"] body:has(> .topnav) { padding-left: var(--sb-w); }
:root[data-theme^="tessera"] .topnav { display: none; }
:root[data-theme^="tessera"] .page { max-width: 1504px; padding: 32px 32px 56px; }          /* content up to 1440 px + 32 px padding, centred beside the sidebar */
/* the panel is painted by CSS from the first frame, so nothing shifts or flashes before common.js builds the sidebar */
:root[data-theme^="tessera"] body:has(> .topnav)::before { content: ""; position: fixed; top: 0; bottom: 0; left: 0; width: var(--sb-w); z-index: 29;
  background: var(--tc-surface); border-right: 1px solid var(--tc-hairline); }
:root[data-theme^="tessera"] .tsb { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: var(--sb-w);
  padding: 12px; background: var(--tc-surface); border-right: 1px solid var(--tc-hairline); overflow-y: auto; overflow-x: hidden; }
:root[data-theme^="tessera"] .tsb-head { display: flex; align-items: center; gap: 8px; min-height: 40px; }
:root[data-theme^="tessera"] .tsb-logo { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--tc-ink); text-decoration: none; border-radius: 12px; }
:root[data-theme^="tessera"] .tsb-tile { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--tc-lime); color: #0F0F0D; }
:root[data-theme^="tessera"] .tsb-names { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; }
:root[data-theme^="tessera"] .tsb-names b { font-size: 14px; line-height: 18px; font-weight: 700; color: var(--tc-ink); }
:root[data-theme^="tessera"] .tsb-names span { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--tc-muted); }
:root[data-theme^="tessera"] :is(.tsb-toggle, .tsb-menu) { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--tc-muted); cursor: pointer; }
:root[data-theme^="tessera"] :is(.tsb-toggle, .tsb-menu):hover { background: var(--tc-fill); color: var(--tc-ink); }
:root[data-theme^="tessera"] .tsb-nav { display: flex; flex-direction: column; gap: 2px; }
:root[data-theme^="tessera"] .tsb-sec { margin: 24px 0 8px; padding: 0 12px; font-size: 11px; line-height: 14px; font-weight: 800; letter-spacing: .66px;
  text-transform: uppercase; color: var(--tc-muted-light); white-space: nowrap; }
:root[data-theme^="tessera"] .tsb-item { position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 999px;
  font-size: 15px; line-height: 20px; font-weight: 600; color: var(--tc-muted); text-decoration: none; white-space: nowrap; }
:root[data-theme^="tessera"] .tsb-item svg { flex: none; }
:root[data-theme^="tessera"] .tsb-item:hover { background: var(--tc-fill); color: var(--tc-ink); }
:root[data-theme^="tessera"] .tsb-item[aria-current="page"] { background: var(--tc-cream); color: var(--tc-ink); font-weight: 700; box-shadow: 0 2px 8px rgba(15,15,13,.08); }
:root[data-theme="tessera-dark"] .tsb-item[aria-current="page"] { background: var(--tc-fill); color: #F8F6EF; box-shadow: none; }
:root[data-theme^="tessera"] .tsb-lab { overflow: hidden; text-overflow: ellipsis; }
:root[data-theme^="tessera"] .tsb-item .ext { margin-left: -4px; color: var(--tc-muted-light); font-size: 13px; }
:root[data-theme^="tessera"] .tsb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--tc-hairline); }
:root[data-theme^="tessera"] .tsb-nav + .tsb-foot { margin-top: auto; }
:root[data-theme^="tessera"] .tsb-me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; border-radius: 12px; background: transparent;
  font: inherit; text-align: left; color: var(--tc-ink); cursor: pointer; }
:root[data-theme^="tessera"] .tsb-me:hover { background: var(--tc-fill); }
:root[data-theme^="tessera"] .tsb-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #B8E870; color: #0F0F0D;
  font-size: 13px; font-weight: 700; }
:root[data-theme^="tessera"] .tsb-who { display: flex; flex-direction: column; min-width: 0; }
:root[data-theme^="tessera"] .tsb-who b { font-size: 14px; line-height: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-theme^="tessera"] .tsb-who span { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--tc-muted); }
/* the icon rail (wide screens only): labels hide, icons centred, the name in a tooltip on hover / focus */
@media (min-width: 860px) {
  :root[data-theme^="tessera"][data-sb="rail"] { --sb-w: 56px; }
  :root[data-theme^="tessera"][data-sb="rail"] .tsb { overflow: visible; }
  :root[data-theme^="tessera"][data-sb="rail"] .tsb-head { flex-direction: column; gap: 8px; }
  :root[data-theme^="tessera"][data-sb="rail"] :is(.tsb-names, .tsb-lab, .tsb-who, .tsb-item .ext) { display: none; }
  :root[data-theme^="tessera"][data-sb="rail"] .tsb-toggle { margin-left: 0; }
  :root[data-theme^="tessera"][data-sb="rail"] .tsb-sec { height: 1px; margin: 16px 4px; padding: 0; font-size: 0; background: var(--tc-hairline); }
  :root[data-theme^="tessera"][data-sb="rail"] .tsb-item { justify-content: center; padding: 0; }
  :root[data-theme^="tessera"][data-sb="rail"] .tsb-me { justify-content: center; padding: 0; }
  :root[data-theme^="tessera"][data-sb="rail"] .tsb-item::after { content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%);
    padding: 4px 10px; border-radius: 8px; background: var(--tc-ink); color: var(--tc-cream); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 40; }
  :root[data-theme^="tessera"][data-sb="rail"] .tsb-item:is(:hover, :focus-visible)::after { opacity: 1; }
}
/* under 860 px: a thin top bar with the menu button; the sidebar slides over the page */
@media (max-width: 859.98px) {
  :root[data-theme^="tessera"] body:has(> .topnav) { padding-left: 0; }
  :root[data-theme^="tessera"] body:has(> .topnav)::before { display: none; }
  :root[data-theme^="tessera"] .tsb-mbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; height: 56px;
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); background: var(--tc-surface); border-bottom: 1px solid var(--tc-hairline); }
  :root[data-theme^="tessera"] .tsb-menu { width: 40px; height: 40px; margin-left: 0; color: var(--tc-ink); }
  :root[data-theme^="tessera"] .tsb { width: 256px; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s;
    padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  :root[data-theme^="tessera"].tsb-open .tsb { transform: none; visibility: visible; transition: transform .2s ease; box-shadow: 0 8px 32px rgba(15,15,13,.16); }
  :root[data-theme^="tessera"].tsb-open .tsb-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: var(--tc-scrim); }
  :root[data-theme^="tessera"] .page { padding: 20px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { :root[data-theme^="tessera"] .tsb { transition: none !important; } }
/* surfaces: tessera.pe's card (--tc-surface, 1.5 px ink-at-8% border, 28 px corners, 22 px padding, no shadow) */
:root[data-theme^="tessera"] :is(.card, .rangebar, .oscard, .wcard, .sharebox, .campaignfinal) {
  background: var(--tc-surface); border: 1.5px solid var(--tc-hairline-faint); border-radius: 28px; box-shadow: none; padding: 22px; }
:root[data-theme^="tessera"] .stats { background: transparent; border: 0; gap: 12px; overflow: visible; border-radius: 0; }
/* wide screens (content up to 1440 px): a stat tile holds one 22 px number, so tiles stop at 240 px instead of stretching
   around it; on Volume the Organic share card next to them takes the rest of the row (its chart uses the width) */
:root[data-theme^="tessera"] .stats { grid-template-columns: repeat(4, minmax(150px, 240px)); }
:root[data-theme^="tessera"] .stats[data-n="3"] { grid-template-columns: repeat(3, minmax(150px, 240px)); }
:root[data-theme^="tessera"] .stats[data-n="1"] { grid-template-columns: minmax(150px, 340px); }
:root[data-theme^="tessera"] .statsrow { grid-template-columns: auto minmax(300px, 1fr); }
:root[data-theme^="tessera"] .statsrow:has(> .oscard[hidden]) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { :root[data-theme^="tessera"] .statsrow { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { :root[data-theme^="tessera"] .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { :root[data-theme^="tessera"] .stats[data-n="3"] { grid-template-columns: minmax(0, 1fr); } }
:root[data-theme^="tessera"] .stat { background: var(--tc-surface); border: 1.5px solid var(--tc-hairline-faint); border-radius: 28px; padding: 22px; min-width: 0; }
/* Ops' three counters: the brand card instead of the grey fill */
:root[data-theme^="tessera"] .opsstrip { gap: 12px; }
:root[data-theme^="tessera"] .opsstrip div { background: var(--tc-surface); border: 1.5px solid var(--tc-hairline-faint); border-radius: 28px; padding: 22px; }
:root[data-theme^="tessera"] .opsstrip dt { font-size: 11px; line-height: 14px; font-weight: 800; letter-spacing: .66px; text-transform: uppercase; color: var(--tc-green); }
:root[data-theme^="tessera"] .opsstrip dd { margin-top: 4px; }
:root[data-theme^="tessera"] :is(.ddmenu, .colpop, .tip, .mini-tip, .infopop, .evdetail.evpop) { border: 1.5px solid var(--tc-hairline); border-radius: 22px;
  box-shadow: 0 8px 24px rgba(15,15,13,.08); }
:root[data-theme="tessera-dark"] :is(.ddmenu, .colpop, .tip, .mini-tip, .infopop, .evdetail.evpop) { box-shadow: 0 8px 24px rgba(0,0,0,.5); }
/* buttons: tessera.pe's. Primary = an ink pill (cream text; in dark a cream pill with #070706 text), 40 px, bold 14 px;
   48 px with 0 24 px padding for the big sign-in action. Secondary = a --tc-surface pill, 48 px, 0 24 px, bold 15 px.
   Lime is never a button. */
:root[data-theme^="tessera"] :is(.cust-save:not(:disabled), .papply, .evsend, .login button, .login .google, .infopop .itheme[aria-pressed="true"]) {
  background: var(--tc-ink); border-color: var(--tc-ink); color: var(--tc-cream); border-radius: 999px; }
:root[data-theme^="tessera"] :is(.cust-save, .papply, .evsend) { min-height: 40px; padding: 0 18px; font-size: 14px; font-weight: 700; }
:root[data-theme^="tessera"] :is(.login button, .login .google) { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  font-size: 15px; font-weight: 700; }
:root[data-theme^="tessera"] :is(.btn-sum, .state button, .infopop .isignout button) { display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px; background: var(--tc-surface); border: 1.5px solid var(--tc-hairline); color: var(--tc-ink);
  font-size: 15px; font-weight: 700; }
:root[data-theme^="tessera"] :is(.chip, .infopop .itheme, .seg, .seg button) { border-radius: 999px; }
:root[data-theme^="tessera"] :is(.ib:hover, .ib[aria-expanded="true"]) { color: var(--tc-ink); border-color: var(--tc-ink); }
:root[data-theme^="tessera"] .state .spin { border-top-color: var(--tc-ink); }
:root[data-theme^="tessera"] :is(.dusttog input, .colpop input, .ddrow input, .pf.pcheck input) { accent-color: var(--tc-ink); }
:root[data-theme^="tessera"] .vnew { background: var(--tc-lime); color: #0F0F0D; }
:root[data-theme^="tessera"] :is(.ptag, .agentline.warn, .demobanner) { background: var(--tc-warning-soft); color: var(--tc-ink); border-color: var(--tc-warning); }
/* links (tessera.pe: 14 px 600) and "up": the brand green */
:root[data-theme^="tessera"] :is(.w-head a, .w-cta, .links a, table.en td.w a, .admlink, .evdetail .evsrc a, .evdetail .evopen) { color: var(--tc-green); font-weight: 600; }
:root[data-theme^="tessera"] :is(.w-head a, .admlink) { font-size: 14px; }
/* focus: a lime ring with a thin ink edge so it shows on cream too */
:root[data-theme^="tessera"] :focus-visible { outline: 2px solid var(--tc-lime); outline-offset: 2px; box-shadow: 0 0 0 1px var(--tc-graphite); }
/* type: tessera.pe's table (dash/BRAND.md). Outfit everywhere; numbers in tables, stats and chart axes use tabular figures
   so columns line up (the number font is still open; Geist Mono isn't loaded). */
:root[data-theme^="tessera"] :is(table, .stat, .stats, svg, .mono, .tip, .mini-tip, .big, .mid, .wbig, .os-big, .os-num, .os-foot, .kv, .opsstrip, .rbig, .tklegend, .bars) {
  font-variant-numeric: tabular-nums; }
:root[data-theme^="tessera"] .page h1 { font-size: 34px; line-height: 38px; font-weight: 800; letter-spacing: -.9px; color: var(--tc-ink); }
:root[data-theme^="tessera"] .page > header .sub { font-size: 15px; line-height: 19px; font-weight: 500; color: var(--tc-muted); }
:root[data-theme^="tessera"] .page h2:not(.lbl) { font-size: 19px; line-height: 24px; font-weight: 800; letter-spacing: -.38px; color: var(--tc-ink); }
:root[data-theme^="tessera"] :is(.card h2:not(.lbl), .card h3, .wcard h2, .w-head h2, .evdetail h3, .vheld h3) { font-size: 16px; line-height: 20px; font-weight: 800;
  letter-spacing: -.32px; text-transform: none; color: var(--tc-ink); }
:root[data-theme^="tessera"] table { font-size: 14px; line-height: 20px; }
:root[data-theme^="tessera"] th { font-size: 12px; line-height: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--tc-muted); }
:root[data-theme^="tessera"] :is(th, td) { border-bottom-color: var(--tc-hairline-faint); }
/* card meta 12/15 600 ink at 55%; footnote 11.5/15 600 ink at 50% */
:root[data-theme^="tessera"] :is(.note, .os-sub, .w-sub, .whoami, .stat dd small) { font-size: 12px; line-height: 15px; font-weight: 600; letter-spacing: 0;
  color: color-mix(in srgb, var(--tc-ink) 55%, transparent); }
:root[data-theme^="tessera"] :is(.os-foot, .os-axis) { font-size: 11.5px; line-height: 15px; font-weight: 600; color: color-mix(in srgb, var(--tc-ink) 50%, transparent); }
/* eyebrow 12/16 800 1.2 px green; small eyebrow / label 11/14 800 .66 px green */
:root[data-theme^="tessera"] .eyebrow { font-size: 12px; line-height: 16px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--tc-green); }
:root[data-theme^="tessera"] :is(.lbl, .stat dt) { font-size: 11px; line-height: 14px; font-weight: 800; letter-spacing: .66px; text-transform: uppercase; color: var(--tc-green); }
/* big number 36/42 800 -1.08 px: one headline number per page (Home's "Volume · today so far"); number in a card 22/26 800
   -0.66 px: everything else, the stat tiles included (dash/BRAND.md, type table notes) */
:root[data-theme^="tessera"] .w .big { font-size: 36px; line-height: 42px; font-weight: 800; letter-spacing: -1.08px; color: var(--tc-ink); }
:root[data-theme^="tessera"] :is(.stat dd, .w .mid, .os-big, .wbig, .opsstrip dd, .rbig, .kv dd) { font-size: 22px; line-height: 26px; font-weight: 800; letter-spacing: -.66px; color: var(--tc-ink); }
:root[data-theme^="tessera"] .stat dd small { margin-top: 4px; }

/* ---- Glass (2026-10-30): backdrop, glass panels, solid surfaces, chrome ---- */
:root[data-theme="glass"] { background: #b9a48c; }
:root[data-theme="glass"] body { background: transparent; }
:root[data-theme="glass"] body::before {
  content: ""; position: fixed; inset: -60px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 46% at 14% 22%, #f7ecd9 0%, rgba(247,236,217,0) 70%),
    radial-gradient(30% 40% at 78% 18%, #e8eef3 0%, rgba(232,238,243,0) 70%),
    radial-gradient(26% 34% at 62% 70%, #6e4a30 0%, rgba(110,74,48,0) 72%),
    radial-gradient(22% 30% at 24% 82%, #8a6a4c 0%, rgba(138,106,76,0) 72%),
    radial-gradient(18% 26% at 90% 64%, #6f7d52 0%, rgba(111,125,82,0) 72%),
    radial-gradient(40% 30% at 48% 104%, #4d3524 0%, rgba(77,53,36,0) 70%),
    linear-gradient(180deg, #d9c6ad 0%, #bfa588 55%, #8f7258 100%);
  filter: blur(28px) saturate(115%);
}
/* glass panels: cards, the header, the nav */
:root[data-theme="glass"] :is(.card, .rangebar, .oscard, .wcard, .sharebox, .campaignfinal, .login .box, .topnav, .glnav) {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 24px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
:root[data-theme="glass"] .campaignfinal { border-left: 3px solid var(--s2); }
/* solid surfaces for dense data: tables, stat tiles, inner boxes, the coin panel, menus, tooltips */
:root[data-theme="glass"] :is(.table-scroll, .stat, .kv div, .ctlcard, .note-metric, .evdetail, .cp-challenge, .coinpanel, .admbox .kv, .evsuggest,
                              .ddmenu, .colpop, .tip, .mini-tip, .evdetail.evpop) {
  background: var(--solid); border: 1px solid var(--solid-line); border-radius: 20px;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  --surface: var(--solid-opaque); --chip: rgba(15,26,43,.06);
}
:root[data-theme="glass"] :is(.ddmenu, .colpop, .tip, .mini-tip, .evdetail.evpop) { border-radius: 16px; box-shadow: 0 18px 40px rgba(60,40,20,.18); }
:root[data-theme="glass"] .evdetail.evpop { background: var(--solid-opaque); }   /* readable over the chips when it opens above the pins */
:root[data-theme="glass"] .coinpanel { box-shadow: var(--shadow); }
:root[data-theme="glass"] .table-scroll { padding: 2px 4px; }
:root[data-theme="glass"] th { background: var(--solid-opaque); }
:root[data-theme="glass"] .stats { background: transparent; border: 0; gap: 10px; overflow: visible; border-radius: 0; }
:root[data-theme="glass"] .stats6, :root[data-theme="glass"] .statsrow .stats { gap: 10px; }
/* text: dark ink, secondary #3d4756 (never lighter), 12 px / 600 uppercase labels, mono numbers at 600 */
:root[data-theme="glass"] :is(.eyebrow, .lbl, .stat dt, th, .kv dt, .dt, .wk, .k, .tip .d, .cp-sec) {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
:root[data-theme="glass"] :is(.mono, .stat dd, td.num, .wbig, .os-big, .big, .mid, .kv dd, .v) { font-weight: 600; }
:root[data-theme="glass"] a:hover { color: var(--link-hover); }
:root[data-theme="glass"] :is(.login button, .cust-save:not(:disabled), .evsend) { color: #fff; background: var(--s1); }
/* cards lift 4 px on hover; not the data panels you work inside */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :root[data-theme="glass"] :is(.card, .oscard, .wcard) { transition: transform .2s ease, box-shadow .2s ease; }
  :root[data-theme="glass"] :is(.card, .oscard, .wcard):not(:is(.lbcard, .coinpanel, #chartcard, .evlog, .card[data-sub], .customize, .editing)):hover {
    transform: translateY(-4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 24px 48px rgba(60,40,20,.18);
  }
}
/* header: a glass pill that scrolls away with the page (only the bottom nav floats): the avatar (its menu: theme, sign
   out), title + one short subtitle line, the status pill (freshness; details in its popover) */
:root[data-theme="glass"] .topnav { position: relative; top: 0; width: calc(100% - 24px); max-width: 1152px; margin: 12px auto 0; border-radius: 999px; z-index: 10; }
:root[data-theme="glass"] .topnav .in { height: auto; min-height: 64px; padding: 8px 10px 8px 8px; gap: 12px; max-width: none; }
:root[data-theme="glass"] .topnav .brand, :root[data-theme="glass"] .topnav .tabs, :root[data-theme="glass"] .whoami,
:root[data-theme="glass"] .topnav .navright { display: none; }
:root[data-theme="glass"] .linksbtn { display: none; }                      /* Glass: the Links are in the account menu */
:root[data-theme="glass"] .gl-av { border: 0; cursor: pointer; font-family: var(--font); }
:root[data-theme="glass"] .gl-av:focus-visible, :root[data-theme="glass"] .gl-status:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
:root[data-theme="glass"] .gl-status { cursor: pointer; font-family: var(--font); min-height: 36px; }
:root[data-theme="glass"] .gl-status[hidden] { display: none; }
:root[data-theme="glass"] .fresh { display: none; }                          /* the status pill carries it */
/* segmented controls: the selected option solid accent, the rest transparent */
:root[data-theme="glass"] :is(.seg, .subseg) { background: rgba(255,255,255,.35); }
:root[data-theme="glass"] :is(.seg button, .subseg button) { background: transparent; color: var(--ink-2); box-shadow: none; }
:root[data-theme="glass"] :is(.seg button, .subseg button)[aria-pressed="true"] { background: #1d4ed8; color: #fff; font-weight: 600; box-shadow: none; }
:root[data-theme="glass"] .chip[aria-pressed="true"] { background: rgba(255,255,255,.8); border-color: rgba(29,78,216,.45); color: var(--ink); }
:root[data-theme="glass"] .infopop { background: var(--solid); border-color: var(--solid-line); border-radius: 16px; --surface: var(--solid-opaque);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: 0 18px 40px rgba(60,40,20,.18); }
:root[data-theme="glass"] .gl-head { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
:root[data-theme="glass"] .gl-av { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--s1); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; letter-spacing: .02em; }
:root[data-theme="glass"] .gl-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
:root[data-theme="glass"] .gl-title b { font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="glass"] .gl-title span { font-size: 12.5px; color: var(--ink-2); max-width: 60ch; }   /* one short line, never truncated */
:root[data-theme="glass"] .gl-status { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--solid); border: 1px solid var(--solid-line); font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
:root[data-theme="glass"] .gl-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(5,150,105,.18); }
:root[data-theme="glass"] .gl-status.warn i { background: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,.2); }
:root[data-theme="glass"] .navright { margin-left: 0; gap: 4px; }
:root[data-theme="glass"] .iconbtn { min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--ink); }
:root[data-theme="glass"] .iconbtn:hover { background: rgba(255,255,255,.55); border-color: var(--glass-line); }
/* the page's own title moves into the header pill (kept for screen readers) */
:root[data-theme="glass"] .page > header :is(h1, .sub, .eyebrow) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:root[data-theme="glass"] .page > header:not(.home-h) { display: contents; }
/* navigation: a floating glass pill fixed bottom-centre, ending in a round accent "+" */
:root[data-theme="glass"] .glnav { display: flex; align-items: center; gap: 4px; position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 20; padding: 6px; border-radius: 999px; max-width: calc(100vw - 24px); }
:root[data-theme="glass"] .glitem { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
:root[data-theme="glass"] .glitem:hover { background: rgba(255,255,255,.45); color: var(--ink); }
:root[data-theme="glass"] .glitem[aria-current="page"] { background: rgba(255,255,255,.75); color: var(--ink); font-weight: 600; }
:root[data-theme="glass"] .glitem:focus-visible, :root[data-theme="glass"] .glplus:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
:root[data-theme="glass"] .glplus { flex: none; width: 44px; height: 44px; margin-left: 2px; border-radius: 50%; border: 0; background: var(--s1); color: #fff;
  font: 400 26px/1 var(--font); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 16px rgba(29,78,216,.35); }
:root[data-theme="glass"] .glplus[hidden] { display: none; }
:root[data-theme="glass"] .page { padding-bottom: 120px; }
/* phones: the header wraps (status on its own line), the nav tightens, icon-only under 420 px; every tap target 44 px */
@media (max-width: 640px) {
  :root[data-theme="glass"] .topnav { border-radius: 28px; top: 8px; margin-top: 8px; width: calc(100% - 16px); }
  :root[data-theme="glass"] .topnav .in { flex-wrap: wrap; row-gap: 6px; padding: 8px; }
  :root[data-theme="glass"] .gl-head { display: contents; }                 /* line 1: avatar + title; line 2: status + actions */
  :root[data-theme="glass"] .gl-title { flex: 1 1 calc(100% - 60px); }
  :root[data-theme="glass"] .gl-title span { max-width: none; }
  :root[data-theme="glass"] .gl-status { margin-left: 0; }
  :root[data-theme="glass"] .navright { margin-left: auto; }
  :root[data-theme="glass"] .glitem { padding: 0 11px; gap: 6px; font-size: 13px; }
  :root[data-theme="glass"] :is(.chip, .seg button, .ddbtn, .dt input, .dt select, .evtog, .btn-sum, .w-tools button, .subseg button, .tklegend button) { min-height: 44px; }
}
@media (max-width: 520px) {                      /* phone menus sit above the bottom nav, never under the (taller) header pill */
  :root[data-theme="glass"] :is(.ddmenu, .colpop) { top: auto; bottom: calc(92px + env(safe-area-inset-bottom)); max-height: min(60vh, calc(100vh - 300px)); z-index: 25; }
}
@media (pointer: coarse) {
  :root[data-theme="glass"] :is(.chip, .seg button, .ddbtn, .dt input, .dt select, .evtog, .btn-sum, .w-tools button, .subseg button, .tklegend button) { min-height: 44px; }
}
@media (max-width: 420px) {
  :root[data-theme="glass"] .gllab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  :root[data-theme="glass"] .glitem { padding: 0; width: 48px; justify-content: center; }
}
/* no backdrop-filter: solid rgba(255,255,255,.85) panels */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme="glass"] :is(.card, .rangebar, .oscard, .wcard, .sharebox, .campaignfinal, .login .box, .topnav, .glnav,
                                .table-scroll, .stat, .kv div, .ctlcard, .note-metric, .evdetail, .cp-challenge, .coinpanel, .evsuggest, .ddmenu, .colpop, .tip, .mini-tip) {
    background: rgba(255,255,255,.85);
  }
}
