/* Time Ballot. System fonts only; no external resources.
   --brand / --brand-ink can be overridden per organiser by /brand/{kind}/{id}.css */
:root {
  --brand: #4338ca;
  --brand-ink: #ffffff;
  --brand-soft: rgba(67, 56, 202, 0.10);
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #2c3e50;
  --muted: #5d6b78;
  --border: #e0e4ea;
  --link: #4338ca;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --focus: #2563eb;
  --yes: #166534;
  --yes-bg: #dcfce7;
  --maybe: #854d0e;
  --maybe-bg: #fef3c7;
  --no: #991b1b;
  --no-bg: #fee2e2;
  --ok-bg: #ecfdf5;
  --ok-border: #059669;
  --warn-bg: #fffbeb;
  --warn-border: #d97706;
  --err-bg: #fef2f2;
  --err-border: #dc2626;
  --radius: 12px;
  color-scheme: light;
}
/* Dark: automatically (device setting, often by time of day) unless light was chosen, or when chosen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318;
    --surface: #1b1e26;
    --text: #e5e7eb;
    --muted: #a3aab6;
    --border: #353c4a;
    --link: #a5b4fc;
    --brand-soft: rgba(165, 180, 252, 0.14);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    --focus: #93c5fd;
    --yes: #86efac;
    --yes-bg: #14351f;
    --maybe: #fcd34d;
    --maybe-bg: #3b2f0e;
    --no: #fca5a5;
    --no-bg: #3f1717;
    --ok-bg: #0f2a20;
    --warn-bg: #2d220c;
    --err-bg: #2d1414;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111318;
  --surface: #1b1e26;
  --text: #e5e7eb;
  --muted: #a3aab6;
  --border: #353c4a;
  --link: #a5b4fc;
  --brand-soft: rgba(165, 180, 252, 0.14);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  --focus: #93c5fd;
  --yes: #86efac;
  --yes-bg: #14351f;
  --maybe: #fcd34d;
  --maybe-bg: #3b2f0e;
  --no: #fca5a5;
  --no-bg: #3f1717;
  --ok-bg: #0f2a20;
  --warn-bg: #2d220c;
  --err-bg: #2d1414;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Anything marked hidden stays hidden, whatever display a component sets */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; padding-top: 1.5rem; padding-bottom: 3rem; }
.wrap { width: 100%; max-width: 60rem; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }
p { margin: 0 0 .75rem; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }
html:not(.js) .js-only, .js .nojs-only { display: none !important; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.stack > * + * { margin-top: 1.25rem; }

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-top: .75rem; padding-bottom: .75rem; }
.wordmark { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.header-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.header-nav a { text-decoration: none; }
.lang-switch { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.lang-switch a { display: inline-block; padding: .2rem .45rem; border-radius: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.lang-switch a[aria-current="true"] { background: var(--brand); color: var(--brand-ink); }
.brand-bar { background: var(--brand); color: var(--brand-ink); }
.brand-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding-top: .6rem; padding-bottom: .6rem; }
.brand-logo { height: 40px; width: auto; max-width: 160px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px; }
.brand-name { font-weight: 700; }
.brand-book { margin-left: auto; color: var(--brand-ink) !important; font-weight: 600; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; padding: 1.25rem 0; }
.site-footer p { margin: .25rem 0; }
.site-footer a { color: inherit; }

/* Blocks */
.trust { color: var(--muted); font-size: .95rem; font-weight: 600; }
.hero .lead, .lead { font-size: 1.1rem; color: var(--muted); max-width: 42rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem 1.25rem; margin-left: 0; margin-right: 0; margin-bottom: 0; min-width: 0; }
fieldset.card { padding-top: .5rem; }
.card > legend, details.card > summary { font-weight: 700; font-size: 1.15rem; padding: 0 .3rem; }
details.card > summary { cursor: pointer; padding: .2rem 0; }
details.card[open] > summary { margin-bottom: .75rem; }
.card.danger { border-color: var(--err-border); }
.meta { color: var(--muted); }
.notice { border-left: 4px solid var(--border); background: var(--surface); border-radius: 6px; padding: .75rem 1rem; }
.notice > :last-child { margin-bottom: 0; }
.notice h2 { font-size: 1.05rem; }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice.success { background: var(--ok-bg); border-left-color: var(--ok-border); }
.notice.warning { background: var(--warn-bg); border-left-color: var(--warn-border); }
.notice.error { background: var(--err-bg); border-left-color: var(--err-border); }

/* Forms */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; min-width: 0; }
.field > label, .label { font-weight: 600; }
.help { color: var(--muted); font-size: .9rem; margin: 0; }
input[type=text], input[type=email], input[type=date], input[type=time], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: .55rem .65rem;
  width: 100%; max-width: 100%; min-height: 44px;
}
textarea { resize: vertical; }
/* Optional description: one line like the title until typing starts (app.js adds .grown) */
.js textarea[data-grow]:not(.grown) { height: 44px; min-height: 44px; resize: none; overflow: hidden; }
textarea[data-grow] { transition: height .15s ease; }
.inline-fields { display: flex; flex-wrap: wrap; gap: .5rem; }
.inline-fields input { width: auto; }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.check { display: flex; gap: .55rem; align-items: flex-start; margin: .5rem 0; }
.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.subsection { border: 1px dashed var(--border); border-radius: 8px; padding: .5rem .9rem .75rem; margin: 0; }
.subsection > legend { font-weight: 700; padding: 0 .3rem; }
.inline { display: inline; margin: 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  border-radius: 8px; padding: .6rem 1.1rem; min-height: 44px; border: 1px solid transparent;
}
.button.primary { background: var(--brand); color: var(--brand-ink); }
.button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button.danger { background: #b91c1c; color: #fff; }
.button.small { padding: .3rem .7rem; min-height: 36px; font-size: .9rem; }
.button.large { font-size: 1.1rem; padding: .8rem 1.5rem; }
.button:hover { filter: brightness(1.08); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }

/* Date option rows */
.slot-row { border: 1px solid var(--border); border-radius: 8px; padding: .4rem .75rem .75rem; margin: 0 0 .75rem; min-width: 0; }
.slot-row > legend { font-weight: 600; font-size: .9rem; color: var(--muted); padding: 0 .25rem; }
.slot-fields { display: grid; gap: .5rem .75rem; grid-template-columns: 1fr 1fr; align-items: end; }
.slot-fields label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; min-width: 0; }
.slot-date { grid-column: 1 / -1; }
.slot-fields [data-remove-slot] { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 40rem) {
  .slot-fields { grid-template-columns: 1.4fr 1fr 1fr auto; }
  .slot-date, .slot-fields [data-remove-slot] { grid-column: auto; }
}

/* Time zone bar and copy fields */
.tz-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--muted); font-size: .95rem; }
.tz-bar p { margin: 0; flex: 1 1 16rem; }
.tz-bar select { width: auto; max-width: 100%; flex: 0 1 16rem; min-height: 36px; padding: .3rem .5rem; }
.copy-field { display: flex; gap: .5rem; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }

/* Ballot */
.ballot-head h1 { overflow-wrap: anywhere; }
.description { max-width: 42rem; }
.final { border-color: var(--ok-border); background: var(--ok-bg); }
.final-date { font-size: 1.3rem; font-weight: 700; }
.deadline { font-weight: 600; }
.editing-as { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.editing-as p { margin: 0; }
.day-heading { margin-top: 1.5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--border); }
.answer { border: 0; padding: .5rem 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-width: 0; }
.answer > legend { float: left; font-weight: 600; padding: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label { padding: .5rem .85rem; min-height: 44px; display: flex; align-items: center; cursor: pointer; border-left: 1px solid var(--border); font-weight: 500; }
.segmented label:first-of-type { border-left: 0; }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }
.segmented input:checked + .opt-yes { background: var(--yes-bg); color: var(--yes); font-weight: 700; }
.segmented input:checked + .opt-maybe { background: var(--maybe-bg); color: var(--maybe); font-weight: 700; }
.segmented input:checked + .opt-no { background: var(--no-bg); color: var(--no); font-weight: 700; }
.segmented input:checked + label::before { content: "● "; }

/* Results grid */
.grid-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.grid { border-collapse: collapse; width: 100%; font-size: .95rem; }
.grid th, .grid td { border-bottom: 1px solid var(--border); padding: .5rem .6rem; text-align: center; white-space: nowrap; }
.grid thead th { font-weight: 600; }
.grid thead tr:first-child th { border-bottom: 0; color: var(--muted); font-size: .85rem; }
.grid tbody th, .grid tfoot th { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.grid .cell.yes { background: var(--yes-bg); color: var(--yes); font-weight: 700; }
.grid .cell.maybe { background: var(--maybe-bg); color: var(--maybe); }
.grid .cell.no { color: var(--no); }
.grid .cell.none { color: var(--muted); }
.grid tr.me th { font-weight: 700; }
.grid .you { color: var(--muted); font-weight: 400; font-size: .85rem; }
.grid tfoot td { vertical-align: top; font-size: .85rem; }
.grid tfoot span { display: block; }
.grid .best { box-shadow: inset 0 3px 0 var(--brand); }
.grid .badge { color: var(--link); font-weight: 700; }

/* Organiser page */
.choices { border: 0; padding: 0; margin: 0; }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .25rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.choice input { margin-top: .35rem; width: 1.1rem; height: 1.1rem; flex: none; }
.choice small { display: block; color: var(--muted); }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.tag { display: inline-block; font-size: .8rem; padding: .05rem .5rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.tag.open { background: var(--yes-bg); color: var(--yes); border-color: transparent; }

/* My ballots */
.list-table { border-collapse: collapse; width: 100%; }
.list-table th, .list-table td { padding: .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.list-table tbody th { font-weight: 600; overflow-wrap: anywhere; min-width: 10rem; }
.list-table .actions { white-space: nowrap; display: flex; gap: .4rem; }

/* Text pages */
.prose { max-width: 42rem; }
.prose h2 { margin-top: 1.75rem; }

/* Theme switch */
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 999px; width: 36px; height: 36px; font-size: 1.05rem; cursor: pointer; line-height: 1; }
.theme-toggle:hover { border-color: var(--brand); }

/* Date picker (styled after the scheduler's booking page) */
.picker-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); margin-top: .5rem; }
@media (min-width: 52rem) { .picker-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.picker-card { background: var(--bg); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.picker-card h3 { margin: 0 0 .75rem; font-size: 1rem; }
.picker-card h3 + * { margin-top: 0; }
.picker-card h3:not(:first-child) { margin-top: 1.25rem; }
.duration-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.duration-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  min-height: 64px; padding: .5rem; border: 2px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s;
}
.duration-btn strong { font-size: 1.25rem; line-height: 1.1; }
.duration-btn span { font-size: .8rem; color: var(--muted); }
.duration-btn:hover { border-color: var(--brand); }
.duration-btn[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.duration-btn[data-duration="allday"] strong, .duration-btn[data-duration="custom"] strong { font-size: 1rem; }
.duration-btn[data-duration="custom"] { grid-column: span 2; }
.custom-duration { display: flex; align-items: center; gap: .6rem; margin-top: .75rem; font-weight: 600; }
.custom-duration input { width: 7rem; }

.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.calendar-month { font-weight: 700; text-transform: capitalize; }
.calendar-nav { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.calendar-nav:hover { border-color: var(--brand); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-day-header { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); padding: .25rem 0; text-transform: capitalize; }
.calendar-day {
  aspect-ratio: 1; min-height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s; padding: 0;
}
.calendar-day:hover:not([disabled]) { border-color: var(--brand); }
.calendar-day.today { font-weight: 800; box-shadow: inset 0 -3px 0 var(--brand); }
.calendar-day[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.calendar-day[disabled] { opacity: .35; cursor: not-allowed; }

.time-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: 6px; max-height: 18rem; overflow-y: auto; padding: 2px; }
.time-slot {
  padding: .5rem .25rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; min-height: 40px;
}
.time-slot:hover { border-color: var(--brand); }
.time-slot[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.step-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .6rem; font-size: .9rem; color: var(--muted); }
.step-switch span { margin-right: .2rem; }
.step-switch button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .75rem; min-height: 34px; font: inherit; cursor: pointer; }
.step-switch button:hover { border-color: var(--brand); }
.step-switch button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.other-time { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin: .75rem 0; }
.other-time label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--muted); }
.other-time input { width: auto; }
.date-times h4 { margin: 1rem 0 .5rem; font-size: .95rem; text-transform: capitalize; }

.picker-summary { margin-top: 1rem; padding: .75rem 1rem; border-radius: var(--radius); border: 1px dashed var(--border); }
.picker-summary-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.option-chips { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.option-chips li { display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .25rem .2rem .7rem; border-radius: 999px; background: var(--brand-soft); font-size: .9rem; }
.option-chips button { border: 0; background: none; color: var(--text); width: 28px; height: 28px; border-radius: 999px; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.option-chips button:hover { background: var(--border); }

/* Meeting location (styled like the scheduler's meeting type buttons) */
.location-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 40rem) { .location-options { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.location-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.location-btn {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: .5rem;
  border: 2px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 600; cursor: pointer;
}
.location-btn:hover { border-color: var(--brand); }
.location-options input:checked + .location-btn { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.location-options input:focus-visible + .location-btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.location-options input[value=""] + .location-btn { font-weight: 500; color: var(--muted); }
.location-detail { display: flex; flex-direction: column; gap: .3rem; margin-top: .75rem; }
.location-detail > label { font-weight: 600; }
.suggest-wrap { position: relative; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: .25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 16rem; overflow-y: auto;
}
.suggestions li { padding: .55rem .65rem; border-radius: 6px; cursor: pointer; font-size: .92rem; }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--brand-soft); }
.location-line { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; margin: .25rem 0 .75rem; }
.location-kind { display: inline-block; font-weight: 700; font-size: .85rem; padding: .1rem .6rem; border-radius: 999px; background: var(--brand-soft); }

/* Public pages: how it works, FAQ, footer links */
.how, .home-faq { margin-top: 2.5rem; }
.steps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); counter-reset: step; }
.step { position: relative; padding-top: 3.3rem; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 1rem; left: 1.25rem; width: 1.8rem; height: 1.8rem; border-radius: 999px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: .95rem; }
.step h3 { margin: 0 0 .4rem; }
.step p { margin: 0; color: var(--muted); }
.faq-short { margin: 0 0 1rem; display: grid; gap: .25rem 0; max-width: 46rem; }
.faq-short dt { font-weight: 700; margin-top: .75rem; }
.faq-short dd { margin: 0; color: var(--muted); }
.faq-item h2 { font-size: 1.1rem; margin: 1.5rem 0 .4rem; }
.steps-list { padding-left: 1.3rem; }
.steps-list li { margin-bottom: .6rem; }
.page-links { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 2rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-bottom: .5rem; }
.footer-nav a { color: inherit; font-weight: 600; }

/* Offer of the browser's language on English pages (no automatic redirect) */
.lang-offer { background: var(--brand-soft); border-bottom: 1px solid var(--border); font-size: .95rem; }
.lang-offer .wrap { padding-top: .55rem; padding-bottom: .55rem; }
.lang-offer a { font-weight: 700; }

/* Statistics dashboard. One data colour: the reference blue, stepped per theme (light #2a78d6 / dark #3987e5). */
.stats { --series-1: #2a78d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stats { --series-1: #3987e5; } }
:root[data-theme="dark"] .stats { --series-1: #3987e5; }
.stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; }
.stats-periods { display: flex; gap: .3rem; flex-wrap: wrap; }
.stats-periods a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: .9rem; }
.stats-periods a[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; }
.kpi-label { font-size: .85rem; color: var(--muted); }
.kpi-value { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-delta { font-size: .8rem; color: var(--muted); }
.kpi-delta.up { color: var(--yes); }
.kpi-delta.down { color: var(--no); }
.viz-pair, .viz-grid-2 { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) { .viz-pair, .viz-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stats h3 { font-size: .95rem; margin: 0 0 .5rem; }
.viz-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 11rem auto; column-gap: .5rem; }
.viz-plot { grid-column: 2; grid-row: 1; min-width: 0; }
.viz-columns { width: 100%; height: 100%; display: block; }
.viz-y { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; margin: -.35rem 0; }
.viz-x { grid-column: 2; grid-row: 2; display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); padding-top: .35rem; }
.viz-grid { stroke: var(--border); stroke-width: 1; }
.viz-bar { fill: var(--series-1); }
.viz-target { fill: transparent; }
.viz-hit:hover .viz-bar { opacity: .75; }
.viz-hit:hover .viz-target { fill: var(--brand-soft); }
.viz-bars { width: 100%; border-collapse: collapse; font-size: .9rem; }
.viz-bars th { text-align: left; font-weight: 500; padding: .3rem .5rem .3rem 0; max-width: 11rem; overflow-wrap: anywhere; }
.viz-bar-cell { width: 45%; padding: .3rem .4rem; }
.viz-bar-cell svg { width: 100%; height: 12px; display: block; }
.viz-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; padding-left: .4rem; white-space: nowrap; }
.viz-pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: .5rem; white-space: nowrap; font-size: .85rem; }
.viz-funnel .viz-bar-cell { width: 50%; }
.viz-list { width: 100%; border-collapse: collapse; }
.viz-list th { text-align: left; font-weight: 500; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.viz-list td { border-bottom: 1px solid var(--border); }
.viz-empty, .viz-note { color: var(--muted); font-size: .88rem; }
.viz-table { margin-top: .5rem; font-size: .85rem; }
.viz-table summary { cursor: pointer; color: var(--link); }
.viz-table table { border-collapse: collapse; margin-top: .4rem; }
.viz-table td, .viz-table th { padding: .15rem .8rem .15rem 0; text-align: left; font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
  .viz-bars tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; padding: .15rem 0; }
  .viz-bars th { grid-column: 1 / -1; max-width: none; padding-bottom: 0; }
  .viz-bars .viz-bar-cell, .viz-funnel .viz-bar-cell { width: auto; }
  .viz-chart { grid-template-rows: 8rem auto; }
}
