/* Gestione Studio — You Are Art
   Estensione del marchio del sito (Marcellus + DM Sans, oro) in versione "registro":
   carta calda e leggibile di giorno, palette vault di notte. Mobile-first, niente framework. */

:root {
  --paper: #f5efe3;
  --paper-2: #ede4d2;
  --card: #fffcf6;
  --ink: #1c1712;
  --ink-2: #574d41;
  --ink-3: #847868;
  --rule: rgba(28, 23, 18, 0.13);
  --rule-2: rgba(28, 23, 18, 0.07);
  --gold: #9c6630;
  --gold-deep: #7d4f20;
  --gold-soft: #efdfc1;
  --on-gold: #fffaf0;
  --ok: #3d6a48;
  --ok-soft: #e1ebdc;
  --warn: #8f5b0c;
  --warn-soft: #f5e5c3;
  --bad: #a1372a;
  --bad-soft: #f6ddd6;
  --shadow: 0 1px 2px rgba(28, 23, 18, 0.06), 0 10px 26px -14px rgba(28, 23, 18, 0.28);
  --shadow-up: 0 -1px 0 var(--rule-2), 0 -12px 30px -18px rgba(28, 23, 18, 0.35);
  --r-s: 8px;
  --r: 12px;
  --r-l: 18px;
  --display: "Marcellus", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --script: "Mrs Saint Delafield", cursive;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 62px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #100d08;
    --paper-2: #17130d;
    --card: #1d1811;
    --ink: #f1ecdd;
    --ink-2: #c9c0aa;
    --ink-3: #9b917d;
    --rule: rgba(241, 236, 221, 0.15);
    --rule-2: rgba(241, 236, 221, 0.075);
    --gold: #d4ad62;
    --gold-deep: #e8c277;
    --gold-soft: rgba(212, 173, 98, 0.16);
    --on-gold: #17120a;
    --ok: #93c39a;
    --ok-soft: rgba(147, 195, 154, 0.14);
    --warn: #e2b456;
    --warn-soft: rgba(226, 180, 86, 0.15);
    --bad: #ee907e;
    --bad-soft: rgba(238, 144, 126, 0.15);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
    --shadow-up: 0 -1px 0 var(--rule-2), 0 -14px 30px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--paper);
  /* grana carta leggerissima */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.num { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; letter-spacing: 0.02em; }
.label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.display { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.stack-s > * + * { margin-top: 6px; }
.stack-l > * + * { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-top { display: flex; align-items: flex-start; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; text-align: right; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─────────────── Guscio ─────────────── */

.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(var(--safe-t) + 58px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule-2);
}
.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .sub { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.01em; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: -4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
}
.icon-btn:active { background: var(--rule-2); }
.icon-btn svg { width: 24px; height: 24px; }

.main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tab-h) + var(--safe-b) + 28px);
}
.main.no-tabs { padding-bottom: calc(var(--safe-b) + 110px); }
.main.con-azione { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 110px); }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 6px 6px calc(var(--safe-b) + 6px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  box-shadow: var(--shadow-up);
}
.tabbar-inner { display: flex; width: 100%; max-width: 560px; }
.tab {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 5px;
  min-height: 50px;
  border-radius: 12px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--gold); }
.tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -6px;
  width: 26px;
  height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--gold);
}
.tab .dot {
  position: absolute;
  top: 4px;
  left: calc(50% + 8px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
}

/* ─────────────── Superfici ─────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card.flat { box-shadow: none; }
.card.tight { padding: 4px 0; }
.card.warn { background: var(--warn-soft); border-color: transparent; box-shadow: none; }
.card.bad { background: var(--bad-soft); border-color: transparent; box-shadow: none; }
.card.gold { background: var(--gold-soft); border-color: transparent; box-shadow: none; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 26px 2px 10px;
}
.section-title h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 19px;
}

/* Liste stile registro: filetti sottili, cifre allineate */
.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule-2);
  background: none;
  width: 100%;
  text-align: left;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  color: inherit;
}
.list > li:first-child > .item,
.list > .item:first-child { border-top: 0; }
button.item:active, a.item:active { background: var(--rule-2); }
a.item { text-decoration: none; }
.item .t { font-weight: 500; line-height: 1.3; }
.item .s { font-size: 13px; color: var(--ink-3); margin-top: 2px; line-height: 1.3; }
.item .v { font-variant-numeric: tabular-nums lining-nums; font-weight: 600; white-space: nowrap; }
.item .chev { color: var(--ink-3); width: 18px; height: 18px; flex: none; }

.ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--paper-2);
  color: var(--ink-2);
}
.ico svg { width: 20px; height: 20px; }
.ico.gold { background: var(--gold-soft); color: var(--gold-deep); }
.ico.bad { background: var(--bad-soft); color: var(--bad); }
.ico.ok { background: var(--ok-soft); color: var(--ok); }
.ico.warn { background: var(--warn-soft); color: var(--warn); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--paper-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.gold { background: var(--gold-soft); color: var(--gold-deep); }

/* ─────────────── Oggi: azioni grandi ─────────────── */

.hello { margin: 6px 2px 18px; }
.hello .display { font-size: 30px; line-height: 1.1; }
.tiles { display: grid; gap: 12px; }
.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 16px;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-l);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s var(--ease);
}
.tile:active { transform: scale(0.985); }
.tile .ico { width: 52px; height: 52px; border-radius: 15px; }
.tile .ico svg { width: 26px; height: 26px; }
.tile .t { font-family: var(--display); font-size: 22px; line-height: 1.1; }
.tile .s { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }

/* ─────────────── Campi ─────────────── */

.field { display: block; }
.field > .label { display: block; margin: 0 2px 7px; }
.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--card);
  font-size: 16px;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus,
.select:focus,
.textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input.code { text-transform: uppercase; letter-spacing: 0.32em; font-weight: 600; text-align: center; font-size: 20px; }
.hint { margin: 6px 2px 0; font-size: 13px; color: var(--ink-3); }
.error-text { margin: 6px 2px 0; font-size: 13.5px; color: var(--bad); font-weight: 500; }
input[type="date"].input { min-height: 50px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }

/* Importo grande, da registratore */
.money {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px 14px;
  border-radius: var(--r-l);
  background: var(--card);
  border: 1px solid var(--rule-2);
  box-shadow: var(--shadow);
}
.money input {
  width: 100%;
  max-width: 260px;
  border: 0;
  background: transparent;
  text-align: right;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 42px;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 0;
  font-variant-numeric: tabular-nums lining-nums;
}
.money input:focus { outline: none; }
.money input::placeholder { color: var(--ink-3); opacity: 0.55; }
.money .cur { font-family: var(--display); font-size: 30px; color: var(--gold); }

/* Chip e segmentati */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--paper-2);
}
.seg button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* La domanda della guida: due scelte grandi */
.choice { display: grid; gap: 10px; }
.choice button {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--rule);
  border-radius: var(--r);
  background: var(--card);
  text-align: left;
}
.choice button[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }
.choice .radio {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  display: grid;
  place-items: center;
}
.choice button[aria-pressed="true"] .radio { border-color: var(--gold); }
.choice button[aria-pressed="true"] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.choice .t { font-weight: 600; }
.choice .s { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--card);
  text-align: left;
}
.switch {
  flex: none;
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: var(--rule);
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--ease);
}
[aria-checked="true"] > .switch { background: var(--gold); }
[aria-checked="true"] > .switch::after { transform: translateX(18px); }

/* Stepper quantità */
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.stepper button:active { background: var(--rule-2); }
.stepper button:disabled { opacity: 0.35; }
.stepper input {
  width: 58px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stepper.big button { width: 56px; height: 56px; font-size: 26px; }
.stepper.big input { width: 84px; height: 56px; font-size: 26px; }

/* Bottoni */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--gold);
  color: var(--on-gold);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.15s var(--ease), opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.soft { background: var(--paper-2); color: var(--ink); }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 14.5px; border-radius: 10px; }
.btn svg { width: 20px; height: 20px; }

.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 12px 16px calc(var(--safe-b) + 12px);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-up);
}
.actionbar > * { max-width: 608px; margin-left: auto; margin-right: auto; }
.with-tabs .actionbar { bottom: calc(var(--tab-h) + var(--safe-b)); padding-bottom: 12px; }

/* Foto fattura */
.photo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1.5px dashed var(--rule);
  border-radius: var(--r);
  background: transparent;
  width: 100%;
  text-align: left;
  color: var(--ink-2);
}
.photo .thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  flex: none;
}
.photo .thumb svg { width: 24px; height: 24px; }

/* ─────────────── Mese ─────────────── */

.hero-num { padding: 22px 18px 18px; text-align: center; }
/* REGOLA: Marcellus solo per le parole, mai per le cifre (lo 0 sembra una O, l'1 una I). */
.hero-num .big {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(36px, 11vw, 52px);
  line-height: 1.02;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums lining-nums;
}
.hero-num .formula { font-size: 12.5px; color: var(--ink-3); }

.bar { height: 6px; border-radius: 3px; background: var(--rule-2); overflow: hidden; margin-top: 7px; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--gold); }
.bar.bad > span { background: var(--bad); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14.5px; }
.kv + .kv { border-top: 1px dashed var(--rule-2); }
.kv .k { color: var(--ink-2); }
.kv .v { font-variant-numeric: tabular-nums lining-nums; font-weight: 600; }

/* ─────────────── Magazzino ─────────────── */

/* Quantità in DM Sans: in Marcellus lo 0 sembra una O e l'1 una I */
.stock { font-family: var(--sans); font-weight: 600; font-size: 22px; line-height: 1; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.stock.bad { color: var(--bad); }
.stock.warn { color: var(--warn); }
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 13px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--ink-3); }
.searchbox .input { padding-left: 40px; }

/* ─────────────── Foglio dal basso ─────────────── */

.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 12, 8, 0.45);
  animation: fade 0.18s ease both;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: calc(100dvh - var(--safe-t) - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 16px calc(var(--safe-b) + 18px);
  border-radius: 22px 22px 0 0;
  background: var(--paper);
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.45);
  animation: rise 0.28s var(--ease) both;
}
.sheet-inner { max-width: 608px; margin: 0 auto; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--rule); margin: 4px auto 12px; }
.sheet h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; }

@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.screen { animation: pop 0.26s var(--ease) both; }

/* ─────────────── Avvisi ─────────────── */

.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--safe-t) + 10px);
  z-index: 90;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  font-size: 15px;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.5);
  animation: pop 0.25s var(--ease) both;
}
.toast.bad { background: var(--bad); color: #fff; }
.toast svg { width: 20px; height: 20px; flex: none; }

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 14px;
}
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--gold-deep); }

.empty { padding: 34px 20px; text-align: center; color: var(--ink-3); }
.empty .display { font-size: 21px; color: var(--ink-2); margin-bottom: 6px; }

.loader { display: grid; place-items: center; padding: 48px 0; }
.loader span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--rule);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--rule-2), var(--rule), var(--rule-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─────────────── Accesso (sempre scuro, come il sito) ─────────────── */

.gate {
  --card: #1d1811;
  --ink: #f1ecdd;
  --ink-2: #c9c0aa;
  --ink-3: #9b917d;
  --rule: rgba(241, 236, 221, 0.18);
  --rule-2: rgba(241, 236, 221, 0.08);
  --gold: #d4ad62;
  --gold-soft: rgba(212, 173, 98, 0.18);
  --on-gold: #17120a;
  --bad: #ee907e;
  color-scheme: dark;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--safe-t) + 32px) 22px calc(var(--safe-b) + 28px);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(212, 173, 98, 0.22), transparent 60%),
    radial-gradient(90% 50% at 100% 110%, rgba(212, 173, 98, 0.1), transparent 60%),
    #100d08;
  color: var(--ink);
}
.gate-inner { width: 100%; max-width: 380px; margin: 0 auto; }
.wordmark { text-align: center; margin-bottom: 34px; }
.wordmark .frame {
  display: inline-block;
  padding: 16px 22px 14px;
  border: 1px solid rgba(212, 173, 98, 0.55);
  outline: 1px solid rgba(212, 173, 98, 0.22);
  outline-offset: 5px;
}
.wordmark .name {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.34em;
  margin-right: -0.34em;
  color: var(--gold);
}
.wordmark .what { margin-top: 18px; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-3); }
.signature { margin-top: 40px; text-align: center; font-family: var(--script); font-size: 34px; color: rgba(212, 173, 98, 0.7); line-height: 1; }
.gate .input { background: rgba(255, 255, 255, 0.04); }
.gate .linkish { display: block; width: 100%; margin-top: 16px; padding: 10px; border: 0; background: none; color: var(--ink-2); font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }

.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

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