:root {
  --accent-fill: #0f766e;
  --surface: #fcfcfb; --plane: #f4f4f1; --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
  --border: rgba(11,11,11,0.10); --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: rgba(15,118,110,0.10);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #1a1a19; --plane: #0f0f0e; --ink: #f0efec; --ink2: #c3c2b7; --muted: #8f8d86;
    --border: rgba(255,255,255,0.10); --accent: #2dd4bf; --accent-ink: #062b27; --accent-soft: rgba(45,212,191,0.12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #1a1a19; --plane: #0f0f0e; --ink: #f0efec; --ink2: #c3c2b7; --muted: #8f8d86;
  --border: rgba(255,255,255,0.10); --accent: #2dd4bf; --accent-ink: #062b27; --accent-soft: rgba(45,212,191,0.12);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--plane); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.45;
}
h1, h2, h3, h4 { line-height: 1.2; }

.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 1440px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none; background: var(--accent);
  background-image: radial-gradient(circle at 30% 65%, #fff 0 3px, transparent 3.5px),
    radial-gradient(circle at 55% 40%, #fff 0 3px, transparent 3.5px),
    radial-gradient(circle at 78% 22%, #fff 0 3px, transparent 3.5px);
}
.brand h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.brand p { margin: 2px 0 0; font-size: 13px; color: var(--ink2); }
.top-link { color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.top-link:hover { text-decoration: underline; }

.layout {
  max-width: 1440px; margin: 0 auto; padding: 16px 20px 28px;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start;
}
.settings { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto;
  background: var(--surface); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); }
.settings-fold > summary { list-style: none; padding: 12px 16px 4px; font-weight: 700; font-size: 15px; cursor: default; }
.settings-fold > summary::-webkit-details-marker { display: none; }
form { padding: 4px 16px 16px; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
details.group { border-top: 1px solid var(--border); margin: 0; }
details.group:first-of-type { margin-top: 12px; }
details.group > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; font-weight: 700; padding: 11px 0; min-height: 44px; box-sizing: border-box; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
details.group[open] > summary::after { content: "–"; }
details.group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.group-body { padding: 2px 0 12px; }
form > details.group:last-of-type { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
legend { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; padding: 0; }
.field { margin-bottom: 10px; }
.field > label, .field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.slider-row { display: flex; align-items: center; gap: 8px; }
.slider-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
input.num, #seed, select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 7px;
}
input.num { width: 72px; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; }
select { width: 100%; font-size: 14px; }
.out { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.check { display: flex; align-items: baseline; gap: 7px; font-size: 13.5px; margin-top: 4px; flex-wrap: wrap; }
.check input { accent-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin: 3px 0 0; font-weight: 400; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.presets .field-label { width: 100%; margin: 0; }
.presets button, .seed-step {
  font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 0; cursor: pointer;
  color: var(--ink); background: var(--plane); box-shadow: inset 0 0 0 1px var(--border);
}
.presets button:hover, .seed-step:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.rules { display: grid; gap: 6px; margin-bottom: 10px; }
.rule { position: relative; padding: 8px 38px 8px 10px; border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--border); }
.rule > label { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.rule:hover { background: var(--plane); }
.rule input { margin-top: 3px; accent-color: var(--accent); }
.rule > .explain { position: static; }
.rule > .explain > summary { position: absolute; top: 8px; right: 8px; }
.rule > .explain[open] > .explain-body { margin-top: 8px; }
.rule strong { display: block; font-size: 13.5px; }
.rule small { display: block; font-size: 12px; color: var(--ink2); }
.rule:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.seed-row { display: flex; gap: 6px; align-items: center; }
#seed { width: 64px; font-size: 15px; text-align: center; font-variant-numeric: tabular-nums; }
.seed-step { min-width: 34px; font-size: 16px !important; line-height: 1; padding: 6px 10px !important; }
.about-list { padding-left: 18px; margin: 0; font-size: 14px; max-width: 80ch; }
.about-list li { margin-bottom: 5px; }
.run {
  width: 100%; margin-top: 14px; padding: 11px 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent-fill); color: #ffffff; font: inherit; font-weight: 700; font-size: 15px;
}
.run:hover { filter: brightness(1.07); }
.run.is-stale { box-shadow: 0 0 0 3px var(--accent-soft); }
.status { margin: 8px 0 0; font-size: 12.5px; color: var(--ink2); min-height: 18px; }
.stage-col { min-width: 0; }

.about { background: var(--surface); border-top: 1px solid var(--border); }
.about-inner { max-width: 1100px; margin: 0 auto; padding: 26px 20px 40px; }
.about h2 { margin: 0 0 6px; font-size: 20px; }
.about h3 { font-size: 15px; margin: 18px 0 6px; }
.about h4 { font-size: 13px; margin: 0 0 6px; }
.about .lead { color: var(--ink2); max-width: 70ch; margin: 0; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.about ol, .about ul { padding-left: 18px; margin: 0; font-size: 14px; }
.about li { margin-bottom: 5px; }
.tables { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.table-card { padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); min-width: 0; }
.table-card h4 + .tw { margin-bottom: 12px; }
.tw { overflow-x: auto; }
.tables table { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; width: 100%; }
.tables th, .tables td { padding: 4px 7px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.tables th:first-child, .tables td:first-child { text-align: left; }
.tables thead th { color: var(--ink2); font-weight: 600; font-size: 11.5px; white-space: normal; vertical-align: bottom; }
.small { font-size: 13px; color: var(--ink2); max-width: 80ch; }
code { font-size: 12.5px; background: var(--plane); padding: 1px 4px; border-radius: 4px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  /* settings become a drawer that slides in from the left (opened by the Settings button) */
  .settings { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(380px, 88vw); max-height: none; border-radius: 0 14px 14px 0;
    transform: translateX(-104%); transition: transform 0.22s ease; box-shadow: 0 0 0 1px var(--border), 8px 0 30px rgba(0,0,0,0.18); overflow-y: auto;
    -webkit-overflow-scrolling: touch; visibility: hidden; }
  body.drawer-open .settings { transform: none; visibility: visible; }
  body.drawer-open { overflow: hidden; }
  .settings-fold > summary { cursor: default; padding: 14px 16px 4px; }
  .drawer-close { display: block; }
  .drawer-btn { display: inline-flex; }
  .about-grid, .tables { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .settings { transition: none; } }
.drawer-close { display: none; position: sticky; top: 8px; float: right; margin: 8px 8px 0 0; z-index: 1; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--plane); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.drawer-btn { display: none; position: fixed; z-index: 55; left: 12px; bottom: 14px; align-items: center; gap: 8px; padding: 11px 16px; border: 0;
  border-radius: 999px; background: var(--accent-fill); color: #ffffff; font: inherit; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22); cursor: pointer; }
body.drawer-open .drawer-btn { display: none; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 58; background: rgba(0,0,0,0.35); }
.drawer-backdrop[hidden] { display: none; }
@media (max-width: 640px) {
  .top-inner { padding: 12px; }
  .brand p { display: none; }
  form { grid-template-columns: 1fr; }
}
.formula-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; font-size: 14px; }
.formula-grid > div { display: grid; gap: 2px; min-width: 0; }
.formula-grid span { color: var(--ink2); }
@media (max-width: 980px) { .formula-grid { grid-template-columns: 1fr; } }

/* "+" explainers ------------------------------------------------------- */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.label-row > label, .label-row > .field-label { margin-bottom: 0; }
.label-row > .explain { display: contents; }
.label-row > .explain > .explain-body { flex-basis: 100%; }
.explain > summary {
  list-style: none; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--surface);
}
.explain > summary::-webkit-details-marker { display: none; }
.explain > summary > span::before { content: "+"; font-weight: 700; font-size: 15px; line-height: 1; }
.explain[open] > summary { background: var(--accent-fill); color: #ffffff; }
.explain[open] > summary > span::before { content: "−"; }
.explain > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.explain-body {
  font-size: 12.5px; line-height: 1.45; color: var(--ink2); background: var(--plane);
  border-radius: 8px; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--border);
}
.explain-body p { margin: 0 0 6px; }
.explain-body p:last-child { margin-bottom: 0; }
.explain-body strong { color: var(--ink); }
.explain-body code { font-size: 11.5px; }
.label-row > .explain > summary { margin-left: auto; }
.rule .explain-body strong { display: inline; font-size: inherit; }

.out-split { min-width: 118px; font-size: 13px; }
.split-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 6px; gap: 2px; }
.split-bar span { display: block; transition: width 0.15s; }
.split-dcd { background: var(--accent); }
.split-dbd { background: var(--ink2); opacity: 0.45; }
.split-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.split-presets button {
  font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 0; cursor: pointer;
  color: var(--ink); background: var(--plane); box-shadow: inset 0 0 0 1px var(--border);
}
.split-presets button:hover { box-shadow: inset 0 0 0 1px var(--accent); }
@media (prefers-reduced-motion: reduce) { .split-bar span { transition: none; } }
.label-row > label, .label-row > .field-label { display: block; font-size: 13px; font-weight: 600; }

.route-group { display: grid; gap: 6px; }
.route-row > label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink2); margin-bottom: 1px; }
.route-summary { font-size: 12.5px; font-weight: 600; color: var(--ink); padding: 6px 9px; border-radius: 8px; background: var(--accent-soft); font-variant-numeric: tabular-nums; }
.route-row .out { min-width: 140px; }

.urgent-field { padding: 8px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border); }
.urgent-field .check-strong { font-weight: 600; font-size: 13.5px; margin: 0; }
.urgent-controls { margin-top: 6px; display: grid; gap: 5px; }
.urgent-field:not(.is-on) .urgent-controls { display: none; }
.unit-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink2); }
.unit-row select { width: auto; font-size: 13px; padding: 3px 6px; }
.urgent-field .hint { margin: 0; }
.table-card-wide { margin-top: 14px; }
#t-vs td:last-child { min-width: 260px; white-space: normal; }

.weight-band-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13.5px; }
.weight-band-row[hidden] { display: none; }
.weight-band-row label { margin-bottom: 0; white-space: nowrap; }
.weight-band-row select { width: auto; flex: 0 0 auto; }

/* follow a patient */
.follow-fields[hidden], .follow-grid[hidden], #f_vcat_wrap[hidden], #f_dg_wrap[hidden] { display: none; }
.follow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 8px; }
.follow-grid > label:not(.check) { display: grid; gap: 3px; font-size: 12.5px; color: var(--ink2); }
.follow-grid > label:first-child, #f_dg_wrap, #f_vcat_wrap { grid-column: 1 / -1; }
.follow-grid input[type=number] { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 5px 7px; }
.follow-grid .check { margin-top: 0; align-self: end; }
.follow-scores { margin: 8px 0 0; font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Match UK patient groups */
.grp-fields { display: grid; gap: 6px; margin-top: 8px; }
.grp-fields[hidden] { display: none; }
.grp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.grp-row label { margin-bottom: 0; }
.grp-row input { width: 5.5em; flex: 0 0 auto; }

/* explainer at the top of the page (28 Oct 2026) */
.intro { max-width: 1440px; margin: 0 auto; padding: 16px 20px 0; }
.intro-fold { background: var(--surface); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); border-left: 4px solid var(--accent); }
.intro-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.intro-fold > summary::-webkit-details-marker { display: none; }
.intro-fold > summary h2 { margin: 0; font-size: 17px; font-weight: 700; }
.intro-toggle::after { content: 'Hide'; font-size: 13px; font-weight: 600; color: var(--accent); }
.intro-fold:not([open]) .intro-toggle::after { content: 'Show'; }
.intro-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.intro-body { padding: 0 18px 16px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 6px 28px; font-size: 14px; line-height: 1.5; }
.intro-what p { margin: 0 0 8px; color: var(--ink2); }
.intro-what strong, .intro-steps strong { color: var(--ink); }
.intro-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.intro-steps li { counter-increment: st; position: relative; padding-left: 34px; color: var(--ink2); }
.intro-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-fill); color: #ffffff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.intro-steps em, .intro-what em { font-style: normal; font-weight: 600; color: var(--ink); }
.intro-try { grid-column: 1 / -1; margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink2); font-size: 13.5px; }
@media (max-width: 980px) {
  .intro-body { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .intro { padding: 12px 12px 0; }
  .intro-steps { grid-template-columns: 1fr; }
  .intro-fold > summary { padding: 12px 14px; }
  .intro-body { padding: 0 14px 14px; }
}
.field-note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink2); }
.field-note .ref { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

/* tabs: single run / compare strategies (28 Oct 2026) */
.tabs { max-width: 1440px; margin: 0 auto; padding: 16px 20px 0; }
.tabs-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-bottom: 2px solid var(--border); }
.tab { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 16px; border: 0; background: transparent; cursor: pointer;
  font: inherit; color: var(--ink2); border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 10px 10px 0 0; }
.tab span:last-child { display: flex; flex-direction: column; }
.tab strong { font-size: 16px; color: var(--ink); }
.tab small { font-size: 12.5px; color: var(--muted); }
.tab:hover { background: var(--accent-soft); }
.tab.is-on { border-bottom-color: var(--accent); background: var(--surface); }
.tab.is-on strong { color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--border); color: var(--ink2); font-weight: 700; font-size: 13px; }
.tab.is-on .tab-n { background: var(--accent-fill); color: #ffffff; }
.tab-panel[hidden] { display: none !important; }
@media (max-width: 600px) {
  .tabs { padding: 10px 12px 0; }
  .tab { padding: 10px 8px; gap: 8px; }
  .tab small { display: none; }
  .tab strong { font-size: 14px; }
}

/* compare tab */
.cmp-tab { min-width: 0; display: grid; gap: 16px; align-content: start; }
.cmp-setup h2 { margin: 0 0 4px; font-size: 20px; }
.cmp-lead { margin: 0 0 14px; color: var(--ink2); max-width: 900px; font-size: 14px; line-height: 1.5; }
.cmp-steps { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.1fr) minmax(280px, 2fr) minmax(200px, 1fr); gap: 14px; align-items: start; }
.cmp-step { background: var(--plane); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.cmp-step-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.cmp-step-h small { font-weight: 500; color: var(--muted); }
.cmp-step .tab-n { background: var(--accent-fill); color: #ffffff; width: 22px; height: 22px; font-size: 12px; }
.cmp-step select { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); width: 100%; }
.cmp-step .hint { margin: 0; font-size: 12.5px; color: var(--ink2); }
.cmp-radio { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--border); }
.cmp-radio:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.cmp-radio input { margin-top: 3px; accent-color: var(--accent); }
.cmp-radio span { display: flex; flex-direction: column; font-size: 14px; }
.cmp-radio small { color: var(--muted); font-size: 12px; }
.cmp-values { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--border); font-size: 14px; }
.cmp-chip input { accent-color: var(--accent); margin: 0; }
.cmp-chip small { margin-left: 6px; font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.cmp-chip:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); font-weight: 600; }
.cmp-chip.is-dis { opacity: 0.45; cursor: not-allowed; }
.cmp-seeds { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cmp-seeds select { width: auto; flex: 1; }
.cmp-step .run { width: 100%; }
.cmp-step .run:disabled { opacity: 0.5; cursor: not-allowed; }
.cmp-advanced { background: var(--surface); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); }
.cmp-advanced > summary { cursor: pointer; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.cmp-advanced > summary small { color: var(--muted); font-size: 12.5px; }
.cmp-advanced[open] > summary { border-bottom: 1px solid var(--border); }
.cmp-advanced > .wlv-panel { box-shadow: none; }
#cmp-strategies { display: grid; gap: 16px; }
@media (max-width: 1400px) { .cmp-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cmp-steps { grid-template-columns: 1fr; } }

.cmp-tab > .wlv-show { margin: 0; }
.cmp-plot[hidden] { display: none; }
.cmp-plot-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.cmp-plot-head h3 { margin: 0; }
.cmp-plot-head .wlv-panel-sub { margin: 2px 0 0; }
.cmp-plot-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cmp-plot-ctl select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.wls-panel[hidden], .cmp-advanced[hidden] { display: none; }
@media (max-width: 980px) { .drawer-close { display: block; } .drawer-btn { display: inline-flex; } body.drawer-open .drawer-btn { display: none; } }
.group-intro { margin: 2px 0 12px; }
.cmp-allrule { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--border); font-size: 13.5px; }
.cmp-allrule[hidden] { display: none; }
.cmp-allrule input { margin-top: 3px; accent-color: var(--accent); }
.cmp-allrule span { display: flex; flex-direction: column; }
.cmp-allrule small { color: var(--muted); font-size: 12px; }
.cmp-allrule:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }

/* phones: on opening, the Settings button starts in the middle of the screen, then settles bottom left (28 Oct 2026) */
@keyframes drawer-btn-intro {
  0%   { transform: translate(calc(50vw - 12px - 50%), calc(-50vh + 14px + 50%)) scale(1.25); box-shadow: 0 0 0 0 rgba(15,118,110,0.45), 0 10px 30px rgba(0,0,0,0.28); }
  20%  { transform: translate(calc(50vw - 12px - 50%), calc(-50vh + 14px + 50%)) scale(1.25); box-shadow: 0 0 0 14px rgba(15,118,110,0), 0 10px 30px rgba(0,0,0,0.28); }
  40%  { transform: translate(calc(50vw - 12px - 50%), calc(-50vh + 14px + 50%)) scale(1.25); box-shadow: 0 0 0 0 rgba(15,118,110,0.45), 0 10px 30px rgba(0,0,0,0.28); }
  60%  { transform: translate(calc(50vw - 12px - 50%), calc(-50vh + 14px + 50%)) scale(1.25); box-shadow: 0 0 0 14px rgba(15,118,110,0), 0 10px 30px rgba(0,0,0,0.28); }
  100% { transform: none; box-shadow: 0 6px 20px rgba(0,0,0,0.22); }
}
@media (max-width: 980px) {
  .drawer-btn.is-intro { animation: drawer-btn-intro 2.4s cubic-bezier(.5, 0, .2, 1) both; }
}
@media (prefers-reduced-motion: reduce) { .drawer-btn.is-intro { animation: none; } }
.top-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }

/* guided demo (wl_tour.js) ------------------------------------------------- */
.demo-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 0; background: var(--accent-fill, var(--accent)); color: #fff; }
.demo-btn:hover { filter: brightness(1.08); }
.demo-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-btn .demo-ic { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.intro-demo { margin: 10px 0 0; }
.tour { position: fixed; inset: 0; z-index: 1000; pointer-events: none; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.tour[hidden] { display: none; }
.tour-shade { position: fixed; inset: 0; background: rgba(8, 12, 12, 0.55); opacity: 0; transition: opacity 0.35s ease; }
.tour-shade.is-on { opacity: 1; pointer-events: auto; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(8, 12, 12, 0.55);
  transition: top 0.45s cubic-bezier(.4,.1,.2,1), left 0.45s cubic-bezier(.4,.1,.2,1), width 0.45s cubic-bezier(.4,.1,.2,1), height 0.45s cubic-bezier(.4,.1,.2,1), opacity 0.3s;
  animation: tour-pulse 1.8s ease-in-out infinite; }
.tour-spot.is-none { opacity: 0; }
@keyframes tour-pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(8,12,12,0.55); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 9999px rgba(8,12,12,0.55); } }
.tour-box { position: fixed; pointer-events: auto; box-sizing: border-box; padding: 16px 18px 14px; border-radius: 14px; background: var(--surface); color: var(--ink);
  box-shadow: 0 12px 40px rgba(0,0,0,0.28), 0 0 0 1px var(--border); opacity: 0; transform: translateY(10px) scale(0.98);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(.2,.9,.3,1.2), left 0.35s ease, top 0.35s ease; }
.tour-box.is-in { opacity: 1; transform: none; }
.tour-box[data-side="above"] { transform-origin: bottom center; }
.tour-stepn { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.tour-title { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.tour-text { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.tour-nav { display: flex; align-items: center; gap: 8px; }
.tour-nav button { font: inherit; font-size: 13.5px; cursor: pointer; border-radius: 8px; padding: 7px 12px; border: 0; }
.tour-skip { background: transparent; color: var(--muted); padding-left: 0 !important; }
.tour-skip:hover { color: var(--ink); }
.tour-back { background: var(--plane); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); margin-left: auto; }
.tour-back:disabled { opacity: 0.4; cursor: default; }
.tour-next { background: var(--accent-fill, var(--accent)); color: #fff; font-weight: 650 !important; min-width: 76px; }
.tour-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tour-dots { display: flex; gap: 4px; flex-wrap: wrap; max-width: 120px; }
.tour-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.tour-dots span.is-done { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.tour-dots span.is-on { background: var(--accent); width: 14px; border-radius: 3px; }
/* arrow: a filled triangle at the box edge, pointing at the target, nudging towards it */
.tour-arrow { position: fixed; width: 26px; height: 14px; margin-left: -13px; background: var(--accent); opacity: 0; transition: opacity 0.25s ease 0.1s, left 0.35s ease, top 0.35s ease; }
.tour-arrow[hidden] { display: none; }
.tour-arrow.is-in { opacity: 1; }
.tour-arrow.is-below { clip-path: polygon(50% 0, 100% 100%, 0 100%); animation: tour-nudge-up 1s ease-in-out infinite; }
.tour-arrow.is-above { clip-path: polygon(0 0, 100% 0, 50% 100%); animation: tour-nudge-down 1s ease-in-out infinite; }
.tour-arrow.is-right { width: 14px; height: 26px; margin-left: 0; margin-top: -13px; clip-path: polygon(0 50%, 100% 0, 100% 100%); animation: tour-nudge-left 1s ease-in-out infinite; }
.tour-arrow.is-left { width: 14px; height: 26px; margin-left: 0; margin-top: -13px; clip-path: polygon(0 0, 100% 50%, 0 100%); animation: tour-nudge-right 1s ease-in-out infinite; }
@keyframes tour-nudge-up { 50% { transform: translateY(-5px); } }
@keyframes tour-nudge-down { 50% { transform: translateY(5px); } }
@keyframes tour-nudge-left { 50% { transform: translateX(-5px); } }
@keyframes tour-nudge-right { 50% { transform: translateX(5px); } }
.tour.is-out .tour-box, .tour.is-out .tour-arrow, .tour.is-out .tour-spot, .tour.is-out .tour-shade { opacity: 0; transition: opacity 0.25s ease; }
@media (prefers-reduced-motion: reduce) {
  .tour-spot, .tour-arrow, .tour-box { animation: none !important; transition: opacity 0.2s ease !important; }
}
@media (max-width: 600px) { .tour-title { font-size: 16px; } .tour-text { font-size: 13.5px; } .tour-dots { display: none; } }
/* presets: UK baseline and changes from it */
.presets .preset-sub { width: 100%; font-size: 11.5px; color: var(--muted, #666); margin: 4px 0 -2px; }
.presets button.preset-base { font-weight: 650; }
.presets button.is-on { background: var(--accent); color: #fff; box-shadow: none; }
.presets .preset-note { width: 100%; margin: 2px 0 0; }
