/* =========================================================================
   Hair Mentor — Design system
   Palette calda da salone: prugna + rosa cipria su neutri caldi.
   Token di colore su :root, ridefiniti per il tema scuro.
   ========================================================================= */

:root {
  /* Colori di marca (mix Rosé & Onyx, tinte accese) */
  --plum:        #8e3e5c;   /* prugna/rosa, colore principale */
  --plum-dark:   #6b2b45;
  --rose:        #c87e96;   /* rosa, accento */
  --rose-soft:   #f6e4ea;
  --gold:        #cfa056;   /* oro */
  --on-primary:  #ffffff;   /* testo su pulsante/accento principale */

  /* Superfici e testo (tema chiaro) */
  --bg:          #fbf6f2;
  --surface:     #ffffff;
  --surface-2:   #f4ebe6;
  --border:      #eaddd6;
  --text:        #241a1e;
  --text-soft:   #8a7982;
  --text-faint:  #a696a0;

  /* Stati */
  --ok:          #2fa06e;   /* incassi */
  --warn:        #cc8a2e;
  --danger:      #d93b38;   /* uscite, rosso pieno */
  --info:        #3e6fb0;   /* spostamenti */

  /* Condizioni cute (tricocamera) */
  --cute-ottimo: #2fa06e;
  --cute-buono:  #6fb84f;
  --cute-tratt:  #d79a3a;
  --cute-no:     #d93b38;

  /* Forma e profondità */
  --radius:      14px;
  --radius-sm:   9px;
  --radius-lg:   22px;
  --shadow:      0 1px 2px rgba(51,36,42,.06), 0 6px 20px rgba(51,36,42,.08);
  --shadow-soft: 0 1px 3px rgba(51,36,42,.07);

  /* Tipografia */
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Georgia", "Times New Roman", serif;

  /* Misure */
  --maxw: 980px;
  --nav-h: 64px;
}

/* Tema scuro: attivo col sistema, salvo override [data-theme="light"] */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #1a1215;
    --surface:   #241a1e;
    --surface-2: #2c2127;
    --border:    #3a2c32;
    --text:      #f5eaee;
    --text-soft: #c2afb7;
    --text-faint:#9e8a92;
    --rose-soft: #3a2730;
    --plum:      #e3be74;
    --plum-dark: #c99a3f;
    --rose:      #db7e9d;
    --gold:      #e3be74;
    --on-primary:#2a1620;
    --ok:        #4fc08d;
    --warn:      #e7b659;
    --danger:    #f26a63;
    --info:      #6e9be0;
    --cute-ottimo:#4fc08d;
    --cute-buono: #86cc66;
    --cute-tratt: #e7b659;
    --cute-no:    #f26a63;
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.45);
    --shadow-soft: 0 1px 3px rgba(0,0,0,.4);
  }
}
/* Override manuale dalle impostazioni */
:root[data-theme="dark"] {
  --bg:        #1a1215;
  --surface:   #241a1e;
  --surface-2: #2c2127;
  --border:    #3a2c32;
  --text:      #f5eaee;
  --text-soft: #c2afb7;
  --text-faint:#9e8a92;
  --rose-soft: #3a2730;
  --plum:      #e3be74;
  --plum-dark: #c99a3f;
  --rose:      #db7e9d;
  --gold:      #e3be74;
  --on-primary:#2a1620;
  --ok:        #4fc08d;
  --warn:      #e7b659;
  --danger:    #f26a63;
  --info:      #6e9be0;
  --cute-ottimo:#4fc08d;
  --cute-buono: #86cc66;
  --cute-tratt: #e7b659;
  --cute-no:    #f26a63;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.45);
  --shadow-soft: 0 1px 3px rgba(0,0,0,.4);
}

/* ------------------------------------------------------------------ Base */
* { box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom));
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
a { color: var(--plum); }
img { max-width: 100%; display: block; }

/* --------------------------------------------------------------- Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__brand {
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: 0; cursor: pointer; padding: 4px 6px;
  color: var(--text); font-family: var(--font-display); font-size: 1.2rem; font-weight: 600;
}
.topbar__logo {
  width: 32px; height: 32px; border-radius: 10px;
  object-fit: cover; display: block;
}
.topbar__name { letter-spacing: .2px; }
.topbar__account { display: flex; align-items: center; gap: 8px; }
.topbar__gear {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: none; border: 0; cursor: pointer; padding: 0;
  color: var(--text-soft);
}
.topbar__gear:hover { background: var(--surface-2); color: var(--text); }
.topbar__gear .ic { width: 22px; height: 22px; }

/* --------------------------------------------------------- Navigazione */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.nav__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--text-faint);
  font-size: .72rem; font-weight: 600;
}
.nav__ico { font-size: 1.25rem; filter: grayscale(.2); }
.nav__item.is-active { color: var(--plum); }
.nav__item.is-active .nav__ico { filter: none; transform: translateY(-1px); }

/* ---------------------------------------------------------------- View */
.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-left)) 44px max(16px, env(safe-area-inset-right));
}
.page-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 { margin: 0; flex: 1; min-width: 0; }
.breadcrumb { color: var(--text-soft); font-size: .9rem; margin-bottom: 4px; }
.breadcrumb a { text-decoration: none; }

/* -------------------------------------------------------------- Bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text);
  transition: transform .04s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--plum); color: var(--on-primary); box-shadow: var(--shadow-soft); }
.btn--primary:hover { background: var(--plum-dark); }
.btn--ghost { background: transparent; border-color: var(--border); }
.btn--danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn--sm { padding: 6px 12px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn__ico { font-size: 1.05em; }

/* Icone (SVG monocromatiche, stile UICONS Rounded Thin) */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.17em; flex: 0 0 auto; }
.nav__ico .ic { width: 24px; height: 24px; vertical-align: middle; filter: none; }
.quick__ico .ic { width: 26px; height: 26px; }
.empty__ico .ic { width: 42px; height: 42px; }
.card__title .ic, h2 .ic, h3 .ic { width: 1.1em; height: 1.1em; vertical-align: -0.14em; }
.btn--sm .ic { width: 1.05em; height: 1.05em; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  z-index: 15;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--plum); color: var(--on-primary); border: 0; cursor: pointer;
  font-size: 1.7rem; line-height: 1; box-shadow: var(--shadow);
  display: grid; place-items: center;
}

/* --------------------------------------------------------------- Card */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 16px;
}
.card + .card { margin-top: 14px; }
.card__title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.05rem; }
.stack { display: grid; gap: 14px; }

/* Griglia elenco clienti */
.client-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.client-card {
  text-align: left; cursor: pointer; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column;
  color: var(--text-soft); font: inherit;
}
.client-card__cover {
  aspect-ratio: 4 / 3; background: var(--surface-2); position: relative;
  display: grid; place-items: center; overflow: hidden;
}
.client-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.client-card__cover .placeholder { font-size: 2.2rem; color: var(--text-faint); }
.client-card__body { padding: 10px 12px 12px; }
.client-card__name { font-weight: 600; }
.client-card__meta { color: var(--text-soft); font-size: .82rem; }

/* ---------------------------------------------------------------- Pill */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--rose-soft); color: var(--plum);
}
.pill--muted { background: var(--surface-2); color: var(--text-soft); }
.pill--ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill--warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill--danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Condizione cute */
.cute--molto_buono { background: color-mix(in srgb, var(--cute-ottimo) 18%, transparent); color: var(--cute-ottimo); }
.cute--buono       { background: color-mix(in srgb, var(--cute-buono) 20%, transparent);  color: var(--cute-buono); }
.cute--da_trattare { background: color-mix(in srgb, var(--cute-tratt) 22%, transparent);  color: var(--cute-tratt); }
.cute--non_buono   { background: color-mix(in srgb, var(--cute-no) 16%, transparent);     color: var(--cute-no); }
.cdot--molto_buono { background: var(--cute-ottimo); }
.cdot--buono       { background: var(--cute-buono); }
.cdot--da_trattare { background: var(--cute-tratt); }
.cdot--non_buono   { background: var(--cute-no); }

/* --------------------------------------------------------------- Form */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-soft); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft);
}
.textarea { min-height: 84px; resize: vertical; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row--3 { grid-template-columns: 1fr 1fr 1fr; }
.hint { font-size: .78rem; color: var(--text-faint); margin-top: 4px; }
.checkbox { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--text); }
.checkbox input { width: 18px; height: 18px; accent-color: var(--plum); }

/* Dati scheda (coppie etichetta/valore) */
.datalist { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.datalist dt { font-size: .76rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.datalist dd { margin: 2px 0 0; font-weight: 600; }

/* Elenco etichetta/valore leggibile (dettagli espansi, anagrafica) */
.kv { display: grid; }
.kv__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.kv__row:last-child { border-bottom: 0; }
.kv__k { color: var(--text-soft); font-size: .88rem; flex: 0 0 auto; }
.kv__v { font-weight: 600; text-align: right; min-width: 0; word-break: break-word; }
.kv__v a { text-decoration: none; }
/* Blocco nota (testo lungo) */
.noteblock { margin: 12px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.noteblock__k { font-size: .76rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 3px; }

/* ----------------------------------------------------------- Timeline */
.visit { border-left: 3px solid var(--rose); padding: 2px 0 6px 14px; margin-left: 4px; position: relative; }
.visit::before { content: ""; position: absolute; left: -7px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--plum); }
.visit__date { font-weight: 700; }
.formula { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 8px; font-size: .9rem; }
.formula b { color: var(--plum); }

/* --------------------------------------------------------- Gallerie */
.tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 999px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text-soft); padding: 9px; border-radius: 999px; cursor: pointer; }
.tabs button.is-active { background: var(--surface); color: var(--plum); box-shadow: var(--shadow-soft); }

.photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.photo {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); cursor: pointer; border: 1px solid var(--border);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__tag { position: absolute; left: 6px; bottom: 6px; font-size: .68rem; }
.photo__social { position: absolute; right: 6px; top: 6px; font-size: .9rem; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.photo__cover { position: absolute; left: 6px; top: 6px; font-size: .78rem; background: var(--gold); color:#2a1d0a; border-radius:999px; padding:1px 7px; font-weight:700; }

/* Visualizzatore foto a schermo intero */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.86); display: grid; grid-template-rows: 1fr auto; }
.lightbox__img { display: grid; place-items: center; padding: 16px; overflow: auto; }
.lightbox__img img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox__bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 14px; background: rgba(0,0,0,.4); }

/* --------------------------------------------------------------- Conti */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-soft); }
.kpi__lbl { font-size: .76rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.kpi__val { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.kpi--in .kpi__val { color: var(--ok); }
.kpi--out .kpi__val { color: var(--danger); }
.kpi--profit .kpi__val { color: var(--plum); }

.movlist { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mov { display: flex; align-items: center; gap: 12px; background: var(--surface); padding: 11px 14px; }
.mov__cat { flex: 1; min-width: 0; }
.mov__cat b { display: block; }
.mov__cat small { color: var(--text-soft); }
.mov__amt { font-weight: 700; white-space: nowrap; }
.mov__amt.in { color: var(--ok); }
.mov__amt.out { color: var(--danger); }

/* Grafici SVG */
.chart { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; font-size: .82rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); }

/* --------------------------------------------------------------- Modale */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(28,18,22,.5); display: grid; place-items: end center; }
@media (min-width: 640px) { .modal-bg { place-items: center; } }
.modal {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow);
  padding: 20px max(18px, env(safe-area-inset-left)) calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) { .modal { border-radius: var(--radius-lg); } }
.modal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal__head h2 { flex: 1; margin: 0; }
.modal__close { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; color: var(--text-soft); }
.modal__actions { display: flex; gap: 10px; margin-top: 18px; }
.modal__actions .btn { flex: 1; }

/* --------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px); z-index: 70;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px;
  font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--err { background: var(--danger); color: #fff; }

/* --------------------------------------------------------------- Home */
.hero { margin-bottom: 4px; }
.hero__hi { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.hero__date { color: var(--text-soft); text-transform: capitalize; }
.quick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); margin: 16px 0; }
.quick__btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 8px; color: var(--text); font: inherit; font-weight: 600; font-size: .82rem; box-shadow: var(--shadow-soft);
}
.quick__btn:active { transform: translateY(1px); }
.quick__ico { font-size: 1.5rem; }

.home-appt { padding: 12px 14px; }
.home-appt__head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; cursor: pointer; font: inherit; color: var(--text); text-align: left; padding: 2px; }
.home-appt__time { font-weight: 700; color: var(--plum); min-width: 48px; }
.home-appt__who { font-weight: 600; }
.home-appt__sub { color: var(--text-soft); font-size: .85rem; }
.home-appt__chev { margin-left: auto; color: var(--text-faint); font-size: .9rem; }
.home-appt__details { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border); }

/* --------------------------------------------------------- Fotocamera */
.cam-wrap { text-align: center; }
.cam-stage { position: relative; width: 100%; max-width: 340px; margin: 0 auto; background: #000; border-radius: var(--radius); overflow: hidden; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-mask { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.cam-err { color: var(--text-soft); font-size: .88rem; padding: 14px; max-width: 340px; margin: 10px auto 0; background: var(--surface-2); border-radius: var(--radius-sm); }

/* Scatto SEMPRE al centro; switch camera a distanza fissa alla sua sinistra. */
.cam-ctrl { position: relative; display: flex; align-items: center; justify-content: center; min-height: 80px; margin: 10px 0 4px; }
.cam-switch { position: absolute; top: 50%; left: calc(50% - 97px); transform: translateY(-50%); }
.cam-iconbtn { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); cursor: pointer; padding: 0; }
.cam-iconbtn:active { transform: translateY(-50%) scale(.96); }
.cam-iconbtn .ic { width: 22px; height: 22px; }
/* Riga selettori: galleria · foto/video · cornici (allineati, distanziati dallo scatto) */
.cam-select { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; max-width: 320px; margin: 22px auto 10px; }
.cam-select__cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: 0; cursor: pointer; font: inherit; color: var(--text-soft); padding: 0; }
.cam-select__lbl { font-size: .68rem; color: var(--text-faint); max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-tile { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); background: var(--surface-2); color: var(--text-soft); }
.cam-tile img { width: 100%; height: 100%; object-fit: cover; }
.cam-tile .ic { width: 24px; height: 24px; }
.cam-tile.is-active { border-color: var(--plum); }
.cam-tile.is-disabled { opacity: .4; }
.cam-tile__none { font-size: 1.2rem; color: var(--text-faint); }
.cam-seg { display: inline-flex; align-items: center; height: 46px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.cam-seg__btn { border: 0; background: none; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; color: var(--text-soft); padding: 0 16px; height: 100%; border-radius: 999px; }
.cam-seg__btn.is-active { background: var(--plum); color: var(--on-primary); }
.cam-shutter { width: 66px; height: 66px; border-radius: 50%; border: 4px solid var(--plum); background: var(--surface); cursor: pointer; box-shadow: var(--shadow); }
.cam-shutter:active { transform: scale(.96); }
.cam-shutter--rec { border-color: var(--danger); position: relative; }
.cam-shutter--rec::after { content: ""; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border-radius: 50%; background: var(--danger); }
.cam-shutter--rec.is-rec::after { border-radius: 5px; width: 24px; height: 24px; animation: campulse 1s infinite; }
@keyframes campulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.cam-timer { display: inline-block; background: var(--danger); color: #fff; font-weight: 700; font-size: .8rem; padding: 2px 10px; border-radius: 999px; }

.mask-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mask-chip { flex: 0 0 auto; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; cursor: pointer; font: inherit; color: var(--text-soft); padding: 0; }
.mask-chip > img, .mask-chip__none { width: 52px; height: 66px; border-radius: 8px; object-fit: cover; border: 2px solid var(--border); background: var(--surface-2); }
.mask-chip__none { display: grid; place-items: center; font-size: 1.2rem; color: var(--text-faint); }
.mask-chip.is-active > img, .mask-chip.is-active .mask-chip__none { border-color: var(--plum); }
.mask-chip__lbl { font-size: .68rem; max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Maschere in Impostazioni */
.mask-manage { display: flex; gap: 10px; flex-wrap: wrap; }
.mask-manage__item { width: 90px; }
.mask-manage__item > img { width: 90px; height: 114px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.mask-manage__name { font-size: .78rem; text-align: center; margin-top: 4px; word-break: break-word; }

/* -------------------------------------------------------- Vuoto / varie */
.empty { text-align: center; color: var(--text-soft); padding: 40px 20px; }
.empty__ico { font-size: 2.6rem; }
.search { width: 100%; }
.spacer { flex: 1; }
.muted { color: var(--text-soft); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.wrap-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 420px) {
  .row, .row--3 { grid-template-columns: 1fr; }
}
