/* ============================================================================
   TITAN Field Operations - shared "Liquid Glass" design system.
   ============================================================================

   One stylesheet for every console page. Each page still keeps a small
   <style> block for the parts that are genuinely its own (the call-outcome
   grid, the permission toggles, the line-item table); everything shared -
   tokens, type, inputs, buttons, cards, lists, the nav - lives here so a
   change lands everywhere at once.

   Dark by default, with a real light theme now available via the toggle in
   the nav's account sheet (see titan-app.js's applyTheme()/toggleTheme()) -
   this supersedes the earlier "dark-only, no toggle" decision recorded in
   .ai/DECISIONS.md, which was about removing a both-themes-must-work
   *token set*, not about ruling out a theme choice forever. `[data-theme]`
   on <html> selects the palette; there is still no `prefers-color-scheme`
   branch, since the owner wants an explicit pick remembered per browser,
   not the OS deciding.

   Two rules worth knowing before editing:

   1. The OLD variable names (--graphite, --paper, --slate, --amber,
      --copper, --red, --brass) are deliberately kept as aliases pointing at
      the new tokens. Page-specific CSS written before this redesign still
      resolves correctly without being rewritten.

   2. Chrome that floats over the TOP of content is `position: sticky`, never
      `fixed` - it still occupies its own space in the flow, so it cannot
      silently cover a heading that wraps to two lines. The one deliberate
      exception is `.tbar-wrap` (the bottom tab bar): it floats OVER content
      by design, the same way any mobile app's tab bar does, and `body`'s
      bottom padding is hand-maintained to clear it - see the comment there
      if that bar's height ever changes.
*/

/* Manrope / IBM Plex Mono are loaded via <link rel="stylesheet"> tags in
   each page's <head>, preceded by <link rel="preconnect">, not via @import
   here. @import is render-blocking and the browser can't discover it (or
   start the cross-origin connection) until this whole stylesheet has been
   fetched and parsed first - on a slow/flaky mobile connection (the
   Android app's WebView, not a warm desktop browser) that was enough
   delay to visibly fall back to the system font before swapping, which
   read as "messy" inconsistent type. A <link> in <head> lets the browser
   discover and start the font fetch immediately, in parallel with this
   file. Do not move this back to @import. */

/* ------------------------------------------------------------- tokens --- */
:root {
  color-scheme: dark;

  --wall:
    radial-gradient(circle 480px at 10% 2%,  #6b4a12 0%, transparent 60%),
    radial-gradient(circle 540px at 90% 8%,  #1d3f76 0%, transparent 58%),
    radial-gradient(circle 580px at 74% 94%, #5a2247 0%, transparent 56%),
    radial-gradient(circle 470px at 12% 82%, #114438 0%, transparent 58%);
  --bg: #06080d;
  --fg: #f2f5fa;
  --fg-2: #a3aebd;
  --fg-3: #7e8998;

  /* Three elevation tiers instead of one flat treatment: sections sit
     lowest, cards above them, and floating chrome (nav/sheets/toasts)
     highest - each a touch brighter and more blurred than the last, so
     stacking glass on glass reads as real depth instead of a repeated
     texture. */
  --g-1: rgba(255,255,255,0.055);
  --g-1-blur: 18px;
  --g-2: rgba(255,255,255,0.085);
  --g-2-blur: 26px;
  --g-3: rgba(255,255,255,0.130);
  --g-3-blur: 34px;

  /* Back-compat: anything still keying off --g-bg / --g-bg-soft gets the
     card tier / section tier respectively. */
  --g-bg: var(--g-2);
  --g-bg-soft: var(--g-1);
  --g-brd: rgba(255,255,255,0.17);
  --g-edge: linear-gradient(160deg, rgba(255,255,255,0.34), rgba(255,255,255,0.06) 55%);
  --g-spec: rgba(255,255,255,0.30);
  --g-lip: rgba(0,0,0,0.22);
  --g-shadow: 0 14px 34px -14px rgba(0,0,0,0.70);
  --field-bg: rgba(0,0,0,0.26);

  --acc: #f0c464;
  --acc-dim: #d8ab3f;
  --acc-bg: rgba(240,196,100,0.16);
  --acc-grad: linear-gradient(150deg, #f0c464, #c9982e);
  --acc-on: #1a1304;

  --good: #4fd6a0;
  --warn: #f0c464;
  --bad:  #ff8a6f;
  --dot-good: #35d68a;
  --dot-warn: #f0b73f;
  --dot-bad:  #ff7a5c;

  --sheet-bg: rgba(24,28,37,0.80);
  --scrim: rgba(0,0,0,0.50);
  --wall-strength: 0.42;
  --radius: 20px;
  --radius-sm: 13px;

  /* Near-opaque panel background for dropdowns that must fully replace
     what's under them (see .gselect-panel) - themed, unlike a hardcoded
     color, so it still contrasts with --fg text once light theme flips
     --fg from near-white to near-black. */
  --panel-solid: rgba(10,12,17,0.97);
}

/* Aliases for the pre-redesign variable names. Page-specific CSS that
   still says var(--slate) or var(--amber) keeps working. */
:root {
  --graphite: var(--bg);
  --paper: var(--fg);
  --slate: var(--fg-2);
  --amber: var(--acc);
  --brass-bright: var(--acc);
  --brass: var(--acc-dim);
  --copper: var(--good);
  --red: var(--bad);
}

/* ------------------------------------------------------- light theme --- */
/* The "Monochrome" concept from the nav demo the owner reviewed - chrome
   stays black-and-white, but tier/status colour (good/warn/bad - the
   leads bar chart, tier pills, breach/online status) survives as the one
   deliberate exception, per the owner's explicit instruction, because
   that is information a director scans for at a glance and graying it
   out would cost more than the monochrome concept gains. */
:root[data-theme="light"] {
  color-scheme: light;

  --wall:
    radial-gradient(circle 480px at 10% 2%,  #ffffff 0%, transparent 60%),
    radial-gradient(circle 540px at 90% 8%,  #d7dae0 0%, transparent 58%),
    radial-gradient(circle 580px at 74% 94%, #e8eaee 0%, transparent 56%),
    radial-gradient(circle 470px at 12% 82%, #ffffff 0%, transparent 58%);
  --wall-strength: 0.7;
  --bg: #eef0f3;
  --fg: #17181c;
  --fg-2: #6c6e74;
  --fg-3: #98999e;

  --g-1: rgba(255,255,255,0.55);
  --g-1-blur: 18px;
  --g-2: rgba(255,255,255,0.68);
  --g-2-blur: 26px;
  --g-3: rgba(255,255,255,0.82);
  --g-3-blur: 34px;
  --g-bg: var(--g-2);
  --g-bg-soft: var(--g-1);
  --g-brd: rgba(20,20,22,0.10);
  --g-edge: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(255,255,255,0.25) 55%);
  --g-spec: rgba(255,255,255,0.9);
  --g-lip: rgba(30,32,38,0.14);
  --g-shadow: 0 14px 34px -14px rgba(30,32,38,0.26);
  --field-bg: rgba(255,255,255,0.6);

  --acc: #17181c;
  --acc-dim: #3a3b40;
  --acc-bg: rgba(20,20,22,0.07);
  --acc-grad: linear-gradient(150deg, #2b2c30, #101012);
  --acc-on: #f5f5f6;

  --good: #1e9e63;
  --warn: #b8860b;
  --bad:  #d64545;
  --dot-good: #1e9e63;
  --dot-warn: #b8860b;
  --dot-bad:  #d64545;

  --sheet-bg: rgba(255,255,255,0.9);
  --scrim: rgba(20,20,22,0.35);
  --panel-solid: rgba(255,255,255,0.97);
}

/* --------------------------------------------------------------- base --- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: Manrope, -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Clears the floating bottom tab bar (fixed, ~56px tall + 16px offset) so
     the last row of real content is never hidden underneath it. */
  padding: 0 0 100px;
}
/* The wallpaper the glass refracts. Fixed so it does not scroll away and
   the blur always has colour to pick up.

   Held well below full strength on purpose: at full saturation the colour
   fights the data on every card, and this is a screen someone has open all
   day. It needs to read as a faint tint behind glass, not as a wallpaper. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--wall);
  opacity: var(--wall-strength);
  pointer-events: none;
}

.wrap { max-width: 940px; margin: 0 auto; padding: 22px 18px 0; }
.wrap.narrow { max-width: 680px; }
.wrap.wide { max-width: 1140px; }

h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 5px; }
h2 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
h3 { font-size: 0.94rem; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 8px; }
a { color: var(--acc); }
.sub { color: var(--fg-2); font-size: 0.88rem; line-height: 1.5; margin: 0 0 20px; }
.mono { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; }
.note { font-size: 0.78rem; color: var(--fg-2); margin-top: 6px; line-height: 1.5; }
.sec-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-2); margin: 24px 0 9px 6px;
}

/* Utility. !important because several page-specific rules set their own
   display at equal specificity and would otherwise win on source order -
   that bug used to leave a "cancel" banner sitting on a fresh form. */
.hidden { display: none !important; }

/* -------------------------------------------------------------- glass --- */
/* blur + saturate for the refraction, a soft cast shadow underneath, and a
   gradient edge (not a flat inset line) standing in for a lit glass rim -
   brightest top-left, fading out by the far corner. The edge is a masked
   ::before ring so it follows border-radius exactly. */
.glass, .card, .list {
  position: relative;
  background: var(--g-2);
  backdrop-filter: blur(var(--g-2-blur)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--g-2-blur)) saturate(185%);
  box-shadow: var(--g-shadow);
}
.glass::before, .card::before, .list::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; pointer-events: none;
  background: var(--g-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.card {
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  animation: surfaceIn 0.28s cubic-bezier(.2,.8,.3,1) both;
}
.list {
  background: var(--g-1);
  backdrop-filter: blur(var(--g-1-blur)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--g-1-blur)) saturate(185%);
  border-radius: var(--radius); padding: 5px; margin-bottom: 16px;
  animation: surfaceIn 0.28s cubic-bezier(.2,.8,.3,1) both;
}
/* A card/list is built with `display:none` while `.hidden` (sign-in vs.
   the signed-in app body, one section swapped for another) - a browser
   restarts a CSS animation whenever an element re-enters rendering, so
   removing `.hidden` replays this for free. That's what turns the
   previously-instant sign-in-card-to-app-view cut into a soft entrance,
   without touching how `.hidden` itself works. */
@keyframes surfaceIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- nav ---- */
/* Floating glass tab bar at the bottom, not the old sticky top bar - the
   owner's own call after a live demo. `fixed`, deliberately, unlike the
   old top bar's documented "sticky, never fixed" rule: that rule protected
   against a horizontal bar clipping a heading that wraps to two lines. A
   small floating pill has no such content underneath it to clip - it
   floats over the page by design, same as any mobile app's tab bar, and
   `.wrap`'s bottom padding (see body, above) keeps real content clear of it. */
.tbar-wrap {
  position: fixed; left: 0; right: 0; bottom: 16px; z-index: 60;
  display: flex; justify-content: center; padding: 0 16px; pointer-events: none;
}
.tbar {
  pointer-events: auto; position: relative;
  display: flex; align-items: center; gap: 2px; max-width: 100%; overflow-x: auto;
  background: var(--g-3);
  border: 1px solid var(--g-brd);
  border-radius: 26px; padding: 6px;
  backdrop-filter: blur(var(--g-3-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--g-3-blur)) saturate(180%);
  box-shadow: var(--g-shadow), inset 0 1.5px 0 var(--g-spec);
  scrollbar-width: none;
}
.tbar::-webkit-scrollbar { display: none; }
.tbar-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 16px; border-radius: 20px; text-decoration: none; white-space: nowrap;
  font-size: 0.66rem; font-weight: 700; color: var(--fg-2);
  transition: background 0.2s, color 0.2s;
}
.tbar-item svg { width: 20px; height: 20px; }
.tbar-item.on {
  color: var(--acc-on); background: var(--acc-grad);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}
.tbar-more {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; margin-left: 4px;
  background: var(--g-1); border: 1px solid var(--g-brd); color: var(--fg);
  font-weight: 800; font-size: 0.8rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.tbar-more:active { transform: scale(0.92); }

/* Owner-only pages (Territories/Approvals/Permissions) and the account
   identity + sign out - previously nowhere in the console at all - live
   here instead of permanently occupying bar space a director can't use. */
.tbar-scrim {
  position: fixed; inset: 0; z-index: 61; background: var(--scrim);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.tbar-scrim.open { opacity: 1; pointer-events: auto; }
.tbar-sheet {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 62;
  max-width: 420px; margin: 0 auto;
  background: var(--g-3); border: 1px solid var(--g-brd); border-radius: 22px;
  padding: 8px 18px 16px;
  backdrop-filter: blur(var(--g-3-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--g-3-blur)) saturate(180%);
  box-shadow: 0 -10px 40px -10px rgba(0,0,0,0.55), inset 0 1.5px 0 var(--g-spec);
  transform: translateY(120%); transition: transform 0.35s cubic-bezier(.2,.85,.25,1.1);
}
.tbar-sheet.open { transform: translateY(0); }
.tbar-grabber { width: 34px; height: 4px; background: var(--fg-3); opacity: 0.5; border-radius: 3px; margin: 6px auto 10px; }
.tbar-who { display: flex; align-items: center; gap: 12px; padding: 6px 2px 14px; }
.tbar-av {
  width: 36px; height: 36px; border-radius: 50%; background: var(--acc-grad); flex-shrink: 0;
  color: var(--acc-on); display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
}
.tbar-name { font-size: 0.92rem; font-weight: 700; color: var(--fg); }
.tbar-role { font-size: 0.72rem; color: var(--fg-2); }
.tbar-sheet-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 13px 2px; border-top: 1px solid var(--g-lip);
  background: none; border-left: none; border-right: none; border-bottom: none;
  font-family: inherit; font-size: 0.88rem; font-weight: 700; color: var(--fg);
  text-decoration: none; cursor: pointer;
}
.tbar-sheet-item .chev { color: var(--fg-3); font-weight: 400; }
.tbar-sheet-item.danger { color: var(--red); }

@media (max-width: 480px) {
  .tbar-item span { display: none; } /* icon-only on a narrow phone - labels alone would force horizontal scroll */
  .tbar-item { padding: 10px 14px; }
}

/* ------------------------------------------------------------- fields --- */
label {
  display: block; font-size: 0.75rem; font-weight: 600; color: var(--fg-2);
  margin: 14px 0 5px;
}
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%; font-family: inherit; font-size: 0.9rem; color: var(--fg);
  background: var(--field-bg);
  border: 1px solid var(--g-brd);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--fg-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-bg);
}
textarea { resize: vertical; min-height: 58px; }

/* Two or three fields side by side on a desktop; stacked on a phone, where
   squeezing three selects into 345px turns each one into a bare chevron. */
.row { display: flex; gap: 12px; }
.row > div { flex: 1; min-width: 0; }
input[type="checkbox"] { width: auto; accent-color: var(--acc); }
input[type="file"] { padding: 9px; font-size: 0.82rem; }
input[type="number"], .mono-field { font-family: "IBM Plex Mono", monospace; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

/* ------------------------------------------------------ glass select --- */
/* Replaces a native <select>'s open dropdown, which is unstyleable OS/
   browser chrome (a plain white system list inside the Android app's dark
   WebView). Mounted by TITAN.glassSelect() in titan-app.js over a hidden
   original <select>, so it inherits the same box treatment as `select`
   above for the closed trigger, then a proper glass panel for the open
   list. */
.gselect { position: relative; }
.gselect-trigger {
  width: 100%; text-align: left; font-family: inherit; font-size: 0.9rem;
  color: var(--fg); background: var(--field-bg);
  border: 1px solid var(--g-brd); border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.gselect-trigger:focus, .gselect-trigger:focus-visible {
  outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-bg);
}
.gselect-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  /* Near-opaque, not the usual translucent glass tier - this panel covers
     real form controls sitting right below it (Search, Filter, etc. in
     leads.html's stacked mobile layout), and at the normal --g-3 alpha
     those showed through clearly enough to make the open list unreadable -
     text-on-text, not a subtle glass effect. A dropdown needs to fully
     replace what's under it while open, the same way a native OS list
     does, not blend with it. */
  background: var(--panel-solid);
  border: 1px solid var(--g-brd); border-radius: var(--radius-sm);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--g-shadow); padding: 4px; max-height: 260px; overflow-y: auto;
}
.gselect-opt {
  padding: 9px 11px; border-radius: 9px; font-size: 0.88rem; color: var(--fg);
  cursor: pointer; transition: background 0.12s;
}
.gselect-opt:hover { background: var(--g-1); }
.gselect-opt.on { color: var(--acc); font-weight: 700; }
.gselect-opt.on::after { content: " ✓"; }

/* ------------------------------------------------------------ buttons --- */
button {
  font-family: inherit; cursor: pointer; border: none;
  border-radius: var(--radius-sm); padding: 11px 18px;
  font-size: 0.88rem; font-weight: 800; letter-spacing: -0.01em;
  background: var(--acc-grad); color: var(--acc-on);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 5px 14px -7px rgba(120,90,10,0.7);
  transition: filter 0.12s, transform 0.06s;
  -webkit-tap-highlight-color: transparent;
}
button:hover:not(:disabled) { filter: brightness(1.06); }
button:active:not(:disabled) { transform: scale(0.98); }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--acc); outline-offset: 2px;
}
button.ghost {
  background: var(--g-bg-soft); color: var(--fg); border: 1px solid var(--g-brd);
  box-shadow: inset 0 1px 0 var(--g-spec);
}
button.ghost:hover:not(:disabled) { background: var(--g-bg); filter: none; }
button.danger {
  background: transparent; color: var(--bad); border: 1px solid var(--bad); box-shadow: none;
}
button.small { padding: 7px 12px; font-size: 0.78rem; }
button.icon { padding: 9px 11px; font-size: 0.82rem; }
button.block { width: 100%; }

/* -------------------------------------------------------------- bits ---- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 14px;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.01em;
  background: var(--g-bg-soft); color: var(--fg-2);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--acc-bg); color: var(--good); }
.pill.warn { background: var(--acc-bg); color: var(--warn); }
.pill.bad  { background: var(--acc-bg); color: var(--bad); }

.row-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 15px; text-align: left;
  background: none; border: none; box-shadow: none; color: var(--fg);
  font-family: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background 0.14s, transform 0.07s;
}
.row-link + .row-link { box-shadow: inset 0 1px 0 var(--g-lip); }
.row-link:hover { background: var(--g-bg-soft); filter: none; }
.row-link:active { transform: scale(0.99); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { text-align: center; }
.stat .num {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums; color: var(--fg); display: block;
}
.stat .lbl { font-size: 0.7rem; color: var(--fg-2); margin-top: 2px; font-weight: 600; }
.stat.good .num { color: var(--good); }
.stat.warn .num { color: var(--warn); }
.stat.bad  .num { color: var(--bad); }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 0.84rem; background: var(--acc-bg); color: var(--fg);
  border: 1px solid var(--g-brd);
}
/* Both the short names (used in existing markup) and the -box names. */
.warn, .warn-box, .info, .info-box {
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px;
  font-size: 0.82rem; border: 1px solid var(--g-brd); background: var(--acc-bg);
}
.warn, .warn-box { color: var(--warn); }
.info, .info-box { color: var(--fg-2); }
.error { color: var(--bad); font-size: 0.83rem; margin-top: 9px; white-space: pre-wrap; }
.empty { text-align: center; color: var(--fg-2); font-size: 0.88rem; padding: 34px 16px; }

/* Wide content never pushes the page sideways - it scrolls in its own box. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  text-align: left; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--fg-2); padding: 8px 9px;
  border-bottom: 1px solid var(--g-brd);
}
td { padding: 10px 9px; border-bottom: 1px solid var(--g-lip); }
td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }
tr:last-child td { border-bottom: none; }

/* -------------------------------------------------------------- toast --- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  transform: translate(-50%, 14px);
  padding: 12px 20px; border-radius: 18px;
  font-size: 0.84rem; font-weight: 700; color: var(--fg);
  background: var(--g-3);
  backdrop-filter: blur(var(--g-3-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--g-3-blur)) saturate(180%);
  border: 1px solid var(--g-brd);
  box-shadow: inset 0 1.5px 0 var(--g-spec), 0 10px 28px -10px rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.22s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { color: var(--bad); }

/* ------------------------------------------------------------- phones --- */
@media (max-width: 720px) {
  body { padding-bottom: 52px; }
  .wrap { padding: 16px 12px 0; }
  h1 { font-size: 1.24rem; }
  .sub { font-size: 0.82rem; margin-bottom: 16px; }
  .card { padding: 16px; border-radius: 17px; margin-bottom: 13px; }
  .list { border-radius: 17px; }

  /* 16px is the threshold under which iOS Safari zooms in on focus and
     never zooms back out - the usual reason a form "feels broken". */
  input, select, textarea { font-size: 16px; padding: 11px 12px; }
  button { padding: 12px 18px; font-size: 0.92rem; }
  button.small { padding: 9px 13px; font-size: 0.82rem; }

  .row { flex-direction: column; gap: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat .num { font-size: 1.32rem; }
  .banner { flex-direction: column; align-items: stretch; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
