/* Pasqyra — the design system of the new screens (#/, #/fillo, #/plani, #/matja, #/marresit, #/kerkesa, #/te-dhenat).
   Everything lives under the root `.pq` that ui.shell() renders. Nothing here touches the three existing apps.

   HOW IT IS BUILT
   · Tokens: the palette is on `.pq`; `.pq-light` and `.pq-night` set the SEMANTIC tokens (--pq-bg, --pq-surface,
     --pq-fg, --pq-fg-2, --pq-line …). Components only use semantic tokens, so every component works on both.
     Either class can also sit on a section inside the other (a light sheet under the night Flow).
   · Area accent: put `.pq-a-power`, `.pq-a-water`, `.pq-a-wastewater` or `.pq-a-organic` on a component; it then has
     --pq-ac (the bright ribbon colour), --pq-ac-fill (bars), --pq-ac-ink (text) and --pq-ac-soft (tinted ground).
   · green.css (loaded for the whole app) forces white text and green surfaces, mostly with !important. This file
     therefore sets colour and background explicitly on its own elements. !important is used ONLY in these places,
     where green.css itself uses !important and would otherwise win:
       1. the page ground behind .pq (html/body background),
       2. the source sheet (.src-sheet, opened by facts.js on <body>) while a .pq screen is shown,
       3. `border-radius` of select and textarea (livadhi.css: `input, select, textarea { border-radius: 12px !important }`),
       4. print and reduced-motion resets.
   · Specificity: the resets for headings, links and form controls are written `.pq h2`, `.pq a`, `.pq .pq-in input`
     (they must beat the app-wide element rules). A rule that restyles a heading or a link therefore needs
     `.pq .your-class`, not `.your-class` alone.
   · Screen files (pq-home.css, pq-plan.css, pq-monitor.css, pq-takers.css) should need layout only: reuse the
     classes below and the tokens; do not redefine colours.

   VOCABULARY (see app/js/pq/ui.js for the builders that emit these)
   page      .pq .pq-light|.pq-night · .pq-top (.pq-back|.pq-logo .pq-title .pq-nav .pq-lang) · .pq-main (.pq-wide)
             · .pq-bar · .pq-band (.pq-band-sheet) > .pq-wrap · .pq-example
   layout    .pq-stack (.pq-stack-l) · .pq-row (.pq-row-between) · .pq-grid · .pq-cols-2 · .pq-cols-3 · .pq-split (> .pq-aside)
             · .pq-actions · .pq-hero · .pq-h-row > .pq-h · .pq-lead · .pq-eyebrow · .pq-muted · .pq-sr · .pq-noprint · .pq-print-only
   blocks    .pq-card (.pq-card-h .pq-sub .pq-card-f; tones .pq-card-duty|-warn|-ok|-quiet|-night) · .pq-stats > .pq-stat
             · .pq-big · .pq-banner (-info|-warn|-duty|-ok) · .pq-empty · .pq-list > .pq-item-li > .pq-item · .pq-date
             · .pq-table (.pq-num) · .pq-lines > .pq-line · .pq-steps · .pq-tabs · .pq-meter · .pq-tools · .pq-doc
   numbers   .pq-n (tappable when it has data-src) · .pq-range · .pq-count · .pq-chip (-est -measured -missing -duty
             -ok -warn -over -info -area -mine -example) · .pq-chips
   forms     .pq-form (.pq-form-2) · .pq-field > .pq-label + .pq-in (> input + .pq-unit) + .pq-help|.pq-err · .pq-in-select
             · .pq-toggle · .pq-seg · .pq-scrub · .pq-btn (-ghost -quiet -danger -full -icon)
   overlays  .pq-sheet-layer > .pq-sheet · .pq-toast
   figures   .pq-flow (.pq-flow-bare) · .pq-bars · .pq-spark · .pq-ring · .pq-race · .pq-legend > .pq-key-*            */

/* ───────────────────────────── page ground (outside .pq) ───────────────────────────── */
/* `pq-on` is the body class main.js sets from pasqyra.isPq(); :has() covers the case without it. */
body.pq-on { background: #f4f6f3 !important; }
html:has(.pq), body:has(.pq) { background: #f4f6f3 !important; }
html:has(.pq.pq-night), body:has(.pq.pq-night) { background: #07150d !important; }
body.pq-on .topbar, body.pq-on .st-back { display: none; }
body:has(.pq) .topbar, body:has(.pq) .st-back { display: none; }
body.pq-on #view { padding: 0; }
body:has(.pq) #view { padding: 0; }

/* ───────────────────────────── tokens ───────────────────────────── */
.pq, .pq-toast {
  --pq-night: #07150d; --pq-night-2: #0c2617;
  --pq-amber: #f5b524; --pq-cyan: #38bdf8; --pq-lime: #84cc16; --pq-mint: #5fe3a8;
  --pq-r: 24px; --pq-r-s: 16px; --pq-r-xs: 10px;
  --pq-num: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pq-text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --pq-ease: cubic-bezier(.2, .8, .2, 1);
}
.pq-light, .pq-sheet, .pq-doc {
  --pq-bg: #f4f6f3; --pq-surface: #ffffff; --pq-surface-2: #f4f6f3; --pq-bar-bg: #ffffff;
  --pq-fg: #0b130e; --pq-fg-2: #3f4a43; --pq-line: #e3e8e2; --pq-line-2: #7d8a80;
  --pq-shadow: 0 1px 2px rgba(11, 19, 14, .05), 0 14px 32px -18px rgba(11, 19, 14, .22);
  --pq-primary: #0b130e; --pq-on-primary: #ffffff; --pq-link: #0b5d2a; --pq-focus: #0b5d2a;
  --pq-amber-t: #8a5a00; --pq-amber-s: #fdf2d0; --pq-amber-f: #c48a00;
  --pq-cyan-t: #075985; --pq-cyan-s: #def1fd; --pq-cyan-f: #0284c7;
  --pq-lime-t: #3f6212; --pq-lime-s: #e9f5cf; --pq-lime-f: #5c9a0b;
  --pq-mint-t: #0b6b45; --pq-mint-s: #dbf7e9;
  --pq-red-t: #b42318; --pq-red-s: #fde7e4; --pq-red-f: #d92d20;
  --pq-ok-t: #146c2e; --pq-ok-s: #dff3e3; --pq-ok-f: #1a8a3c;
  --pq-ac: var(--pq-fg); --pq-ac-fill: var(--pq-fg); --pq-ac-ink: var(--pq-fg); --pq-ac-soft: #e9ede8;
  background: var(--pq-bg); color: var(--pq-fg); color-scheme: light;
}
.pq-night, .pq-card-night, .pq-flow {
  --pq-bg: #07150d; --pq-surface: rgba(255, 255, 255, .07); --pq-surface-2: rgba(255, 255, 255, .05); --pq-bar-bg: #0c2617;
  --pq-fg: #f2f7f3; --pq-fg-2: #c3d0c7; --pq-line: rgba(255, 255, 255, .16); --pq-line-2: rgba(255, 255, 255, .5);
  --pq-shadow: 0 0 0 1px rgba(255, 255, 255, .1);
  --pq-primary: #5fe3a8; --pq-on-primary: #06140c; --pq-link: #5fe3a8; --pq-focus: #5fe3a8;
  --pq-amber-t: #f5b524; --pq-amber-s: rgba(245, 181, 36, .16); --pq-amber-f: #f5b524;
  --pq-cyan-t: #38bdf8; --pq-cyan-s: rgba(56, 189, 248, .16); --pq-cyan-f: #38bdf8;
  --pq-lime-t: #a3e635; --pq-lime-s: rgba(132, 204, 22, .18); --pq-lime-f: #84cc16;
  --pq-mint-t: #5fe3a8; --pq-mint-s: rgba(95, 227, 168, .16);
  --pq-red-t: #ffb4a8; --pq-red-s: rgba(255, 110, 90, .18); --pq-red-f: #ff6b57;
  --pq-ok-t: #7ee2a0; --pq-ok-s: rgba(95, 227, 168, .16); --pq-ok-f: #3ecf7a;
  --pq-ac: var(--pq-fg); --pq-ac-fill: var(--pq-fg); --pq-ac-ink: var(--pq-fg); --pq-ac-soft: rgba(255, 255, 255, .1);
  background: linear-gradient(180deg, #07150d 0%, #0c2617 100%); color: var(--pq-fg); color-scheme: dark;
}
.pq-a-power { --pq-ac: var(--pq-amber); --pq-ac-fill: var(--pq-amber-f); --pq-ac-ink: var(--pq-amber-t); --pq-ac-soft: var(--pq-amber-s); }
.pq-a-water, .pq-a-wastewater { --pq-ac: var(--pq-cyan); --pq-ac-fill: var(--pq-cyan-f); --pq-ac-ink: var(--pq-cyan-t); --pq-ac-soft: var(--pq-cyan-s); }
.pq-a-organic { --pq-ac: var(--pq-lime); --pq-ac-fill: var(--pq-lime-f); --pq-ac-ink: var(--pq-lime-t); --pq-ac-soft: var(--pq-lime-s); }

/* ───────────────────────────── root and type ───────────────────────────── */
.pq { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; font: 16px/1.5 var(--pq-text); letter-spacing: 0; -webkit-text-size-adjust: 100%; overflow-wrap: break-word; }
.pq *, .pq *::before, .pq *::after { box-sizing: border-box; }
.pq h1, .pq h2, .pq h3, .pq h4 { margin: 0; color: inherit; font-family: var(--pq-text); font-stretch: normal; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.pq p, .pq figure, .pq dl, .pq dd { margin: 0; }
.pq a { color: var(--pq-link); text-underline-offset: 3px; }
.pq small { font-size: 13.5px; }
.pq svg { flex: none; }
.pq :focus-visible { outline: 3px solid var(--pq-focus); outline-offset: 2px; }
.pq-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.pq-print-only { display: none; }
.pq .pq-h { font-size: 20px; font-weight: 700; }
.pq-h-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pq-lead { font-size: 17px; line-height: 1.45; color: var(--pq-fg-2); }
.pq-eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pq-fg-2); }
.pq-muted { color: var(--pq-fg-2); }
.pq-ic { width: 24px; height: 24px; }

/* ───────────────────────────── top bar, places ───────────────────────────── */
.pq-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 6px; min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--pq-bg) 88%, transparent); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--pq-line); color: var(--pq-fg); }
.pq .pq-back, .pq .pq-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--pq-fg); text-decoration: none; flex: none; }
.pq-logo-m { width: 32px; height: 32px; border-radius: 10px; box-shadow: 0 0 0 1px var(--pq-line); }
.pq .pq-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pq-nav { display: none; gap: 4px; }
.pq .pq-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 14px; color: var(--pq-fg-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.pq .pq-nav a .pq-ic { width: 20px; height: 20px; }
.pq .pq-nav a:hover { color: var(--pq-fg); background: var(--pq-ac-soft); }
.pq .pq-nav a[aria-current="page"] { color: var(--pq-on-primary); background: var(--pq-primary); }
.pq-lang { flex: none; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 14px; border: 1.5px solid var(--pq-line-2); background: transparent; color: var(--pq-fg); font: 700 13px/1 var(--pq-text); letter-spacing: .04em; cursor: pointer; }
.pq-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: var(--pq-bar-bg); border-top: 1px solid var(--pq-line); }
.pq .pq-bar a { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 5px 2px 3px; border-radius: 14px; color: var(--pq-fg-2); text-decoration: none; font-size: 12px; font-weight: 600; line-height: 1.2; }
.pq .pq-bar a .pq-ic { width: 26px; height: 26px; padding: 1px; border-radius: 9px; }
.pq .pq-bar a[aria-current="page"] { color: var(--pq-fg); }
.pq .pq-bar a[aria-current="page"] .pq-ic { width: 46px; background: var(--pq-primary); color: var(--pq-on-primary); }
.pq-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.pq-main.pq-wide { display: flex; flex-direction: column; max-width: none; padding: 0; }
.pq-main.pq-wide > .pq-band:last-child { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.pq-band { padding: 20px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); min-width: 0; }
.pq-band-sheet { border-radius: var(--pq-r) var(--pq-r) 0 0; padding-top: 24px; flex: 1; }
.pq-wrap { width: 100%; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pq-example { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 16px; background: repeating-linear-gradient(135deg, #f5b524 0 14px, #eaa80f 14px 28px); color: #1a1300; font-size: 14px; font-weight: 600; line-height: 1.35; }
.pq-example b { padding: 2px 8px; border-radius: 6px; background: #1a1300; color: #f5b524; letter-spacing: .12em; font-size: 12.5px; }
.pq .pq-example a { color: #1a1300; margin-left: auto; min-height: 28px; display: inline-flex; align-items: center; }

/* ───────────────────────────── layout helpers ───────────────────────────── */
.pq-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.pq-stack-l { gap: 20px; }
.pq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.pq-row-between { justify-content: space-between; }
.pq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.pq-cols-2, .pq-cols-3, .pq-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.pq-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pq-hero { display: grid; gap: 16px; padding: 24px 0 8px; }
.pq .pq-hero h2 { font-size: clamp(30px, 7.6vw, 56px); line-height: 1.05; letter-spacing: -.03em; font-weight: 750; max-width: 17ch; }
.pq-hero p { font-size: 17px; line-height: 1.45; color: var(--pq-fg-2); max-width: 52ch; }

/* ───────────────────────────── numbers and chips ───────────────────────────── */
.pq-n { font-family: var(--pq-num); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pq-range { font-family: var(--pq-num); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pq-u { font-weight: 600; }
.pq [data-src] { cursor: pointer; text-decoration: underline dotted 1.5px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); border-radius: 4px; }
.pq [data-src]:hover { text-decoration-color: currentColor; }
.pq [data-src]:focus-visible { outline: 3px solid var(--pq-focus); outline-offset: 2px; }
.pq-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; border: 1px solid transparent; background: var(--pq-surface-2); color: var(--pq-fg-2); font: 600 12px/1.3 var(--pq-text); letter-spacing: 0; white-space: nowrap; vertical-align: middle; text-decoration: none; }
.pq-n + .pq-chip, .pq-range + .pq-chip { margin-left: 6px; }
.pq-chip-est, .pq-chip-warn { background: var(--pq-amber-s); color: var(--pq-amber-t); }
.pq-chip-measured, .pq-chip-ok { background: var(--pq-ok-s); color: var(--pq-ok-t); }
.pq-chip-missing { background: transparent; border: 1.5px dashed var(--pq-line-2); color: var(--pq-fg-2); }
.pq-chip-duty { background: var(--pq-fg); color: var(--pq-bg); }
.pq-chip-over { background: var(--pq-red-s); color: var(--pq-red-t); }
.pq-chip-info { border-color: var(--pq-line); }
.pq-chip-area { background: var(--pq-ac-soft); color: var(--pq-ac-ink); }
.pq-chip-mine { background: var(--pq-cyan-s); color: var(--pq-cyan-t); }
.pq-chip-example { background: #f5b524; color: #1a1300; letter-spacing: .08em; }
.pq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pq-big { display: grid; gap: 2px; min-width: 0; }
.pq-big-l { font-size: 14px; font-weight: 600; color: var(--pq-fg-2); }
.pq-big-v { font: 700 clamp(40px, 11vw, 72px)/1.02 var(--pq-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--pq-fg); overflow-wrap: anywhere; }
.pq-big[class*="pq-a-"] .pq-big-v { color: var(--pq-ac-ink); }
.pq-big-v small { font: 600 clamp(15px, 3.6vw, 20px)/1 var(--pq-text); letter-spacing: 0; margin-left: 4px; color: var(--pq-fg-2); }
.pq-big-s { font-size: 14px; color: var(--pq-fg-2); }
.pq-count { font: inherit; }

/* ───────────────────────────── cards, tiles, notices ───────────────────────────── */
.pq .pq-card { display: block; min-width: 0; padding: 18px; border-radius: var(--pq-r); background: var(--pq-surface); color: var(--pq-fg); box-shadow: var(--pq-shadow); text-decoration: none; }
.pq-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pq-card-h > div { min-width: 0; display: grid; gap: 2px; }
.pq .pq-card h3 { font-size: 17px; font-weight: 650; }
.pq-card[class*="pq-a-"] > .pq-card-h h3::before, .pq-stat[class*="pq-a-"] .pq-stat-l::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--pq-ac-fill); }
.pq-sub { font-size: 14px; color: var(--pq-fg-2); }
.pq-card-f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--pq-line); }
.pq .pq-card-duty { box-shadow: 0 0 0 2px var(--pq-fg), var(--pq-shadow); }
.pq .pq-card-warn { background: var(--pq-amber-s); box-shadow: none; }
.pq .pq-card-ok { background: var(--pq-ok-s); box-shadow: none; }
.pq .pq-card-quiet { background: transparent; box-shadow: 0 0 0 1px var(--pq-line); }
.pq .pq-card-night { background: linear-gradient(160deg, #07150d, #0c2617); box-shadow: none; }
@media (hover: hover) { .pq a.pq-card, .pq a.pq-stat, .pq .pq-tool { transition: transform .18s var(--pq-ease), box-shadow .18s; } .pq a.pq-card:hover, .pq a.pq-stat:hover, .pq .pq-tool:hover { transform: translateY(-2px); } }
.pq-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr)); gap: 10px; }
.pq .pq-stat { display: grid; gap: 2px; align-content: start; min-width: 0; padding: 14px; border-radius: var(--pq-r-s); background: var(--pq-surface); color: var(--pq-fg); box-shadow: var(--pq-shadow); text-decoration: none; }
.pq .pq-card .pq-stat { background: var(--pq-surface-2); box-shadow: none; }
.pq-stat-l { font-size: 13px; font-weight: 600; color: var(--pq-fg-2); }
.pq-stat-v { font: 700 26px/1.15 var(--pq-num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pq-stat-v .pq-n { white-space: normal; }
.pq-stat-v small { font: 600 13px/1 var(--pq-text); letter-spacing: 0; margin-left: 4px; color: var(--pq-fg-2); }
.pq-stat-v .pq-chip { font-size: 11.5px; }
.pq-stat-s { font-size: 13px; color: var(--pq-fg-2); }
.pq-banner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; padding: 14px 16px; border-radius: var(--pq-r-s); background: var(--pq-surface); color: var(--pq-fg); box-shadow: 0 0 0 1px var(--pq-line); }
.pq-banner > div { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.pq-banner b { font-weight: 650; }
.pq-banner p { font-size: 14.5px; color: var(--pq-fg-2); }
.pq-banner-info > .pq-ic { color: var(--pq-fg-2); }
.pq-banner-warn { background: var(--pq-amber-s); box-shadow: none; }
.pq-banner-warn > .pq-ic, .pq-banner-warn b { color: var(--pq-amber-t); }
.pq-banner-ok { background: var(--pq-ok-s); box-shadow: none; }
.pq-banner-ok > .pq-ic, .pq-banner-ok b { color: var(--pq-ok-t); }
.pq-banner-duty { box-shadow: 0 0 0 2px var(--pq-fg); }
.pq-empty { display: grid; justify-items: center; gap: 10px; padding: 28px 18px; border-radius: var(--pq-r); border: 1.5px dashed var(--pq-line-2); text-align: center; color: var(--pq-fg); }
.pq-empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--pq-ac-soft); color: var(--pq-fg); }
.pq .pq-empty h3 { font-size: 18px; font-weight: 650; }
.pq-empty p { color: var(--pq-fg-2); max-width: 46ch; }
.pq-empty .pq-actions { justify-content: center; margin-top: 4px; }

/* ───────────────────────────── lists, tables, lines ───────────────────────────── */
.pq-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.pq-item-li + .pq-item-li { border-top: 1px solid var(--pq-line); }
.pq .pq-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 0; border: 0; background: none; color: var(--pq-fg); font: inherit; text-align: left; text-decoration: none; }
.pq button.pq-item { cursor: pointer; }
.pq-item-ic, .pq-tool-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--pq-ac-soft); color: var(--pq-ac-ink); }
.pq-item-b { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pq-item-b b { font-weight: 600; }
.pq-item-b small { color: var(--pq-fg-2); }
.pq-item-v { flex: none; max-width: 46%; text-align: right; font: 700 16px/1.25 var(--pq-num); font-variant-numeric: tabular-nums; }
.pq-item > .pq-ic:last-child { width: 20px; height: 20px; color: var(--pq-fg-2); }
.pq-date { flex: none; width: 54px; padding: 6px 4px; border-radius: 12px; background: var(--pq-surface-2); box-shadow: 0 0 0 1px var(--pq-line); text-align: center; font: 700 19px/1.1 var(--pq-num); color: var(--pq-fg); }
.pq-date small { display: block; font: 600 11px/1.3 var(--pq-text); letter-spacing: .04em; text-transform: uppercase; color: var(--pq-fg-2); }
.pq-table { width: 100%; border-collapse: collapse; font-size: 15px; color: var(--pq-fg); }
.pq-table caption { padding-bottom: 8px; text-align: left; font-weight: 650; }
.pq-table th { padding: 8px 12px 8px 0; border-bottom: 1.5px solid var(--pq-fg); text-align: left; font-size: 13px; font-weight: 600; color: var(--pq-fg-2); vertical-align: bottom; }
.pq-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--pq-line); vertical-align: top; overflow-wrap: anywhere; }
.pq-table th:last-child, .pq-table td:last-child { padding-right: 0; }
.pq-table .pq-num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 559px) {
  .pq-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pq-table, .pq-table tbody { display: block; }
  .pq-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--pq-line); }
  .pq-table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .pq-table td::before { content: attr(data-th); flex: none; max-width: 50%; text-align: left; font-size: 13px; font-weight: 600; color: var(--pq-fg-2); }
  .pq-table td:first-child { display: block; text-align: left; font-weight: 650; }
  .pq-table td:first-child::before, .pq-table td[data-th=""]::before { display: none; }
  .pq-table td:empty { display: none; }
}
.pq-lines { display: grid; }
.pq-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--pq-line); }
.pq-line:first-child { border-top: 0; }
.pq-line dt { min-width: 0; font-size: 14.5px; color: var(--pq-fg-2); }
.pq-line dd { flex: none; max-width: 62%; text-align: right; }
.pq-steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.pq-steps li { flex: 1; min-width: 0; }
.pq-steps li::before { content: ""; display: block; height: 4px; margin-bottom: 8px; border-radius: 2px; background: var(--pq-line); }
.pq-steps li.is-done::before, .pq-steps li.is-on::before { background: var(--pq-primary); }
.pq .pq-steps li > a, .pq-steps li > span { display: grid; gap: 4px; justify-items: start; align-content: start; min-height: 44px; color: var(--pq-fg-2); text-decoration: none; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.pq-steps i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--pq-line-2); font: 700 13px/1 var(--pq-num); font-style: normal; }
.pq-steps i .pq-ic { width: 16px; height: 16px; }
.pq-steps li.is-on i { border-color: var(--pq-primary); background: var(--pq-primary); color: var(--pq-on-primary); }
.pq-steps li.is-done i { border-color: var(--pq-ok-t); color: var(--pq-ok-t); }
.pq .pq-steps li.is-on > a, .pq-steps li.is-on > span { color: var(--pq-fg); }
.pq-tabs { display: flex; gap: 6px; padding: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pq-tabs::-webkit-scrollbar { display: none; }
.pq .pq-tabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--pq-line-2); color: var(--pq-fg); text-decoration: none; font-weight: 600; font-size: 15px; }
.pq .pq-tabs a[aria-current="page"] { border-color: var(--pq-primary); background: var(--pq-primary); color: var(--pq-on-primary); }
.pq-meter { display: grid; gap: 6px; }
.pq-meter-t { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.pq-meter-b { height: 10px; border-radius: 5px; background: var(--pq-surface-2); box-shadow: inset 0 0 0 1px var(--pq-line); overflow: hidden; }
.pq-meter-b i { display: block; height: 100%; border-radius: 5px; background: var(--pq-ac-fill); }
.pq-meter-ok .pq-meter-b i { background: var(--pq-ok-f); }
.pq-meter-over .pq-meter-b i { background: var(--pq-red-f); }
.pq-tools { display: grid; gap: 10px; }
.pq-tools-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.pq .pq-tool { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border-radius: var(--pq-r-s); background: var(--pq-surface); color: var(--pq-fg); box-shadow: var(--pq-shadow); text-decoration: none; }
.pq-tool > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.pq-tool b { font-weight: 650; }
.pq-tool small { color: var(--pq-fg-2); }
.pq-tool > .pq-ic { width: 20px; height: 20px; color: var(--pq-fg-2); }

/* ───────────────────────────── buttons ───────────────────────────── */
.pq .pq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--pq-r-s); border: 1.5px solid var(--pq-primary); background: var(--pq-primary); color: var(--pq-on-primary); font: 650 16px/1.2 var(--pq-text); letter-spacing: 0; text-decoration: none; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .15s var(--pq-ease), opacity .15s; }
.pq .pq-btn:active { transform: scale(.98); }
.pq .pq-btn[disabled] { opacity: .5; cursor: default; }
.pq .pq-btn-ghost { background: transparent; border-color: var(--pq-line-2); color: var(--pq-fg); }
.pq .pq-btn-quiet { background: transparent; border-color: transparent; color: var(--pq-link); padding: 0 12px; }
.pq .pq-btn-danger { background: #b42318; border-color: #b42318; color: #ffffff; }
.pq .pq-btn-full { width: 100%; }
.pq .pq-btn-icon { width: 48px; padding: 0; }

/* ───────────────────────────── forms ───────────────────────────── */
.pq-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pq-field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pq-field-seg > legend { margin-bottom: 6px; }
.pq-label { padding: 0; font: 600 14.5px/1.3 var(--pq-text); color: var(--pq-fg); }
.pq-in { position: relative; display: flex; align-items: center; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--pq-line-2); background: var(--pq-surface); transition: border-color .15s, box-shadow .15s; }
.pq-in:focus-within { border-color: var(--pq-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pq-focus) 28%, transparent); }
.pq .pq-in input, .pq .pq-in select, .pq .pq-in textarea { flex: 1; width: 100%; min-width: 0; min-height: 49px; margin: 0; padding: 0 14px; border: 0; background: transparent; color: var(--pq-fg); font: 600 18px/1.3 var(--pq-num); font-variant-numeric: tabular-nums; letter-spacing: 0; appearance: none; -webkit-appearance: none; }
.pq .pq-in input:focus, .pq .pq-in select:focus, .pq .pq-in textarea:focus { outline: none; box-shadow: none; }
.pq .pq-in input::placeholder, .pq .pq-in textarea::placeholder { color: var(--pq-fg-2); opacity: .75; font-weight: 500; }
.pq .pq-in textarea { min-height: 112px; padding: 12px 14px; border-radius: 14px !important; font: 500 16px/1.45 var(--pq-text); resize: vertical; }
.pq .pq-in select { padding-right: 40px; border-radius: 14px !important; font: 600 16px/1.3 var(--pq-text); cursor: pointer; }
.pq .pq-in select option { background: #ffffff; color: #0b130e; }
.pq-in-select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--pq-fg); border-bottom: 2px solid var(--pq-fg); transform: rotate(45deg); pointer-events: none; }
.pq-unit { flex: none; padding-right: 14px; font: 600 14px/1 var(--pq-text); font-style: normal; color: var(--pq-fg-2); pointer-events: none; white-space: nowrap; }
.pq-help { font-size: 13.5px; line-height: 1.4; color: var(--pq-fg-2); }
.pq-err { font-size: 13.5px; line-height: 1.4; font-weight: 600; color: var(--pq-red-t); }
.pq-field.is-bad .pq-in { border-color: var(--pq-red-t); }
.pq-toggle { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--pq-fg); cursor: pointer; }
.pq .pq-toggle input { position: absolute; left: 0; top: 50%; width: 52px; height: 32px; margin: -16px 0 0; opacity: 0; cursor: pointer; }
.pq-switch { position: relative; flex: none; width: 52px; height: 32px; border-radius: 16px; background: var(--pq-line-2); transition: background .2s; }
.pq-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--pq-ease); }
.pq-toggle input:checked + .pq-switch { background: var(--pq-ok-f); }
.pq-toggle input:checked + .pq-switch::after { transform: translateX(20px); }
.pq-toggle input:focus-visible + .pq-switch { outline: 3px solid var(--pq-focus); outline-offset: 2px; }
.pq-toggle-t { min-width: 0; display: grid; }
.pq-toggle-t b { font-weight: 600; }
.pq-toggle-t small { color: var(--pq-fg-2); }
.pq-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--pq-r-s); background: var(--pq-surface-2); box-shadow: inset 0 0 0 1px var(--pq-line); }
.pq-seg label { position: relative; flex: 1 1 auto; min-width: 0; }
.pq .pq-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pq-seg span { display: grid; place-items: center; min-height: 44px; padding: 4px 14px; border-radius: 12px; color: var(--pq-fg-2); font-weight: 600; font-size: 15px; line-height: 1.2; text-align: center; }
.pq-seg input:checked + span { background: var(--pq-primary); color: var(--pq-on-primary); }
.pq-seg input:focus-visible + span { outline: 3px solid var(--pq-focus); outline-offset: 2px; }
.pq-scrub { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 14px; font-weight: 650; color: var(--pq-fg); }
.pq .pq-scrub input[type=range] { width: 100%; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.pq-scrub input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--pq-line-2), var(--pq-mint)); }
.pq-scrub input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--pq-line-2), var(--pq-mint)); }
.pq-scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; border: 3px solid var(--pq-mint); background: #ffffff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.pq-scrub input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--pq-mint); background: #ffffff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }

/* ───────────────────────────── sheets, toast, source sheet ───────────────────────────── */
.pq-sheet-layer { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; background: rgba(7, 21, 13, .55); animation: pq-fade .2s both; }
.pq-sheet-layer[hidden] { display: none; }
.pq-sheet { width: min(560px, 100%); max-height: 88vh; max-height: 88dvh; overflow: auto; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: var(--pq-r) var(--pq-r) 0 0; background: #ffffff; box-shadow: 0 -12px 40px rgba(0, 0, 0, .3); animation: pq-up .3s var(--pq-ease) both; }
.pq-sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pq .pq-sheet-h h3 { font-size: 19px; font-weight: 700; }
.pq-sheet-b { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.pq-sheet-f { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pq-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 5000; transform: translateX(-50%); max-width: min(92vw, 480px); padding: 12px 18px; border-radius: 14px; background: #0b130e; color: #ffffff; font: 600 15px/1.35 var(--pq-text); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); animation: pq-toast-in .25s var(--pq-ease) both; }
.pq-toast-ok { background: #146c2e; }
.pq-toast-warn { background: #8a5a00; }
/* The source sheet belongs to facts.js and sits on <body>; green.css paints it green with !important. On a Pasqyra
   screen it is a white sheet with ink text. */
body:has(.pq) .src-sheet { background: rgba(7, 21, 13, .55); }
body:has(.pq) .src-sheet .sheet-card { background: #ffffff !important; color: #0b130e !important; border-radius: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35) !important; font: 15.5px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
body:has(.pq) .src-sheet h3 { color: #0b130e; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; letter-spacing: -.01em; }
body:has(.pq) .src-sheet p, body:has(.pq) .src-sheet .note, body:has(.pq) .src-sheet .where { color: #3f4a43 !important; }
body:has(.pq) .src-sheet a { color: #0b5d2a; }
body:has(.pq) .src-sheet .calc { background: #f4f6f3 !important; color: #0b130e !important; }
body:has(.pq) .src-sheet .grab { background: #c9d2c9 !important; }
body:has(.pq) .src-sheet .est { background: #fdf2d0; color: #8a5a00; }
body:has(.pq) .src-sheet .okchip { background: #dff3e3 !important; color: #146c2e !important; }
body:has(.pq) .src-sheet .sheet-close { background: #0b130e !important; color: #ffffff !important; border-radius: 16px; }

/* ───────────────────────────── the printable page (dossier) ───────────────────────────── */
.pq-doc { width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(18px, 5vw, 40px); border-radius: var(--pq-r-s); background: #ffffff; box-shadow: var(--pq-shadow); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; font-size: 15.5px; }
.pq .pq-doc h2 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.pq .pq-doc h3 { font-size: 16px; font-weight: 700; margin-top: 6px; }
.pq-doc-foot { padding-top: 10px; border-top: 1px solid var(--pq-line); font-size: 12.5px; line-height: 1.45; color: var(--pq-fg-2); }

/* ───────────────────────────── figures ───────────────────────────── */
.pq-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; font-weight: 600; color: var(--pq-fg-2); }
.pq-legend li { display: inline-flex; align-items: center; gap: 7px; }
.pq-key { display: inline-block; flex: none; width: 22px; height: 12px; border-radius: 3px; color: var(--pq-ac-fill); background: currentColor; }
.pq-key-solid { background: currentColor; }
.pq-key-hatch { background: repeating-linear-gradient(135deg, currentColor 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px currentColor; }
.pq-key-dash { background: none; border: 1.5px dashed currentColor; }
.pq-key-ghost { background: none; border: 1.5px dashed var(--pq-line-2); }
.pq-key-line { height: 0; border-radius: 0; background: none; border-top: 2px solid var(--pq-fg); }
.pq-key-over { background: repeating-linear-gradient(135deg, var(--pq-red-f) 0 4px, color-mix(in srgb, var(--pq-red-f) 55%, transparent) 4px 7px); }
.pq-key-under { background: var(--pq-ok-f); }
.pq-key-saved { background: var(--pq-mint); }
.pq-key-mark { width: 14px; height: 14px; border-radius: 50%; background: var(--pq-fg); }

/* the Flow: carries its own night panel, so it reads the same on a light sheet */
.pq-flow { margin: 0; min-width: 0; padding: 10px 8px 8px; border-radius: var(--pq-r); background: radial-gradient(120% 90% at 0% 50%, rgba(95, 227, 168, .10), transparent 55%), linear-gradient(160deg, #07150d, #0c2617); container: pqflow / inline-size; overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pq-flow.pq-flow-bare { padding: 0; border-radius: 0; background: none; overflow: visible; }
.pq-flow svg { display: block; width: 100%; height: auto; overflow: visible; }
.pq-flow .pq-flow-t { max-width: 540px; margin: 0 auto; }
.pq-flow .pq-flow-w { display: none; }
@container pqflow (min-width: 720px) { .pq-flow .pq-flow-t { display: none; } .pq-flow .pq-flow-w { display: block; } }
.pq-flow text { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.pq-flow .pq-flow-v { font-family: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pq-flow [data-src] { cursor: pointer; text-decoration: underline dotted; text-decoration-color: rgba(242, 247, 243, .55); }
.pq-flow [data-src]:focus-visible { outline: 2px solid #5fe3a8; outline-offset: 3px; }
.pq-flow a { text-decoration: none; }
.pq-flow .pq-flow-add { text-decoration: underline; }
.pq-flow-dot { fill: none; stroke-linecap: round; opacity: .7; animation: pq-flow-run 6s linear infinite; }
@keyframes pq-flow-run { to { stroke-dashoffset: var(--pq-p, -30px); } }
.pq-enter .pq-flow-rib { transform-box: fill-box; transform-origin: left center; animation: pq-flow-in .9s var(--pq-ease) both; }
@keyframes pq-flow-in { from { transform: scaleX(.02); opacity: 0; } }
/* a missing area is a dashed placeholder: it stands still and whole, it never grows in with the ribbons */
.pq-flow .pq-flow-miss { animation: none; transform: none; opacity: 1; }

/* twelve monthly bars */
.pq-bars { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; color: var(--pq-fg); }
.pq-bars-cap { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--pq-fg-2); }
.pq-bars-plot { position: relative; display: grid; grid-template-columns: repeat(var(--pq-n, 12), minmax(0, 1fr)); gap: 3px; }
.pq-bars-col { grid-row: 1; display: grid; grid-template-rows: 18px 128px auto; justify-items: center; gap: 4px; min-width: 0; }
.pq-bars-flag { display: flex; align-items: center; gap: 2px; font: 700 11px/1 var(--pq-num); color: var(--pq-red-t); }
.pq-bars-flag b { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--pq-fg); color: var(--pq-surface); font-size: 10.5px; }
.pq-night .pq-bars-flag b { color: #07150d; }
.pq-bars-track { position: relative; width: 100%; height: 100%; box-shadow: 0 1.5px 0 var(--pq-line-2); }
.pq-bars-now, .pq-bars-ghost, .pq-bars-gap { position: absolute; left: 50%; bottom: 0; display: block; transform: translateX(-50%); border-radius: 5px 5px 0 0; }
.pq-bars-now { width: 60%; background: var(--pq-ac-fill); opacity: .7; }
.pq-bars-col.is-last .pq-bars-now { opacity: 1; }
.pq-bars-ghost { width: 96%; border: 1.5px dashed var(--pq-line-2); border-bottom: 0; }
.pq-bars-gap { width: 60%; height: 10px; border: 1.5px dashed var(--pq-line-2); border-bottom: 0; }
.pq-bars-m { font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--pq-fg-2); white-space: nowrap; }
.pq-bars-col.is-last .pq-bars-m { color: var(--pq-fg); }
.pq-bars-none { grid-row: 1; grid-column: 1 / -1; z-index: 1; display: grid; place-items: center; min-height: 150px; margin: 0; font-size: 14px; color: var(--pq-fg-2); text-align: center; }
.pq-bars-foot { display: grid; gap: 6px; }
.pq-bars-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; color: var(--pq-fg-2); }
.pq-bars-notes b { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-right: 4px; border-radius: 50%; font: 700 10.5px/1 var(--pq-num); color: var(--pq-fg); }

/* spark and ring */
.pq-spark { display: inline-block; vertical-align: middle; max-width: 100%; }
.pq-spark-line { fill: none; stroke: var(--pq-ac-fill); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pq-spark-dot { fill: var(--pq-ac-fill); }
.pq-spark-none { fill: none; stroke: var(--pq-line-2); stroke-width: 2; stroke-dasharray: 3 4; }
.pq-ring { display: inline-grid; justify-items: center; gap: 6px; text-align: center; color: var(--pq-fg); }
.pq-ring-track { fill: none; stroke: var(--pq-line); stroke-width: 10; }
.pq-ring-arc { fill: none; stroke: var(--pq-ac-fill); stroke-width: 10; stroke-linecap: round; }
.pq-ring-v { font: 700 20px/1 var(--pq-num); fill: var(--pq-fg); }
.pq-ring figcaption { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.pq-ring figcaption small { display: block; font-weight: 400; color: var(--pq-fg-2); }

/* the limit race */
.pq-race { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; color: var(--pq-fg); }
.pq-race-stages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pq-race-stages li > * { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--pq-line-2); background: transparent; color: var(--pq-fg-2); font: 600 14px/1.2 var(--pq-text); }
.pq-race-stages button { cursor: pointer; }
.pq-race-stages i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font: 700 11.5px/1 var(--pq-num); font-style: normal; }
.pq-race-stages li.is-on > * { border-color: var(--pq-fg); color: var(--pq-fg); }
.pq-race-stages li.is-here > * { border-color: var(--pq-primary); background: var(--pq-primary); color: var(--pq-on-primary); }
.pq-race-plot { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 14px 0; }
.pq-race-col { display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0; padding: 0 4px; overflow: hidden; overflow-wrap: anywhere; text-align: center; }
.pq-race-plot > .pq-bars-none { grid-row: auto; }
.pq-race-x { height: 16px; font: 700 12px/16px var(--pq-num); color: var(--pq-red-t); }
.pq-race-track { position: relative; width: min(46px, 72%); height: 150px; margin-bottom: 6px; border-radius: 8px 8px 0 0; background: var(--pq-surface-2); box-shadow: inset 0 0 0 1px var(--pq-line); }
.pq-race-now, .pq-race-raw { position: absolute; left: 0; right: 0; bottom: 0; display: block; border-radius: 6px 6px 0 0; }
.pq-race-raw { border: 1.5px dashed var(--pq-line-2); border-bottom: 0; }
.pq-race-now { background: var(--pq-ok-f); transition: height .6s var(--pq-ease); animation: pq-race-drop .7s var(--pq-ease) both; }
@keyframes pq-race-drop { from { height: var(--pq-from, 0%); } }
.pq-race-col.is-over .pq-race-now { background: repeating-linear-gradient(135deg, var(--pq-red-f) 0 6px, color-mix(in srgb, var(--pq-red-f) 62%, transparent) 6px 10px); }
.pq-race-col.is-nolimit .pq-race-now { background: var(--pq-fg-2); }
.pq-race-col.is-cut .pq-race-now::after { content: ""; position: absolute; left: -2px; right: -2px; top: 12px; height: 4px; background: var(--pq-bg); transform: skewY(-14deg); }
/* each column draws its piece of the limit line and clips it at its own edge: together they read as one line */
.pq-race-line { position: absolute; left: -120px; right: -120px; bottom: var(--pq-limit, 50%); height: 0; border-top: 2px solid var(--pq-fg); }
.pq-race-l { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.pq-race-v { font: 600 12.5px/1.3 var(--pq-num); font-variant-numeric: tabular-nums; }
.pq-race-lim { font-size: 12px; line-height: 1.3; color: var(--pq-fg-2); }
.pq-race-s { font-size: 12.5px; font-weight: 700; line-height: 1.3; color: var(--pq-fg-2); }
.pq-race-col.is-over .pq-race-s { color: var(--pq-red-t); }
.pq-race-col.is-under .pq-race-s { color: var(--pq-ok-t); }
.pq-race-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; }
.pq-race-verdict { font-weight: 650; }
.pq-race-verdict.is-ok { color: var(--pq-ok-t); }
.pq-race-note { flex-basis: 100%; font-size: 13px; color: var(--pq-fg-2); }

/* ───────────────────────────── motion ───────────────────────────── */
@keyframes pq-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pq-fade { from { opacity: 0; } }
@keyframes pq-up { from { opacity: 0; transform: translateY(24px); } }
@keyframes pq-toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.pq-enter .pq-card, .pq-enter .pq-stat, .pq-enter .pq-banner, .pq-enter .pq-empty, .pq-enter .pq-tool { animation: pq-rise .5s var(--pq-ease) both; }
.pq-enter .pq-card:nth-child(2), .pq-enter .pq-stat:nth-child(2), .pq-enter .pq-tool:nth-child(2) { animation-delay: .05s; }
.pq-enter .pq-card:nth-child(3), .pq-enter .pq-stat:nth-child(3), .pq-enter .pq-tool:nth-child(3) { animation-delay: .1s; }
.pq-enter .pq-card:nth-child(n+4), .pq-enter .pq-stat:nth-child(n+4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  .pq *, .pq *::before, .pq *::after, .pq-toast { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ───────────────────────────── laptop (≥ 900 px) ───────────────────────────── */
@media (min-width: 900px) {
  .pq-top { gap: 12px; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); min-height: calc(64px + env(safe-area-inset-top)); }
  .pq .pq-title { font-size: 19px; }
  .pq-nav { display: flex; }
  .pq-bar { display: none; }
  .pq-main { padding: 28px 32px 56px; gap: 20px; }
  .pq-main.pq-wide { padding: 0; }
  .pq-band { padding: 28px 32px 36px; }
  .pq-main.pq-wide > .pq-band:last-child { padding-bottom: 56px; }
  .pq-wrap { gap: 20px; }
  .pq-grid, .pq-cols-2, .pq-cols-3, .pq-split { gap: 20px; }
  .pq-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pq-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pq-split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .pq-split > .pq-aside { position: sticky; top: 84px; }
  .pq .pq-card { padding: 22px; }
  .pq .pq-h { font-size: 22px; }
  .pq-sheet-layer { align-items: center; }
  .pq-sheet { border-radius: var(--pq-r); padding-bottom: 20px; }
  .pq-toast { bottom: 32px; }
  .pq-bars-col { grid-template-rows: 18px 160px auto; }
  .pq-bars-m { font-size: 12px; }
  .pq-race-track { height: 180px; }
}
@media (min-width: 560px) { .pq-form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pq-form-2 > .pq-field-seg, .pq-form-2 > .pq-toggle, .pq-form-2 > .pq-span { grid-column: 1 / -1; } }

/* ───────────────────────────── print: white, no navigation ───────────────────────────── */
@media print {
  html:has(.pq), body:has(.pq), body.pq-on { background: #ffffff !important; }
  .pq, .pq-night, .pq-light, .pq-band, .pq-card-night {
    --pq-bg: #ffffff; --pq-surface: #ffffff; --pq-surface-2: #ffffff; --pq-fg: #000000; --pq-fg-2: #2b2b2b; --pq-line: #b9b9b9; --pq-line-2: #6f6f6f;
    --pq-shadow: none; --pq-primary: #000000; --pq-on-primary: #ffffff; --pq-link: #000000;
    --pq-amber-t: #5c3c00; --pq-cyan-t: #053f5e; --pq-lime-t: #2c450c; --pq-mint-t: #074a30; --pq-red-t: #8f1c13; --pq-ok-t: #0f5223;
    background: #ffffff !important; color: #000000 !important;
  }
  .pq { min-height: 0; display: block; }
  .pq-top, .pq-bar, .pq-nav, .pq-tabs, .pq-actions, .pq-scrub, .pq-sheet-layer, .pq-toast, .pq-noprint, .pq-tools, .pq-race-stages { display: none !important; }
  .pq-print-only { display: block; }
  .pq-main, .pq-band { padding: 0 !important; max-width: none; }
  .pq .pq-card, .pq .pq-stat, .pq-banner, .pq-doc { box-shadow: none !important; border: 1px solid #b9b9b9; break-inside: avoid; }
  .pq-doc { border: 0; padding: 0; max-width: none; }
  .pq [data-src] { text-decoration: none; }
  .pq-flow.pq-flow-bare { padding: 10px 8px 8px; border-radius: 16px; background: linear-gradient(160deg, #07150d, #0c2617); }
  .pq-flow { break-inside: avoid; }
  .pq *, .pq *::before, .pq *::after { animation: none !important; transition: none !important; }
  @page { margin: 14mm; }
}
