/* =========================================================
   Vertek B2B — foglio di stile unico
   I colori arrivano dal pannello: qui restano solo i valori
   di ripiego, usati dall'installer e dalle pagine di errore.
   ========================================================= */

:root {
  --ink: #15191E;
  --paper: #F4F3EF;
  --surface: #FFFFFF;
  --signal: #E34D18;
  --steel: #5A6A7C;
  --hiviz: #D8E23F;
  --radius: 2px;
  --font-display: 'Barlow Condensed', 'Oswald', Impact, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 28%, transparent);
  --muted: color-mix(in srgb, var(--ink) 58%, transparent);
  --shade: color-mix(in srgb, var(--ink) 4%, var(--surface));
  --ok: #2F7D4F;
  --ko: #B3261E;
  --warn: #B47407;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.04;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; max-width: 72ch; }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

.wrap { width: min(1240px, 92vw); margin-inline: auto; }
.narrow { width: min(760px, 92vw); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section + .section { padding-top: 0; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .85em; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- barra alta visibilità: elemento identitario ---------- */
.hiviz {
  height: 10px;
  background: repeating-linear-gradient(115deg,
    var(--hiviz) 0 22px, var(--ink) 22px 44px);
}

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}
.header-row {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 72px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; flex: 0 0 auto; }
.brand img { height: 38px; width: auto; }
.brand-name {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 700;
  letter-spacing: .02em; line-height: 1;
}
.brand-claim { font-size: .7rem; color: var(--muted); line-height: 1.2; max-width: 20ch; }

.nav { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.nav a {
  text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.on { border-bottom-color: var(--signal); }

.header-actions { display: flex; gap: .6rem; align-items: center; }

.searchbox { position: relative; flex: 1 1 260px; max-width: 320px; }
.searchbox input {
  width: 100%; padding: .55rem .8rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--shade); font: inherit; font-size: .9rem;
}
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 70;
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px -24px rgba(0,0,0,.5); display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: flex; gap: .6rem; padding: .5rem .7rem; text-decoration: none;
  border-bottom: 1px solid var(--line); font-size: .88rem; align-items: center;
}
.search-results a:hover { background: var(--shade); }

.menu-toggle { display: none; background: none; border: 1px solid var(--line-strong); padding: .4rem .6rem; font: inherit; cursor: pointer; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  letter-spacing: .01em;
  padding: .6rem 1.4rem; border: 1px solid var(--ink); background: var(--ink);
  color: var(--paper); border-radius: var(--radius); cursor: pointer;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.signal { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.signal:hover { background: var(--ink); border-color: var(--ink); }
.btn.small { font-size: .9rem; padding: .35rem .8rem; }
.btn.danger { background: transparent; border-color: var(--ko); color: var(--ko); }
.btn.danger:hover { background: var(--ko); color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- hero ---------- */
.hero {
  background: var(--ink); color: var(--paper);
  padding: clamp(3rem, 8vw, 6.5rem) 0 0;
  position: relative; overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: end;
}
.hero-kicker {
  font-family: var(--font-display); font-size: 1rem; letter-spacing: .12em;
  color: var(--hiviz); margin-bottom: 1rem; display: block;
}
.hero h1 { color: var(--paper); white-space: pre-line; }
.hero p { color: color-mix(in srgb, var(--paper) 78%, transparent); font-size: 1.08rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 2rem 0 3rem; }
.hero .btn.ghost { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 45%, transparent); }
.hero .btn.ghost:hover { background: var(--paper); color: var(--ink); }
.hero-visual {
  align-self: stretch; min-height: 300px; position: relative;
  border-left: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
  display: flex; align-items: flex-end;
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-norms { padding: 0 0 2.5rem 1.6rem; }
.hero-norms li {
  list-style: none; padding: .55rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 16%, transparent);
  font-size: .9rem; display: flex; justify-content: space-between; gap: 1rem;
  color: color-mix(in srgb, var(--paper) 80%, transparent);
}
.hero-norms li b { font-family: var(--font-display); font-size: 1.05rem; color: var(--hiviz); font-weight: 600; }
.hero-norms { margin: 0; padding-left: 1.6rem; }

/* fascia dati sotto l'hero */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
}
.stat { padding: 1.6rem 1.2rem 2rem; }
.stat + .stat { border-left: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); }
.stat b {
  display: block; font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 2.8rem);
  font-weight: 600; line-height: 1; color: var(--paper);
}
.stat span { font-size: .82rem; color: color-mix(in srgb, var(--paper) 62%, transparent); }

/* ---------- griglie ---------- */
.grid { display: grid; gap: 1.25rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2.5rem; align-items: start; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.8rem; border-bottom: 2px solid var(--ink); padding-bottom: .6rem;
}
.section-head h2 { margin: 0; }

/* ---------- scheda prodotto (card) ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; flex-direction: column;
  position: relative; transition: border-color .15s;
}
.card:hover { border-color: var(--ink); }
.card-media {
  aspect-ratio: 4 / 3; background: var(--shade); overflow: hidden;
  display: grid; place-items: center; border-bottom: 1px solid var(--line);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .placeholder {
  font-family: var(--font-display); font-size: 2.6rem; color: var(--line-strong);
  letter-spacing: .08em;
}
.card-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-sku { font-size: .74rem; letter-spacing: .06em; color: var(--muted); }
.card h3 { font-size: 1.12rem; margin: 0; }
.card h3 a { text-decoration: none; }
.card-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; }

.flag {
  position: absolute; top: 0; left: 0; background: var(--signal); color: #fff;
  font-family: var(--font-display); font-size: .82rem; padding: .15rem .55rem; letter-spacing: .04em;
}
.flag.hiviz { background: var(--hiviz); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  font-size: .7rem; border: 1px solid var(--line-strong); padding: .1rem .4rem;
  border-radius: var(--radius); color: var(--muted); white-space: nowrap;
}
.chip.norm { border-color: var(--steel); color: var(--steel); }

/* ---------- prezzi ---------- */
.price { font-family: var(--font-display); line-height: 1; }
.price .net { font-size: 1.6rem; font-weight: 700; }
.price .gross { font-size: .85rem; color: var(--muted); text-decoration: line-through; font-family: var(--font-body); }
.price .chain {
  font-size: .78rem; color: var(--signal); font-family: var(--font-body); font-weight: 600;
}
.price-locked { font-size: .8rem; color: var(--muted); max-width: 18ch; }

.cascade { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; font-size: .8rem; }
.cascade i {
  font-style: normal; border: 1px solid var(--signal); color: var(--signal);
  padding: 0 .35rem; border-radius: var(--radius); font-weight: 600;
}

/* ---------- tabelle ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th {
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  background: var(--shade); position: sticky; top: 0; z-index: 2;
}
table.data tr:hover td { background: var(--shade); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- form ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .78rem; display: block; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem;
  border-radius: var(--radius);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input[type=color] { width: 100%; height: 42px; padding: 2px; border: 1px solid var(--line-strong); background: var(--surface); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-bottom: .5rem; }
.check input { width: 18px; height: 18px; accent-color: var(--signal); }
fieldset { border: 1px solid var(--line); padding: 1.2rem; margin: 0 0 1.5rem; border-radius: var(--radius); }
legend { font-family: var(--font-display); font-size: 1.2rem; padding: 0 .4rem; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- avvisi ---------- */
.notice {
  padding: .8rem 1rem; border-left: 4px solid var(--steel); background: var(--shade);
  margin-bottom: 1.2rem; font-size: .92rem;
}
.notice.ok { border-color: var(--ok); }
.notice.ko { border-color: var(--ko); }
.notice.warn { border-color: var(--warn); }

.badge {
  display: inline-block; font-size: .72rem; padding: .12rem .5rem;
  border-radius: 999px; background: var(--shade); border: 1px solid var(--line-strong);
}
.badge.ok { border-color: var(--ok); color: var(--ok); }
.badge.ko { border-color: var(--ko); color: var(--ko); }
.badge.warn { border-color: var(--warn); color: var(--warn); }
.badge.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: color-mix(in srgb, var(--paper) 72%, transparent); margin-top: 4rem; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--hiviz); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; padding: 3rem 0 2rem; }
.footer-grid h4 { color: var(--paper); font-size: 1.15rem; margin-bottom: .8rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.footer-grid li { padding: .2rem 0; }
.footer-bottom {
  border-top: 1px solid color-mix(in srgb, var(--paper) 15%, transparent);
  padding: 1rem 0; font-size: .82rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- bot ---------- */
.bot-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  background: var(--ink); color: var(--paper); border: none; cursor: pointer;
  font-family: var(--font-display); font-size: 1.05rem; padding: .7rem 1.1rem;
  display: flex; align-items: center; gap: .5rem; border-radius: var(--radius);
  box-shadow: 0 14px 30px -18px rgba(0,0,0,.8);
}
.bot-launcher::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--hiviz);
}
.bot-panel {
  position: fixed; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 40px)); background: var(--surface);
  border: 1px solid var(--ink); z-index: 95; display: none;
  flex-direction: column; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
}
.bot-panel.open { display: flex; }
.bot-head {
  background: var(--ink); color: var(--paper); padding: .7rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.bot-head strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.bot-head button { background: none; border: none; color: inherit; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.bot-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.bot-msg { font-size: .9rem; padding: .6rem .8rem; border-radius: var(--radius); white-space: pre-wrap; }
.bot-msg.bot { background: var(--shade); border-left: 3px solid var(--hiviz); }
.bot-msg.me { background: var(--ink); color: var(--paper); align-self: flex-end; max-width: 85%; }
.bot-sugg { display: flex; flex-wrap: wrap; gap: .3rem; }
.bot-sugg a { font-size: .76rem; border: 1px solid var(--line-strong); padding: .15rem .45rem; text-decoration: none; }
.bot-form { display: flex; gap: .4rem; padding: .7rem; border-top: 1px solid var(--line); }
.bot-form input { flex: 1; }
.bot-form button { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 0 .9rem; cursor: pointer; font-family: var(--font-display); }

/* ---------- paginazione ---------- */
.pager { display: flex; gap: .3rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pager a, .pager span {
  padding: .35rem .7rem; border: 1px solid var(--line-strong); text-decoration: none; font-size: .9rem;
}
.pager .on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- filtri laterali ---------- */
.side h4 { font-family: var(--font-display); font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
.side ul { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.side li a { display: block; padding: .3rem 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.side li a.on { color: var(--signal); font-weight: 600; }

/* =========================================================
   Area riservata e pannello
   ========================================================= */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.app-side {
  background: var(--ink); color: color-mix(in srgb, var(--paper) 75%, transparent);
  padding: 1.2rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-side .brand { padding: 0 1.2rem 1.2rem; color: var(--paper); }
.app-side .brand-name { color: var(--paper); }
.app-side h5 {
  font-size: .7rem; letter-spacing: .12em; margin: 1.4rem 1.2rem .4rem;
  color: color-mix(in srgb, var(--paper) 45%, transparent); font-weight: 600;
}
.app-side a {
  display: flex; justify-content: space-between; gap: .5rem; padding: .5rem 1.2rem;
  text-decoration: none; font-size: .92rem; border-left: 3px solid transparent;
}
.app-side a:hover { background: color-mix(in srgb, var(--paper) 8%, transparent); color: var(--paper); }
.app-side a.on { border-left-color: var(--hiviz); color: var(--paper); background: color-mix(in srgb, var(--paper) 6%, transparent); }
.app-side .count { font-size: .75rem; background: var(--signal); color: #fff; padding: 0 .4rem; border-radius: 999px; }

.app-main { padding: 0 0 4rem; background: var(--paper); min-width: 0; }
.app-top {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: .9rem clamp(1rem, 3vw, 2rem); display: flex; align-items: center;
  gap: 1rem; justify-content: space-between; position: sticky; top: 0; z-index: 40;
}
.app-top h1 { font-size: 1.7rem; margin: 0; }
.app-body { padding: clamp(1rem, 3vw, 2rem); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.tile { background: var(--surface); border: 1px solid var(--line); padding: 1rem; }
.tile b { display: block; font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.tile span { font-size: .82rem; color: var(--muted); }
.tile.alert { border-color: var(--signal); }

.panel { background: var(--surface); border: 1px solid var(--line); padding: 1.4rem; margin-bottom: 1.5rem; }
.panel > h2, .panel > h3 { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }

.tabs { display: flex; gap: .2rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); margin-bottom: 1.5rem; }
.tabs a {
  padding: .5rem 1rem; text-decoration: none; font-family: var(--font-display);
  font-size: 1.05rem; border: 1px solid var(--line); border-bottom: none; background: var(--shade);
}
.tabs a.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.thumb { width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--line); background: var(--shade); }
.img-grid { display: flex; gap: .6rem; flex-wrap: wrap; }
.img-item { position: relative; width: 92px; }
.img-item img { width: 92px; height: 92px; object-fit: cover; border: 1px solid var(--line); }
.img-item label { font-size: .7rem; display: flex; gap: .2rem; align-items: center; }

.repeat-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; margin-bottom: .5rem; align-items: center; }
.repeat-row button { background: none; border: 1px solid var(--line-strong); cursor: pointer; padding: .4rem .6rem; }

.order-status { display: inline-block; padding: .1rem .55rem; font-size: .78rem; border: 1px solid var(--line-strong); }
.order-status[data-s="inviato"] { border-color: var(--warn); color: var(--warn); }
.order-status[data-s="confermato"] { border-color: var(--steel); color: var(--steel); }
.order-status[data-s="spedito"], .order-status[data-s="evaso"] { border-color: var(--ok); color: var(--ok); }
.order-status[data-s="annullato"] { border-color: var(--ko); color: var(--ko); }

.totals { margin-left: auto; width: min(360px, 100%); }
.totals div { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.totals div.grand { border-bottom: none; border-top: 2px solid var(--ink); font-family: var(--font-display); font-size: 1.4rem; padding-top: .6rem; }

.onbehalf {
  background: var(--hiviz); color: var(--ink); padding: .5rem 1rem; font-size: .9rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}

/* ---------- installer ---------- */
.install { max-width: 840px; margin: 3rem auto; padding: 0 1rem; }
.install-card { background: var(--surface); border: 1px solid var(--line); padding: 2rem; }
.steps { display: flex; gap: 1rem; margin-bottom: 2rem; font-family: var(--font-display); font-size: 1.1rem; }
.steps span { color: var(--muted); }
.steps span.on { color: var(--ink); border-bottom: 3px solid var(--signal); }

/* ---------- stampa ---------- */
@media print {
  .site-header, .site-footer, .bot-launcher, .bot-panel, .app-side, .toolbar, .no-print { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; }
}

/* ---------- adattamento ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { border-left: none; border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); min-height: 0; }
  .hero-norms { padding-left: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3), .stat:nth-child(4) { border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); }
  .stat:nth-child(3) { border-left: none; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .app { grid-template-columns: 1fr; }
  .app-side { position: static; height: auto; }
}

@media (max-width: 720px) {
  .menu-toggle { display: block; margin-left: auto; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line-strong);
    flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1rem 1rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .searchbox { max-width: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: none; border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); }
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2.3rem; }
}

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