/*
VOICE   Studio serio e ordinato, come un buon codice commentato: calmo, preciso, mai giocoso.
IDEA    Il codice rilegato: copertina in tela bordeaux, unghiature colorate per anno, articoli numerati con §.
PICTURE La copertina in testa a ogni sezione e le unghiature colorate che separano gli anni di corso.
COLOUR  Carta bianca e inchiostro blu-nero; bordeaux dominante; un colore per ciascun anno; verde e rosso solo per corretta ed errata.
TYPE    Newsreader per titoli e testo delle domande; Atkinson Hyperlegible per interfaccia e spiegazioni.
LAYOUT  Telefono: colonna unica con barra in basso. Da 960px: barra laterale e contenuto fino a 1120px.
*/

/* ---------- Token ---------- */
:root {
  color-scheme: light;
  --bg: #FCFCFA;
  --surface: #FFFFFF;
  --sunken: #F2F2EE;
  --ink: #1B2130;
  --ink-2: #464D5E;
  --muted: #697083;
  --line: #E2E2DC;
  --line-2: #CFCFC7;
  --brand: #8C1D2F;
  --brand-deep: #6F1524;
  --brand-text: #8C1D2F;
  --on-brand: #FFFFFF;
  --ok: #1D7347;
  --ok-bg: #E6F2EB;
  --bad: #B3261E;
  --bad-bg: #FBEAE7;
  --warn: #8A5A00;
  --focus: #2F5DA8;
  --shadow: 0 1px 2px rgba(27, 33, 48, .06), 0 6px 20px rgba(27, 33, 48, .06);
  --heat-0: #EEEDE8; --heat-1: #E8C3C8; --heat-2: #CF8592; --heat-3: #AE4357; --heat-4: #7C1728;

  --y1: #8C1D2F; --y2: #24477A; --y3: #2E6B53; --y4: #9A6416; --y5: #553C7B; --y0: #4A5163;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Atkinson Hyperlegible", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;

  --fs-s: 13px;
  --fs-b: 16px;
  --fs-m: 20px;
  --fs-l: clamp(30px, 7vw, 42px);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --pad: max(16px, var(--sal));
  --padr: max(16px, var(--sar));
  --tabbar-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101318; --surface: #171B22; --sunken: #0C0E12;
    --ink: #ECEAE5; --ink-2: #C2C4CB; --muted: #9297A3;
    --line: #2A2F39; --line-2: #3A404C;
    --brand: #6A1423; --brand-deep: #4E0E19; --brand-text: #EE9AA6; --on-brand: #FFFFFF;
    --ok: #63C893; --ok-bg: #14281D; --bad: #F2847A; --bad-bg: #321719; --warn: #E2B45C;
    --focus: #8DB4F5;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --heat-0: #1E232B; --heat-1: #4A2129; --heat-2: #7C2E3D; --heat-3: #B44D61; --heat-4: #E98C9C;
    --y1: #6A1423; --y2: #1E3B66; --y3: #255A45; --y4: #7A4F10; --y5: #463166; --y0: #3A404C;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101318; --surface: #171B22; --sunken: #0C0E12;
  --ink: #ECEAE5; --ink-2: #C2C4CB; --muted: #9297A3;
  --line: #2A2F39; --line-2: #3A404C;
  --brand: #6A1423; --brand-deep: #4E0E19; --brand-text: #EE9AA6; --on-brand: #FFFFFF;
  --ok: #63C893; --ok-bg: #14281D; --bad: #F2847A; --bad-bg: #321719; --warn: #E2B45C;
  --focus: #8DB4F5;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --heat-0: #1E232B; --heat-1: #4A2129; --heat-2: #7C2E3D; --heat-3: #B44D61; --heat-4: #E98C9C;
  --y1: #6A1423; --y2: #1E3B66; --y3: #255A45; --y4: #7A4F10; --y5: #463166; --y0: #3A404C;
}

/* Colore dell'anno: --yc pieno, --yc-text per testo su fondo chiaro/scuro, --yc-soft tinta leggera */
.y1 { --yc: var(--y1); --yc-text: #8C1D2F; --yc-soft: #F6E8EA; }
.y2 { --yc: var(--y2); --yc-text: #24477A; --yc-soft: #E7EDF6; }
.y3 { --yc: var(--y3); --yc-text: #2E6B53; --yc-soft: #E5F0EB; }
.y4 { --yc: var(--y4); --yc-text: #8A5912; --yc-soft: #F6EEDF; }
.y5 { --yc: var(--y5); --yc-text: #553C7B; --yc-soft: #EEE9F5; }
.y0 { --yc: var(--y0); --yc-text: #4A5163; --yc-soft: #ECEDEF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .y1 { --yc-text: #EE9AA6; --yc-soft: #2A161B; }
  :root:not([data-theme="light"]) .y2 { --yc-text: #9BB9E8; --yc-soft: #141E2E; }
  :root:not([data-theme="light"]) .y3 { --yc-text: #8FD0B3; --yc-soft: #13231C; }
  :root:not([data-theme="light"]) .y4 { --yc-text: #E5BD78; --yc-soft: #2A2012; }
  :root:not([data-theme="light"]) .y5 { --yc-text: #C4AEEA; --yc-soft: #201A2C; }
  :root:not([data-theme="light"]) .y0 { --yc-text: #C2C4CB; --yc-soft: #1D2128; }
}
:root[data-theme="dark"] .y1 { --yc-text: #EE9AA6; --yc-soft: #2A161B; }
:root[data-theme="dark"] .y2 { --yc-text: #9BB9E8; --yc-soft: #141E2E; }
:root[data-theme="dark"] .y3 { --yc-text: #8FD0B3; --yc-soft: #13231C; }
:root[data-theme="dark"] .y4 { --yc-text: #E5BD78; --yc-soft: #2A2012; }
:root[data-theme="dark"] .y5 { --yc-text: #C4AEEA; --yc-soft: #201A2C; }
:root[data-theme="dark"] .y0 { --yc-text: #C2C4CB; --yc-soft: #1D2128; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: var(--fs-b)/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic .fill, .ic.fill { fill: currentColor; stroke: none; }
#i-stars .fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-s); }

/* ---------- Layout ---------- */
.app { min-height: 100dvh; }
.main { min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--sab) + 24px); outline: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--padr) 0 var(--pad); }
.sidebar { display: none; }

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, var(--sar)) calc(6px + var(--sab)) max(8px, var(--sal));
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .tabbar { background: var(--surface); } }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 46px; justify-content: center;
  text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; border-radius: 10px;
}
.tab[aria-current="page"] { color: var(--brand-text); }
.tab .ic { width: 24px; height: 24px; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .tabbar { display: none; }
  .main { padding-bottom: 48px; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
    padding: 28px 16px 20px; border-right: 1px solid var(--line); background: var(--surface);
  }
  .side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 24px/1 var(--serif); padding: 0 10px 24px; }
  .mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: var(--on-brand); font: 500 22px/1 var(--serif); }
  .side-nav { display: grid; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 700; }
  .side-nav a:hover { background: var(--sunken); }
  .side-nav a[aria-current="page"] { background: var(--sunken); color: var(--brand-text); }
  .side-foot { margin-top: auto; padding: 0 10px; font-size: var(--fs-s); color: var(--muted); }
}

/* ---------- Copertina ---------- */
.cover {
  background: var(--yc, var(--brand)); color: var(--on-brand);
  padding: calc(var(--sat) + 18px) var(--padr) 26px var(--pad);
  position: relative;
}
.cover::after { /* bordo della tela */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,0)); transform: translateY(100%); pointer-events: none;
}
.cover-in { max-width: 1120px; margin: 0 auto; }
.cover .brand { display: flex; align-items: center; gap: 8px; font: 600 15px/1 var(--serif); opacity: .9; margin-bottom: 18px; }
.cover .brand .sec { font-size: 18px; }
.cover h1 { font-size: var(--fs-l); line-height: 1.05; letter-spacing: -.01em; }
.cover .sub { margin-top: 8px; opacity: .86; max-width: 60ch; }
.cover-meter { margin-top: 20px; display: grid; gap: 8px; max-width: 420px; }
.cover-meter .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cover-meter strong { font: 500 26px/1 var(--serif); }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: #fff; }
.backlink {
  display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 14px -8px; padding: 6px 10px 6px 4px;
  color: inherit; text-decoration: none; font-weight: 700; border-radius: 10px; min-height: 40px;
}
.backlink:hover { background: rgba(255,255,255,.12); }
.subj-head { display: flex; gap: 14px; align-items: flex-start; }
.subj-head .big-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.14); flex: none; }
.subj-head .big-ic .ic { width: 30px; height: 30px; stroke-width: 1.4; }
.subj-head h1 { font-size: clamp(26px, 6.4vw, 38px); line-height: 1.08; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; opacity: .9; font-size: 15px; }

/* ---------- Unghiature (anni) ---------- */
.thumbs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 16px var(--padr) 2px var(--pad); max-width: 1120px; margin: 0 auto;
  scroll-snap-type: x proximity;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  flex: none; scroll-snap-align: start; min-height: 44px; min-width: 52px; padding: 0 14px;
  border: 1px solid var(--line); border-top: 5px solid var(--yc); border-radius: 4px 4px 12px 12px;
  background: var(--surface); color: var(--ink-2); font: 600 17px/1 var(--serif);
}
.thumb.all { border-top-color: var(--line-2); font-family: var(--sans); font-size: 15px; font-weight: 700; }
.thumb[aria-selected="true"] { background: var(--yc, var(--ink)); border-color: var(--yc, var(--ink)); color: #fff; }
.thumb.all[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Elenco materie ---------- */
.year { margin-top: 26px; }
.year-h { display: flex; align-items: baseline; gap: 10px; padding: 0 2px 10px; border-bottom: 1px solid var(--line); }
.year-h h2 { font-size: 24px; color: var(--yc-text); }
.year-h .roman { font-weight: 600; }
.year-h p { color: var(--muted); font-size: var(--fs-s); margin-left: auto; text-align: right; }
.subjects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 720px) { .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } }
@media (min-width: 1280px) { .subjects { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.subj {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 12px 4px; min-height: 72px; text-decoration: none; border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.subj:hover .subj-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.subj-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--yc-soft); color: var(--yc-text); position: relative; }
.subj-ic::before { content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--yc); }
.subj-name { display: block; font-weight: 700; line-height: 1.3; }
.subj-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: var(--fs-s); margin-top: 2px; }
.subj-end { display: flex; align-items: center; color: var(--muted); }
.ring { flex: none; width: 42px; height: 42px; position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring .trk { fill: none; stroke: var(--line); stroke-width: 3.5; }
.ring .val { fill: none; stroke: var(--yc, var(--brand)); stroke-width: 3.5; stroke-linecap: round; }
.ring b { font: 700 12px/1 var(--sans); color: var(--ink); }
.add-row { display: flex; align-items: center; gap: 10px; padding: 14px 4px; min-height: 56px; width: 100%; border: 0; background: none; color: var(--brand-text); font-weight: 700; text-align: left; border-bottom: 1px dashed var(--line-2); }

/* ---------- Banner ---------- */
.banner {
  display: flex; gap: 12px; align-items: center; margin: 16px auto 0; max-width: 1120px;
  padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.banner-wrap { padding: 0 var(--padr) 0 var(--pad); }
.banner .grow { flex: 1; }
.banner strong { display: block; }
.banner .grow > span { display: block; line-height: 1.4; margin-top: 2px; }
.banner .ic { color: var(--brand-text); }

/* ---------- Bottoni e controlli ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--sunken); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 15px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn .ic { width: 20px; height: 20px; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: inherit; }
.iconbtn:hover { background: var(--sunken); }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }

.field { margin-top: 22px; }
.field > .lbl { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; margin-bottom: 10px; }
.field > .lbl .aux { font-weight: 400; color: var(--muted); font-size: var(--fs-s); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; min-width: 56px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 700;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.chip.area { font-weight: 400; min-width: 0; }
.chip.area[aria-pressed="true"] { font-weight: 700; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--sunken); border-radius: 13px; }
.seg button { min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 700; line-height: 1.15; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg button:disabled { opacity: .4; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .t { display: block; font-weight: 700; }
.switch-row .d { display: block; font-size: var(--fs-s); color: var(--muted); }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--line-2); position: relative; margin: 0; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- Schede (tab interne materia) ---------- */
.sbar { position: fixed; z-index: 35; top: 0; left: 0; right: 0; height: var(--sat); background: var(--brand); pointer-events: none; }
.subtabs-wrap { position: sticky; top: var(--sat); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.subtabs { display: flex; gap: 4px; max-width: 1120px; margin: 0 auto; padding: 8px var(--padr) 8px var(--pad); overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: 1 0 auto; min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.subtabs button .ic { width: 19px; height: 19px; }
.subtabs button[aria-selected="true"] { background: var(--yc-soft); color: var(--yc-text); }
@media (max-width: 559px) {
  .subtabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding-top: 6px; padding-bottom: 6px; }
  .subtabs button { flex-direction: column; gap: 2px; min-height: 52px; padding: 4px 2px; font-size: 13px; }
}

.panel { max-width: 1120px; margin: 0 auto; padding: 8px var(--padr) 0 var(--pad); }
.cols { display: grid; gap: 0 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1040px) { .cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.section { margin-top: 28px; }
.section > h2, .section-h { font-size: 22px; line-height: 1.2; margin-bottom: 4px; }
.section > .lead { color: var(--muted); margin-bottom: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; }
.card.pad { padding: 16px; }

.startbar { position: sticky; bottom: calc(var(--tabbar-h) + var(--sab) + 8px); margin-top: 24px; z-index: 5; }
@media (min-width: 960px) { .startbar { bottom: 16px; } }
.startbar .btn { width: 100%; min-height: 54px; font-size: 17px; box-shadow: var(--shadow); }
.pool { margin-top: 10px; font-size: var(--fs-s); color: var(--muted); }

/* ---------- Vuoti ---------- */
.empty { text-align: center; padding: 40px 16px; max-width: 440px; margin: 0 auto; }
.empty .ic { width: 44px; height: 44px; color: var(--yc-text, var(--muted)); stroke-width: 1.3; }
.empty h3 { font-size: 22px; margin: 12px 0 6px; }
.empty p { color: var(--muted); margin-bottom: 18px; }

/* ---------- Liste ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 60px; }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; }
.li .t { font-weight: 700; display: block; overflow-wrap: anywhere; }
.li .d { font-size: var(--fs-s); color: var(--muted); display: block; }
.li .score { font: 500 22px/1 var(--serif); }
.li-link { text-decoration: none; color: inherit; width: 100%; background: none; border: 0; text-align: left; padding: 0; display: flex; align-items: center; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--sunken); font-size: var(--fs-s); color: var(--ink-2); white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; }

/* ---------- Statistiche ---------- */
.overall { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.overall .pct { font: 500 clamp(52px, 14vw, 72px)/.9 var(--serif); letter-spacing: -.02em; }
.overall .pct small { font-size: .45em; }
.overall p { color: var(--ink-2); }
.meter { height: 8px; border-radius: 4px; background: var(--sunken); position: relative; margin-top: 10px; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--yc, var(--brand)); }
.meter > .thr { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; border-radius: 1px; }
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 18px; }
@media (min-width: 640px) { .figs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fig-cell { background: var(--surface); padding: 14px 16px; }
.fig-cell b { display: block; font: 500 26px/1.1 var(--serif); white-space: nowrap; }
.fig-cell span { font-size: var(--fs-s); color: var(--muted); }

.areas { display: grid; gap: 14px; }
.area-row .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.area-row .name { font-weight: 700; }
.area-row .v { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 15px; }
.area-row .sub { font-size: var(--fs-s); color: var(--muted); }
.track { height: 8px; border-radius: 4px; background: var(--sunken); position: relative; margin-top: 6px; }
.track > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--yc, var(--brand)); min-width: 4px; }
.track > .thr { position: absolute; left: 60%; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--ink); opacity: .45; }
.legend-thr { display: flex; align-items: center; gap: 8px; font-size: var(--fs-s); color: var(--muted); margin-top: 12px; }
.legend-thr i { width: 2px; height: 14px; background: var(--ink); opacity: .45; border-radius: 1px; }

.duo { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.verdict { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--surface); }
.verdict h3 { display: flex; align-items: center; gap: 8px; font: 700 16px/1.3 var(--sans); margin-bottom: 8px; }
.verdict.weak h3 { color: var(--bad); }
.verdict.strong h3 { color: var(--ok); }
.verdict ol { margin: 0; padding: 0; list-style: none; }
.verdict li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.verdict li:first-child { border-top: 0; }
.verdict li > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.verdict .hint { color: var(--muted); font-size: var(--fs-s); }

.fig { position: relative; height: 220px; margin-top: 8px; }
.fig > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fig .gl { stroke: var(--line); stroke-width: 1; }
.fig .axl { fill: var(--muted); font: 12px var(--sans); }
.fig .thrl { stroke: var(--ink); stroke-opacity: .5; stroke-dasharray: 4 4; }
.fig .ln { fill: none; stroke: var(--yc, var(--brand)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fig .ar { fill: var(--yc, var(--brand)); fill-opacity: .08; }
.fig .pt { fill: var(--yc, var(--brand)); stroke: var(--surface); stroke-width: 2; }
.fig .cross { stroke: var(--ink); stroke-opacity: .35; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: var(--fs-s); line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); }
.tip[hidden] { display: none; }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 14px; height: 14px; border-radius: 3px; background: var(--heat-0); }
.heat i.l1 { background: var(--heat-1); } .heat i.l2 { background: var(--heat-2); } .heat i.l3 { background: var(--heat-3); } .heat i.l4 { background: var(--heat-4); }
.heat i.fut { background: transparent; }
.heat-leg { display: flex; align-items: center; gap: 4px; font-size: var(--fs-s); color: var(--muted); margin-top: 8px; }
.heat-leg i { width: 12px; height: 12px; border-radius: 3px; }

.subjbars .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.subjbars .row:last-child { border-bottom: 0; }
.subjbars .row .track { grid-column: 1 / -1; margin-top: 2px; }

/* ---------- Programma ---------- */
.prog-sum { display: flex; align-items: center; gap: 16px; }
.mod { margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.mod-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px 10px; }
.mod-n { font: 600 22px/1 var(--serif); color: var(--yc-text); min-width: 28px; padding-top: 2px; }
.mod-h h3 { font-size: 19px; line-height: 1.25; }
.mod-h .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; align-items: center; }
.mod .topics { list-style: none; margin: 0; padding: 0 16px 6px; }
.topic { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.topic input { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 1.6px solid var(--line-2); border-radius: 7px; display: grid; place-items: center; cursor: pointer; background: var(--surface); }
.topic input:checked { background: var(--yc); border-color: var(--yc); }
.topic input:checked::after { content: ""; width: 12px; height: 7px; border: 2.2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.topic input:checked + span { color: var(--muted); }
.mod-f { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--sunken); }

/* ---------- Quiz (overlay) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: flex; flex-direction: column; }
.overlay[hidden] { display: none; }
.qtop {
  position: sticky; top: 0; z-index: 3; background: var(--bg);
  padding: calc(var(--sat) + 6px) var(--padr) 0 var(--pad);
}
.qtop-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 8px; min-height: 52px; }
.qtop .ttl { flex: 1; text-align: center; line-height: 1.2; }
.qtop .ttl b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qtop .ttl span { font-size: var(--fs-s); color: var(--muted); }
.timer { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; min-height: 36px; border-radius: 18px; background: var(--sunken); font-weight: 700; font-variant-numeric: tabular-nums; }
.timer .ic { width: 18px; height: 18px; }
.timer.low { background: var(--bad-bg); color: var(--bad); }
.qprog { max-width: 760px; margin: 8px auto 0; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.qprog i { display: block; height: 100%; background: var(--yc, var(--brand)); border-radius: 2px; transition: width .25s; }
.qbody { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 22px var(--padr) 24px var(--pad); }
.qmeta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.qnum { font: 600 22px/1 var(--serif); color: var(--yc-text); }
.qarea { font-size: var(--fs-s); color: var(--muted); }
.qtext { font: 500 clamp(21px, 5.2vw, 26px)/1.32 var(--serif); margin: 12px 0 22px; overflow-wrap: anywhere; }
.opts { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left;
  width: 100%; min-height: 58px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink);
  line-height: 1.4; -webkit-user-select: none; user-select: none;
}
.opt:hover:not(:disabled) { border-color: var(--ink-2); }
.opt-l { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); font-weight: 700; font-size: 15px; }
.opt .ic { width: 22px; height: 22px; stroke-width: 2.2; }
.opt.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt.sel .opt-l { background: var(--ink); color: var(--bg); }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); }
.opt.ok .opt-l { background: var(--ok); color: var(--bg); }
.opt.ok .ic { color: var(--ok); }
.opt.bad { border-color: var(--bad); background: var(--bad-bg); }
.opt.bad .opt-l { background: var(--bad); color: var(--bg); }
.opt.bad .ic { color: var(--bad); }
.opt:disabled { cursor: default; }
.opt:disabled:not(.ok):not(.bad) { opacity: .62; }

.fb { margin-top: 18px; border-radius: 14px; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); }
.fb h3 { display: flex; align-items: center; gap: 8px; font: 700 17px/1.3 var(--sans); }
.fb.ok h3 { color: var(--ok); }
.fb.bad h3 { color: var(--bad); }
.fb .expl { margin-top: 8px; color: var(--ink-2); -webkit-user-select: text; user-select: text; }
.src { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.src .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.src b { color: var(--ink); }
.src a { color: var(--brand-text); text-underline-offset: 2px; overflow-wrap: anywhere; }
.src span { overflow-wrap: anywhere; }

.qbar { position: sticky; bottom: 0; z-index: 3; background: var(--bg); border-top: 1px solid var(--line); padding: 10px var(--padr) calc(10px + var(--sab)) var(--pad); }
.qbar-in { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.qbar .btn { flex: 1; min-height: 52px; }
.qbar .btn.flex0 { flex: 0 0 auto; }
.kbd-hint { display: none; max-width: 760px; margin: 18px auto 0; font-size: var(--fs-s); color: var(--muted); }
@media (hover: hover) and (min-width: 960px) { .kbd-hint { display: block; } }
kbd { font: 700 12px var(--sans); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--surface); }

.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.navgrid button { min-height: 48px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-variant-numeric: tabular-nums; }
.navgrid button.done { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.navgrid button.okc { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.navgrid button.badc { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.navgrid button.cur { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Risultato ---------- */
.ov-sbar { position: sticky; top: 0; z-index: 5; flex: none; height: var(--sat); background: var(--yc, var(--brand)); }
.res-head { background: var(--yc, var(--brand)); color: #fff; padding: 10px var(--padr) 28px var(--pad); }
.res-head .in { max-width: 760px; margin: 0 auto; }
.res-top { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.res-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 8px; }
.score-ring { width: 132px; height: 132px; position: relative; display: grid; place-items: center; }
.score-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-ring .trk { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 9; }
.score-ring .val { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; }
.score-ring b { font: 500 40px/1 var(--serif); }
.score-ring b small { font-size: 20px; }
.res-main h1 { font-size: clamp(26px, 6vw, 34px); line-height: 1.1; }
.res-main p { opacity: .9; margin-top: 6px; }
.res-body { max-width: 760px; margin: 0 auto; padding: 0 var(--padr) 40px var(--pad); width: 100%; }
.tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 20px; }
.tri div { background: var(--surface); padding: 12px 14px; }
.tri b { display: flex; align-items: center; gap: 6px; font: 500 26px/1.1 var(--serif); }
.tri b .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.tri .okc b .ic { color: var(--ok); } .tri .badc b .ic { color: var(--bad); }
.tri span { font-size: var(--fs-s); color: var(--muted); }
.rev { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-top: 10px; }
.rev > summary { list-style: none; display: grid; grid-template-columns: 28px minmax(0, 1fr) 22px; gap: 10px; padding: 12px 14px; cursor: pointer; align-items: start; }
.rev > summary::-webkit-details-marker { display: none; }
.rev > summary .st { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.rev > summary .st .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.rev.okr > summary .st { background: var(--ok-bg); color: var(--ok); }
.rev.badr > summary .st { background: var(--bad-bg); color: var(--bad); }
.rev.skr > summary .st { background: var(--sunken); color: var(--muted); }
.rev > summary .chev { color: var(--muted); transition: transform .2s; margin-top: 2px; }
.rev[open] > summary .chev { transform: rotate(180deg); }
.rev .qtx { font-family: var(--serif); font-size: 17px; line-height: 1.35; }
.rev .qtx small { display: block; font-family: var(--sans); font-size: var(--fs-s); color: var(--muted); margin-bottom: 2px; }
.rev .body { padding: 0 14px 14px 52px; }
.rev .ans { display: grid; gap: 6px; }
.rev .ans p { display: flex; gap: 8px; align-items: flex-start; }
.rev .ans .ic { width: 18px; height: 18px; margin-top: 3px; stroke-width: 2.2; }
.rev .ans .y { color: var(--bad); } .rev .ans .c { color: var(--ok); }
.rev .expl { margin-top: 10px; color: var(--ink-2); }
details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; color: var(--brand-text); font-weight: 700; min-height: 32px; display: flex; align-items: center; }

/* ---------- Foglio modale ---------- */
.backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 18, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px var(--padr) calc(18px + var(--sab)) var(--pad);
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
.sheet .grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.sheet h2 { font-size: 23px; line-height: 1.2; margin-bottom: 6px; }
.sheet .sheet-body { color: var(--ink-2); }
.sheet .sheet-actions { display: grid; gap: 10px; margin-top: 20px; }
.sheet input[type=text], .sheet select, .sheet textarea { width: 100%; min-height: 48px; font-size: 16px; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.sheet label.f { display: block; font-weight: 700; margin: 14px 0 6px; color: var(--ink); }
@media (min-width: 720px) {
  .backdrop { align-items: center; }
  .sheet { border-radius: 20px; padding: 20px 24px 24px; }
  .sheet .grip { display: none; }
}

pre.code { background: var(--sunken); border-radius: 12px; padding: 12px 14px; overflow-x: auto; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink-2); margin: 10px 0 0; }

.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(var(--tabbar-h) + var(--sab) + 16px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 24px; } }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--sunken); color: var(--ink-2); font-size: 15px; margin-top: 14px; }
.note .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--muted); }

.dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Simulazione d'esame ---------- */
.exam-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; border: 1px solid var(--line); border-left: 4px solid var(--yc, var(--brand)); background: var(--surface); }
.exam-card + .exam-card { margin-top: 10px; }
.exam-card h3 { font-size: 19px; line-height: 1.25; margin-bottom: 4px; }
.exam-card .btn { flex: 0 0 auto; }
@media (max-width: 560px) { .exam-card .btn { width: 100%; } }
.score small { font-size: 14px; }
.score-ring b.pts { display: grid; text-align: center; font-size: 30px; line-height: 1; }
.score-ring b.pts small { font: 13px var(--sans); opacity: .85; margin-top: 4px; }

/* ---------- Domande aperte, calcoli, completamenti ---------- */
.qmeta .pill { font-size: 12.5px; }
.lbl-ta { display: block; font-weight: 700; margin: 4px 0 8px; }
.ta { width: 100%; min-height: 150px; resize: vertical; font: 17px/1.5 var(--sans); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 14px; padding: 12px 14px; }
.ta:focus, .inp:focus, .blank:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.ta[readonly] { background: var(--sunken); color: var(--ink-2); }
.numrow { display: flex; align-items: center; gap: 10px; }
.inp { width: 100%; max-width: 260px; min-height: 52px; font: 700 20px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 12px; padding: 0 14px; }
.inp.ok, .blank.ok { border-color: var(--ok); background: var(--ok-bg); }
.inp.bad, .blank.bad { border-color: var(--bad); background: var(--bad-bg); }
.unit { color: var(--muted); font-weight: 700; }
.qtext.cloze { line-height: 1.9; }
.blank { display: inline-block; width: 9.5em; max-width: 100%; min-height: 40px; margin: 0 4px; padding: 0 10px; vertical-align: baseline; font: 600 18px var(--sans); color: var(--ink); background: var(--surface); border: 1.5px dashed var(--line-2); border-radius: 10px; }
.blank:disabled { opacity: 1; color: var(--ink); }
.fb.sol { border-color: var(--yc, var(--line)); }
.fb.sol h3 { color: var(--yc-text, var(--ink)); }
.graph-wrap { margin: 10px 0 4px; padding: 8px; background: var(--sunken); border-radius: 12px; }
.graph { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.graph .g-ax { fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
.graph .g-c1 { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.graph .g-c2 { fill: none; stroke: var(--yc, var(--brand)); stroke-width: 2.4; }
.graph .g-new { stroke-dasharray: 7 5; }
.graph .g-dash { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; }
.graph .g-arrow { fill: none; stroke: var(--yc, var(--brand)); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.graph .g-pt { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.graph .g-lb { fill: var(--ink); font: 700 13px var(--sans); }
.graph .g-sm { fill: var(--ink-2); font: 12px var(--sans); }
.kp { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.kp-h { font-weight: 700; font-size: 15px; color: var(--ink); }
.kp-list { list-style: none; margin: 6px 0 0; padding: 0; }
.kp-list .topic { border-top: 0; padding: 8px 0; }
.kp-score { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.kp-score b { color: var(--ink); font-size: 17px; }
.myans { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--line-2); background: var(--sunken); border-radius: 0 10px 10px 0; white-space: pre-wrap; color: var(--ink-2); font-size: 15px; }
.myans b { display: block; color: var(--ink); margin-bottom: 4px; }
.sol-box { margin-top: 12px; }
.rev.pnr > summary .st { background: var(--sunken); color: var(--warn); }
.rev > summary { grid-template-columns: 28px minmax(0, 1fr) auto; }
.rev-end { display: flex; align-items: flex-start; gap: 6px; }
.rev-pts { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; padding-top: 3px; font-variant-numeric: tabular-nums; }

/* Vetro smerigliato dove color-mix è supportato */
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .subtabs-wrap { background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .qbar { background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}

/* ---------- Accesso (versione con server) ---------- */
.gate { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; place-items: center; overflow-y: auto;
  padding: calc(env(safe-area-inset-top) + 24px) calc(env(safe-area-inset-right) + 24px) calc(env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + 24px); }
.gate-in { width: 100%; max-width: 380px; }
.gate-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--brand); color: var(--on-brand); font: 500 34px/1 var(--serif); }
.gate h1 { font: 500 40px/1.1 var(--serif); margin: 20px 0 8px; letter-spacing: -0.01em; }
.gate-sub { color: var(--ink-2); margin: 0 0 26px; line-height: 1.5; }
.gate label.f { display: block; font-weight: 700; margin: 0 0 6px; }
.gate input { width: 100%; min-height: 50px; font-size: 17px; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; background: var(--surface, var(--bg)); color: var(--ink); margin-bottom: 14px; }
.gate input:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; border-color: var(--brand); }
.gate-err { color: var(--bad, #B3261E); min-height: 1.4em; margin: 12px 0 0; font-weight: 600; }
.note.sync-ok .ic { color: var(--ok); }
.note.sync-error .ic, .note.sync-login .ic { color: var(--warn, #A35A00); }
.sheet-link { color: inherit; text-decoration: none; display: block; }
