/* AgenticStockScreener: futuristic theme, light and dark.
   Colours are tokens on :root (light). Dark mode applies when the visitor picks it (data-theme="dark"),
   or when the device prefers dark and the visitor hasn't picked light. */
:root {
  --bg: #eef2fb; --bg-2: #f8faff; --grid: rgba(37, 99, 235, .07);
  --surface: rgba(255, 255, 255, .78); --surface-solid: #ffffff; --surface-2: rgba(240, 245, 255, .9);
  --line: rgba(15, 23, 42, .10); --line-strong: rgba(15, 23, 42, .18);
  --text: #0b1220; --muted: #5b6782;
  --accent: #0891b2; --accent-2: #7c3aed; --accent-soft: rgba(8, 145, 178, .10);
  --glow: 0 0 0 1px rgba(8, 145, 178, .25), 0 8px 30px rgba(8, 145, 178, .12);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .07);
  --up: #059669; --down: #dc2626; --bad: #b91c1c;
  --cat-large: #2563eb; --cat-mid: #7c3aed; --cat-small: #0891b2; --cat-micro: #d97706;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #05070f; --bg-2: #0a1020; --grid: rgba(34, 211, 238, .06);
  --surface: rgba(16, 22, 40, .72); --surface-solid: #0e1428; --surface-2: rgba(22, 30, 54, .85);
  --line: rgba(148, 163, 255, .14); --line-strong: rgba(148, 163, 255, .26);
  --text: #e6ecff; --muted: #8f9bbd;
  --accent: #22d3ee; --accent-2: #a78bfa; --accent-soft: rgba(34, 211, 238, .10);
  --glow: 0 0 0 1px rgba(34, 211, 238, .35), 0 0 28px rgba(34, 211, 238, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 40px rgba(0, 0, 0, .45);
  --up: #34d399; --down: #f87171; --bad: #fca5a5;
  --cat-large: #60a5fa; --cat-mid: #a78bfa; --cat-small: #22d3ee; --cat-micro: #fbbf24;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05070f; --bg-2: #0a1020; --grid: rgba(34, 211, 238, .06);
    --surface: rgba(16, 22, 40, .72); --surface-solid: #0e1428; --surface-2: rgba(22, 30, 54, .85);
    --line: rgba(148, 163, 255, .14); --line-strong: rgba(148, 163, 255, .26);
    --text: #e6ecff; --muted: #8f9bbd;
    --accent: #22d3ee; --accent-2: #a78bfa; --accent-soft: rgba(34, 211, 238, .10);
    --glow: 0 0 0 1px rgba(34, 211, 238, .35), 0 0 28px rgba(34, 211, 238, .18);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 40px rgba(0, 0, 0, .45);
    --up: #34d399; --down: #f87171; --bad: #fca5a5;
    --cat-large: #60a5fa; --cat-mid: #a78bfa; --cat-small: #22d3ee; --cat-micro: #fbbf24;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 15px/1.55 var(--sans); overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-size: auto, auto, 36px 36px, 36px 36px, auto;
  background-attachment: fixed;
}
a { color: var(--accent); }
[hidden] { display: none !important; }
.na { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 4px; }
code { font-family: var(--mono); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 4px; background: var(--surface-solid); }
.brand-text { font-weight: 800; letter-spacing: .02em; font-size: 17px; }
.brand-text b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text;
  background-clip: text; color: transparent; }

/* header / footer */
header.top { display: flex; align-items: center; gap: 14px; padding: 12px 24px; position: sticky; top: 0; z-index: 5;
  background: var(--surface); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line); }
header.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); opacity: .7; }
.crumb { color: var(--muted); }
.spacer { flex: 1; }
main { padding: 30px 24px 40px; max-width: 1180px; margin: 0 auto; }
footer.foot { max-width: 1180px; margin: 0 auto; padding: 16px 24px 32px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--line); }
h1.page { margin: 0 0 6px; font-size: 28px; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 760px; }
.chip { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

/* buttons / inputs */
.btn, .theme-toggle { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit;
  text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.btn:hover, .theme-toggle:hover { border-color: var(--accent); box-shadow: var(--glow); }
.theme-toggle { width: 38px; height: 38px; padding: 0; font-size: 17px; }
.primary { display: inline-block; padding: 11px 20px; border: 0; border-radius: 10px; color: #fff; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; filter: none; }
input[type=search], select { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit;
  background: var(--surface-solid); color: var(--text); min-width: 0; }
input:focus, select:focus, .btn:focus-visible, .primary:focus-visible, .theme-toggle:focus-visible, .q:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { width: 300px; }
.toolbar input[type=search], .dd-btn { height: 44px; }

/* themed dropdown (common.js enhanceSelect): glass button + glowing listbox */
.native-hidden { position: absolute !important; left: 0; top: 0; width: 1px !important; height: 1px !important; padding: 0 !important;
  border: 0 !important; margin: -1px; opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
.dd { position: relative; min-width: 210px; }
.dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px 0 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-solid); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.dd-btn:hover { border-color: var(--accent); }
.dd-btn:focus-visible, .dd.open .dd-btn { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.dd.is-filtered .dd-btn { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.dd-value { display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.dd-value small { color: var(--muted); font-weight: 500; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.dd-chev { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform .18s, color .18s; }
.dd.open .dd-chev { transform: rotate(180deg); color: var(--accent); }
.dd-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 320px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface-solid); box-shadow: var(--glow), var(--shadow); outline: none; animation: dd-in .14s ease-out; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; }
.dd-opt.active { background: var(--accent-soft); }
.dd-text { display: grid; }
.dd-text small { color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.dd-check { color: var(--accent); font-weight: 800; visibility: hidden; }
.dd-opt.selected { font-weight: 700; } .dd-opt.selected .dd-check { visibility: visible; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* disclaimer page */
body.center { display: flex; flex-direction: column; }
.corner-tools { position: fixed; top: 14px; right: 16px; z-index: 6; }
.center-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.gate-card { width: min(860px, 100%); position: relative; overflow: hidden; }
.gate-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border: 1px solid var(--line-strong);
  padding: 2px 8px; border-radius: 99px; }
.gate-card h1 { margin: 0 0 2px; font-size: 22px; }
.ver { color: var(--muted); font-size: 12px; margin-bottom: 14px; font-family: var(--mono); }
.summary { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.summary ul { margin: 6px 0 0; padding-left: 18px; } .summary li { margin: 4px 0; }
.legal { overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 12px; max-height: 40vh;
  min-height: 140px; font-size: 13px; line-height: 1.6; background: var(--surface-2); }
.legal.full { max-height: none; }
.legal h4 { margin: 14px 0 4px; font-size: 13px; color: var(--accent); } .legal p { margin: 4px 0; }
.checks label { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.checks input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.checks.off label { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* home */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.sec-card { display: block; color: var(--text); text-decoration: none; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s; }
a.sec-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--glow); }
.sec-icon { font-size: 22px; color: var(--accent); margin-bottom: 10px; text-shadow: 0 0 16px var(--accent); }
.sec-card h2 { margin: 0 0 6px; font-size: 20px; }
.sec-card p { margin: 0; color: var(--muted); }
.sec-card .go { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 700; }
.sec-card.soon { opacity: .55; cursor: not-allowed; }
.sec-card.soon .sec-icon { color: var(--muted); text-shadow: none; }
.badge { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 99px; font-size: 11px; font-weight: 700;
  vertical-align: middle; color: var(--accent-2); border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent); }

/* investments tabs: This Week / Past Weeks / Weekly Changes */
.tabs { display: flex; gap: 6px; margin: 6px 0 18px; padding: 5px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: fit-content; max-width: 100%;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 14px; border-radius: 10px;
  border: 1px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.tab.active { color: var(--text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: var(--glow); }
.tab:disabled { cursor: not-allowed; opacity: .55; }
.tab .badge { margin-left: 0; }

/* ranked list */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lrow, .lhead { display: grid; grid-template-columns: 64px 140px minmax(0, 1fr) 100px 150px 80px 28px; gap: 10px;
  align-items: center; padding: 12px 16px; }
.lhead { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--line); }
.lrow { border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.item:last-child .lrow:not(.open), .item:last-child .detail { border-bottom: 0; }
.lrow:hover { background: var(--accent-soft); }
.lrow.open { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lrow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lrow .rk { font-weight: 700; color: var(--accent); } .lrow .sy { font-weight: 800; letter-spacing: .02em; }
.lrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.lrow .sc { font-weight: 800; }
.num { text-align: right; }
.cat { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700;
  border: 1px solid currentColor; }
.cat-large { color: var(--cat-large); } .cat-mid { color: var(--cat-mid); }
.cat-small { color: var(--cat-small); } .cat-micro { color: var(--cat-micro); }
.chev { transition: transform .15s; color: var(--muted); text-align: center; }
.lrow.open .chev { transform: rotate(180deg); color: var(--accent); }
.mobile-meta { display: none; color: var(--muted); font-size: 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* expanded row */
.detail { padding: 18px 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.group { margin-bottom: 14px; }
.group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700;
  margin-bottom: 6px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 8px; }   /* auto-fit: no empty slots */
.field { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: var(--surface-solid); min-width: 0; }
/* label on the left, its "?" pinned to the right, so a long label wraps without pushing the "?" onto its own line */
.field .k { color: var(--muted); font-size: 11.5px; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.field .k .q { margin-left: 0; margin-top: 1px; }
.field .v { font-size: 15px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.yoy { margin-top: 4px; overflow-x: auto; }
.yoy table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; background: var(--surface-solid);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.yoy th, .yoy td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.yoy thead th { color: var(--muted); font-weight: 700; font-size: 11.5px; background: var(--surface-2); }
.yoy tbody th { text-align: left; color: var(--muted); font-weight: 600; }
.yoy tr:last-child th, .yoy tr:last-child td { border-bottom: 0; }
.yoy td { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.how { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface-solid); box-shadow: var(--glow); }
/* right-hand panel: compact score card + company list */
.side { display: grid; gap: 12px; align-content: start; min-width: 0; align-self: center; }   /* centred beside the left column */
.side .how { padding: 14px 16px; }
.side .big { font-size: 32px; }
.side .ranks { font-size: 11.5px; gap: 3px; } .side .ranks b { font-size: 13.5px; }
.side .how .explain { font-size: 12px; margin: 8px 0 4px; line-height: 1.45; }
.side .bar-row { margin: 7px 0; }
.side .bar-top { font-size: 12.5px; }
.side .bar { height: 6px; margin-top: 3px; }
.side .group { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface-solid); }
.side .group .group-title { margin-bottom: 5px; }
.side .fields { display: block; }
.side .field { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 0; background: none; }
.side .field:last-child { border-bottom: 0; }
.side .field .k { font-size: 12px; flex: none; justify-content: flex-start; align-items: center; }
.side .field .k .q { margin-left: 5px; margin-top: 0; }
.side .field .v { font-size: 13.5px; margin: 0; text-align: right; font-family: var(--sans); }
.score-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.big { font-size: 40px; font-weight: 800; line-height: 1; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.ranks { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.ranks b { color: var(--text); font-size: 14px; } .ranks small { color: var(--muted); font-weight: 400; }
.how .explain { color: var(--muted); font-size: 12.5px; margin: 10px 0 6px; }
.bar-row { margin: 9px 0; }
.bar-top { display: flex; justify-content: space-between; font-size: 13px; gap: 10px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }

/* "?" help */
.q { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 5px;
  border-radius: 50%; border: 1px solid currentColor; background: none; color: var(--muted); font-size: 10px; font-weight: 700;
  line-height: 1; cursor: help; padding: 0; vertical-align: middle; flex: none; }
.q:hover { color: var(--accent); }
#tip { position: fixed; z-index: 30; max-width: 300px; background: var(--surface-solid); color: var(--text); border-radius: 10px;
  border: 1px solid var(--line-strong); padding: 9px 12px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--glow); }
#tip b { display: block; margin-bottom: 2px; color: var(--accent); }

/* pager */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 18px; }
.pager button { min-width: 38px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer;
  background: var(--surface-2); color: var(--text); font: inherit; font-family: var(--mono); }
.pager button:hover:not(:disabled):not(.cur) { border-color: var(--accent); }
.pager button.cur { border: 0; color: #fff; font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.pager button:disabled { opacity: .35; cursor: not-allowed; }
.pager .gap { color: var(--muted); }
.range-note { text-align: center; color: var(--muted); margin-top: 8px; font-size: 12.5px; }

@media (max-width: 1024px) {
  /* tablet: slimmer fixed columns so the company name gets more room */
  .lrow, .lhead { grid-template-columns: 60px 120px minmax(0, 1fr) 96px 124px 74px 24px; gap: 8px; }
  .lhead { white-space: nowrap; font-size: 10.5px; letter-spacing: .03em; }
}
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  header.top { padding: 10px 16px; } main { padding: 20px 16px 32px; } footer.foot { padding: 14px 16px 28px; }
  h1.page { font-size: 24px; }
  .lhead { display: none; }
  .lrow { grid-template-columns: 40px minmax(0, 1fr) 26px; grid-template-areas: "rk sy ch" "rk nm ch" "rk mm ch"; row-gap: 2px; }
  .lrow .rk { grid-area: rk; } .lrow .sy { grid-area: sy; } .lrow .nm { grid-area: nm; white-space: normal; }
  .lrow .ct, .lrow .mc, .lrow .sc { display: none; } .lrow .chev { grid-area: ch; }
  .mobile-meta { display: block; grid-area: mm; }
  .crumb { display: none; }
  .toolbar input[type=search], .toolbar select, .toolbar .dd { width: 100%; }
  .dd-list { max-height: 60vh; }
  .dd-opt { padding: 11px 10px; white-space: normal; }       /* bigger touch targets on phones */
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* phone: tabs wrap onto two lines instead of hiding off-screen */
  .tabs { flex-wrap: wrap; width: 100%; overflow-x: visible; gap: 4px; }
  .tab { padding: 7px 10px; font-size: 13.5px; gap: 6px; }
  .tab .chip { font-size: 11px; padding: 1px 8px; }
  .corner-tools { top: 10px; right: 10px; }
  .card { padding: 18px; }
}
