/* The Rope Inside — DS derivato da 2026.therope.it (v9, dark-first) */
@font-face { font-family: 'Helvetica Now'; src: url('/assets/fonts/HelveticaNowDisplay-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Helvetica Now'; src: url('/assets/fonts/HelveticaNowDisplay-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Helvetica Now'; src: url('/assets/fonts/HelveticaNowDisplay-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark; /* controlli nativi (date picker, select) in tinta col tema */
  --bg: #060608;
  --bg-2: #0d0d11;
  --bg-3: #131319;
  --text: #d8d8d6;
  --muted: #8f8f98;
  --faint: #5c5c66;
  --line: rgba(255,255,255,.09);
  --line-soft: rgba(255,255,255,.05);
  --shade: rgba(255,255,255,.025);
  --white: #f4f4f2;
  --on-strong: #060608;
  --ok: #2fbf71;
  --warn: #e8b931;
  --err: #e85555;
  --fs-h1: clamp(28px, 4vw, 42px);
  --fs-h2: clamp(20px, 2.6vw, 27px);
  --fs-h3: 17px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-label: 12px;
  --side-w: 232px;
  --r: 0;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2ef;
  --bg-2: #ffffff;
  --bg-3: #e9e9e5;
  --text: #26262a;
  --muted: #6d6d76;
  --faint: #9c9ca4;
  --line: rgba(0,0,0,.13);
  --line-soft: rgba(0,0,0,.06);
  --shade: rgba(0,0,0,.04);
  --white: #0d0d11;      /* "forte" si inverte: CTA/testi pieni scuri */
  --on-strong: #f4f4f2;
  --ok: #1e9d5a;
  --warn: #b58a10;
  --err: #cc3f3f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 400 var(--fs-body)/1.55 'Helvetica Now', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100dvh;
  overflow-x: clip; /* nessuno scroll orizzontale di pagina: le tabelle scrollano dentro il loro box */
}
a { color: inherit; text-decoration: none; }
h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.05; letter-spacing: 0; margin-bottom: .35em; }
h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.1; }
h3 { font-size: var(--fs-h3); font-weight: 700; }

.lbl { font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; color: var(--muted); letter-spacing: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- shell ---- */
/* minmax(0,…): senza il floor a 0 il track prende il min-content del planner (~2500px) e sfonda la pagina */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  border-right: 1px solid var(--line); padding: 22px 18px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg);
}
.brand { font-weight: 700; font-size: 16px; text-transform: lowercase; color: var(--white); margin-bottom: 22px; display: block; }
.brand span { color: var(--faint); margin: 0 .35em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  font-size: var(--fs-small); font-weight: 700; text-transform: lowercase;
  color: var(--muted); padding: 9px 10px; border-left: 2px solid transparent;
  transition: color .15s;
}
.nav a:hover { color: var(--white); }
.nav a.on { color: var(--white); border-left-color: var(--white); background: var(--bg-2); }
.nav svg.ic { width: 17px; height: 17px; flex: none; opacity: .75; }
.nav a.on svg.ic, .nav a:hover svg.ic { opacity: 1; }
.nav-badge { margin-left: auto; color: var(--warn); border-color: var(--warn); }
.side-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.side-top .brand { margin-bottom: 0; }
.side .side-close { display: none; }
.tb-btn {
  background: none; border: none; color: var(--text); cursor: pointer;
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
}
.tb-btn svg { width: 22px; height: 22px; }
.topbar { display: none; }
.backdrop { display: none; }
.nav-sec { margin-top: 22px; padding: 0 10px 6px; font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; color: var(--faint); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.nav-admin a { padding-left: 12px; }
.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; }
.ava {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--on-strong); font-weight: 700; font-size: 12px; border-radius: 50%;
  flex: none;
}
.me-name { font-weight: 700; font-size: var(--fs-small); text-transform: lowercase; }
.out { margin-left: auto; font-size: var(--fs-label); font-weight: 700; color: var(--muted); text-transform: lowercase; }
.out:hover { color: var(--white); }

.main { padding: clamp(20px, 4vw, 44px); max-width: 1280px; width: 100%; min-width: 0; }

/* ---- componenti ---- */
.card { background: var(--bg-2); border: 1px solid var(--line); padding: 20px; border-radius: var(--r); }
.grid { display: grid; gap: 14px; }
/* colonne passate dal template via --cols, così il media query mobile può vincerle (l'inline style no) */
.grid--2col { grid-template-columns: var(--cols, 1fr); align-items: start; }
/* colonna destra del wizard: card impilate, la prima parte allineata al form anche se una è nascosta */
.wizcol { display: grid; gap: 14px; align-content: start; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); color: var(--on-strong);
  font-size: var(--fs-small); font-weight: 700; text-transform: lowercase;
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--white);
  cursor: pointer; transition: opacity .15s;
}
.pill:hover { opacity: .85; }
.pill--ghost { background: transparent; color: var(--white); border-color: var(--line); }
.pill--ghost:hover { border-color: var(--white); opacity: 1; }
.pill--sm { padding: 6px 14px; font-size: var(--fs-label); }
.pill--danger { background: transparent; color: var(--err); border-color: var(--err); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.flash {
  display: flex; gap: 10px; align-items: baseline;
  padding: 12px 16px; margin-bottom: 16px; font-size: var(--fs-small);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
}
.flash::before { font-weight: 700; flex: none; }
.flash--ok { border-left: 3px solid var(--ok); }
.flash--ok::before { content: '✓'; color: var(--ok); }
.flash--error { border-left: 3px solid var(--err); }
.flash--error::before { content: '✕'; color: var(--err); }

/* hint "?" con tooltip puro CSS */
.hint {
  display: inline-flex; width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--faint); background: var(--bg-3);
  font-size: 10px; font-weight: 700; align-items: center; justify-content: center;
  cursor: help; position: relative; vertical-align: middle; margin-left: 5px;
  text-transform: none;
}
.hint:hover, .hint:focus { color: var(--text); border-color: var(--muted); outline: none; }
.hint:hover::after, .hint:focus::after {
  content: attr(data-hint);
  position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 280px; white-space: normal;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  padding: 9px 12px; font-size: var(--fs-label); font-weight: 400; line-height: 1.5;
  text-align: left; text-transform: none; letter-spacing: 0;
  z-index: 60; box-shadow: 0 14px 34px rgba(0,0,0,.4);
}

/* ---- tabelle ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.tbl th { text-align: left; font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: var(--bg-2); }
.tbl-wrap { overflow-x: auto; max-width: 100%; overscroll-behavior-x: contain; }

/* ---- form ---- */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=file], input[type=month], select, textarea {
  width: 100%; background: var(--bg-3); color: var(--text);
  border: 1px solid var(--line); padding: 10px 12px; font: inherit; font-size: var(--fs-small);
  border-radius: var(--r); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--muted); }
input[type=color] { width: 44px; height: 32px; background: none; border: 1px solid var(--line); padding: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); margin-bottom: 10px; }
.check input { width: auto; }

/* ---- dashboard ---- */
/* due colonne: a sinistra chi è in ufficio (lista lunga), a destra smart e sotto assenti */
.today-strip { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: start; }
.today-col { display: flex; flex-direction: column; gap: 20px; }
.tgroup .lbl { margin-bottom: 10px; display: block; }
.tperson { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: var(--fs-small); }
.tperson .ava { width: 26px; height: 26px; font-size: 10px; }
.tperson .why { margin-left: auto; color: var(--faint); font-size: var(--fs-label); text-transform: lowercase; }

.bal { display: flex; flex-direction: column; gap: 4px; }
.bal .v { font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--white); }
.bal .v small { font-size: 14px; color: var(--muted); font-weight: 700; }
.bal .proj { font-size: var(--fs-label); color: var(--faint); }
.bal.neg .v { color: var(--err); }

.alertbox {
  display: flex; gap: 10px; align-items: baseline;
  background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--warn);
  color: var(--text); padding: 13px 16px; font-size: var(--fs-small);
}
.alertbox::before { content: '⚠'; color: var(--warn); font-weight: 700; flex: none; }
.alertbox.err { border-left-color: var(--err); }
.alertbox.err::before { content: '✕'; color: var(--err); }
.alertbox a { text-decoration: underline; color: inherit; }

/* ---- planner ---- */
.plan-wrap {
  overflow-x: auto; border: 1px solid var(--line); background: var(--bg-2);
  max-width: 100%;
  overscroll-behavior-x: contain;      /* lo scroll resta nella griglia */
  touch-action: pan-x pan-y;           /* trascini la griglia, non zoomi la pagina */
  -webkit-overflow-scrolling: touch;
}
.plan { border-collapse: collapse; font-size: 11px; }
.plan th, .plan td { border: 1px solid var(--line-soft); padding: 0; }
.plan thead th { position: sticky; top: 0; background: var(--bg-3); z-index: 2; font-weight: 700; color: var(--muted); padding: 4px 2px; min-width: 26px; text-align: center; }
.plan .pname { position: sticky; left: 0; background: var(--bg-2); z-index: 3; text-align: left; padding: 6px 12px 6px 10px; font-weight: 700; font-size: 12px; white-space: nowrap; min-width: 130px; }
.plan thead .pname { z-index: 4; background: var(--bg-3); }
.plan .dept td { background: var(--bg-3); font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; color: var(--faint); padding: 5px 10px; text-align: left; }
.plan .we { background: var(--shade); }
.plan .hol { background: rgba(232,185,49,.07); }
.plan td.today-col { background: rgba(79,124,255,.09); }
.plan thead th.today-col .tdy {
  display: inline-flex; width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); color: var(--on-strong);
  align-items: center; justify-content: center; font-weight: 700;
}
.cell { display: block; width: 100%; height: 30px; position: relative; }
a.cell:hover { background: var(--shade); }
.bar { position: absolute; inset: 5px 1px; border-radius: 2px; }
.bar.half-am { inset: 5px 1px 17px 1px; }
.bar.half-pm { inset: 17px 1px 5px 1px; }
.heat { height: 4px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.legend .chip { border: none; padding-left: 0; }

/* ---- smart cal ---- */
.scal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.scal .dh { font-size: var(--fs-label); font-weight: 700; color: var(--faint); text-align: center; text-transform: lowercase; padding: 4px 0; }
.sday { min-height: 64px; border: 1px solid var(--line); padding: 5px 7px; font-size: var(--fs-label); position: relative; background: var(--bg-2); }
.sday.out { opacity: .25; }
.sday.we { background: transparent; border-style: dashed; }
.sday .n { color: var(--muted); font-weight: 700; }
.sday.today { border-color: var(--white); }
.sday .mine { position: absolute; inset: auto 5px 5px 5px; background: var(--ok); color: #04140b; font-weight: 700; text-align: center; border-radius: 2px; padding: 1px 0; }
.sday .others { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; line-height: 1.3; }
.sday form { position: absolute; top: 3px; right: 4px; }
.sday button { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 13px; }
.sday button:hover { color: var(--white); }

/* ---- tooltip tipologie ---- */
.tt { position: relative; }
.tt-card { display: none; position: absolute; z-index: 30; top: 100%; left: 0; width: min(340px, 80vw); background: var(--bg-3); border: 1px solid var(--line); padding: 14px 16px; font-size: var(--fs-small); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.tt.open .tt-card { display: block; }
.tt-card dt { font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; color: var(--muted); margin-top: 8px; }
.tt-card dt:first-child { margin-top: 0; }
.tt-card dd { margin: 2px 0 0; }

/* spiegazione tipologia: nota sotto il campo, non un altro field */
.type-info { margin: -6px 0 20px; padding-left: 12px; border-left: 2px solid var(--line); }
.type-info p { font-size: var(--fs-small); color: var(--muted); margin: 0 0 7px; line-height: 1.55; }
.type-info p:last-child { margin-bottom: 0; }
.type-info b { color: var(--text); font-weight: 700; }

/* elenco "buono a sapersi" */
.tips { margin: 10px 0 0; padding: 0; list-style: none; font-size: var(--fs-small); }
.tips li { position: relative; padding-left: 16px; margin-bottom: 9px; color: var(--muted); line-height: 1.55; }
.tips li::before { content: '·'; position: absolute; left: 4px; color: var(--faint); font-weight: 700; }
.tips li:last-child { margin-bottom: 0; }
.tips strong { color: var(--text); }
.tips-note {
  margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: var(--fs-label); line-height: 1.65; color: var(--faint);
}
.tips-note strong { color: var(--muted); }
.tips-note em { font-style: italic; }

/* ---- tema & vedi-come ---- */
.theme-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 15px; line-height: 1; flex: none;
}
.theme-btn:hover { color: var(--white); border-color: var(--white); }
.topbar .theme-btn { border: none; font-size: 17px; }
.viewas { margin-bottom: 12px; }
.viewas select { font-size: var(--fs-label); padding: 7px 10px; }
.impersonate-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-left: 3px solid var(--warn);
  color: var(--text); background: var(--bg-2);
  padding: 10px 14px; margin-bottom: 16px; font-size: var(--fs-small);
}

/* mini-calendario anteprima wizard */
.pcal { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.pcal-month { flex: 1; min-width: 210px; }
.pcal-month .lbl { margin-bottom: 6px; display: block; }
.pcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pcal-grid .dh { font-size: 9px; font-weight: 700; color: var(--faint); text-align: center; text-transform: lowercase; }
.pcal-d {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-variant-numeric: tabular-nums; color: var(--muted);
  border-radius: 3px; background: var(--bg-3);
}
.pcal-d.off { background: transparent; color: var(--faint); }
.pcal-d.hol { background: rgba(232,185,49,.14); color: var(--warn); }
.pcal-d.sel { background: #4f7cff; color: #fff; font-weight: 700; }
.pcal-d.sel.off { background: rgba(79,124,255,.25); color: var(--muted); font-weight: 400; }
.preview-sum { font-size: var(--fs-small); margin-top: 10px; }
.preview-sum strong { color: var(--white); }

/* ---- card team ---- */
.tcard { display: flex; flex-direction: column; gap: 14px; }
.tcard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tcard-top .ava { width: 40px; height: 40px; font-size: 13px; }
.tcard-id { min-width: 0; }
.tcard-name { display: block; font-weight: 700; font-size: 17px; line-height: 1.25; letter-spacing: -.01em; }
.tcard-dept { display: block; margin-top: 6px; font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; color: var(--faint); }
.tcard-status { flex: none; }
.tcard-status.is-smart { color: var(--ok); border-color: var(--ok); }
.tcard-status.is-off { color: var(--warn); border-color: var(--warn); }
.tcard-meta {
  display: grid; grid-template-columns: 74px 1fr; gap: 6px 10px;
  margin: 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: var(--fs-small);
}
.tcard-meta dt { font-size: var(--fs-label); font-weight: 700; text-transform: lowercase; color: var(--faint); }
.tcard-meta dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.tcard-meta a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.tcard-meta a:hover { color: var(--white); border-bottom-color: var(--white); }

/* ---- switch on/off ---- */
.switch { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 40px; height: 23px; border-radius: 999px; flex: none; margin-top: 1px;
  background: var(--bg-3); border: 1px solid var(--line); position: relative;
  transition: background .18s, border-color .18s;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--faint); transition: transform .18s, background .18s;
}
.switch input:checked + .track { background: rgba(47,191,113,.18); border-color: var(--ok); }
.switch input:checked + .track .knob { transform: translateX(17px); background: var(--ok); }
.switch input:focus-visible + .track { outline: 2px solid var(--muted); outline-offset: 2px; }
.switch-txt { font-size: var(--fs-small); color: var(--muted); line-height: 1.5; }
.switch-txt strong { color: var(--text); }

/* ---- bottoni-icona (azioni compatte in tabella) ---- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; position: relative;
}
.icon-btn:hover { color: var(--white); border-color: var(--white); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn .ok-check { display: none; color: var(--ok); }
.icon-btn.ok { color: var(--ok); border-color: var(--ok); }
.icon-btn.ok svg:not(.ok-check) { display: none; }
.icon-btn.ok .ok-check { display: block; }

/* freccina download dei documenti: a destra, nuda (niente cerchio) */
.doc-dl { margin-left: auto; display: inline-flex; color: var(--muted); flex: none; padding: 2px; }
.doc-dl:hover { color: var(--white); }
.doc-dl svg { width: 16px; height: 16px; }

/* ---- cartelle anno documenti ---- */
.yfold { border-top: 1px solid var(--line); }
.yfold:first-of-type { border-top: none; }
.yfold summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 0; list-style: none;
}
.yfold summary::-webkit-details-marker { display: none; }
.yfold summary::before { content: '▸'; color: var(--faint); font-size: 10px; transition: transform .15s; }
.yfold[open] summary::before { transform: rotate(90deg); }
.yfold summary .chip { margin-left: auto; }
.yfold > .tperson { padding-left: 16px; }

/* ---- regolamento ---- */
.reg { max-width: 820px; padding: clamp(24px, 4vw, 48px); line-height: 1.7; }
.reg h1 { font-size: var(--fs-h2); margin: 0 0 .6em; }
.reg h2 { font-size: var(--fs-h3); margin: 2.2em 0 .8em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.reg h3 { font-size: var(--fs-body); margin: 1.6em 0 .5em; color: var(--white); }
.reg p { margin: 0 0 .9em; font-size: var(--fs-small); color: var(--text); }
.reg ul, .reg ol { margin: 0 0 1em 1.3em; font-size: var(--fs-small); }
.reg li { margin-bottom: .35em; }
.reg .reg-head { margin-bottom: 1.6em; }
.reg a { text-decoration: underline; }

/* ---- login cover (sempre dark, tessuto WebGL) ---- */
@font-face { font-family: 'VCR OSD Mono'; src: url('/assets/fonts/VCR_OSD_MONO.ttf') format('truetype'); font-display: swap; }
.cover-body { background: #000; color: #d8d8d6; overflow: hidden; }
#silk, #fabric { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; }
.cover-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(18px, 3vw, 32px) clamp(20px, 4vw, 48px);
}
.cover-lang { display: flex; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: #8f8f98; }
.cover-lang a { color: inherit; }
.cover-lang a.on, .cover-lang a:hover { color: #f4f4f2; }
.cover-logo { height: 20px; width: auto; opacity: .92; }
.cover-foot {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 3;
  text-align: center; padding: 18px;
  font-size: 11px; font-weight: 700; text-transform: lowercase;
  color: rgba(216,216,214,.4); letter-spacing: .08em;
}
.cover {
  position: relative; z-index: 2; min-height: 100dvh;
  display: grid; place-items: center start;
  padding: 0 clamp(20px, 4vw, 48px);
}
.cover-inner { display: flex; flex-direction: column; align-items: flex-start; width: min(560px, 100%); text-align: left; }
.cover-title {
  font-family: 'Helvetica Now', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: clamp(76px, 14vw, 188px); font-weight: 700; line-height: .95;
  color: #f4f4f2; letter-spacing: -.03em; margin: 0 0 16px;
  user-select: none;
}
.cover-sub {
  font-size: clamp(15px, 1.6vw, 19px); color: #9a9aa2;
  margin: 0 0 clamp(30px, 6vh, 56px);
}
.cover-foot { text-align: left; padding: 18px clamp(20px, 4vw, 48px); }
.cover .pill.cover-google {
  background: #f4f4f2; color: #060608; border-color: #f4f4f2;
  padding: 14px 34px; font-size: 14px;
}
/* il toggle si allinea al centro del bottone Google, che resta a sinistra */
.cover-google { align-self: flex-start; }
.cover-email-toggle {
  margin-top: 16px; background: none; border: none; cursor: pointer; padding: 0;
  color: #8f8f98; font-size: var(--fs-label); font-weight: 700; text-transform: lowercase;
  text-decoration: underline; text-underline-offset: 3px;
  align-self: flex-start;
  width: var(--google-w, auto); text-align: center;
}
.cover-email-toggle:hover { color: #f4f4f2; }
.cover-form { display: none; width: 100%; margin-top: 22px; }
.cover-form.always, .show-email .cover-form { display: block; }
.cover-form label.f > span { color: #8f8f98; }
.cover-form input {
  background: rgba(19,19,25,.82); color: #d8d8d6; border-color: rgba(255,255,255,.14);
  backdrop-filter: blur(4px);
}
.cover-form .pill--ghost { color: #f4f4f2; border-color: rgba(255,255,255,.25); }
.cover .flash { width: 100%; background: rgba(13,13,17,.85); }

/* ---- wallboard ---- */
.wall { min-height: 100dvh; padding: 5vw; display: flex; flex-direction: column; gap: 4vh; }
.wall h1 { font-size: clamp(34px, 6vw, 80px); text-transform: lowercase; }
.wall .tgroup { font-size: clamp(16px, 2vw, 26px); }
.wall .tperson { font-size: inherit; padding: 8px 0; }
.wall .ava { width: 1.8em; height: 1.8em; font-size: .6em; }

/* ---- consulente ---- */
.cons { max-width: 1100px; margin: 0 auto; padding: clamp(18px, 4vw, 40px); }

/* ---- responsive: topbar + drawer hamburger ---- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: 0; z-index: 55;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
  }
  .topbar .brand { margin: 0; flex: 1; text-align: center; font-size: 15px; }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: min(300px, 84vw); height: 100dvh;
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 24px 0 60px rgba(0,0,0,.35);
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }
  .side.open { transform: translateX(0); }
  .side .side-close { display: inline-flex; }
  .backdrop {
    display: block; position: fixed; inset: 0; z-index: 60;
    background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  .backdrop.show { opacity: 1; pointer-events: auto; }
  .main { padding: 18px 14px 40px; }
  .me .theme-btn { display: inline-flex; }

  /* form + elenco (richieste, bacheca, wizard assenza, admin) su una colonna sola */
  .grid--2col { grid-template-columns: minmax(0, 1fr); }
  .grid--2col > * { min-width: 0; }

  /* planner: griglia più stretta, così di settimane ne entrano di più prima di scrollare */
  .plan { font-size: 10px; }
  .plan thead th { min-width: 20px; padding: 3px 1px; }
  .plan .pname { min-width: 104px; font-size: 11px; padding: 5px 8px; }
  .cell { height: 26px; }
  .plan thead th.today-col .tdy { width: 16px; height: 16px; }
  /* la barra orizzontale del planner sotto il pollice, non a fondo pagina */
  .plan-wrap { max-height: 70dvh; overflow-y: auto; }
}
/* ---- stampa ---- */
.print-head { display: none; }

@page { margin: 18mm 16mm; }

@media print {
  /* palette carta: vince su entrambi i temi, tutto il resto eredita dalle variabili */
  :root, :root[data-theme="light"], :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #fff; --bg-2: #fff; --bg-3: #fff;
    --text: #111; --muted: #444; --faint: #666;
    --line: #bbb; --line-soft: #ddd; --shade: #f4f4f4;
    --white: #000; --on-strong: #fff;
    --ok: #1a7a46; --warn: #8a6708; --err: #a32b2b;
    --fs-h1: 22px; --fs-h2: 17px; --fs-h3: 14px;
    --fs-body: 11pt; --fs-small: 10pt; --fs-label: 9pt;
  }
  body { background: #fff; color: #111; overflow: visible; }

  /* via tutto ciò che su carta non si clicca */
  .side, .topbar, .backdrop, .bbar, .flash, .pill, button, .tb-btn, .theme-btn,
  .viewas, .impersonate-bar, .hint, .tt, .nav-badge, .legend, .noprint,
  .head .row, .head .lbl { display: none !important; }

  .shell { display: block; }
  .main { max-width: none; width: auto; padding: 0; }

  /* intestazione: marchio + titolo del documento, con un filo sotto */
  .print-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    padding-bottom: 6px; margin-bottom: 18px; border-bottom: 2px solid #111;
  }
  .ph-brand { font-size: 13pt; font-weight: 700; letter-spacing: .12em; }
  .ph-org { font-size: 8pt; color: #555; }
  .head { display: block; margin-bottom: 16px; }
  .head h1 { font-size: 20pt; margin-bottom: 2px; }

  /* niente cornici/ombre: sulla carta il contenuto è il contenuto */
  .card { border: none !important; padding: 0 !important; background: #fff !important; }
  .grid, .grid--2col { display: block; }
  .reg { max-width: none; padding: 0; line-height: 1.5; }
  .reg h2 { font-size: 13pt; margin: 1.4em 0 .5em; padding-top: .7em; border-top: 1px solid #bbb; }
  .reg h3 { font-size: 11pt; color: #111; }
  .reg a { text-decoration: none; color: #111; }
  .reg a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; word-break: break-all; }

  /* tabelle e planner: leggibili, non tagliati a metà */
  .tbl-wrap, .plan-wrap { overflow: visible !important; max-height: none !important; border: none !important; }
  .tbl td, .tbl th, .plan th, .plan td { border-color: #ccc !important; background: #fff !important; }
  .plan thead th, .plan .pname { position: static; }

  /* impaginazione */
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  .reg li, .reg p, tr, .card { break-inside: avoid; page-break-inside: avoid; }
  * { box-shadow: none !important; }
}
