/* BatteryCheckup – system fonts only, no external resources.
   Light and dark follow the browser/OS setting (prefers-color-scheme). */

:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --field: #fbfcfb;
  --ink: #0d1820;
  --ink-2: #5b6871;
  --line: #e1e7e4;
  --line-strong: #c2ccc7;
  --accent: #2f47ec;
  --accent-ink: #ffffff;
  --accent-soft: #e4e8fd;
  --data: #2f47ec;
  --band: rgba(47, 71, 236, 0.13);
  --good: #0aac23;
  --good-ink: #006c10;
  --warn: #fbb315;
  --warn-ink: #7a4f00;
  --crit: #dc3c3d;
  --crit-ink: #b3261e;
  --grid: #e9eeeb;
  --header-bg: rgba(244, 246, 245, 0.82);
  --shadow: 0 1px 2px rgba(13, 24, 32, 0.05), 0 12px 32px -12px rgba(13, 24, 32, 0.14);
  --glow: none;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a0f13;
    --surface: #11181e;
    --field: #0d1419;
    --ink: #e9efeb;
    --ink-2: #8e9ca4;
    --line: #1d2830;
    --line-strong: #33424c;
    --accent: #8a9bff;
    --accent-ink: #0a0f13;
    --accent-soft: #1a2350;
    --data: #8a9bff;
    --band: rgba(138, 155, 255, 0.17);
    --good: #0aac23;
    --good-ink: #53c556;
    --warn: #fbb315;
    --warn-ink: #fbb315;
    --crit: #dc3c3d;
    --crit-ink: #f07b7b;
    --grid: #182229;
    --header-bg: rgba(10, 15, 19, 0.78);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
    --glow: drop-shadow(0 0 18px rgba(138, 155, 255, 0.45));
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  max-width: 14ch;
}

h2 {
  font-size: 1.45rem;
  font-weight: 750;
}

h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-top: 2.5rem;
}

p {
  margin: 0 0 1em;
}

code {
  font-size: 0.92em;
}

.wrap {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.wrap.wide {
  max-width: 62rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  z-index: 50;
}

.skip:focus {
  top: 0.75rem;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.12rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.wordmark b {
  font-weight: 800;
}

.glyph {
  width: 1.85rem;
  height: 0.95rem;
  color: var(--ink);
  flex: none;
}

.glyph-fill {
  fill: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: var(--r-s);
}

.site-nav a:hover {
  background: var(--line);
}

.site-nav a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--ink);
}

.lang-switch {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.site-nav .nav-cta {
  background: var(--ink);
  color: var(--bg);
  font-weight: 650;
  margin-left: 0.35rem;
}

.site-nav .nav-cta:hover {
  background: var(--ink);
  opacity: 0.88;
}

@media (max-width: 30rem) {
  .wordmark span,
  .site-nav .nav-cta {
    display: none;
  }
}

main {
  padding-bottom: 5rem;
  min-height: 60vh;
}

/* ---------------------------------------------------------------- hero */
.hero {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6.5rem) 1.25rem clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 50rem) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.lede {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--ink-2);
  max-width: 34rem;
  margin-top: 1.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-cell {
  margin: 0;
}

.hero-cell svg {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: auto;
  overflow: visible;
}

.cell-shell {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 6;
}

.cell-nub {
  fill: var(--ink);
}

.cell-fill {
  fill: var(--accent);
  filter: var(--glow);
  transform-box: fill-box;
  transform-origin: left center;
  animation: charge 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

@keyframes charge {
  from {
    transform: scaleX(0);
  }
}

.hero-cell figcaption {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
}

.cell-value {
  font-size: clamp(3rem, 7vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

.cell-value small {
  font-size: 0.45em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-2);
  margin-left: 0.1em;
}

.cell-label {
  color: var(--ink-2);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

/* ---------------------------------------------------------------- form */
.check {
  scroll-margin-top: 5rem;
}

.where {
  margin: 0 0 1.25rem;
  background: var(--accent-soft);
  border-radius: var(--r-m);
  padding: 0.85rem 1.1rem;
}

.where summary {
  cursor: pointer;
  font-weight: 650;
}

.where p {
  margin: 0.6rem 0 0.15rem;
  color: var(--ink);
}

.battery-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
  padding: 0.5rem clamp(1.1rem, 4vw, 2.25rem) 2rem;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.step {
  padding: 1.75rem 0 0.75rem;
  border-bottom: 1px solid var(--line);
}

.step:last-child {
  border-bottom: 0;
}

.step > legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  padding: 0;
  margin-bottom: 1.25rem;
  float: left;
  width: 100%;
}

.step > legend + * {
  clear: both;
}

.step-no {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 800;
}

.opt {
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--ink-2);
  letter-spacing: 0;
}

.field {
  margin: 0 0 1.4rem;
}

.field > legend,
.field label,
.field-inline label {
  display: block;
  font-weight: 650;
  font-size: 0.98rem;
  margin-bottom: 0.45rem;
  padding: 0;
}

.field-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 34rem) {
  .field-inline {
    grid-template-columns: 1fr;
  }
}

select,
input[type='text'],
input[type='number'],
input[type='month'] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-s);
  padding: 0.65rem 0.8rem;
  min-height: 3rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select:focus,
input[type='text']:focus,
input[type='number']:focus,
input[type='month']:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

[aria-invalid='true'] {
  border-color: var(--crit) !important;
}

.unit-input {
  position: relative;
}

.unit-input input {
  padding-right: 2.4rem;
  font-size: 1.3rem;
  font-weight: 750;
}

.unit-input span {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-2);
  font-weight: 700;
  pointer-events: none;
}

.hint {
  font-size: 0.88rem;
  color: var(--ink-2);
  margin: 0.45rem 0 0;
}

.field-error {
  color: var(--crit-ink);
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0.45rem 0 0;
}

/* segmented control */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--field);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-m);
  max-width: 100%;
}

.seg {
  position: relative;
  margin: 0 !important;
  font-weight: 550 !important;
  font-size: 0.97rem !important;
}

.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.seg span {
  display: inline-block;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.3;
  transition: background 0.15s, color 0.15s;
}

.seg:hover span {
  background: var(--line);
}

.seg input:checked + span {
  background: var(--ink);
  color: var(--bg);
}

.seg input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.checkbox {
  display: flex !important;
  gap: 0.75rem;
  align-items: flex-start;
  font-weight: 400 !important;
  cursor: pointer;
}

.checkbox input {
  width: 1.3rem;
  height: 1.3rem;
  margin: 0.15rem 0 0;
  flex: none;
  accent-color: var(--accent);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pow {
  font-size: 0.86rem;
  color: var(--ink-2);
  padding-left: 1.4rem;
  position: relative;
  margin-top: 0.5rem;
}

.pow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.pow.pow-ready::before {
  animation: none;
  border-color: var(--good);
  background: var(--good);
}

.pow.pow-failed::before {
  animation: none;
  border-color: var(--crit);
  background: var(--crit);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-error {
  color: var(--crit-ink);
  font-weight: 650;
}

/* ---------------------------------------------------------------- buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1.5px solid var(--accent);
  border-radius: var(--r-s);
  padding: 0.75rem 1.35rem;
  cursor: pointer;
  text-decoration: none;
  min-height: 3rem;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
}

.button:hover {
  opacity: 0.9;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.battery-form .button[type='submit'] {
  width: 100%;
  font-size: 1.08rem;
  min-height: 3.4rem;
  margin-top: 0.5rem;
}

.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button-quiet:hover {
  background: var(--surface);
  opacity: 1;
}

.button-danger {
  background: transparent;
  color: var(--crit-ink);
  border-color: var(--crit);
}

.button-small {
  font-size: 0.82rem;
  padding: 0.25rem 0.6rem;
  min-height: 0;
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button-small.button-danger {
  color: var(--crit-ink);
  border-color: var(--crit);
}

.button-link {
  font: inherit;
  font-size: 0.95rem;
  background: none;
  border: 0;
  padding: 0.5rem 0.25rem;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.js-hidden {
  display: none;
}

.notice {
  background: var(--accent-soft);
  border-radius: var(--r-s);
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
}

.notice-warning {
  background: color-mix(in srgb, var(--warn) 22%, var(--surface));
}

/* ---------------------------------------------------------------- trust */
.trust {
  margin-top: 3.5rem;
}

.trust h2 {
  font-size: 1.15rem;
}

.trust ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trust li {
  padding: 0.75rem 0 0.75rem 2.1rem;
  border-top: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
}

.trust li::before {
  content: '';
  position: absolute;
  left: 0.15rem;
  top: 1.2rem;
  width: 1.1rem;
  height: 0.6rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: inset 0.45rem 0 0 var(--accent);
}

/* ---------------------------------------------------------------- result */
.result {
  padding-top: clamp(2.5rem, 7vw, 4.5rem);
}

.result:focus {
  outline: none;
}

.result-model {
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--ink-2);
  margin: 0;
}

.big-number {
  margin: 0;
  font-size: clamp(5.5rem, 22vw, 10rem);
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.big-number .unit {
  font-size: 0.4em;
  font-weight: 700;
  letter-spacing: 0;
  margin-left: 0.08em;
  color: var(--ink-2);
}

.big-label {
  margin: 0.4rem 0 1.5rem;
  color: var(--ink-2);
}

.gauge {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
  margin-bottom: 0.5rem;
  overflow: visible;
}

.g-shell {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 5;
}

.g-nub {
  fill: var(--ink);
}

.g-fill {
  transform-box: fill-box;
  transform-origin: left center;
  animation: charge 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.g-fill.g-good {
  fill: var(--good);
}

.g-fill.g-warning {
  fill: var(--warn);
}

.g-fill.g-critical {
  fill: var(--crit);
}

.g-threshold {
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-dasharray: 6 5;
}

.g-threshold-label {
  fill: var(--ink-2);
  font-size: 22px;
  font-family: var(--font);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.4rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  margin: 0.75rem 0 1rem;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
}

.status-good .status-icon {
  background: var(--good);
}

.status-warning .status-icon {
  background: var(--warn);
  color: #0b0b0b;
}

.status-critical .status-icon {
  background: var(--crit);
}

.status-good {
  color: var(--good-ink);
}

.status-warning {
  color: var(--warn-ink);
}

.status-critical {
  color: var(--crit-ink);
}

.reasons p {
  max-width: 38rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1px;
  margin: 2rem 0 1rem;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}

.facts div {
  padding: 0.85rem 1rem;
  background: var(--surface);
}

.facts dt {
  font-size: 0.82rem;
  color: var(--ink-2);
}

.facts dd {
  margin: 0.15rem 0 0;
  font-weight: 700;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}

.message {
  padding-top: 4rem;
}

/* ---------------------------------------------------------------- ads */
.ad-slot {
  margin: 2.5rem 0 0;
  min-height: 6rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-m);
  position: relative;
  padding-top: 1.5rem;
}

.ad-slot[hidden] {
  display: none;
}

.ad-slot::before {
  content: attr(data-label);
  position: absolute;
  top: 0.4rem;
  left: 0.75rem;
  font-size: 0.75rem;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- stats */
.page-head {
  padding-top: clamp(2.5rem, 7vw, 4.5rem);
}

.page-head h1 {
  max-width: 18ch;
}

.model-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1.75rem 0 2.25rem;
}

.model-picker label {
  font-weight: 650;
}

.model-picker select {
  width: auto;
  min-width: 17rem;
}

.stats-body h2 {
  margin-top: 0.5rem;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1px;
  margin: 1rem 0 1.5rem;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}

.kpis div {
  padding: 1rem 1.1rem;
  background: var(--surface);
}

.kpis dt {
  font-size: 0.85rem;
  color: var(--ink-2);
}

.kpis dd {
  margin: 0.2rem 0 0;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpis dd small {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0;
}

.chart-desc {
  color: var(--ink-2);
  font-size: 0.95rem;
  max-width: 42rem;
}

.chart-figure {
  margin: 0 0 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 1.1rem 0.85rem 0.6rem;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font);
}

.c-grid {
  stroke: var(--grid);
  stroke-width: 1;
}

.c-axis,
.c-tickmark {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.c-tick,
.c-axis-label {
  fill: var(--ink-2);
  font-size: 12px;
}

.c-dot {
  fill: var(--data);
  fill-opacity: 0.45;
  stroke: var(--surface);
  stroke-width: 1.5;
}

.c-dot:hover {
  fill-opacity: 1;
}

.c-band {
  fill: var(--band);
}

.c-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.c-line-dot {
  fill: var(--ink);
  stroke: var(--surface);
  stroke-width: 2;
}

.c-ref {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-dasharray: 7 6;
}

.c-threshold {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  padding: 0.5rem 0.25rem 0.25rem;
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.key {
  display: inline-block;
}

.key-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--data);
  opacity: 0.6;
}

.key-line {
  width: 1.4rem;
  height: 3px;
  background: var(--ink);
}

.key-band {
  width: 1.2rem;
  height: 0.8rem;
  background: var(--band);
  border-radius: 2px;
}

.key-ref {
  width: 1.4rem;
  border-top: 2px dashed var(--ink);
}

figcaption .hint {
  padding: 0 0.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-weight: 600;
  color: var(--ink-2);
  font-size: 0.85rem;
  border-bottom-color: var(--line-strong);
}

.num {
  text-align: right;
}

.overview td a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.overview td a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.cap-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: flex-end;
}

.cap-num {
  display: inline-block;
  min-width: 3.4em;
  text-align: right;
}

.minibar {
  width: 5.5rem;
  height: 0.5rem;
}

.minibar .mb-track {
  fill: var(--grid);
}

.minibar .mb-fill {
  fill: var(--data);
}

@media (max-width: 34rem) {
  .minibar,
  .overview .col-age {
    display: none;
  }
}

.table-view {
  margin: 0 0 1rem;
}

.table-view summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.95rem;
}

.table-view table {
  margin-top: 0.75rem;
}

.empty {
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- legal */
.legal {
  padding-top: clamp(2.5rem, 7vw, 4.5rem);
}

.legal h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.legal h2 {
  font-size: 1.12rem;
  margin-top: 2.25rem;
}

.legal ul {
  padding-left: 1.2rem;
}

.legal li {
  margin-bottom: 0.4rem;
}

/* ---------------------------------------------------------------- consent */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  pointer-events: none;
}

.consent[hidden] {
  display: none;
}

.consent-inner {
  pointer-events: auto;
  max-width: 40rem;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow), 0 24px 60px -20px rgba(0, 0, 0, 0.35);
  padding: 1.25rem 1.35rem 1.1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  font-size: 0.95rem;
}

.consent h2 {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.consent-actions .button-link {
  grid-column: 1 / -1;
  justify-self: center;
}

/* Both choices look exactly the same: no nudging. */
.button-equal {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  min-height: 2.9rem;
}

.consent-settings {
  border-top: 1px solid var(--line);
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}

.consent-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.consent-row p {
  margin: 0.2rem 0 0;
  color: var(--ink-2);
  font-size: 0.88rem;
}

.consent-always {
  font-size: 0.82rem;
  color: var(--ink-2);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.consent-settings .button {
  margin-top: 0.75rem;
  width: 100%;
}

.switch {
  position: relative;
  flex: none;
  width: 2.9rem;
  height: 1.7rem;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.15s;
}

.switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.7rem - 6px);
  height: calc(1.7rem - 6px);
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(1.2rem);
}

.switch input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- admin */
.table-scroll {
  overflow-x: auto;
}

.admin {
  padding-top: 2.5rem;
}

.admin-table td,
.admin-table th {
  white-space: nowrap;
  font-size: 0.86rem;
}

.row-flag td {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}

.admin-actions {
  display: flex;
  gap: 0.3rem;
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.footer-inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.wordmark-small {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.wordmark-small span {
  display: inline !important;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

.footer-links a {
  color: var(--ink);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.fine {
  font-size: 0.8rem;
  max-width: 44rem;
  margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pow::before,
  .cell-fill,
  .g-fill {
    animation: none;
  }
}

@media (forced-colors: active) {
  .g-fill,
  .cell-fill,
  .c-dot,
  .key-dot {
    fill: CanvasText;
    background: CanvasText;
  }
}
