/* "Build your plan" (/plan.html): a screen of the application. It uses the same theme tokens as the app (themes.css sets
   --x-* for Daylight, Performance and Classic; the original Ocean look is defined here), so it looks like part of the
   app in every theme. Everything is readable without JavaScript; scripts add the builder, tabs and motion. */

/* Ocean: the app's original dashboard colours (app.html :root). */
:root, :root[data-theme="ocean"] {
  --x-bg:#EAF3FF; --x-surface:#FFFFFF; --x-surface-2:#F3F8FF; --x-line:#D4E4F7; --x-line-2:#BCD3EE;
  --x-ink:#0A1628; --x-ink-2:#4A5568; --x-ink-3:#56667E;
  --x-accent:#0057FF; --x-accent-hover:#0346C8; --x-on-accent:#FFFFFF; --x-accent-soft:#DBEAFE; --x-accent-text:#0050EB;
  --x-hot:#F05A28; --x-hot-text:#C2410C; --x-hot-soft:#FDEBE3;
  --x-good:#059669; --x-good-soft:#D1FAE5; --x-warn:#D97706; --x-warn-soft:#FEF3C7; --x-bad:#DC2626; --x-bad-soft:#FEE2E2;
  --x-font:-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --x-display:-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; --x-display-weight:800; --x-display-spacing:-.02em; --x-display-transform:none;
  --x-label-font:inherit;
  --x-radius:12px; --x-shadow:0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04); --x-shadow-lg:0 12px 40px rgba(10,22,40,.12);
  color-scheme:light;
}
:root {
  /* Phases go from a soft tint of the theme's accent to the full accent, then the theme's "hot" colour for the peak. */
  --ph-GPP:color-mix(in srgb, var(--x-accent) 28%, var(--x-surface));
  --ph-SPP1:color-mix(in srgb, var(--x-accent) 52%, var(--x-surface));
  --ph-SPP2:color-mix(in srgb, var(--x-accent) 76%, var(--x-surface));
  --ph-COMP:var(--x-accent);
  --ph-TAPER:color-mix(in srgb, var(--x-hot) 62%, var(--x-surface));
  --ph-CHAMP:var(--x-hot);
  --z-Z1:color-mix(in srgb, var(--x-good) 45%, var(--x-surface)); --z-Z2:var(--x-good); --z-Z3:var(--x-accent); --z-Z4:var(--x-warn); --z-Z5:var(--x-hot);
  --c-CALCULATION:var(--x-good); --c-MODERATE:var(--x-accent); --c-LIMITED:var(--x-warn); --c-DEBATED:var(--x-bad); --c-COACH_SUPPLIED:var(--x-ink-3); --c-HEURISTIC:#8b5cf6;
  --r:var(--aq-r-lg, 16px); --r-s:var(--aq-r-md, 12px);
  --ease:cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font-family:var(--x-font); color:var(--x-ink); background:var(--x-bg); line-height:1.55; font-size:15px; }
body.locked { overflow:hidden; }
a { color:var(--x-accent-text); }
button, input, select { font:inherit; color:inherit; }
[hidden] { display:none !important; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.i { width:16px; height:16px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle; }
[dir="rtl"] .i.flip { transform:scaleX(-1); }
main#page { width:min(1240px, 100%); margin:0 auto; padding:24px clamp(14px, 3vw, 28px) 40px; }
html.embed main#page { padding-top:18px; }
.site-footer { width:min(1240px, 100%); margin:0 auto; padding:0 clamp(14px, 3vw, 28px) 32px; color:var(--x-ink-3); font-size:13px; }
.site-footer a { color:var(--x-ink-2); }
html.embed .site-footer { display:none; }

/* Shared pieces, matching the app's cards and labels */
.kick { margin:0 0 4px; font-family:var(--x-label-font); font-size:12.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--x-accent-text); }
.card { background:var(--x-surface); border:1px solid var(--x-line); border-radius:var(--r); box-shadow:var(--x-shadow); padding:18px 20px; }
.card-h { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
.card-sub { margin:2px 0 0; color:var(--x-ink-3); font-size:13px; max-width:72ch; }
.btn { display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border-radius:999px; border:1px solid var(--x-accent); background:var(--x-accent); color:var(--x-on-accent); font-weight:700; font-size:13px; cursor:pointer; white-space:nowrap; transition:background .2s, transform .15s; }
.btn:hover { background:var(--x-accent-hover); } .btn:active { transform:scale(.97); }
.btn.ghost { background:var(--x-surface); color:var(--x-ink); border-color:var(--x-line-2, var(--x-line)); }
.btn.ghost:hover { border-color:var(--x-accent); color:var(--x-accent-text); }
.ibtn { display:inline-grid; place-items:center; width:34px; height:34px; border-radius:50%; border:1px solid var(--x-line); background:var(--x-surface); color:var(--x-ink); cursor:pointer; }
.ibtn:hover { border-color:var(--x-accent); }
:focus-visible { outline:2px solid var(--x-accent); outline-offset:2px; }
.note { margin:14px 0 0; padding:12px 14px; border-radius:var(--r-s); background:var(--x-surface-2); border:1px solid var(--x-line); color:var(--x-ink-2); font-size:13px; }
.scroll { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { padding:9px 10px; text-align:start; vertical-align:top; border-bottom:1px solid var(--x-line); }
th { font-family:var(--x-label-font); font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--x-ink-3); background:var(--x-surface-2); position:sticky; top:0; }
tbody tr:hover td { background:color-mix(in srgb, var(--x-accent) 5%, transparent); }
.badge { display:inline-flex; align-items:center; gap:6px; padding:3px 9px; border-radius:999px; font-size:12.5px; font-weight:700; background:var(--x-surface-2); color:var(--x-ink-2); border:1px solid var(--x-line); }
[class*="badge b-"] { background:color-mix(in srgb, var(--rc, var(--x-accent)) 14%, var(--x-surface)); color:color-mix(in srgb, var(--rc, var(--x-accent)) 80%, var(--x-ink)); border-color:color-mix(in srgb, var(--rc, var(--x-accent)) 30%, transparent); }
.b-CALCULATION { --rc:var(--c-CALCULATION); } .b-MODERATE { --rc:var(--c-MODERATE); } .b-LIMITED { --rc:var(--c-LIMITED); } .b-DEBATED { --rc:var(--c-DEBATED); } .b-COACH_SUPPLIED { --rc:var(--c-COACH_SUPPLIED); } .b-HEURISTIC { --rc:var(--c-HEURISTIC); }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--rc, var(--x-ink-3)); flex:none; }
details.table-card { padding:0; }
details.table-card > summary { list-style:none; cursor:pointer; display:flex; justify-content:space-between; align-items:center; padding:16px 20px; }
details.table-card > summary::-webkit-details-marker { display:none; }
details.table-card > summary .kick { margin:0; }
details.table-card > summary .i { transition:transform .25s var(--ease); color:var(--x-ink-3); }
details.table-card[open] > summary .i { transform:rotate(90deg); }
details.table-card > .card-sub { padding:0 20px 10px; }
details.table-card > .scroll { padding:0 6px 10px; max-height:520px; overflow:auto; }

/* Header: the shared hero band (aq-ui.css .aq-hero), full width at the top of the screen */
body { overflow-x:clip; }
.ws-head.aq-hero { margin:-24px calc(50% - 50vw) 0; padding:24px calc(50vw - 50% + clamp(14px, 3vw, 28px)) 56px; }
html.embed .ws-head.aq-hero { margin-top:-18px; }
.ws-head .ws-back { color:var(--aq-hero-ink-2); position:relative; z-index:1; }
.ws-head .ws-back:hover { color:var(--aq-hero-ink); }
.ws-head .aq-hero__title { margin:2px 0 8px; }
.ws-head .pill { background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.2); color:var(--aq-hero-ink); }
/* Header (older rules below keep working when the hero is absent) */
.ws-back { display:inline-flex; align-items:center; gap:6px; margin-bottom:14px; color:var(--x-ink-2); font-size:13px; font-weight:700; text-decoration:none; }
.ws-back:hover { color:var(--x-accent-text); }
.ws-back .i { transform:scaleX(-1); } [dir="rtl"] .ws-back .i { transform:none; }
.ws-top { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:18px; }
.ws-brand { display:inline-flex; align-items:center; gap:10px; color:var(--x-ink); font-weight:800; letter-spacing:.1em; font-size:14px; text-decoration:none; }
.ws-mark { display:grid; place-items:center; width:32px; height:32px; border-radius:10px; background:var(--x-accent); }
.ws-mark svg { width:20px; height:20px; fill:none; stroke:var(--x-on-accent); stroke-width:2.4; stroke-linecap:round; }
.ws-lang select { padding:7px 12px; border-radius:999px; border:1px solid var(--x-line); background:var(--x-surface); font-size:13px; }
html.embed .ws-top { display:none; }
.ws-title { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; flex-wrap:wrap; }
.ws-title h1 { margin:2px 0 6px; font-family:var(--x-display); font-weight:var(--x-display-weight); letter-spacing:var(--x-display-spacing); text-transform:var(--x-display-transform); font-size:clamp(28px, 4vw, 40px); line-height:1.05; }
.ws-sub { margin:0; color:var(--x-ink-2); max-width:70ch; font-size:14px; }
.pill { display:inline-flex; align-items:center; gap:8px; padding:7px 12px; border-radius:999px; background:var(--x-surface); border:1px solid var(--x-line); color:var(--x-ink-2); font-size:12px; font-weight:700; white-space:nowrap; }
.pill-dot { width:8px; height:8px; border-radius:50%; background:var(--x-good); box-shadow:0 0 0 0 color-mix(in srgb, var(--x-good) 60%, transparent); animation:pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow:0 0 0 8px transparent; } 100% { box-shadow:0 0 0 0 transparent; } }
.tabs { position:relative; z-index:2; display:flex; gap:4px; margin:-26px 0 20px; padding:4px; background:var(--x-surface); border:1px solid var(--x-line); border-radius:calc(var(--r) + 2px); width:max-content; max-width:100%; overflow-x:auto; scrollbar-width:none; box-shadow:var(--x-shadow); }
.tab { position:relative; z-index:1; padding:9px 16px; border-radius:999px; color:var(--x-ink-2); font-weight:700; font-size:14px; text-decoration:none; white-space:nowrap; transition:color .25s; }
.tab:hover { color:var(--x-ink); }
.tab[aria-selected="true"] { color:var(--x-surface); }
.tab-ink { position:absolute; z-index:0; top:4px; bottom:4px; left:0; width:0; border-radius:999px; background:var(--x-ink); transition:transform .35s var(--ease), width .35s var(--ease); }
html:not(.js) .tab-ink { display:none; }
html:not(.js) .tab[aria-selected="true"] { color:var(--x-accent-text); }
.panel { animation:fade .35s var(--ease); }
@keyframes fade { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
html:not(.js) .panel { margin-bottom:28px; }

/* Builder layout */
html:not(.embed) .b-form { top:84px; }
.b-grid { display:grid; grid-template-columns:minmax(300px, 360px) 1fr; gap:18px; align-items:start; }
.b-form { position:sticky; top:12px; padding:0; overflow:hidden; }
html:not(.js) .b-form, html:not(.js) .b-out { display:none; }
.grp { padding:18px 20px; border-bottom:1px solid var(--x-line); }
.grp:last-of-type { border-bottom:0; }
.grp > .kick { margin-bottom:12px; }
.f { display:block; border:0; padding:0; margin:0 0 14px; min-width:0; }
.f:last-child { margin-bottom:0; }
.f-l { display:flex; justify-content:space-between; gap:8px; margin-bottom:6px; padding:0; font-size:12.5px; font-weight:700; color:var(--x-ink-2); }
.f-l b { color:var(--x-ink); font-variant-numeric:tabular-nums; }
.f-h { display:block; margin-top:5px; font-size:12.5px; color:var(--x-ink-3); }
.f input[type=date], .f input[type=text], .f input[type=number] { width:100%; min-height:46px; padding:9px 14px; border-radius:var(--r-s); border:1px solid var(--x-line); background:var(--x-surface-2); color:var(--x-ink); font-size:14px; transition:border-color .2s, box-shadow .2s; }
.f input:focus { outline:none; border-color:var(--x-accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--x-accent) 20%, transparent); }
.f input[type=range] { width:100%; accent-color:var(--x-accent); }
.dates { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.dates .f { margin:0; }
.span { display:grid; grid-template-columns:auto 1fr; align-items:baseline; column-gap:8px; margin-top:14px; padding:12px 14px; border-radius:var(--r-s); background:var(--x-accent-soft); }
.span-n { font-family:var(--x-display); font-weight:var(--x-display-weight); font-size:30px; line-height:1; color:var(--x-accent-text); font-variant-numeric:tabular-nums; }
.span-u { font-weight:700; color:var(--x-accent-text); font-size:13px; }
.span-bar { grid-column:1 / -1; height:4px; margin-top:10px; border-radius:99px; background:color-mix(in srgb, var(--x-accent) 18%, transparent); overflow:hidden; }
.span-bar i { display:block; height:100%; width:0; background:var(--x-accent); border-radius:inherit; transition:width .5s var(--ease); }
.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chip { position:relative; cursor:pointer; }
.chip input { position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.chip span { display:inline-block; padding:7px 11px; border-radius:999px; border:1px solid var(--x-line); background:var(--x-surface); font-size:12.5px; font-weight:600; color:var(--x-ink-2); transition:all .2s; }
.chip:hover span { border-color:var(--x-accent); color:var(--x-ink); }
.chip input:checked + span { background:var(--x-accent); border-color:var(--x-accent); color:var(--x-on-accent); }
.chip input:focus-visible + span { outline:2px solid var(--x-accent); outline-offset:2px; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.step { position:relative; display:block; min-height:46px; border:1px solid var(--x-line); border-radius:var(--r-s); background:var(--x-surface-2); }
.step .step-btns { position:absolute; inset-block:5px; inset-inline-end:5px; width:34px; display:flex; flex-direction:column; gap:2px; padding-inline-start:4px; border-inline-start:1px solid var(--x-line); }
.step button { flex:1; min-height:0; padding:0; border:0; border-radius:10px; background:transparent; color:var(--x-ink-2); cursor:pointer; display:grid; place-items:center; }
.step button:hover { background:var(--x-accent-soft); color:var(--x-accent-text); }
.f .step input { width:100%; height:44px; min-height:0; border:0; border-radius:var(--r-s); background:transparent; text-align:start; font-weight:800; font-size:16px; padding:0 48px 0 14px; padding-inline:14px 48px; -moz-appearance:textfield; appearance:textfield; }
.step input::-webkit-inner-spin-button, .step input::-webkit-outer-spin-button { -webkit-appearance:none; }
.errs { margin:0 20px 18px; padding:10px 12px; border-radius:var(--r-s); background:var(--x-bad-soft); color:var(--x-bad); font-size:13px; font-weight:600; }
.errs p { margin:0; }

/* Builder output */
.b-out { display:grid; gap:16px; min-width:0; transition:opacity .3s; }
.b-out.dim { opacity:.35; pointer-events:none; filter:grayscale(.6); }
.kpis { display:grid; grid-template-columns:repeat(5, 1fr); gap:12px; }
.kpi { padding:14px 16px; position:relative; overflow:hidden; }
.kpi b { display:block; margin-top:4px; font-family:var(--x-display); font-weight:var(--x-display-weight); font-size:28px; line-height:1.05; font-variant-numeric:tabular-nums; letter-spacing:var(--x-display-spacing); }
.kpi small { display:block; margin-top:3px; color:var(--x-ink-3); font-size:12px; min-height:1em; }
.kpi::after { content:""; position:absolute; inset:auto 0 0 0; height:3px; background:var(--kc, var(--x-accent)); }
.k-total { --kc:var(--ph-SPP2); } .k-peak { --kc:var(--ph-COMP); } .k-sessions { --kc:var(--x-good); } .k-taper { --kc:var(--x-hot); }
.strip { display:flex; gap:4px; margin-bottom:12px; }
.seg { all:unset; cursor:pointer; min-width:0; display:flex; flex-direction:column; gap:3px; }
.seg i { display:block; height:8px; border-radius:99px; background:var(--pc); transition:transform .25s var(--ease), box-shadow .25s; }
.seg b { font-family:var(--x-label-font); font-size:12px; letter-spacing:.06em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.seg span { font-size:12.5px; color:var(--x-ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.seg:hover i, .seg.on i { transform:scaleY(1.5); box-shadow:0 0 0 2px var(--x-surface), 0 0 0 3px var(--pc); }
.seg:focus-visible { outline:2px solid var(--x-accent); outline-offset:3px; border-radius:10px; }
.chart { --n:36; }
.plot { position:relative; display:flex; align-items:flex-end; gap:clamp(1px, .4vw, 4px); height:240px; padding-top:22px; border-bottom:1px solid var(--x-line); }
.gl { position:absolute; left:0; right:0; border-top:1px dashed var(--x-line); pointer-events:none; }
.gl { z-index:3; }
.gl em { position:absolute; inset-inline-end:0; top:-16px; font-style:normal; font-size:12px; color:var(--x-ink-3); background:var(--x-surface); padding:0 4px; }
.bar { all:unset; box-sizing:border-box; position:relative; flex:1 1 0; height:100%; display:flex; align-items:flex-end; cursor:pointer; min-width:0; }
.bar i { display:block; width:100%; height:var(--h); border-radius:5px 5px 2px 2px; background:var(--pc); transform-origin:bottom; transform:scaleY(0); transition:transform .7s var(--ease) var(--d), filter .2s, opacity .2s; }
.chart.grow .bar i { transform:scaleY(1); }
.bar.rec i { opacity:.5; background:repeating-linear-gradient(135deg, var(--pc) 0 4px, color-mix(in srgb, var(--pc) 60%, var(--x-surface)) 4px 7px); }
.bar:hover i { filter:brightness(1.12) saturate(1.1); }
.bar[aria-pressed="true"] i { box-shadow:0 0 0 2px var(--x-surface), 0 0 0 4px var(--x-ink); }
.bar:focus-visible { outline:none; } .bar:focus-visible i { box-shadow:0 0 0 2px var(--x-surface), 0 0 0 4px var(--x-accent); }
.flag { position:absolute; left:50%; bottom:calc(var(--h) + 4px); transform:translateX(-50%); color:var(--x-hot); opacity:0; transition:opacity .4s calc(var(--d) + .5s); }
.chart.grow .flag { opacity:1; }
.flag .i { width:14px; height:14px; }
.tip { position:absolute; z-index:5; bottom:calc(var(--h) + 26px); left:50%; transform:translateX(-50%); min-width:max-content; padding:7px 10px; border-radius:8px; background:var(--x-ink); color:var(--x-surface); font-size:12.5px; line-height:1.45; pointer-events:none; display:none; box-shadow:var(--x-shadow-lg); }
/* Shown on hover or keyboard focus only as a preview; a hidden tip takes no room. At the ends of the chart it is held to the start or end side, so it stays on the screen in right-to-left pages too. */
.bar:hover .tip, .bar:focus-visible .tip { display:block; }
.bar:nth-child(-n+7) .tip { left:auto; inset-inline-start:0; transform:none; }
.bar:nth-last-child(-n+3) .tip { left:auto; inset-inline-start:auto; inset-inline-end:0; transform:none; }
.axis span { flex:1 1 0; min-width:0; }
.axis { display:flex; gap:clamp(1px, .4vw, 4px); margin-top:6px; font-size:12px; color:var(--x-ink-3); text-align:center; font-variant-numeric:tabular-nums; }
.legend { display:flex; flex-wrap:wrap; gap:16px; margin-top:12px; font-size:12px; color:var(--x-ink-3); }
.legend span { display:inline-flex; align-items:center; gap:6px; }
.legend i { width:12px; height:12px; border-radius:50%; background:var(--ph-SPP2); }
.legend .lg-rec { opacity:.55; background:repeating-linear-gradient(135deg, var(--ph-SPP2) 0 3px, var(--x-surface) 3px 5px); }
.lg-flag .i { color:var(--x-hot); width:14px; height:14px; }

/* Selected week */
.wk { display:grid; grid-template-columns:minmax(220px, 300px) 1fr; padding:0; overflow:hidden; }
.wk.swap .wk-side, .wk.swap .wk-main { animation:fade .35s var(--ease); }
.wk-side { padding:18px 20px; background:linear-gradient(160deg, color-mix(in srgb, var(--pc) 22%, var(--x-surface)), var(--x-surface)); border-inline-end:1px solid var(--x-line); position:relative; }
.wk-side::before { content:""; position:absolute; inset-inline-start:0; top:0; bottom:0; width:4px; background:var(--pc); }
.wk-side h3 { margin:2px 0 4px; font-family:var(--x-display); font-weight:var(--x-display-weight); text-transform:var(--x-display-transform); letter-spacing:var(--x-display-spacing); font-size:22px; line-height:1.15; }
.wk-d { margin:0; color:var(--x-ink-2); font-size:13px; }
.wk-tags { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 0; }
.tag { display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:999px; font-size:12.5px; font-weight:700; background:var(--x-surface-2); border:1px solid var(--x-line); }
.tag.hot { background:var(--x-hot-soft); color:var(--x-hot-text); border-color:transparent; }
.tag .i { width:13px; height:13px; }
.wk-f { margin:12px 0 0; font-size:13.5px; color:var(--x-ink); font-weight:600; }
.wk-main { padding:18px 20px; min-width:0; }
.wk-nums { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin-bottom:16px; }
.wk-nums div { padding:10px 12px; border-radius:var(--r-s); background:var(--x-surface-2); }
.wk-nums .kick { color:var(--x-ink-3); font-size:12px; }
.wk-nums b { display:block; font-family:var(--x-display); font-weight:var(--x-display-weight); font-size:22px; line-height:1.1; font-variant-numeric:tabular-nums; }
.wk-nums small { font-family:var(--x-font); font-size:12px; font-weight:600; color:var(--x-ink-3); }
.stack { display:flex; height:12px; border-radius:99px; overflow:hidden; gap:2px; margin:6px 0 12px; }
.stack i { display:block; background:var(--zc); min-width:0; transition:flex .5s var(--ease); }
.stack.sm { height:6px; margin:10px 0 0; }
.zrs { display:grid; gap:6px; }
.zr { display:grid; grid-template-columns:28px minmax(80px, 1fr) 2fr 70px; gap:10px; align-items:center; font-size:12.5px; }
.zrs.has-p .zr { grid-template-columns:28px minmax(80px, 1fr) 2fr 64px 86px; }
.zr-id { font-family:var(--x-label-font); font-weight:800; font-size:12.5px; color:color-mix(in srgb, var(--zc) 62%, var(--x-ink)); }
.zr-n { color:var(--x-ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.zr-bar { height:8px; border-radius:99px; background:var(--x-surface-2); overflow:hidden; }
.zr-bar i { display:block; height:100%; width:min(100%, var(--w)); background:var(--zc); border-radius:inherit; animation:fill .6s var(--ease); }
@keyframes fill { from { width:0; } }
.zr-m, .zr-p { text-align:end; font-weight:700; font-variant-numeric:tabular-nums; }
.zr-p { color:var(--x-accent-text); }
.zr-head span { font-size:12px; font-weight:700; color:var(--x-ink-3); text-transform:uppercase; letter-spacing:.06em; }

/* Phase cards */
.phases { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; }
.ph { all:unset; box-sizing:border-box; cursor:pointer; display:flex; flex-direction:column; gap:4px; padding:14px; border-radius:var(--r-s); border:1px solid var(--x-line); background:var(--x-surface); position:relative; overflow:hidden; transition:transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.ph::before { content:""; position:absolute; inset:0 0 auto 0; height:4px; background:var(--pc); }
.ph:hover { transform:translateY(-2px); box-shadow:var(--x-shadow-lg); }
.ph.on { border-color:var(--pc); box-shadow:0 0 0 1px var(--pc); }
.ph:focus-visible { outline:2px solid var(--x-accent); outline-offset:2px; }
.ph-top { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.ph-top b { font-family:var(--x-label-font); font-size:12.5px; letter-spacing:.08em; padding:2px 9px; border-radius:999px; background:color-mix(in srgb, var(--pc) 22%, var(--x-surface)); }
.ph-top span { font-size:12.5px; color:var(--x-ink-3); }
.ph-n { font-weight:800; font-size:14.5px; margin-top:4px; }
.ph-f { font-size:12.5px; color:var(--x-ink-2); min-height:2.6em; }
.ph-v { font-family:var(--x-display); font-weight:var(--x-display-weight); font-size:20px; font-variant-numeric:tabular-nums; margin-top:4px; }
.ph-v small { font-family:var(--x-font); font-weight:600; font-size:12.5px; color:var(--x-ink-3); }
.pdot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--pc); margin-inline-end:6px; }

/* Method & evidence */
.lead { margin:0 0 16px; max-width:80ch; color:var(--x-ink-2); font-size:15px; }
.aud { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
.aud-c ul { margin:6px 0 0; padding-inline-start:18px; font-size:13.5px; color:var(--x-ink-2); }
.aud-c li + li { margin-top:6px; }
.aud-c:nth-child(2) .kick { color:var(--x-warn); } .aud-c:nth-child(3) .kick { color:var(--x-good); }
#method > .card, #method > details, #sources > .card { margin-top:16px; }
.map { display:grid; grid-template-columns:minmax(150px, 1fr) repeat(3, minmax(170px, 1.3fr)); min-width:640px; border:1px solid var(--x-line); border-radius:var(--r-s); overflow:hidden; }
.map-c { padding:10px; border-bottom:1px solid var(--x-line); border-inline-end:1px solid var(--x-line); display:flex; flex-wrap:wrap; gap:6px; align-content:flex-start; min-height:52px; }
.map-c:nth-child(4n) { border-inline-end:0; }
.map-head { min-height:0; background:var(--x-surface-2); font-family:var(--x-label-font); font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--x-ink-3); }
.map-row { align-items:center; flex-wrap:nowrap; font-weight:700; font-size:12.5px; background:var(--x-surface-2); }
.map-row .dot { margin-inline-end:8px; }
.map-i { display:inline-block; padding:5px 9px; border-radius:7px; font-size:12px; font-weight:600; line-height:1.3; text-decoration:none; color:var(--x-ink); background:color-mix(in srgb, var(--rc) 12%, var(--x-surface)); border:1px solid color-mix(in srgb, var(--rc) 35%, transparent); transition:transform .15s, background .2s; }
.map-i:hover { transform:translateY(-1px); background:color-mix(in srgb, var(--rc) 22%, var(--x-surface)); }
.rules-h { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; margin:28px 0 12px; }
.rules-h h2 { margin:0; font-family:var(--x-display); font-weight:var(--x-display-weight); text-transform:var(--x-display-transform); letter-spacing:var(--x-display-spacing); font-size:24px; }
.search input { width:min(300px, 80vw); padding:9px 12px; border-radius:var(--r-s); border:1px solid var(--x-line); background:var(--x-surface); }
.search input:focus { outline:none; border-color:var(--x-accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--x-accent) 20%, transparent); }
.fchips { display:flex; flex-wrap:wrap; gap:6px; }
.fchip { display:inline-flex; align-items:center; gap:7px; padding:6px 12px; border-radius:999px; border:1px solid var(--x-line); background:var(--x-surface); font-size:12.5px; font-weight:700; cursor:pointer; transition:all .2s; }
.fchip .dot { background:var(--rc); }
.fchip em { font-style:normal; color:var(--x-ink-3); font-weight:600; }
.fchip:hover { border-color:var(--rc, var(--x-accent)); }
.fchip[aria-pressed="true"] { background:var(--x-ink); color:var(--x-surface); border-color:var(--x-ink); }
.fchip[aria-pressed="true"] em { color:inherit; opacity:.7; }
html:not(.js) .fchips, html:not(.js) .search, html:not(.js) .rule-more { display:none; }
.explain { min-height:20px; margin:8px 0 10px; font-size:13px; color:var(--x-ink-3); }
.rules { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap:12px; }
.rule { display:flex; flex-direction:column; padding:16px 18px; border-radius:var(--r); background:var(--x-surface); border:1px solid var(--x-line); box-shadow:var(--x-shadow); position:relative; overflow:hidden; transition:transform .2s var(--ease), box-shadow .2s; }
.rule::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--rc); }
[dir="rtl"] .rule::before { inset:0 0 0 auto; }
.rule:hover { transform:translateY(-2px); box-shadow:var(--x-shadow-lg); }
.rule-h { display:flex; flex-wrap:wrap; gap:6px; }
.rule h3 { margin:10px 0 6px; font-size:15.5px; line-height:1.3; }
.rule-s { margin:0 0 10px; font-size:13px; color:var(--x-ink-2); flex:1; }
.rule-more { align-self:flex-start; display:inline-flex; align-items:center; gap:6px; padding:0; border:0; background:none; color:var(--x-accent-text); font-weight:700; font-size:13px; cursor:pointer; }
.rule-more:hover .i { transform:translateX(3px); } [dir="rtl"] .rule-more:hover .i { transform:scaleX(-1) translateX(3px); }
.rule-more .i { transition:transform .2s; }
html.js .rule-body { display:none; }
.rule-body, .drawer-b { font-size:14px; }
.rule-cert { margin:0 0 4px; font-style:italic; color:var(--x-ink-3); font-size:13px; }
.rule-body dl, .drawer-b dl { margin:0; }
.rule-body dt, .drawer-b dt { margin-top:14px; font-family:var(--x-label-font); font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--x-ink-3); }
.rule-body dd, .drawer-b dd { margin:4px 0 0; line-height:1.6; }
.rule-body ul, .drawer-b ul { margin:0; padding-inline-start:18px; } .drawer-b li + li { margin-top:5px; }
.rule-body .src a, .drawer-b .src a { word-break:break-word; }
.rule-checked { margin:14px 0 0; font-size:12px; color:var(--x-ink-3); }
.empty { padding:24px; text-align:center; color:var(--x-ink-3); }
.callout { margin-top:16px; padding:16px 18px; border-radius:var(--r); border:1px solid color-mix(in srgb, var(--x-good) 35%, transparent); background:color-mix(in srgb, var(--x-good) 9%, var(--x-surface)); }
.callout .kick { color:var(--x-good); } .callout p:last-child { margin:4px 0 0; font-size:13.5px; color:var(--x-ink-2); }

/* Drawer */
.drawer { position:fixed; inset:0; z-index:50; }
.drawer-bg { position:absolute; inset:0; background:color-mix(in srgb, var(--x-ink) 45%, transparent); opacity:0; transition:opacity .25s; backdrop-filter:blur(2px); }
.drawer-p { position:absolute; top:0; bottom:0; inset-inline-end:0; width:min(560px, 100%); display:flex; flex-direction:column; background:var(--x-surface); box-shadow:var(--x-shadow-lg); transform:translateX(100%); transition:transform .3s var(--ease); outline:none; border-top:4px solid var(--rc, var(--x-accent)); }
[dir="rtl"] .drawer-p { transform:translateX(-100%); }
.drawer.on .drawer-bg { opacity:1; } .drawer.on .drawer-p { transform:none; }
.drawer-h { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:16px 22px 0; }
.drawer-meta { display:flex; flex-wrap:wrap; gap:6px; }
.drawer-p h2 { margin:12px 22px 0; font-family:var(--x-display); font-weight:var(--x-display-weight); text-transform:var(--x-display-transform); letter-spacing:var(--x-display-spacing); font-size:24px; line-height:1.2; }
.drawer-b { flex:1; overflow:auto; padding:12px 22px 20px; }
.drawer-f { display:flex; justify-content:space-between; gap:10px; padding:14px 22px; border-top:1px solid var(--x-line); background:var(--x-surface-2); }

/* Sources */
.srcs { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap:12px; }
.src-c { display:flex; gap:14px; transition:transform .2s var(--ease), box-shadow .2s; }
.src-c:hover { transform:translateY(-2px); box-shadow:var(--x-shadow-lg); }
.src-n { font-family:var(--x-display); font-weight:var(--x-display-weight); font-size:26px; line-height:1; color:color-mix(in srgb, var(--x-accent) 55%, var(--x-surface)); }
.src-k { font-family:var(--x-label-font); font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--x-ink-3); }
.src-c p { margin:4px 0 8px; font-size:13.5px; }
.src-c a { display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:13px; text-decoration:none; }

/* Pro (dark) theme touches */
[data-theme="pro"] .tip { background:var(--x-surface-2); color:var(--x-ink); border:1px solid var(--x-line); }
[data-theme="pro"] .tab[aria-selected="true"] { color:var(--x-surface); }

@media (max-width:1080px) {
  .b-grid { grid-template-columns:1fr; }
  .b-form { position:static; }
  .kpis { grid-template-columns:repeat(3, 1fr); }
  .phases { grid-template-columns:repeat(2, 1fr); }
}
@media (max-width:720px) {
  .kpis { grid-template-columns:repeat(2, 1fr); }
  .kpi b { font-size:24px; }
  .wk { grid-template-columns:1fr; }
  .wk-side { border-inline-end:0; border-bottom:1px solid var(--x-line); }
  .aud, .phases { grid-template-columns:1fr; }
  .plot { height:190px; }
  .seg span { display:none; }
  .zr, .zrs.has-p .zr { grid-template-columns:26px 1fr 64px; }
  .zr-bar { display:none; } .zrs.has-p .zr-p { grid-column:2 / 4; text-align:start; font-size:12.5px; margin-top:-4px; } .zr-head { display:none !important; }
  .card-h { flex-direction:column; }
  .ws-title .pill { order:-1; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; transition-delay:0s !important; }
}

/* Print: the plan only, on white paper. */
@media print {
  @page { margin:14mm; }
  body { background:#fff; color:#000; font-size:12.5px; }
  .ws-top, .tabs, .pill, .b-form, #method, #sources, .drawer, .btn, .site-footer { display:none !important; }
  main#page { padding:0; width:100%; }
  .panel { display:block !important; animation:none; }
  .b-grid { display:block; }
  .card, .rule { box-shadow:none; break-inside:avoid; }
  .b-out { gap:10px; }
  .kpis { grid-template-columns:repeat(5, 1fr); }
  .chart .bar i { transform:none !important; transition:none; }
  .flag { opacity:1 !important; }
  .tip { display:none; }
  details.table-card > .scroll { max-height:none; overflow:visible; }
  th { position:static; }
  * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* Safari on iPhone zooms into any field under 16px when it is tapped and does not zoom back out: 16px on touch screens. */
@media (pointer: coarse) { input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]), select, textarea { font-size:16px !important; } }

/* iPhone zooms into a field under 16 px and stays zoomed: on touch screens every field is 16 px (audit 2026-11-17). */
@media (pointer:coarse), (max-width:760px) { input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]), select, textarea { font-size:16px !important; } }
/* Touch: steppers side by side at 44 × 44, choices and phase buttons 44 px tall (audit 2026-11-17). */
@media (pointer:coarse) {
  .step { min-height:54px; }
  .f .step input, .step input { height:52px; padding-inline:14px 104px !important; }
  .step .step-btns { flex-direction:row; width:auto; gap:4px; }
  .step button { flex:none; width:44px; min-height:44px; background:var(--x-surface); }
  .chips .chip, label.chip { min-height:44px; display:inline-flex; align-items:center; }
  .strip .seg { min-height:44px; justify-content:center; }
  .pb-dial-row input[type=range] { height:44px; }
}
