/* ============================================================================
   Bruumers Portal — stile (dark + oro, l'identità di bruumers.it).
   Computer: barra laterale e contenuto a tutta larghezza, con griglie.
   Telefono: barra in alto, menu in basso, una colonna.
   ============================================================================ */

/* ── Font: Outfit (titoli) e Inter (testo), serviti dal portale ────────────────
   Gli stessi file variabili che dava Google Fonts (un file per tutti i pesi),
   senza collegarsi a server esterni: "latin" copre l'italiano, "latin-ext" si
   scarica solo se serve un carattere che lo richiede. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/outfit-v15-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/outfit-v15-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-v20-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-v20-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* marchio */
  --gold: #c9a84c;
  --gold-light: #e3cc7a;
  --gold-dark: #a88a2e;
  /* oro "pieno" (bottoni, barre, medaglie): uguale nei due temi */
  --fill-gold: #c9a84c;
  --fill-gold-light: #e3cc7a;
  --gold-soft: rgba(201, 168, 76, 0.12);
  --gold-line: rgba(201, 168, 76, 0.32);
  --line-gold: var(--gold-line);
  /* superfici */
  --bg: #0a0a0b;
  --bg-elev: #0e0e10;
  --surface: #141417;
  --surface-2: #1a1a1e;
  --surface-3: #222227;
  --input-bg: #0c0c0e;
  --black: #0a0a0a;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.2);
  --tint-1: rgba(255, 255, 255, 0.025);
  --tint-2: rgba(255, 255, 255, 0.055);
  --tint-3: rgba(255, 255, 255, 0.085);
  --placeholder: #5d5d64;
  --topbar-bg: rgba(10, 10, 11, 0.9);
  --nav-bg: rgba(12, 12, 14, 0.95);
  --float-bg: rgba(24, 24, 28, 0.94);
  --scrim: rgba(0, 0, 0, 0.66);
  --th-bg: #17171b;
  --sticky-bg: #151518;
  --track: #2b2b31;
  --tick-line: #3a3a40;
  --poster-bg: #050506;
  /* testo */
  --text: #f5f5f4;
  --text-2: #a7a7ae;
  --text-3: #85858d;
  /* stati */
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.1);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.09);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --info: #7aabf7;
  --draft: #9fb0ff;
  --draft-soft: rgba(159, 176, 255, 0.12);
  /* tipografia */
  --font-h: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-b: 'Inter', system-ui, -apple-system, sans-serif;
  /* forme */
  --radius-xs: 8px;
  --radius-sm: 11px;
  --radius: 16px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px rgba(0, 0, 0, 0.45);
  /* struttura */
  --sidebar-w: 264px;
  --topbar-h: 60px;
  --nav-h: 64px;
  --pad: 16px;
  --content-max: 1360px;
}
@media (min-width: 1024px) {
  :root {
    --topbar-h: 72px;
    --nav-h: 0px;
    --pad: clamp(24px, 2.6vw, 40px);
  }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  :root {
    --sidebar-w: 232px;
  }
  .sb-brand {
    gap: 10px;
  }
  .sb-brand img {
    width: 36px;
    height: 36px;
  }
  .sb-brand b {
    font-size: 14.5px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
}
/* Tema chiaro: carta calda, oro più scuro per i testi (contrasto), stessi accenti */
:root[data-theme='light'] {
  color-scheme: light;
  --gold: #8a6a1c;
  --gold-light: #6f5414;
  --gold-soft: rgba(201, 168, 76, 0.17);
  --gold-line: rgba(168, 132, 42, 0.45);
  --bg: #f4f3ef;
  --bg-elev: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --surface-3: #eeebe4;
  --input-bg: #ffffff;
  --line: rgba(28, 24, 14, 0.09);
  --line-2: rgba(28, 24, 14, 0.15);
  --line-3: rgba(28, 24, 14, 0.26);
  --tint-1: rgba(28, 24, 14, 0.025);
  --tint-2: rgba(28, 24, 14, 0.05);
  --tint-3: rgba(28, 24, 14, 0.08);
  --placeholder: #a19c92;
  --text: #1b1915;
  --text-2: #5c5850;
  --text-3: #6e6a62;
  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, 0.08);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.08);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.07);
  --info: #2563eb;
  --draft: #4c58d0;
  --draft-soft: rgba(76, 88, 208, 0.08);
  --shadow: 0 1px 2px rgba(28, 24, 14, 0.05), 0 8px 24px rgba(28, 24, 14, 0.06);
  --shadow-lg: 0 24px 60px rgba(28, 24, 14, 0.18);
  --shadow-hover: 0 2px 4px rgba(28, 24, 14, 0.05), 0 18px 40px rgba(28, 24, 14, 0.13);
  --topbar-bg: rgba(244, 243, 239, 0.93);
  --nav-bg: rgba(255, 255, 255, 0.96);
  --float-bg: rgba(255, 255, 255, 0.96);
  --scrim: rgba(20, 18, 12, 0.4);
  --th-bg: #f8f7f3;
  --sticky-bg: #ffffff;
  --track: #d5d1c8;
  --tick-line: #cdc8bd;
  --poster-bg: #ebe8e1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}
html,
body {
  min-height: 100%;
}
body {
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a {
  color: var(--gold);
  text-decoration: none;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-h);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: 16px; /* niente zoom su iOS */
  color: inherit;
}
img {
  max-width: 100%;
}
svg {
  flex: none;
}
::selection {
  background: rgba(201, 168, 76, 0.35);
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line-2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.small {
  width: 22px;
  height: 22px;
  border-width: 2px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.muted {
  color: var(--text-2);
}
.hidden {
  display: none !important;
}
.center {
  text-align: center;
}
.grow {
  flex: 1;
  min-width: 0;
}
.small {
  font-size: 13px;
}
.muted.small {
  margin: 2px 2px 12px;
}
.hint,
.hint-small {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
}
.hint-small {
  margin: 8px 2px 0;
}
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.loading-inline {
  display: grid;
  place-items: center;
  padding: 56px 20px;
}
.nick {
  color: var(--gold);
  font-weight: 500;
  font-style: italic;
}

/* ── Login ─────────────────────────────────────────────────────────────────── */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 28px;
  padding: 32px 20px;
  background: radial-gradient(90% 60% at 50% 0%, rgba(201, 168, 76, 0.14), transparent 60%), var(--bg);
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.login-logo {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(201, 168, 76, 0.35));
}
.login-brand h1 {
  margin-top: 16px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.login-brand h1 span {
  color: var(--gold);
}
.login-brand p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14.5px;
}
.login-points {
  display: none;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}
.login-card h2 {
  font-size: 22px;
}
.login-card .sub {
  color: var(--text-2);
  font-size: 14px;
  margin: 4px 0 22px;
}
.login-card .btn {
  margin-top: 6px;
}
@media (min-width: 960px) {
  .login {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-content: stretch;
    gap: 0;
    padding: 0;
    background: var(--bg);
  }
  .login-brand {
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    padding: 64px clamp(40px, 6vw, 96px);
    border-right: 1px solid var(--line);
    background: radial-gradient(80% 70% at 15% 20%, rgba(201, 168, 76, 0.2), transparent 60%),
      radial-gradient(60% 60% at 90% 100%, rgba(201, 168, 76, 0.08), transparent 70%), var(--bg-elev);
  }
  .login-logo {
    width: 140px;
    height: 140px;
  }
  .login-brand h1 {
    margin-top: 28px;
    font-size: 44px;
  }
  .login-brand p {
    font-size: 17px;
    max-width: 440px;
  }
  .login-points {
    display: grid;
    gap: 12px;
    margin-top: 36px;
    list-style: none;
  }
  .login-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-2);
    font-size: 15px;
  }
  .login-points svg {
    width: 20px;
    height: 20px;
    color: var(--gold);
  }
  .login-side {
    display: grid;
    place-items: center;
    padding: 48px 32px;
  }
  .login-card {
    padding: 38px 34px 34px;
  }
}

/* ── Struttura: barra laterale, barra in alto, contenuto, menu in basso ──── */
.app {
  min-height: 100vh;
  min-height: 100dvh;
}
.sidebar {
  display: none;
}
.main {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--pad) 0;
  background: var(--topbar-bg);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.tb-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.tb-back {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: -8px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.tb-back:hover {
  background: var(--tint-2);
}
.tb-back svg {
  width: 22px;
  height: 22px;
}
.tb-titles {
  flex: 1;
  min-width: 0;
}
.tb-title {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-sub {
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-sub:empty {
  display: none;
}
.tb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 18px var(--pad) calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px);
}

/* Menu in basso (telefono e tablet) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-top: 1px solid var(--line);
}
.bn-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px 2px;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s var(--ease);
}
.bn-ico {
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: 999px;
  transition: background 0.2s var(--ease);
}
.bn-ico svg {
  width: 22px;
  height: 22px;
}
.bn-item.active {
  color: var(--gold);
}
.bn-item.active .bn-ico {
  background: var(--gold-soft);
}
.bn-item span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 359px) {
  .bn-ico {
    width: 44px;
  }
  .bn-item {
    font-size: 10px;
  }
}

/* Computer: barra laterale fissa */
@media (min-width: 1024px) {
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .bottom-nav,
  .tb-logo {
    display: none;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 16px 16px;
    background: linear-gradient(180deg, rgba(201, 168, 76, 0.05), transparent 220px), var(--bg-elev);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .topbar {
    padding-left: var(--pad);
    padding-right: var(--pad);
  }
  .tb-back {
    margin-left: -10px;
  }
  .tb-title {
    font-size: 23px;
    font-weight: 800;
  }
  .tb-sub {
    font-size: 13.5px;
  }
  .content {
    padding-top: 28px;
    padding-bottom: 64px;
  }
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 18px;
  color: var(--text);
}
.sb-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(201, 168, 76, 0.28));
}
.sb-brand b {
  display: block;
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.sb-brand b i {
  font-style: normal;
  color: var(--gold);
}
.sb-brand small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}
.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sb-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-label {
  padding: 0 12px 6px;
  font-family: var(--font-h);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.sb-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.sb-link svg {
  width: 20px;
  height: 20px;
}
.sb-link:hover {
  background: var(--tint-2);
  color: var(--text);
}
.sb-link.active {
  background: var(--gold-soft);
  color: var(--gold-light);
}
.sb-link.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.sb-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sb-site {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-3);
}
.sb-site svg {
  width: 17px;
  height: 17px;
}
.sb-site:hover {
  color: var(--text);
  background: var(--tint-2);
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid transparent;
  transition: background 0.15s var(--ease);
}
.sb-user:hover,
.sb-user.active {
  background: var(--tint-2);
  border-color: var(--line);
}
.sb-ava {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 13px;
  color: var(--black);
  background: linear-gradient(135deg, var(--fill-gold-light), var(--gold-dark));
}
.sb-user b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-user small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}

/* Menu "Altro" (telefono) */
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sheet-head h3 {
  margin: 0;
}
.sheet-menu {
  display: grid;
  gap: 6px;
}
.sheet-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: 15.5px;
}
.sheet-link svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}
.sheet-link.active {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}
.sheet-link small {
  display: block;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--text-2);
}

/* ── Pagina: sezioni e intestazioni ─────────────────────────────────────── */
.page-narrow {
  max-width: 760px;
  margin: 0 auto;
}
.page-mid {
  max-width: 980px;
  margin: 0 auto;
}
.sec {
  margin-bottom: 36px;
}
.sec:last-child {
  margin-bottom: 0;
}
.sec-head {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 14px;
}
.sec-head .grow {
  min-width: 180px;
}
.sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
}
.sec-title .count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--tint-2);
}
.sec-sub {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--text-2);
}
.sec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
/* etichetta piccola (sezioni secondarie e liste) */
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-h);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 26px 2px 12px;
}
.section-label:first-child {
  margin-top: 0;
}
.section-label.row-between {
  justify-content: space-between;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad {
  padding: 20px;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
}
.card-title small {
  margin-left: 6px;
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}

/* ── Bottoni ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: var(--font-h);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, var(--fill-gold-light), var(--fill-gold) 45%, var(--gold-dark));
  color: #141008;
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(201, 168, 76, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-ghost {
  background: var(--tint-2);
  border-color: var(--line-2);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--tint-3);
  border-color: var(--line-3);
}
.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.16);
}
.btn-quiet {
  background: none;
  border-color: transparent;
  color: var(--text-2);
}
.btn-quiet:hover:not(:disabled) {
  background: var(--tint-2);
  color: var(--text);
}
.btn-quiet.danger:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-block {
  width: 100%;
}
.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;
}
.btn-sm svg {
  width: 17px;
  height: 17px;
}
.btn-icon {
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border-radius: 11px;
}
.btn-icon svg {
  width: 19px;
  height: 19px;
}
.fab {
  padding: 0 16px;
}
@media (max-width: 1023px) {
  /* nella barra in alto del telefono solo l'icona, se c'è l'etichetta lunga */
  .tb-actions .btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 14px;
  }
}
.btn-del {
  color: var(--text-2);
}
.btn-del:hover,
.btn-del:active {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.35);
  background: var(--danger-soft);
}
.btn-add {
  border-style: dashed;
  border-color: var(--gold-line);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.04);
}
.btn-add:hover:not(:disabled) {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.btn-add:disabled {
  color: var(--text-3);
  border-color: var(--line);
}
.btn-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-b);
  font-size: inherit;
  font-weight: 600;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link.danger,
.field .btn-link {
  color: var(--danger);
  font-size: 13.5px;
}

/* ── Moduli ────────────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 18px;
}
.field:last-child {
  margin-bottom: 0;
}
.field > label,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.field label .req {
  color: var(--gold);
}
.field .hint {
  margin-top: 7px;
}
.input,
.textarea,
select.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  background: var(--input-bg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--placeholder);
}
.input:hover,
.textarea:hover {
  border-color: var(--line-3);
}
.input:focus,
.textarea:focus,
select.input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
  background: var(--input-bg);
}
.input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a7a7ae' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
input[type='date'].input,
input[type='time'].input {
  min-height: 46px;
}
.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}
.textarea.tall {
  min-height: 240px;
}
.row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.date-preview {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gold);
  margin-top: 8px;
  min-height: 18px;
}
.date-preview:empty {
  display: none;
}
.date-preview.err {
  color: var(--danger);
}
.field .hint.counter {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.field .hint.counter.near {
  color: var(--warn);
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 4px;
  margin: 20px 0;
}
fieldset legend {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}
/* Casella di spunta */
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  margin: 4px 2px 12px;
  cursor: pointer;
}
.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  flex: none;
}
/* Interruttore */
.switch {
  position: relative;
  width: 46px;
  height: 27px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch .track {
  position: absolute;
  inset: 0;
  background: var(--track);
  border-radius: 999px;
  transition: background 0.2s var(--ease);
  pointer-events: none;
}
.switch .track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .track {
  background: var(--gold);
}
.switch input:checked + .track::after {
  transform: translateX(19px);
}
.switch input:focus-visible + .track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: var(--tint-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle-row .name {
  display: block;
  font-weight: 600;
  font-size: 15px;
}
.toggle-row .sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-2);
}
/* Scelta file */
.filepick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 26px 18px;
  border: 1.5px dashed var(--gold-line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-2);
  background: rgba(201, 168, 76, 0.03);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.filepick:hover,
.filepick.drag {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold);
}
.filepick svg {
  width: 28px;
  height: 28px;
  color: var(--gold);
}
.filepick b {
  color: var(--text);
  font-weight: 600;
}
.filepick .small {
  font-size: 12.5px;
  color: var(--text-3);
}
.filepick.compact {
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
}
.filepick.compact svg {
  width: 20px;
  height: 20px;
}
.filepick.compact .txt {
  min-width: 0;
}
.filepick.compact .fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filepick.compact .small {
  margin-top: 2px;
}
.filepick.has-file {
  border-style: solid;
  color: var(--text);
  background: rgba(201, 168, 76, 0.07);
}
.filepick:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Badge, chip, schede a pillole ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  background: var(--tint-1);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-future {
  color: var(--gold-light);
  border-color: var(--gold-line);
}
.badge-live {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.35);
}
.badge-gruppo {
  color: var(--info);
  border-color: rgba(122, 171, 247, 0.4);
}
/* Fuori dalle statistiche: in sordina, è un'eccezione e non un allarme */
.badge-fuori {
  color: var(--text-3);
}
.badge-days::before {
  display: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
  white-space: nowrap;
}
.chip svg {
  width: 12px;
  height: 12px;
}
.chip.admin {
  color: var(--gold);
  border-color: var(--gold-line);
}
.chip.on {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.3);
}
.chip.off {
  color: var(--text-3);
}
.chip.warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.32);
}
.chip.person {
  padding: 6px 11px;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text);
  background: var(--tint-1);
  transition: border-color 0.15s var(--ease);
}
.chip.person:hover {
  border-color: var(--gold-line);
}
.chip.person b {
  color: var(--gold);
}
.chip.stato-richiesto {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.35);
}
.chip.stato-pagato {
  color: var(--info);
  border-color: rgba(122, 171, 247, 0.35);
}
.chip.stato-consegnato {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.3);
}
.chips {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: none;
}
.chips.wrap {
  flex-wrap: wrap;
  flex: initial;
  margin-bottom: 8px;
}

/* Schede a pillole (filtri, viste) */
.tabs {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.tabs button {
  flex: 1 0 auto;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-2);
  font-family: var(--font-h);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tabs button:hover {
  color: var(--text);
}
.tabs button.active {
  background: var(--gold-soft);
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}
.tabs.scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs.scroll::-webkit-scrollbar {
  display: none;
}
.tabs.small button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13.5px;
}
.tabs.flush {
  margin-bottom: 0;
}
/* Schede della Crew: in cima alla pagina */
.crew-tabs {
  margin-bottom: 26px;
}
@media (max-width: 639px) {
  .crew-tabs {
    display: flex;
    width: 100%;
  }
  .crew-tabs button {
    flex: 1 0 auto;
  }
}

/* Barra di filtri e ricerca */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 20px;
}
.toolbar .tabs {
  margin: 0;
}
.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}
.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search .input {
  padding-left: 42px;
}
.toolbar select.input {
  width: auto;
  min-width: 160px;
}
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.check-chip input {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
}
.check-chip:has(input:checked) {
  border-color: var(--gold-line);
  color: var(--gold-light);
  background: var(--gold-soft);
}
@media (max-width: 639px) {
  .toolbar .search {
    flex-basis: 100%;
  }
  .toolbar select.input {
    flex: 1 1 170px;
    min-width: 0;
  }
}

/* ── Avvisi, stato vuoto, toast, modale ─────────────────────────────────── */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(201, 168, 76, 0.07);
  border: 1px solid var(--gold-line);
  border-radius: 14px;
}
.banner > svg {
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: 1px;
  color: var(--gold);
}
.banner.warn {
  background: var(--warn-soft);
  border-color: rgba(251, 191, 36, 0.3);
}
.banner.warn > svg {
  color: var(--warn);
}
.banner b {
  font-weight: 700;
}
.banner .btn {
  margin-top: 8px;
}
a.banner-link {
  color: var(--text);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
a.banner-link:hover,
a.banner-link:focus-visible {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.5);
}
.banner-go {
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
  font-weight: 600;
  color: var(--warn);
}
.empty {
  text-align: center;
  color: var(--text-2);
  padding: 56px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.empty > svg {
  width: 44px;
  height: 44px;
  color: var(--text-3);
  margin-bottom: 12px;
  opacity: 0.8;
}
.empty h3 {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 6px;
}
.empty p {
  max-width: 460px;
  margin: 0 auto;
  font-size: 14px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(24px);
  max-width: min(92vw, 520px);
  padding: 13px 18px;
  border-radius: 14px;
  background: #1e1e22;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f5f5f4;
  font-size: 14.5px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 60;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.ok {
  border-color: rgba(74, 222, 128, 0.45);
}
.toast.err {
  border-color: rgba(248, 113, 113, 0.5);
}
@media (max-width: 1023px) {
  body:has(.ed-actions) .toast {
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 84px);
  }
}
@media (min-width: 1024px) {
  .toast {
    left: auto;
    right: 28px;
    bottom: 28px;
    transform: translateY(24px);
    text-align: left;
  }
  .toast.show {
    transform: translateY(0);
  }
}
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadein 0.2s var(--ease);
}
@keyframes fadein {
  from {
    opacity: 0;
  }
}
.modal {
  width: 100%;
  max-width: 540px;
  max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideup 0.25s var(--ease);
}
@keyframes slideup {
  from {
    transform: translateY(40px);
    opacity: 0.6;
  }
}
.modal h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.modal > p {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.modal .actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal .actions .btn {
  flex: 1;
}
.modal .list-item {
  margin-bottom: 8px;
}
@media (min-width: 640px) {
  .modal-back {
    place-items: center;
    padding: 24px;
  }
  .modal {
    border-radius: 22px;
    padding: 28px 28px 24px;
    max-height: calc(100dvh - 48px);
    animation: pop 0.22s var(--ease);
  }
  @keyframes pop {
    from {
      transform: scale(0.97);
      opacity: 0.5;
    }
  }
  .modal .actions {
    justify-content: flex-end;
  }
  .modal .actions .btn {
    flex: 0 0 auto;
    min-width: 130px;
  }
}

/* ── Righe di elenco (generiche) ────────────────────────────────────────── */
.list {
  display: grid;
  gap: 10px;
}
.list-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
@media (min-width: 900px) {
  .list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
}
.list-item + .list-item {
  margin-top: 10px;
}
.list .list-item + .list-item,
.list-grid .list-item + .list-item {
  margin-top: 0;
}
button.list-item,
a.list-item {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
button.list-item:hover,
a.list-item:hover {
  border-color: var(--line-2);
  background: var(--surface-2);
}
.list-item.off {
  opacity: 0.6;
}
.list-item .name {
  display: block;
  font-weight: 600;
  font-size: 15px;
}
.list-item .name .muted {
  font-weight: 500;
}
.list-item .sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-2);
  word-break: break-word;
}
.list-item.toggle-row {
  background: var(--tint-1);
}

/* Avatar: iniziali su fondo tinto, foto sopra (se si carica) */
.avatar {
  --h: 40;
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  color: var(--gold-light);
  background: linear-gradient(145deg, hsl(var(--h) 26% 27%), hsl(var(--h) 20% 15%));
  box-shadow: 0 0 0 1.5px rgba(201, 168, 76, 0.4);
}
:root[data-theme='light'] .avatar {
  color: hsl(var(--h) 40% 27%);
  background: linear-gradient(145deg, hsl(var(--h) 46% 92%), hsl(var(--h) 34% 82%));
  box-shadow: 0 0 0 1.5px rgba(168, 132, 42, 0.45);
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar.lg {
  width: 52px;
  height: 52px;
  font-size: 17px;
}
.avatar.xl {
  width: 96px;
  height: 96px;
  font-size: 32px;
  box-shadow: 0 0 0 3px var(--gold), 0 12px 30px rgba(0, 0, 0, 0.5);
}
.avatar.sm {
  width: 28px;
  height: 28px;
  margin-left: -4px;
  font-size: 10px;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(201, 168, 76, 0.35);
}
.avatar.sm:first-child {
  margin-left: 0;
}
.avatar.more {
  color: var(--gold);
  background: var(--surface-3);
}
.faces {
  display: inline-flex;
  align-items: center;
}

/* ── Uscite: card con locandina ──────────────────────────────────────────── */
.ucards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.ucard {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-areas: 'poster body' 'poster actions';
  gap: 4px 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.ucard:hover {
  border-color: var(--line-2);
}
.ucard:focus-within {
  border-color: var(--gold-line);
}
.ucard-poster {
  grid-area: poster;
  position: relative;
  align-self: start;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 11px;
  background: var(--poster-bg);
  border: 1px solid var(--line);
}
.ucard-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.ucard-noposter {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 8px;
  text-align: center;
  color: var(--text-3);
  font-size: 11.5px;
  background: repeating-linear-gradient(135deg, var(--tint-1) 0 10px, transparent 10px 20px);
}
.ucard-noposter svg {
  width: 26px;
  height: 26px;
}
.ucard-badges {
  display: none;
}
.ucard-body {
  grid-area: body;
  min-width: 0;
}
.ucard-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.ucard-date {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
}
.ucard-title {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.ucard-title a {
  color: var(--text);
}
.ucard-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
}
.ucard-title a:focus-visible {
  outline: none;
}
.ucard-title a:focus-visible::after {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.ucard-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ucard-meta:empty {
  display: none;
}
/* Andata e ritorno: la traccia parte da Palermo e ci torna (se no, il punto esclamativo giallo) */
.ucard-ar {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
}
.ucard-ar svg {
  flex: none;
  width: 14px;
  height: 14px;
}
.ucard-ar.ok {
  color: var(--ok);
}
a.ucard-ar.warn {
  color: var(--warn);
}
a.ucard-ar.warn:hover {
  text-decoration: underline;
}
.ucard-ar .esclamativo {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fbbf24;
  color: #1c1400;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.ucard-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text);
}
.ucard-stats:empty,
.ucard-stats .crew-count:empty,
.ucard-stats .space:empty {
  display: none;
}
.ucard-stats .crew-count {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.ucard-stats .crew-count > span:last-child {
  white-space: nowrap;
}
.ucard-stats .space {
  color: var(--text-3);
  font-size: 12.5px;
}
.ucard-note {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--draft);
}
.ucard-actions {
  grid-area: actions;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.ucard-actions .btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13.5px;
  border-radius: 10px;
}
.ucard-actions .btn svg {
  width: 17px;
  height: 17px;
}
.ucard.is-draft .ucard-poster img {
  filter: saturate(0.55) brightness(0.8);
}
.ucard.is-draft {
  border-style: dashed;
  border-color: var(--draft-soft);
  border-color: color-mix(in srgb, var(--draft) 45%, transparent);
}
/* Presenze, Foto e Card: sul telefono sotto locandina e testo, a tutta larghezza;
   nelle schede strette la card per Instagram resta solo con l'icona e, con
   tutti e tre i bottoni (.tre), anche Foto: altrimenti l'ultimo esce dalla scheda */
.ucard {
  container-type: inline-size;
}
@media (max-width: 639px) {
  .ucard {
    grid-template-areas: 'poster body' 'actions actions';
  }
}
@container (max-width: 330px) {
  .ucard-actions {
    gap: 6px;
  }
  .ucard .ucard-actions .btn {
    flex: 1 1 auto;
    padding: 0 10px;
  }
  .ucard .ucard-actions .btn-card,
  .ucard .ucard-actions.tre .btn-foto {
    flex: 0 0 40px;
    padding: 0;
  }
  .ucard-actions .btn-card span,
  .ucard-actions.tre .btn-foto span {
    display: none;
  }
}
@media (max-width: 379px) {
  .ucard-actions .btn span {
    display: none;
  }
  .ucard-actions .btn {
    width: 38px;
    padding: 0;
  }
}
@media (min-width: 640px) {
  .ucards {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }
  .ucard {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 'poster' 'body' 'actions';
    gap: 0;
    padding: 0;
    overflow: hidden;
  }
  .ucard:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
  }
  .ucard:hover .ucard-poster img {
    transform: scale(1.03);
  }
  .ucard-poster {
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
  }
  .ucard-badges {
    position: absolute;
    left: 10px;
    top: 10px;
    right: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 1;
  }
  /* sopra la locandina: sempre su vetro scuro, in tutti e due i temi */
  .ucard-badges .badge {
    color: #d4d4d8;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(10, 10, 11, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .ucard-badges .badge-live {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.45);
  }

  .ucard-top {
    display: none;
  }
  .ucard-body {
    padding: 14px 16px 6px;
  }
  .ucard-actions {
    padding: 4px 12px 12px;
    justify-content: flex-start;
  }
  .ucard-actions .btn {
    flex: 1;
  }
}
/* La prossima uscita in evidenza (computer): locandina a sinistra, dettagli a destra */
@media (min-width: 900px) {
  .ucards.feature {
    grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  }
  .ucards.feature .ucard {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    grid-template-areas: 'poster body' 'poster actions';
  }
  .ucards.feature .ucard-poster {
    border-bottom: 0;
    border-right: 1px solid var(--line);
    align-self: stretch;
  }
  .ucards.feature .ucard-body {
    padding: 20px 22px 8px;
  }
  .ucards.feature .ucard-title {
    font-size: 21px;
    -webkit-line-clamp: 3;
  }
  .ucards.feature .ucard-date {
    font-size: 13.5px;
  }
  .ucards.feature .ucard-actions {
    padding: 8px 18px 18px;
  }
  .ucards.feature .ucard-actions .btn {
    flex: 0 0 auto;
  }
}
.countdown {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold-light);
  background: var(--gold-soft);
}

/* ── Editor dell'uscita ──────────────────────────────────────────────────── */
.editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ed-main,
.ed-side {
  display: contents;
}
.ed-card {
  padding: 20px 18px;
}
.ed-card-head {
  margin-bottom: 18px;
}
.ed-card-head h2 {
  font-size: 18px;
  font-weight: 700;
}
.ed-card-head p {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--text-2);
}
.ed-card-head p:empty {
  display: none;
}
/* sul telefono lo stato va in cima (i pulsanti stanno nella barra in basso) */
.pub-card {
  order: -1;
}
.pub-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-h);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--line-2);
}
.pub-state .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.pub-state.live {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.35);
  background: var(--ok-soft);
}
.pub-state.live .dot {
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
}
.pub-state.draft {
  color: var(--draft);
  border-color: var(--draft);
  border-style: dashed;
  background: var(--draft-soft);
}
.pub-state.new {
  color: var(--gold-light);
  border-color: var(--gold-line);
  background: var(--gold-soft);
}
/* Solo per il gruppo: online per il gruppo, non sul sito */
.pub-state.gruppo {
  color: var(--info);
  border-color: rgba(122, 171, 247, 0.4);
  background: rgba(122, 171, 247, 0.1);
}
.pub-gruppo {
  margin: 14px 0 0;
  padding: 12px 14px;
}
.pub-gruppo + .pub-gruppo {
  margin-top: 8px;
}
.pub-gruppo .sub {
  font-size: 12.5px;
  line-height: 1.45;
}
.pub-text {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.pub-missing {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--warn);
}
.pub-missing:empty {
  display: none;
}
.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}
.pub-link svg {
  width: 16px;
  height: 16px;
}
.ed-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
/* Telefono: azioni sempre a portata, sopra il menu in basso */
@media (max-width: 1023px) {
  .ed-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    z-index: 25;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 10px var(--pad);
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .ed-actions .btn {
    order: 2;
  }
  .ed-actions .btn-primary {
    order: 3;
  }
  .editor-page {
    padding-bottom: 76px;
  }
}
.ed-poster-box {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 520px;
  overflow: hidden;
  border-radius: 14px;
  border: 1.5px dashed var(--gold-line);
  background: rgba(201, 168, 76, 0.03);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.ed-poster-box:hover,
.ed-poster-box.drag {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}
.ed-poster-box.has-file {
  border-style: solid;
  border-color: var(--line-2);
  background: var(--poster-bg);
}
.ed-poster-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ed-poster-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}
.ed-poster-empty svg {
  width: 34px;
  height: 34px;
  color: var(--gold);
}
.ed-poster-empty b {
  color: var(--text);
}
.ed-poster-empty small {
  color: var(--text-3);
  font-size: 12.5px;
}
.ed-poster-box.has-file .ed-poster-empty {
  display: none;
}
.ed-poster-change {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #f5f5f4;
  background: rgba(10, 10, 11, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.ed-poster-change svg {
  width: 15px;
  height: 15px;
}
.ed-poster-box.has-file .ed-poster-change {
  display: inline-flex;
}
@media (max-width: 1023px) {
  .ed-poster-box {
    max-width: 340px;
    margin: 0 auto;
  }
}
/* computer: la locandina a sinistra, la spiegazione accanto */
@media (min-width: 1024px) {
  .ed-poster {
    display: grid;
    grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
    gap: 0 24px;
    align-items: start;
  }
  .ed-poster .ed-card-head {
    grid-column: 2;
    grid-row: 1;
  }
  .ed-poster .ed-poster-box {
    grid-column: 1;
    grid-row: 1;
  }
}
.ed-danger {
  display: flex;
  justify-content: center;
}
@media (min-width: 1024px) {
  .editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 30%);
    align-items: start;
    gap: 24px;
  }
  .ed-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .ed-side {
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .ed-card {
    padding: 26px 26px;
  }
  .ed-danger {
    justify-content: flex-start;
  }
}
@media (min-width: 1280px) {
  .editor {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
  }
}

/* Programma: gruppi Percorsi / Pranzo / Cena */
.prog-group {
  margin-bottom: 18px;
}
.prog-group:last-child {
  margin-bottom: 0;
}
.prog-group + .prog-group {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.prog-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--font-h);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.prog-head svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}
.sub-card,
.rest-row {
  background: var(--tint-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
}
.sub-card {
  padding: 14px 16px 16px;
}
.sub-card .field {
  margin-bottom: 14px;
}
.sub-card .field:last-child {
  margin-bottom: 0;
}
.sub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.sub-card .sub-grid .field {
  margin: 0;
}
@media (min-width: 760px) {
  .sub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--font-h);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}
.rest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
}
@media (min-width: 560px) {
  .rest-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .rest-row .btn-del {
    order: 3;
  }
}
.trip-card {
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: none;
  background: rgba(201, 168, 76, 0.04);
  border-color: var(--gold-line);
}
.trip-card .field {
  margin-bottom: 0;
}
.day-card {
  margin-bottom: 12px;
  box-shadow: none;
  background: var(--tint-1);
  transition: border-color 0.2s var(--ease);
}
.day-card.open {
  border-color: var(--gold-line);
}
.day-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.day-title {
  display: block;
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.day-title .n {
  color: var(--gold);
}
.day-sub {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-sub:empty {
  display: none;
}
.day-head .chev svg {
  display: block;
  width: 20px;
  height: 20px;
  color: var(--text-3);
  transition: transform 0.2s var(--ease);
}
.day-card.open .chev svg {
  transform: rotate(180deg);
  color: var(--gold);
}
.day-body {
  border-top: 1px solid var(--line);
  padding: 16px;
}
.day-card:not(.open) .day-body {
  display: none;
}

/* Versione inglese (facoltativa) di uscita, giorni, premi e accessori: un
   riquadro richiudibile sotto i campi italiani. */
.ed-en {
  margin-top: 4px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  transition: border-color 0.2s var(--ease);
}
.ed-en[open] {
  border-style: solid;
  border-color: var(--gold-line);
}
.field + .ed-en,
.ed-en + .field {
  margin-top: 18px;
}
.ed-en > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-h);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.ed-en > summary::-webkit-details-marker {
  display: none;
}
.ed-en > summary small {
  font-family: var(--font-b);
  font-weight: 500;
  color: var(--text-3);
}
.ed-en > summary svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: transform 0.2s var(--ease);
}
.ed-en[open] > summary svg {
  transform: rotate(180deg);
  color: var(--gold);
}
.ed-en-flag {
  font-size: 18px;
  line-height: 1;
}
.ed-en-body {
  padding: 2px 14px 14px;
}
.ed-en-aiuto {
  margin: 0 0 14px;
}
.ed-en-giorno {
  margin-bottom: 18px;
}
.ed-en-giorno + .prog-group {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
/* Proposte e richieste di credenziali arrivate dal sito in inglese */
.chip.lingua-en {
  margin-left: 6px;
  color: var(--info);
  border-color: rgba(122, 171, 247, 0.4);
}
/* Credenziali: stato dell'accesso di un membro, sotto la sua email */
.abilitato-stato {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}

/* ── Foto di un'uscita ─────────────────────────────────────────────────── */
.foto-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 640px) {
  .foto-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
  }
}
.foto-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--poster-bg);
}
.foto-item img {
  display: block; /* in linea lascerebbe sotto lo spazio della riga: il riquadro potrebbe scorrere */
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}
.foto-item:hover img {
  transform: scale(1.04);
}
.foto-item .vid {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--gold);
}
.foto-item .vid svg {
  width: 30px;
  height: 30px;
}
.foto-item .del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.foto-item .del:hover {
  background: var(--danger);
}
.foto-item .del svg {
  width: 15px;
  height: 15px;
}
.foto-item .size {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  pointer-events: none;
}
/* Riordino: numero, maniglia e frecce su ogni foto */
.foto-grid.riordino .foto-item {
  cursor: grab;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  scroll-margin: calc(var(--topbar-h) + env(safe-area-inset-top) + 10px) 0 calc(var(--nav-h) + env(safe-area-inset-bottom) + 90px);
}
.foto-grid.riordino .foto-item img {
  pointer-events: none; /* niente trascinamento nativo dell'immagine */
}
.foto-grid.riordino .foto-item:hover img {
  transform: none;
}
.foto-grid.in-presa,
.foto-grid.in-presa * {
  cursor: grabbing;
}
.foto-item.trascinata {
  opacity: 0.3;
  border: 1px dashed var(--gold);
}
.foto-item.foto-fantasma {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  pointer-events: none;
  border-color: var(--gold);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.foto-item .pos {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  pointer-events: none;
}
.foto-item .grip,
.foto-item .sposta {
  position: absolute;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
}
.foto-item .grip {
  top: 4px;
  right: 4px;
  touch-action: none; /* il dito sposta la foto, non la pagina */
}
.foto-item .sposta {
  bottom: 4px;
  cursor: pointer;
  touch-action: manipulation;
}
.foto-item .sposta[data-sposta='-1'] {
  left: 4px;
}
.foto-item .sposta[data-sposta='1'] {
  right: 4px;
}
.foto-item .sposta:disabled {
  opacity: 0.35;
  cursor: default;
}
.foto-item .grip svg,
.foto-item .sposta svg {
  width: 17px;
  height: 17px;
}
/* Riordino: il cestino in alto a sinistra, il numero al centro */
.foto-item .togli {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s var(--ease);
}
.foto-item .togli:hover {
  background: var(--danger);
}
.foto-item .togli svg {
  width: 16px;
  height: 16px;
}
/* (anche nella copia trascinata, che sta fuori dalla griglia) */
.foto-item button.pos {
  left: 50%;
  transform: translateX(-50%);
}
/* Da pubblicare: le nuove hanno l'etichetta, quelle da togliere sono spente */
.foto-item .stato-foto {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--fill-gold);
  color: #141008;
  pointer-events: none;
}
.foto-item .stato-foto.via {
  background: var(--danger);
  color: #fff;
}
.foto-item.da-togliere {
  border-style: dashed;
  border-color: var(--danger);
}
.foto-item.da-togliere img,
.foto-item.da-togliere .vid {
  opacity: 0.35;
  filter: grayscale(1);
}
.foto-item .rimetti {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 30px;
  padding: 0 11px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
}
.foto-item .rimetti:hover {
  background: var(--fill-gold);
  color: #141008;
}
/* Riordino: più foto scelte insieme */
.foto-item button.pos {
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.foto-item button.pos:focus-visible {
  outline: 2px solid var(--fill-gold);
  outline-offset: 2px;
}
.foto-item.scelta {
  border-color: var(--fill-gold);
  box-shadow: 0 0 0 3px var(--fill-gold);
}
.foto-item.scelta .pos {
  background: var(--fill-gold);
  color: #141008;
}
.foto-grid.dove .foto-item {
  cursor: pointer;
}
.foto-grid.dove .foto-item > button,
.foto-grid.dove .foto-item .grip {
  pointer-events: none;
  opacity: 0.35;
}
.foto-grid.dove .foto-item.scelta {
  opacity: 0.5;
}
.foto-grid.dove .foto-item:not(.scelta):hover::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--fill-gold);
}
/* Il gruppo trascinato: una pila, col numero delle foto */
.foto-item.foto-fantasma.gruppo {
  box-shadow: 9px 9px 0 -1px var(--poster-bg), 9px 9px 0 0 var(--fill-gold), 0 14px 34px rgba(0, 0, 0, 0.5);
}
.foto-item .quante {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 800;
  background: var(--fill-gold);
  color: #141008;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.selbar {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top) + 8px);
  z-index: 16;
  margin: 0 0 12px;
}
.selbar-in {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 6px 6px 16px;
  background: var(--float-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--gold-line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.selbar-n {
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.selbar-n b {
  color: var(--text);
  font-family: var(--font-h);
  font-size: 19px;
}
.selbar-azioni,
.selbar-dove {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.selbar-dove span {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
@media (max-width: 480px) {
  .savebar .solo-largo,
  .selbar .solo-largo {
    display: none;
  }
  .selbar-azioni {
    gap: 2px;
  }
}
.jobs .banner .btn {
  min-height: 34px;
  margin: 8px 8px 0 0;
}

/* ── Storico: linea del tempo ─────────────────────────────────────────── */
.timeline {
  position: relative;
  list-style: none;
  display: grid;
  gap: 12px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--line-2);
}
.tl-item {
  position: relative;
  display: flex;
  gap: 16px;
}
.tl-dot {
  position: relative;
  z-index: 1;
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 16px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line-2);
}
.tl-item.current .tl-dot {
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}
.tl-card {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.tl-item.current .tl-card {
  border-color: var(--gold-line);
}
.tl-who {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.tl-who b {
  font-weight: 600;
}
.tl-who time {
  font-size: 12.5px;
  color: var(--text-3);
}
.tl-msg {
  margin-top: 3px;
  font-size: 14px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ── Tabelle dati (registro, utenti) ──────────────────────────────────── */
.table-card {
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-h);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--tint-1);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:hover td {
  background: var(--tint-1);
}
.data-table .nowrap {
  white-space: nowrap;
}
.data-table .dim {
  color: var(--text-3);
  font-size: 13px;
}
.data-table .act {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--gold);
  white-space: nowrap;
}
.data-table tr.fail .act {
  color: var(--danger);
}
.data-table .what {
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.data-table .right {
  text-align: right;
}
.data-table .who {
  font-weight: 600;
}
.data-table .who small {
  display: block;
  font-weight: 400;
  color: var(--text-3);
  font-size: 12.5px;
}
@media (max-width: 760px) {
  .data-table thead {
    display: none;
  }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    position: relative;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .data-table tbody tr:last-child {
    border-bottom: 0;
  }
  .data-table td {
    padding: 2px 0;
    border: 0;
  }
  .data-table td.right {
    position: absolute;
    right: 12px;
    top: 12px;
    width: auto;
  }
  .data-table td[data-l]::before {
    content: attr(data-l) ' · ';
    color: var(--text-3);
  }
}
.log-more {
  margin-top: 16px;
  text-align: center;
}

/* ── Account ─────────────────────────────────────────────────────────── */
.account-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ── Registro presenze ─────────────────────────────────────────────────── */
.pres-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.pres-tools .search {
  flex: 1 1 240px;
}
.pres-tools .input {
  flex: 1;
  min-width: 0;
}
.pres-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
@media (min-width: 900px) {
  .pres-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (min-width: 1440px) {
  .pres-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.pres-grid > .empty {
  grid-column: 1 / -1;
}
.pres-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.pres-row.on {
  border-color: var(--gold-line);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.08), var(--surface) 70%);
}
.pres-toggle {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: none;
  border: 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.pres-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}
.pres-toggle .name {
  display: block;
  font-weight: 600;
  font-size: 15px;
}
.pres-toggle .sub {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tick {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--tick-line);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tick svg {
  width: 17px;
  height: 17px;
}
.pres-row.on .tick {
  background: var(--fill-gold);
  border-color: var(--fill-gold);
  color: var(--black);
}
#pList.readonly .pres-toggle {
  cursor: default;
}
.pres-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--input-bg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 3px;
}
.seg button {
  border: 0;
  background: none;
  color: var(--text-2);
  min-height: 38px;
  border-radius: 9px;
  font-family: var(--font-h);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}
.seg button.on {
  background: var(--gold-soft);
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}
.seg button:focus-visible,
.day-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.pres-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--input-bg);
  color: var(--text-3);
  font-family: var(--font-h);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.day-chip small {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 11px;
}
.day-chip.on {
  color: var(--gold-light);
  border-color: var(--gold-line);
  background: var(--gold-soft);
}
.pres-extra {
  display: grid;
  gap: 8px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stepper-l {
  flex: 1;
  font-size: 14px;
  color: var(--text-2);
}
.stepper .btn-icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
  font-weight: 700;
}
.stepper-n {
  min-width: 26px;
  text-align: center;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 18px;
}
.pres-more summary {
  cursor: pointer;
  color: var(--text-2);
  font-size: 13.5px;
  padding: 6px 2px;
}
.pres-more[open] summary {
  margin-bottom: 10px;
}
.pres-more .field {
  margin-bottom: 4px;
}
.pres-sum {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 28px);
  margin: 0 14px 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--tint-1);
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.pres-sum .grow {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pres-sum .chev svg {
  display: block;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: transform 0.2s var(--ease);
}
.pres-sum.open {
  color: var(--gold-light);
  border-color: var(--gold-line);
}
.pres-sum.open .chev svg {
  transform: rotate(180deg);
  color: var(--gold);
}
.pres-sum.ro {
  cursor: default;
}
.pres-sum:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
/* Barra di salvataggio, sempre a portata */
.savebar {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 15;
  margin-top: 18px;
}
@media (min-width: 1024px) {
  .savebar {
    bottom: 22px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
}
.savebar-in {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 20px;
  background: var(--float-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--gold-line);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}
.savebar-sum {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.3;
}
.savebar-sum b {
  color: var(--text);
  font-family: var(--font-h);
  font-size: 19px;
  margin-right: 3px;
}
.savebar-sum span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saving #pList,
.saving .pres-tools,
.saving .pres-km {
  pointer-events: none;
  opacity: 0.6;
}
.pres-km[hidden] {
  display: none;
}

/* ── Numeri (riquadri) ────────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
@media (min-width: 640px) {
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1200px) {
  .tiles.wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.tile {
  min-width: 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tile b {
  display: block;
  font-family: var(--font-h);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
.tile span {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gold);
}
.tile small {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-2);
}

/* Panoramica della Crew */
.dash-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
@media (min-width: 900px) {
  .dash-top {
    gap: 18px;
    margin-bottom: 18px;
  }
}
.dash-hero {
  position: relative;
  overflow: hidden;
  padding: 24px 24px 22px;
  border-color: var(--gold-line);
  background: radial-gradient(120% 120% at 0% 0%, rgba(201, 168, 76, 0.22), transparent 55%), var(--surface);
}
.dash-hero .k {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-light);
}
.dash-hero b {
  display: block;
  margin: 8px 0 6px;
  font-family: var(--font-h);
  font-size: clamp(44px, 6vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.dash-hero b small {
  margin-left: 8px;
  font-size: 0.32em;
  color: var(--gold);
  letter-spacing: 0;
}
.dash-hero .s {
  display: block;
  font-size: 14px;
  color: var(--text-2);
}
.dash-tiles {
  margin-bottom: 18px;
}
@media (min-width: 900px) {
  .dash-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  .dash-tiles {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
/* barre orizzontali (marche) */
.bars {
  display: grid;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 132px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.bar-row .l {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.bar-row .v {
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.bar-row .t {
  height: 10px;
  border-radius: 99px;
  background: var(--tint-2);
  overflow: hidden;
}
.bar-row .t i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dark), var(--fill-gold-light));
}

/* Tabelle di statistiche */
.table-wrap {
  position: relative; /* contiene gli elementi assoluti (es. .sr-only) */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 8px;
}
.card .table-wrap {
  border: 0;
  border-radius: 0;
  background: none;
  margin: 0 -20px -20px;
  border-top: 1px solid var(--line);
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.stats-table th,
.stats-table td {
  padding: 11px 14px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
}
.stats-table th {
  background: var(--th-bg);
  font-family: var(--font-h);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-3);
}
.stats-table th button {
  all: unset;
  cursor: pointer;
}
.stats-table th button:hover {
  color: var(--text);
}
.stats-table th button.on {
  color: var(--gold);
}
.stats-table th button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.stats-table.sticky th:first-child,
.stats-table.sticky td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--sticky-bg);
  box-shadow: 1px 0 0 var(--line);
}
.stats-table td a {
  color: var(--text);
  font-weight: 600;
}
.stats-table td a:hover {
  color: var(--gold-light);
}
.stats-table tr.off td {
  color: var(--text-3);
}
.stats-table tbody tr:last-child td {
  border-bottom: 0;
}
.stats-table tbody tr:hover td {
  background: var(--tint-1);
}
.stats-table th.txt,
.stats-table td.txt {
  text-align: left;
}
.stats-table td.bar-cell {
  width: 32%;
  min-width: 80px;
  text-align: left;
}
.hbar {
  display: block;
  height: 10px;
  border-radius: 0 5px 5px 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--fill-gold));
}

/* ── Membri: schede ─────────────────────────────────────────────────────── */
.mgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
@media (min-width: 700px) {
  .mgrid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
  }
}
.mcard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), background 0.15s var(--ease);
}
.mcard:hover {
  border-color: var(--gold-line);
  background: var(--surface-2);
}
.mcard.off {
  opacity: 0.6;
}
.mcard .name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mcard .sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcard .chips {
  margin-top: 7px;
  flex-wrap: wrap;
}
.mcard .chips:empty {
  display: none;
}
.mcard-rank {
  flex: none;
  width: 28px;
  text-align: center;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 15px;
  color: var(--text-3);
}
.mcard-rank.r1,
.mcard-rank.r2,
.mcard-rank.r3 {
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--black);
}
.mcard-rank.r1 {
  background: linear-gradient(135deg, #f3dc8e, var(--fill-gold));
}
.mcard-rank.r2 {
  background: linear-gradient(135deg, #e4e4e4, #a8a8a8);
}
.mcard-rank.r3 {
  background: linear-gradient(135deg, #e0a872, #a8693a);
}
.mcard-score {
  flex: none;
  text-align: right;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  color: var(--gold);
}
.mcard-score small {
  display: block;
  font-family: var(--font-b);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}
/* Scegliendo chi confrontare: la scheda è una casella da spuntare */
button.mcard {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mcard.scelto {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.mcard.scegli:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.mcard-spunta {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-2);
  color: transparent;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.mcard-spunta svg {
  width: 15px;
  height: 15px;
}
.mcard.scelto .mcard-spunta {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--black);
}
@media (max-width: 480px) {
  #mSelVai svg {
    display: none; /* sul telefono serve lo spazio per i nomi scelti */
  }
}
.sel-nome {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  cursor: pointer;
}
.sel-nome input {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
}

/* ── Confronto tra membri ───────────────────────────────────────────────── */
.conf > * + * {
  margin-top: 18px;
}
.conf-chi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.conf-scelti {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.conf-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 5px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: var(--tint-1);
  font-size: 14px;
  font-weight: 600;
}
.conf-chip a {
  color: var(--text);
}
.conf-chip a:hover {
  color: var(--gold-light);
}
.conf-togli {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.conf-togli:hover {
  background: var(--tint-2);
  color: var(--text);
}
.conf-togli svg {
  width: 14px;
  height: 14px;
}
.conf-chi select.conf-aggiungi {
  width: auto;
  flex: 1 1 220px;
  max-width: 340px;
}
.conf-esito {
  margin: -4px 0 14px;
  font-size: 14px;
  color: var(--text-2);
}
.conf-esito b {
  color: var(--text);
}
.conf-table td {
  vertical-align: top;
}
/* Le voci a sinistra: testo normale (non come le intestazioni), che può andare a capo */
.conf-table tbody th {
  min-width: 120px;
  font-family: var(--font-b);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-2);
  white-space: normal;
}
@media (max-width: 700px) {
  .conf-table th,
  .conf-table td {
    padding: 9px 10px;
  }
  .conf-table tbody th {
    min-width: 92px;
    max-width: 118px;
    font-size: 13px;
  }
  .conf-th a {
    max-width: 88px;
  }
  .conf-bar {
    width: 48px;
  }
}
.conf-table th small,
.conf-km {
  display: block;
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
}
.conf-table th.txt small {
  display: inline;
  margin-left: 4px;
}
.conf-th a {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 130px;
  margin-left: auto;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0;
  white-space: normal;
  text-align: right;
}
.conf-th a:hover {
  color: var(--gold-light);
}
.conf-numeri td.top {
  color: var(--gold);
  font-weight: 700;
}
.conf-corona {
  margin-right: 5px;
}
.conf-bar {
  display: block;
  width: 72px;
  height: 4px;
  margin: 6px 0 0 auto;
  border-radius: 99px;
  background: var(--tint-2);
  overflow: hidden;
}
.conf-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--text-3);
}
.conf-numeri td.top .conf-bar i {
  background: linear-gradient(90deg, var(--gold-dark), var(--fill-gold));
}
.conf-date td {
  color: var(--text-2);
}
.conf-premi td.si {
  color: var(--ok);
}
.conf-premi td.si svg {
  width: 16px;
  height: 16px;
}
.conf-premi td.no {
  color: var(--text-3);
}
.conf .hist-list {
  grid-template-columns: minmax(0, 1fr);
}
.conf-sotto {
  margin: 20px 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}

/* ── Premi (come gli obiettivi di Xbox 360) e accessori ─────────────────── */
.ach-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}
@media (min-width: 700px) {
  .ach-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (min-width: 1280px) {
  .ach-list.wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.ach {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}
button.ach {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
button.ach:hover {
  border-color: var(--gold);
  background: var(--surface-2);
}
.ach .grow {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ach-ico {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--surface-3);
  filter: grayscale(1);
  opacity: 0.5;
  box-shadow: inset 0 0 0 1px var(--line);
}
.ach.on .ach-ico {
  filter: none;
  opacity: 1;
  background: radial-gradient(circle at 35% 30%, #f3dc8e, var(--fill-gold) 45%, var(--gold-dark));
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.35);
}
.ach.on {
  border-color: var(--gold-line);
}
.ach-title {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: 15px;
}
.ach-title .chip {
  margin-left: 4px;
  vertical-align: 1px;
}
.ach-desc {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}
.ach-when {
  font-size: 12px;
  color: var(--text-3);
}
.ach.on .ach-when {
  color: var(--gold);
}
.ach-pt {
  flex: none;
  text-align: right;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 19px;
  color: var(--text-3);
}
.ach.on .ach-pt {
  color: var(--gold);
}
.ach-pt small {
  margin-left: 2px;
  font-size: 11px;
}
.bar {
  display: block;
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(201, 168, 76, 0.16);
}
.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dark), var(--fill-gold-light));
}
details.more {
  margin-top: 12px;
}
details.more > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px dashed var(--gold-line);
  border-radius: 12px;
  color: var(--gold);
  font-family: var(--font-h);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}
details.more > summary::-webkit-details-marker {
  display: none;
}
details.more[open] > summary {
  border-style: solid;
}
.emoji-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -6px 0 16px;
}
.emoji-pick button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--input-bg);
  font-size: 19px;
  cursor: pointer;
}
.emoji-pick button:hover {
  border-color: var(--gold);
}
.icon-input {
  font-size: 22px;
  text-align: center;
}
.acc-item.locked {
  opacity: 0.7;
}
.acc-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--line);
}
.acc-thumb.ph {
  display: grid;
  place-items: center;
  color: var(--gold);
}
.acc-thumb.ph svg {
  width: 22px;
  height: 22px;
}
.acc-thumb.lg {
  width: 96px;
  height: 96px;
}
.acc-img-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.acc-img-row .btn-link {
  display: block;
  margin-top: 8px;
}

/* ── Scheda membro ─────────────────────────────────────────────────────── */
.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
@media (min-width: 1200px) {
  .profile {
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
  }
  .profile-side {
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
  }
}
@media (min-width: 1400px) {
  .profile {
    grid-template-columns: 340px minmax(0, 1fr);
  }
}
.profile-card {
  padding: 22px;
}
.member-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.member-hero.form {
  align-items: center;
}
.member-hero h2 {
  font-size: 23px;
  overflow-wrap: anywhere;
}
.member-hero .chips {
  margin: 6px 0 4px;
}
.member-hero .sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text-2);
}
.member-hero .hint {
  margin-top: 8px;
}
.member-hero .btn-link {
  margin-left: 10px;
}
@media (min-width: 1200px) {
  .profile-card .member-hero {
    flex-direction: column;
    text-align: center;
  }
  .profile-card .member-hero .chips {
    justify-content: center;
  }
}
.avatar-edit {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
}
.avatar-edit:disabled {
  cursor: default;
}
.avatar-edit:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
.avatar-cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill-gold);
  color: var(--black);
  box-shadow: 0 0 0 3px var(--surface);
}
.avatar-cam svg {
  width: 16px;
  height: 16px;
}
.avatar-edit.busy .avatar {
  opacity: 0.45;
}
.gamercard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.16), rgba(201, 168, 76, 0.02) 60%), var(--surface-2);
}
.gamercard .gc-k {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.gamercard b {
  font-family: var(--font-h);
  font-size: 28px;
  color: var(--gold);
}
.gamercard small {
  font-size: 13px;
  color: var(--text-2);
}
.gamercard .bar {
  grid-column: 1 / -1;
}
.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.member-actions .btn {
  flex: 1 1 auto;
}
.note-box {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-2);
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.moto-ico {
  font-size: 22px;
}
.moto-card.off {
  opacity: 0.65;
}
.moto-off {
  align-self: end;
  margin: 0 0 18px;
}
.hist-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
@media (min-width: 900px) {
  .hist-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.hist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s var(--ease);
}
.hist-item:hover {
  border-color: var(--line-2);
}
.hist-item .name {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
}
.hist-item .sub {
  display: block;
  font-size: 13px;
  color: var(--text-2);
}
.hist-item .sub.nota {
  color: var(--warn);
}
.hist-item.off {
  opacity: 0.6;
}
.hist-mark {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.hist-mark svg {
  width: 14px;
  height: 14px;
}
.hist-item.on .hist-mark {
  background: rgba(74, 222, 128, 0.15);
  color: var(--ok);
}
.hist-item.off .hist-mark {
  background: var(--tint-2);
  color: var(--text-3);
}
.moto-ask {
  margin-bottom: 14px;
}
.moto-ask .list-item > svg,
.abilitati .list-item > svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transform: rotate(-90deg);
}
.moto-todo .btn {
  flex: none;
}

/* Modulo membro */
.mform {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
@media (min-width: 1024px) {
  .mform {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 22px;
  }
  .mform .span-2 {
    grid-column: 1 / -1;
  }
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.form-actions .btn-primary {
  min-width: 200px;
}
.form-actions .push {
  margin-left: auto;
}
@media (max-width: 639px) {
  .form-actions .btn {
    flex: 1 1 100%;
  }
  .form-actions .push {
    margin-left: 0;
  }
}

/* ── Mappa delle strade percorse ───────────────────────────────────────── */
.map-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.map-main,
.map-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.map-filters {
  display: grid;
  gap: 10px;
}
.map-filters .tabs {
  margin: 0;
}
.map-wrap {
  position: relative;
  z-index: 0;
  isolation: isolate; /* i livelli di Leaflet restano sotto barra in alto e menu */
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
#mapAvvisi:empty {
  display: none;
}
.map-list-head {
  margin: 8px 0 0;
}
.map-list {
  display: grid;
  gap: 8px;
}
.map-box {
  /* mai più alta dello spazio tra barra in alto e menu: altrimenti ogni
     trascinamento muove la mappa e la pagina non scorre più */
  height: min(62vh, 560px, calc(100svh - 190px));
  min-height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: #0e0e10;
}
@media (max-width: 600px) {
  /* la Sicilia è larga: su un telefono un riquadro troppo alto è quasi tutto mare */
  .map-box {
    height: clamp(220px, 50svh, 430px);
  }
}
@media (min-width: 1024px) {
  .map-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 32%);
    align-items: start;
    gap: 24px;
  }
  .map-main {
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
    gap: 12px;
  }
  .map-filters {
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    align-items: center;
  }
  .map-box {
    height: calc(100dvh - var(--topbar-h) - 190px);
    min-height: 380px;
  }
}
@media (min-width: 1280px) {
  .map-page {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}
.map-fit {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--gold-line);
  background: rgba(18, 18, 20, 0.92);
  color: var(--fill-gold);
  cursor: pointer;
}
.map-fit svg {
  width: 18px;
  height: 18px;
}
.map-legenda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--text-2);
}
.map-legenda[hidden] {
  display: none;
}
.map-gradiente {
  width: 72px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #c9a84c, #e8791f 50%, #dc2626);
}
.map-legenda small {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--text-3);
}
.map-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.map-stats div {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.map-stats b {
  display: block;
  font-family: var(--font-h);
  font-size: 22px;
  color: var(--gold);
}
.map-stats span {
  font-size: 12.5px;
  color: var(--text-2);
}
.map-item {
  margin: 0 !important;
}
.map-item.on {
  border-color: var(--gold-line);
  background: rgba(201, 168, 76, 0.07);
}
.map-swatch {
  flex: none;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
  opacity: 0.8;
}
.map-item.on .map-swatch {
  height: 6px;
  background: #f2d98a;
  opacity: 1;
}
/* Il basemap CARTO scuro è quasi nero: un po' più di luce e l'isola si distingue dal mare */
.map-box .leaflet-tile-pane {
  filter: brightness(1.6);
}
.map-box .leaflet-bar {
  border: 1px solid var(--gold-line);
  box-shadow: none;
}
.map-box .leaflet-bar a {
  background: rgba(18, 18, 20, 0.92);
  color: var(--fill-gold);
  border-bottom-color: var(--line);
}
.map-box .leaflet-bar a:hover {
  background: #222;
}
.map-box .leaflet-control-attribution {
  background: rgba(10, 10, 10, 0.75);
  color: #8a8a90;
  font-size: 10px;
}
.map-box .leaflet-control-attribution a {
  color: #b4b4ba;
}
.map-box .leaflet-popup-content-wrapper,
.map-box .leaflet-popup-tip {
  background: #18181b;
  color: #f5f5f4;
  border: 1px solid rgba(201, 168, 76, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
.map-box .leaflet-popup-content {
  margin: 12px 14px;
  font-family: var(--font-b);
  font-size: 13px;
  line-height: 1.45;
}
.map-box a.leaflet-popup-close-button {
  color: #8a8a90;
}
.map-pop {
  display: grid;
  gap: 3px;
}
.map-pop b {
  font-family: var(--font-h);
  font-size: 15px;
  color: #f5f5f4;
}
.map-pop span {
  color: #b4b4ba;
}
.map-pop a {
  margin-top: 4px;
  font-weight: 600;
  color: var(--fill-gold);
}

/* Editor dell'uscita: anteprima delle tracce GPX (più bassa della pagina Mappa: sta in un modulo) */
.map-box.ed-map {
  height: clamp(240px, 46svh, 420px);
  min-height: 0;
}
.ed-tracce .map-list {
  margin-top: 12px;
}
.banner-azioni {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 10px;
}
.banner .banner-azioni .btn {
  margin-top: 0;
}
.banner-nota {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.ed-tracce-legenda {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.ed-tracce-legenda[hidden] {
  display: none;
}
.ed-tracce-legenda .segno {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #0e0e10;
  background: var(--c, var(--gold));
}
.ed-tracce-legenda .segno.fine {
  margin-left: 10px;
  border: 3px solid var(--c, var(--gold));
  background: #0e0e10;
}

/* ── Tema chiaro / scuro ────────────────────────────────────────────────── */
/* telefono e tablet: un pulsante nella barra in alto; computer: nella barra laterale */
.tb-theme {
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border-radius: 11px;
}
.tb-theme svg {
  width: 19px;
  height: 19px;
}
@media (min-width: 1024px) {
  .tb-theme {
    display: none;
  }
}
.sb-theme {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tint-1);
}
.sb-theme button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.sb-theme button svg {
  width: 15px;
  height: 15px;
}
.sb-theme button:hover {
  color: var(--text);
}
.sb-theme button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), inset 0 0 0 1px var(--line-2);
}

/* ── Link WhatsApp già usati (editor dell'uscita) ─────────────────────── */
.wa-links:empty {
  display: none;
}
.wa-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* i link lunghi si accorciano, non allargano la pagina */
  gap: 8px;
  margin-top: 12px;
}
.wa-pick .grow {
  min-width: 0;
}
.wa-head {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
}
.wa-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--tint-1);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.wa-pick:hover {
  border-color: var(--line-3);
  background: var(--tint-2);
}
.wa-pick.on {
  border-color: rgba(37, 211, 102, 0.5);
  background: rgba(37, 211, 102, 0.08);
}
.wa-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: #25d366;
  flex: none;
}
.wa-ico svg {
  width: 20px;
  height: 20px;
}
.wa-url {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-n {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
}
.wa-usa {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}
.wa-pick.on .wa-usa {
  color: var(--ok);
}

/* ── Numero accanto alle voci del menu (recensioni da approvare) ─────────── */
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--fill-gold);
  color: #141008;
  font-family: var(--font-h);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nav-badge[hidden] {
  display: none;
}
.sb-link .nav-badge,
.sheet-link .nav-badge {
  margin-left: auto;
}
.bn-ico {
  position: relative;
}
.bn-ico .nav-badge {
  position: absolute;
  top: -4px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 10.5px;
  box-shadow: 0 0 0 2px var(--nav-bg);
}
.tabs .tab-n {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--tint-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tabs button.active .tab-n {
  background: var(--gold-soft);
}

/* ── Recensioni (dall'Area Membri) ───────────────────────────────────────── */
.stelle {
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--fill-gold);
}
.stelle .off {
  color: var(--track);
}
.rcard .pcard-title a {
  color: inherit;
}
.rcard .pcard-title a:hover {
  color: var(--gold);
}
.rcard-data {
  margin-top: -6px;
  font-size: 13px;
  color: var(--text-3);
}
.rcard-avviso {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--warn);
}
.rcard-avviso svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

/* ── Proposte dal sito ────────────────────────────────────────────────── */
.pcards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.pcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pcard.usata {
  border-left-color: var(--line-3);
}
.pcard-top {
  font-size: 12.5px;
  color: var(--text-3);
}
.pcard-title {
  font-family: var(--font-h);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.pcard-chi {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  color: var(--text-2);
}
.pcard-chi svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--gold);
}
.pcard-chi span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.pcard-chi a {
  color: var(--gold);
  font-weight: 600;
}
.pcard-fatti {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pcard-fatti span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--tint-2);
  font-size: 12.5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.pcard-fatti svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--text-3);
}
.pcard-testo,
.pcard-nota {
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}
.pcard-testo {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
/* niente padding verticale: col taglio a 4 righe non spunta mezza riga */
.pcard-nota {
  -webkit-line-clamp: 4;
  padding-left: 12px;
  border-left: 3px solid var(--line-2);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.pcard.aperta .pcard-testo,
.pcard.aperta .pcard-nota {
  display: block;
  overflow: visible;
}
.pcard > .btn-link {
  align-self: flex-start;
  margin-top: -4px;
  font-size: 13.5px;
}
.pcard > .btn-link[hidden] {
  display: none;
}
.pcard-azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.pcard-azioni .danger {
  margin-left: auto;
}
.sec .pcards + details.more,
.sec > .muted + details.more {
  margin-top: 16px;
}
@media (min-width: 900px) {
  .pcards {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 16px;
  }
}

/* Storico: accessi non riusciti e tipo di contenuto */
.tl-item.fail .tl-dot {
  background: var(--danger);
}
.tl-who .chip {
  margin-right: 2px;
}
.tl-act {
  font-weight: 600;
  color: var(--text);
}
.tl-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-3);
}

/* ── Ritocchi delle pagine ─────────────────────────────────────────────── */
.tabs button svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}
.foto-stage:not(:empty),
.jobs:not(:empty) {
  margin-top: 16px;
}
.foto-stage .banner {
  margin-bottom: 12px;
}
.timeline:has(.empty)::before,
.timeline:has(.loading-inline)::before {
  display: none;
}
.pres-km {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.pres-km .field-label {
  margin-bottom: 2px;
  font-size: 15px;
  color: var(--text);
}
.pres-km .input {
  flex: 0 0 220px;
}
@media (max-width: 639px) {
  .pres-km .input {
    flex: 1 1 100%;
  }
}
.pres-tools .check-chip,
.pres-tools .btn {
  flex: none;
}
.hist-list > .empty,
.list-grid > .empty,
.list-grid > p,
.mgrid > .empty {
  grid-column: 1 / -1;
}
.profile-main > .tiles {
  margin-bottom: 36px;
}

/* ── "Premio sbloccato": un cerchio che si allarga in una pillola ──────── */
.ach-toast {
  position: fixed;
  left: 50%;
  /* sopra il toast normale ("Presenze salvate"), così si leggono entrambi */
  bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 66px;
  max-width: 66px;
  padding: 7px;
  overflow: hidden;
  background: linear-gradient(180deg, #2c2c2c, #141414);
  border: 1px solid rgba(201, 168, 76, 0.5);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 32px rgba(201, 168, 76, 0.2);
  color: #f5f5f4;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px) scale(0.85);
  transition: opacity 0.25s var(--ease), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), max-width 0.5s var(--ease) 0.2s;
}
.ach-toast.show {
  opacity: 1;
  max-width: min(92vw, 440px);
  transform: translateX(-50%) translateY(0) scale(1);
}
.ach-icon {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: radial-gradient(circle at 35% 30%, #f3dc8e, var(--fill-gold) 45%, var(--gold-dark));
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 0 16px rgba(201, 168, 76, 0.45);
}
.ach-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-right: 20px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.ach-toast.show .ach-text {
  opacity: 1;
  transition-delay: 0.5s;
}
.ach-k {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  color: #b4b4ba;
}
.ach-t {
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-h);
  font-size: 15.5px;
  font-weight: 700;
}
@media (min-width: 1024px) {
  .ach-toast {
    bottom: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .ach-toast,
  .ach-toast.show,
  .ach-text {
    transition: opacity 0.2s linear !important;
    transition-delay: 0s;
    transform: translateX(-50%);
    max-width: min(92vw, 440px);
  }
}

/* Foto profilo già presente: ritaglia di nuovo / togli (sopra "Scegli un'altra foto") */
.foto-scelte {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.foto-scelte .btn svg {
  width: 18px;
  height: 18px;
}

/* ── Ritaglio della foto profilo (ritaglio.js) ───────────────────────────── */
.crop {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.crop-stage {
  width: min(100%, 380px);
  margin: 0 auto;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* il dito sposta la foto, non la pagina */
  cursor: grab;
}
.crop-canvas.presa {
  cursor: grabbing;
}
.crop-canvas:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
.crop-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 380px);
  margin: 0 auto;
}
.crop-range {
  flex: 1;
  min-width: 0;
  accent-color: var(--gold);
}
.crop-tools {
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* ── Card per Instagram (#/card/<id>) ────────────────────────────────────── */
.cig {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cig-prev {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
/* l'anteprima: il canvas a piena risoluzione, rimpicciolito per stare nello schermo */
.cig-frame {
  --ar: 1080 / 1920;
  --alt: 62vh;
  position: relative;
  width: min(100%, calc(var(--alt) * (var(--ar))));
  aspect-ratio: var(--ar);
  border-radius: 16px;
  overflow: hidden;
  background: #121214;
  box-shadow: var(--shadow-lg);
  outline: 1px solid var(--line-2);
}
.cig-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.cig-frame.spostabile canvas {
  cursor: grab;
  touch-action: none;
}
.cig-frame canvas.presa {
  cursor: grabbing;
}
.cig-frame.drag {
  outline: 2px dashed var(--gold);
}
/* sfondo trasparente: la scacchiera dei programmi di grafica */
.cig-frame.trasparente {
  background: repeating-conic-gradient(#2a2a2f 0 25%, #1b1b1f 0 50%) 0 0 / 28px 28px;
}
.cig-wait[hidden] {
  display: none;
}
.cig-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 11, 0.35);
  pointer-events: none;
}
.cig-hint {
  max-width: 420px;
  min-height: 1.4em;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}
.cig-hint:empty {
  display: none;
}
.cig-actions {
  width: min(100%, 420px);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  grid-auto-flow: column;
}
.cig-ctrl {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cig-tabs {
  display: flex;
  width: 100%;
}
/* gli sfondi vanno a capo invece di scorrere: si vedono tutti */
.cig-tabs.cig-sfondi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}
.cig-tabs.cig-sfondi button {
  padding: 0 6px;
}
.cig-tabs button {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.cig-tabs button small {
  font-family: var(--font-b);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}
.cig-tabs button.active small {
  color: inherit;
  opacity: 0.75;
}
.cig-panel:not(:empty) {
  margin-top: 14px;
}
.cig-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-3);
}
/* foto dell'uscita: una striscia da scorrere */
.cig-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 76px;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cig-thumb {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-3);
  cursor: pointer;
  outline: 1px solid var(--line);
}
.cig-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cig-thumb.on {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
.cig-thumb.on::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 5px rgba(10, 10, 11, 0.55);
  border-radius: inherit;
}
.cig-sliders {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.cig-sliders[hidden] {
  display: none;
}
.cig-slider {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.cig-slider input:disabled {
  opacity: 0.4;
}
.cig-sliders .btn-link {
  justify-self: start;
}
.cig-vista {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.cig-vista .btn-link[hidden] {
  display: none;
}
.cig-sliders .btn-link:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.cig-strada {
  margin: 14px 0 12px;
}
.cig-colori {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cig-colore {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--c);
  box-shadow: inset 0 0 0 3px var(--surface);
  cursor: pointer;
}
.cig-colore.on {
  border-color: var(--c);
  box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent);
}
.cig-colore:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cig-colore:focus-visible,
.cig-chip:focus-visible,
.cig-thumb:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.cig-chips:empty {
  display: none;
}
.cig-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.cig-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--input-bg);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.cig-chip small {
  font-family: var(--font-h);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cig-chip b {
  font-family: var(--font-h);
  font-size: 19px;
  font-weight: 800;
}
.cig-chip.on {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--text);
}
.cig-chip.on small {
  color: var(--gold-light);
}
/* computer: anteprima ferma a sinistra (con i pulsanti sotto), scelte a destra */
@media (min-width: 1024px) {
  .cig {
    display: grid;
    grid-template-columns: auto minmax(340px, 560px);
    justify-content: center;
    align-items: start;
    gap: 36px;
  }
  .cig-prev {
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
  }
  .cig-frame {
    --alt: calc(100vh - var(--topbar-h) - 150px);
  }
  .cig-actions {
    position: static;
  }
}
@media (max-width: 1023px) {
  .cig-actions {
    width: auto;
  }
}

/* ── Sagre in Sicilia (da sagr.it) ──────────────────────────────────────── */
.sagre-testa {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.sagre-mese {
  min-width: 0;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}
.sagre-avanti svg {
  transform: scaleX(-1); /* la freccia "indietro", girata */
}
.sagre-oggi {
  margin-left: auto;
}
@media (max-width: 480px) {
  .sagre-mese {
    font-size: 19px;
  }
  .sagre-oggi span {
    display: none; /* sul telefono basta il calendario */
  }
}
.sgruppo + .sgruppo .section-label {
  margin-top: 30px;
}
.sgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
@media (min-width: 760px) {
  .sgrid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
  }
}
.scard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.scard:hover {
  border-color: var(--gold-line);
  background: var(--surface-2);
}
.scard.off {
  opacity: 0.55;
}
.scard-img {
  position: relative;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--tint-2);
  color: var(--text-3);
}
.scard-img svg {
  width: 26px;
  height: 26px;
}
.scard-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scard-quando {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold);
}
.scard .name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}
.scard .sub {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-2);
}
.sagre-fonte {
  margin-top: 22px;
}
.sagre-fonte a {
  color: var(--gold);
}
/* la pagina di una sagra */
.sagra-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
@media (min-width: 1024px) {
  .sagra-page {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
  .sagra-hero {
    grid-row: span 2;
  }
}
.sagra-hero {
  overflow: hidden;
}
.sagra-img {
  aspect-ratio: 16 / 9;
  background: var(--tint-2);
}
.sagra-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sagra-quando {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gold);
}
.sagra-titolo {
  margin: 6px 0 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}
.sagra-dove {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
}
.sagra-dove svg {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--gold);
}
.sagra-desc {
  margin: 14px 0 16px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.sagra-map {
  height: clamp(240px, 42vh, 420px);
  margin-bottom: 14px;
}
.tratto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.tratto:first-child {
  border-top: 0;
  padding-top: 0;
}
.tratto-segno {
  flex: none;
  width: 22px;
  height: 5px;
  border-radius: 99px;
  background: #d9b45a;
}
.tratto.ritorno .tratto-segno {
  background: repeating-linear-gradient(90deg, #7aabf7 0 6px, transparent 6px 10px);
}
.tratto-num {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tratto-azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tratto-avviso {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--warn);
}
.sagra-giorni {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}
.sagra-giorno {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 64px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.sagra-giorno b {
  font-size: 14px;
}
.sagra-giorno small {
  font-size: 11.5px;
  color: var(--text-3);
}
.sagra-giorno.on {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.sagra-giorno.on small {
  color: var(--gold-light);
}
.sagra-giorno.occupato {
  opacity: 0.6;
  border-style: dashed;
}
.sagra-giorno:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Fondo cassa ──────────────────────────────────────────────────────────── */
.cassa-hero b {
  font-variant-numeric: tabular-nums;
}
.cassa-stato {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}
.cassa-stato svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.cassa-stato.ok svg {
  color: var(--ok);
}
.cassa-stato.warn svg {
  color: var(--warn);
}
.cassa-hero .cassa-stato b {
  display: inline;
  margin: 0;
  font: inherit;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--text);
}
.cassa-azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.cassa-azioni .btn svg {
  width: 18px;
  height: 18px;
}
.cassa-tiles {
  margin-bottom: 22px;
}
@media (min-width: 640px) {
  .cassa-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.cassa-tiles .tile b {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.cassa-mese + .cassa-mese {
  margin-top: 8px;
}
.cassa-mese-tot {
  display: inline-flex;
  gap: 10px;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}
.cassa-mese-tot i {
  font-style: normal;
}
.pos {
  color: var(--ok);
}
.neg {
  color: var(--danger);
}
.cassa-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--tint-2);
  color: var(--text-2);
}
.cassa-ico svg {
  width: 20px;
  height: 20px;
}
.cassa-ico.in {
  background: var(--ok-soft);
  color: var(--ok);
}
.cassa-ico.out {
  background: var(--danger-soft);
  color: var(--danger);
}
.cassa-ico.rett {
  background: var(--warn-soft);
  color: var(--warn);
}
.cassa-ico.fondo {
  background: var(--gold-soft);
  color: var(--gold);
}
.cassa-imp {
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cassa-imp b {
  display: block;
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
.cassa-imp small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}
.cassa-mov.annullato .name,
.cassa-mov.annullato .cassa-imp b {
  text-decoration: line-through;
  color: var(--text-3);
}
.cassa-mov.annullato .cassa-ico {
  opacity: 0.5;
}
.list-item .sub.cassa-annullato {
  color: var(--warn);
}
.cassa-det {
  display: grid;
  gap: 10px;
  margin: 14px 0 16px;
}
.cassa-det > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  font-size: 14.5px;
}
.cassa-det dt {
  color: var(--text-3);
}
.cassa-det dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.modal .banner + .cassa-det {
  margin-top: 16px;
}
.cassa-importo {
  font-variant-numeric: tabular-nums;
}
.field .hint.err {
  color: var(--danger);
}
.cassa-tagli {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 8px 0 16px;
}
@media (min-width: 520px) {
  .cassa-tagli {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.cassa-tagli fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cassa-tagli legend {
  padding: 0 6px;
  font-family: var(--font-h);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cassa-taglio {
  display: grid;
  grid-template-columns: 62px minmax(0, 76px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.cassa-taglio + .cassa-taglio {
  margin-top: 6px;
}
.cassa-taglio .t {
  font-weight: 600;
  white-space: nowrap;
}
.cassa-taglio .input {
  min-height: 38px;
  padding: 6px 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cassa-taglio .v {
  text-align: right;
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cassa-esito {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.cassa-esito svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.cassa-esito.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.cassa-esito.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.cassa-esito b {
  color: var(--text);
}
.cassa-pezzi td,
.cassa-pezzi th {
  font-variant-numeric: tabular-nums;
}
/* Ricevute delle uscite: il segno nel registro, la scelta nel modulo, la
   scheda del movimento (PDF da aprire o foto). */
.cassa-ric-coda {
  white-space: nowrap;
}
.cassa-ric-segno {
  display: inline-block;
  margin-left: 6px;
  color: var(--text-3);
  vertical-align: -2px;
}
.cassa-ric-segno svg {
  width: 15px;
  height: 15px;
}
.cassa-ric-pick,
.cassa-ric-scelta,
.cassa-ric-file {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--font-b);
  font-size: 14px;
  text-align: left;
  color: var(--text-2);
}
.cassa-ric-pick b,
.cassa-ric-scelta b,
.cassa-ric-file b {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.cassa-ric-pick small,
.cassa-ric-scelta small,
.cassa-ric-file small {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--text-3);
}
.cassa-ric-pick {
  border: 1.5px dashed var(--gold-line);
  background: rgba(201, 168, 76, 0.03);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.cassa-ric-pick:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold);
}
.cassa-ric-pick > svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--gold);
}
.cassa-ric-scelta {
  border: 1px solid var(--line-2);
  background: var(--tint-1);
}
.cassa-ric-scelta .btn-link {
  flex: none;
  font-size: 13.5px;
}
.cassa-ric-scelta .btn-link.cambia {
  color: var(--gold);
}
.cassa-ric-mini {
  flex: none;
  display: grid;
  place-items: center;
  align-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--tint-2);
  color: var(--text-2);
}
.cassa-ric-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cassa-ric-mini svg {
  width: 20px;
  height: 20px;
}
.cassa-ric-mini.pdf {
  background: var(--danger-soft);
  color: var(--danger);
}
.cassa-ric-mini.pdf svg {
  width: 17px;
  height: 17px;
}
.cassa-ric-mini i {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}
.cassa-ric-file {
  border: 1px solid var(--line-2);
  background: var(--tint-1);
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.cassa-ric-file:hover {
  background: var(--tint-2);
  border-color: var(--line-3);
}
.cassa-ric-file > svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--danger);
}
.cassa-ric-file > svg:last-child {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}
.cassa-ric-foto {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--tint-2);
}
.cassa-ric-foto img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
}
.cassa-det dd > small {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ── Distintivi: maglietta e sticker del gruppo, accanto al nome ─────────── */
.distintivo {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  vertical-align: -4px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold);
}
.distintivo + .distintivo {
  margin-left: 4px;
}
.distintivo svg {
  width: 13px;
  height: 13px;
}
/* pagato ma ancora da consegnare: tratteggiato */
.distintivo.pagato {
  border-style: dashed;
  border-color: var(--line-3);
  background: transparent;
  color: var(--text-3);
}
.member-hero h2 .distintivo {
  width: 26px;
  height: 26px;
  vertical-align: -3px;
}
.member-hero h2 .distintivo svg {
  width: 15px;
  height: 15px;
}

/* ── Acquisti: selezione di più righe ───────────────────────────────────── */
.acq-item.scelto {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.acq-item.scegli:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.acq-item.scelto .mcard-spunta {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--black);
}
#acqSel .savebar-sum .btn-link {
  font-size: 13px;
}

/* ── Video YouTube dell'uscita (pagina Foto e video) ───────────────────────── */
.video-sec {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.video-sec .sec-head {
  margin-bottom: 12px;
}
.video-sec .sec-title svg {
  width: 21px;
  height: 21px;
  flex: none;
  color: var(--gold);
}
.video-sec.occupato .video-list,
.video-sec.occupato .video-add {
  opacity: 0.6;
  pointer-events: none;
}
.video-sec .banner {
  margin-bottom: 12px;
}
.video-list {
  display: grid;
  gap: 10px;
}
.video-row {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--poster-bg);
}
.video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-thumb.vert img {
  object-fit: contain; /* uno Short: verticale dentro il riquadro */
}
.video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 10, 11, 0.62);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.video-play svg {
  width: 16px;
  height: 16px;
  margin-left: 2px;
}
.video-thumb:hover .video-play {
  background: var(--gold);
  color: var(--black);
  transform: scale(1.06);
}
.video-row.is-off .video-thumb img {
  opacity: 0.4;
  filter: grayscale(1);
}
.video-info {
  min-width: 0;
}
.video-titolo {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.video-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.video-chips:empty {
  display: none;
}
.chip.chip-sm {
  padding: 2px 8px;
  font-size: 11px;
}
.chip.evidenza {
  color: var(--gold);
  border-color: var(--gold-line);
}
.video-meta {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.video-avviso {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--warn);
}
.video-avviso svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
}
.video-avviso .btn-link {
  font-size: 13px;
}
.video-azioni {
  display: flex;
  align-items: center;
  gap: 2px;
}
.video-azioni .btn-icon:disabled {
  visibility: hidden; /* il primo non sale, l'ultimo non scende: i bottoni restano in colonna */
}
.video-add {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.video-list:empty + .video-add,
.video-sec .sec-head + .video-add {
  margin-top: 0;
}
.video-add .input {
  flex: 1;
  min-width: 0;
}
.video-add .btn {
  flex: none;
}
.video-anteprima img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 auto 10px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: var(--poster-bg);
}
.video-anteprima .hint {
  margin-bottom: 10px;
}
.video-anteprima .field {
  margin-bottom: 10px;
}
@media (max-width: 639px) {
  .video-sec {
    padding: 14px;
  }
  .video-row {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px 12px;
  }
  .video-azioni {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin: -4px -4px -6px 0;
  }
  .video-titolo {
    font-size: 14px;
  }
}
/* Nella card della lista Uscite e nell'editor */
.ucard-video {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}
.ucard-video svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.ucard-video.warn {
  color: var(--warn);
}
.ucard-video:hover {
  text-decoration: underline;
}
.hint.ed-video {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
}
.hint.ed-video svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--gold);
}
