/* =====================================================================
   Flare Panel — stesso linguaggio visivo di portfolio.valentinlungu.art
   Font ospitati qui (licenza OFL): nessuna richiesta a server esterni.
   ===================================================================== */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage.woff") format("woff"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans.woff") format("woff"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff") format("woff"); font-weight: 400 700; font-display: swap; }

:root,
:root[data-theme="dark"] {
  --bg: #101219;
  --surface: #171a23;
  --surface-2: #1f2330;
  --ink: #e9ecf3;
  --ink-2: #c3c8d6;
  --ink-3: #9aa1b4;
  --line: #262b38;
  --line-2: #323848;
  --accent: #7b96ff;
  --accent-ink: #0c1020;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --flare: #ff6a12;
  --flare-2: #ff8f24;
  --flare-ink: #ffa463;
  --flare-soft: color-mix(in srgb, var(--flare) 15%, transparent);
  --ok: #3ddc84;
  --ok-soft: color-mix(in srgb, var(--ok) 14%, transparent);
  --danger: #ff5c72;
  --danger-soft: color-mix(in srgb, var(--danger) 14%, transparent);
  --warn: #f0b640;
  --warn-soft: color-mix(in srgb, var(--warn) 15%, transparent);
  --term-bg: #11131c;
  --dot: rgba(233, 236, 243, 0.09);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  --discord-bg: #313338;
  --discord-embed: #2b2d31;
  --discord-text: #dbdee1;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 14px;
  --r-ctl: 10px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #edeff3;
  --surface: #ffffff;
  --surface-2: #e2e6ee;
  --ink: #151821;
  --ink-2: #3b4152;
  --ink-3: #5b6172;
  --line: #d5d9e2;
  --line-2: #c4c9d5;
  --accent: #2f55e6;
  --accent-ink: #ffffff;
  --flare: #e8590c;
  --flare-ink: #b2470a;
  --ok: #18915a;
  --danger: #d2364b;
  --warn: #b87a0c;
  --term-bg: #151824;
  --dot: rgba(21, 24, 33, 0.1);
  --shadow: 0 18px 40px -22px rgba(21, 24, 33, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.hidden { display: none !important; }

h1, h2, h3 { font-family: var(--f-display); line-height: 1.12; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); }
.nowrap { white-space: nowrap; }

/* Cursore lampeggiante dopo i titoli */
.caret {
  display: inline-block;
  width: 0.09em;
  height: 0.82em;
  margin-left: 0.12em;
  vertical-align: -0.04em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Effetti di sfondo ---------- */
#fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -2; pointer-events: none; }
#cursor-glow {
  position: fixed; left: 0; top: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px;
  border-radius: 50%; pointer-events: none; z-index: -1; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 62%);
}
.scanline {
  display: none;
  position: fixed; left: 0; right: 0; top: -20vh; height: 20vh; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 6%, transparent) 85%, color-mix(in srgb, var(--accent) 14%, transparent) 99%, transparent);
  animation: scan 9s linear infinite;
}
@keyframes scan { to { transform: translateY(140vh); } }
html.no-fx #fx-canvas, html.no-fx #cursor-glow, html.no-fx .scanline { display: none; }
@media (hover: none) { #cursor-glow { display: none; } }

/* Spotlight che segue il puntatore su pannelli e statistiche */
.panel, .stat, .server { --mx: 50%; --my: 50%; position: relative; isolation: isolate; }
.panel::before, .stat::before, .server::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(320px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%);
}
.panel:hover::before, .stat:hover::before, .server:hover::before { opacity: 1; }
html.no-fx .panel::before, html.no-fx .stat::before, html.no-fx .server::before { display: none; }

/* Entrata della pagina: un solo momento orchestrato */
.page.enter > * { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.page.enter > *:nth-child(2) { animation-delay: 0.05s; }
.page.enter > *:nth-child(3) { animation-delay: 0.1s; }
.page.enter > *:nth-child(4) { animation-delay: 0.15s; }
.page.enter > *:nth-child(n + 5) { animation-delay: 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.rail {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 34px; flex: none; display: block; filter: drop-shadow(0 4px 14px rgba(255, 106, 18, 0.35)); }
.brand-name { font-family: var(--f-display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; line-height: 1.1; }
.brand-sub { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); line-height: 1.3; }
.nav-group { margin-top: 16px; padding: 0 10px 6px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.nav-group::before { content: "// "; color: var(--accent); opacity: 0.8; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-ctl);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] {
  background: var(--accent-soft); color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.nav a[aria-current="page"] svg { color: var(--accent); opacity: 1; }
.nav a .count {
  margin-left: auto; font: 600 11px/1.6 var(--f-mono);
  background: var(--flare); color: #fff; border-radius: 999px; padding: 0 7px; min-width: 22px; text-align: center;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 106, 18, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(255, 106, 18, 0); } }
.rail-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.rail-tools { display: flex; gap: 6px; padding: 0 4px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 6px; }
.me-name { font-weight: 600; }
.me-role { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.icon-btn[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.icon-btn svg { width: 17px; height: 17px; }

.main { padding: 30px 40px 72px; min-width: 0; }
.page { max-width: 1140px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--ink-3); margin-top: 6px; max-width: 70ch; }
.crumb { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.crumb b { color: var(--accent); font-weight: 400; }

.mobile-bar { display: none; }

/* ---------- Pannelli ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  transition: border-color 0.25s;
}
.panel:hover { border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.panel + .panel, .stack > * + * { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head p { color: var(--ink-3); font-size: 14px; margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 > .panel + .panel { margin-top: 0; }
.page > :is(.panel, .grid-2, .stack, .composer, .ranged, .pl-tiles, div:not([class])) + :is(.panel, .grid-2, .stack, .composer, .pl-tiles, div:not([class])) { margin-top: 18px; }
.grid-2.even { align-items: stretch; }
* + .pl-drop { margin-top: 18px; }

/* Server (intestazione panoramica) */
.server {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; margin-bottom: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--flare) 8%, var(--surface)), var(--surface) 55%);
  border: 1px solid color-mix(in srgb, var(--flare) 28%, var(--line));
  border-radius: var(--r);
}
.server-icon {
  width: 58px; height: 58px; border-radius: 16px; flex: none; object-fit: cover;
  background: linear-gradient(135deg, var(--flare-2), var(--flare)); color: #fff;
  display: grid; place-items: center; font: 800 24px var(--f-display);
  box-shadow: 0 10px 30px -10px rgba(255, 106, 18, 0.6);
}
.server h2 { font-size: 1.4rem; font-weight: 800; }
.server-meta { display: flex; gap: 8px 18px; color: var(--ink-3); font-size: 14px; flex-wrap: wrap; margin-top: 4px; }
.server-meta .mono { font-size: 12px; }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 600; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.live.off { color: var(--danger); }

/* Terminale */
.term {
  display: inline-flex; flex-wrap: wrap; gap: 0 7px; align-items: center;
  padding: 9px 13px; border-radius: 9px; background: var(--term-bg); border: 1px solid #262b38;
  font-family: var(--f-mono); font-size: 12.5px; color: #d7dceb; max-width: 100%;
}
.term .p { color: #7ee787; }
.term .c { color: #7f8ab0; }
.term .cmd::after { content: ""; display: inline-block; width: 7px; height: 1em; background: #d7dceb; margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.term .cmd.done::after { display: none; }
.term .out { color: #9fb2ff; flex-basis: 100%; }
.term .out:not(:empty)::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 8px #3ddc84; }

/* Statistiche */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 18px; overflow: hidden; }
.stat { padding: 18px 20px; border-left: 1px solid var(--line); text-decoration: none; color: inherit; transition: background 0.2s; }
.stat:first-child { border-left: 0; }
a.stat:hover { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.stat-value { font: 800 30px/1.05 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-label { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.stat.hot .stat-value { color: var(--flare-ink); }

/* ---------- Tabelle ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font: 500 11.5px var(--f-mono); color: var(--ink-3);
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; transition: background 0.15s; }
tr.clickable:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }

.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font: 700 11px var(--f-mono); color: var(--ink-2);
}
.avatar.lg { width: 52px; height: 52px; font-size: 16px; }
.who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-id { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px;
  font: 500 11.5px/1.7 var(--f-mono); background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); white-space: nowrap;
}
.chip.flare { background: var(--flare-soft); color: var(--flare-ink); border-color: color-mix(in srgb, var(--flare) 30%, transparent); }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

.empty { padding: 32px 8px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; font-family: var(--f-display); font-size: 1.05rem; }

/* ---------- Controlli ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--r-ctl); padding: 9px 15px; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--line-2); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary {
  position: relative; overflow: hidden; border: 0; color: #fff;
  background: linear-gradient(135deg, #5b7bff 0%, #8a5bff 55%, #c44bff 100%);
  box-shadow: 0 8px 22px -10px rgba(110, 90, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn.primary:hover { box-shadow: 0 14px 28px -10px rgba(110, 90, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg); transition: left 0.6s;
}
.btn.primary:hover::after { left: 120%; }
.btn.flare { border: 0; color: #fff; background: linear-gradient(135deg, var(--flare-2), var(--flare) 55%, #f2481c); box-shadow: 0 8px 22px -10px rgba(255, 106, 18, 0.8); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field > label, .field-label { font-weight: 600; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: color-mix(in srgb, var(--surface-2) 45%, var(--bg));
  color: var(--ink); font-size: 14.5px; line-height: 1.35;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--ink-3); opacity: 0.75; }
.input:hover { border-color: var(--line-2); background-color: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); }
.input:focus, .input:focus-visible {
  outline: none; border-color: var(--accent); background-color: var(--bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), inset 0 1px 0 transparent;
}
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.input[aria-invalid="true"], .input:user-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
textarea.input { resize: vertical; min-height: 104px; line-height: 1.55; }
textarea.mono, .input.mono { font-family: var(--f-mono); font-size: 13px; }

/* Menu a tendina: freccia disegnata in CSS (niente immagini esterne) */
select.input {
  padding-right: 42px; cursor: pointer; text-overflow: ellipsis;
  background-image: var(--chev); background-repeat: no-repeat;
  background-position: right 15px center; background-size: 12px 8px;
}
select.input:focus { background-image: var(--chev-on); }
:root, :root[data-theme="dark"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%239aa1b4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --chev-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%237b96ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
:root[data-theme="light"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%235b6172' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --chev-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%232f55e6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
select.input option { background: var(--surface); color: var(--ink); }
select.input option:disabled { color: var(--ink-3); }

/* Numeri: niente frecce del browser, pulsanti - / + propri (aggiunti da core.js) */
.input[type="number"] { -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.input[type="number"]::-webkit-inner-spin-button, .input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.num-wrap { position: relative; display: flex; width: 100%; }
.num-wrap .input { padding-right: 70px; }
.num-wrap .num-btns { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; gap: 3px; }
.num-wrap .num-btns button {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer; display: grid; place-items: center; font: 600 15px/1 var(--f-mono); padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.num-wrap .num-btns button:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-2); }
.num-wrap .num-btns button:active { transform: scale(0.94); }
.num-wrap .num-btns button:disabled { opacity: 0.4; cursor: not-allowed; }
.num-wrap.narrow .input { padding-right: 13px; }
.num-wrap.narrow .num-btns { display: none; }

/* Ora */
.input[type="time"] { font-family: var(--f-mono); font-size: 13.5px; }
.input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; filter: var(--picker-filter, none); }
:root, :root[data-theme="dark"] { --picker-filter: invert(0.8); }
:root[data-theme="light"] { --picker-filter: none; }

/* Caselle di spunta */
input[type="checkbox"]:not(.switch input) {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; margin: 0;
  border: 1.5px solid var(--line-2); border-radius: 5px; background: var(--bg); cursor: pointer;
  display: inline-grid; place-items: center; vertical-align: -3px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
input[type="checkbox"]:not(.switch input)::after {
  content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform 0.15s;
}
input[type="checkbox"]:not(.switch input):checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:not(.switch input):checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
input[type="checkbox"]:not(.switch input):hover { border-color: var(--accent); }
input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field:focus-within > label { color: var(--accent); }
.field > label { transition: color 0.15s; }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.input-color { display: flex; gap: 8px; align-items: center; }
.input-color input[type="color"] { width: 46px; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--bg); cursor: pointer; }

.switch { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; margin-bottom: 13px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; flex: none; cursor: pointer; margin: 1px 0 0; transition: background 0.2s, border-color 0.2s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-3); transition: transform 0.2s, background 0.2s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: #fff; }
.switch-text strong { display: block; font-weight: 600; }
.switch-text span { font-size: 13px; color: var(--ink-3); }

.picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.pick { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; font-weight: 600; }
.pick-dot { width: 9px; height: 9px; border-radius: 50%; }
.pick button { border: 0; background: none; cursor: pointer; color: var(--ink-3); width: 20px; height: 20px; border-radius: 50%; line-height: 1; }
.pick button:hover { background: var(--line); color: var(--ink); }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { border: 0; background: none; padding: 7px 14px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-radius: 8px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }

/* Configurazione */
.cfg { display: grid; grid-template-columns: 190px 1fr; gap: 28px; align-items: start; }
.cfg-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.cfg-nav a { padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-3); font-family: var(--f-mono); font-size: 12.5px; }
.cfg-nav a::before { content: "# "; color: var(--accent); }
.cfg-nav a:hover { background: var(--surface); color: var(--ink); }
.cfg-section { scroll-margin-top: 20px; }
.savebar {
  position: sticky; bottom: 16px; margin-top: 18px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--r);
  padding: 10px 12px 10px 18px; box-shadow: var(--shadow);
  animation: rise 0.25s ease-out;
}
.savebar span { font-family: var(--f-mono); font-size: 13px; }
.savebar span::before { content: "● "; color: var(--warn); }

.types-table input { min-height: 34px; padding: 6px 8px; }
.types-table td { padding: 6px; }
.types-table .emoji-in { width: 64px; text-align: center; }
.types-table .id-in { width: 110px; }

/* ---------- Annunci: anteprima Discord ---------- */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.preview-wrap { position: sticky; top: 24px; }
.preview-label { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); margin-bottom: 8px; }
.preview-label::before { content: "// "; color: var(--accent); }
.discord {
  background: var(--discord-bg); border-radius: var(--r); padding: 18px 16px 20px;
  color: var(--discord-text); font: 15px/1.375 "gg sans", "Noto Sans", var(--f-body);
  border: 1px solid #3f4147; box-shadow: var(--shadow);
}
.dc-head { display: flex; gap: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: #1e1f22; flex: none; display: grid; place-items: center; overflow: hidden; }
.dc-avatar img { width: 30px; height: 30px; }
.dc-name { font-weight: 600; color: #f2f3f5; }
.dc-bot { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 1px 4px; margin-left: 4px; vertical-align: 2px; }
.dc-time { font-size: 12px; color: #949ba4; margin-left: 6px; }
.dc-mention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-embed { margin-top: 6px; background: var(--discord-embed); border-left: 4px solid var(--flare); border-radius: 4px; padding: 10px 16px 14px 12px; max-width: 520px; display: grid; grid-template-columns: 1fr auto; gap: 0 14px; }
.dc-title { font-weight: 600; color: #f2f3f5; font-size: 16px; margin-top: 2px; grid-column: 1; }
.dc-desc { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; margin-top: 6px; grid-column: 1; }
.dc-desc:empty::before { content: attr(data-ph); color: #6d6f78; }
.dc-thumb { grid-column: 2; grid-row: 1 / span 2; width: 80px; height: 80px; border-radius: 4px; object-fit: cover; margin-top: 4px; }
.dc-image { grid-column: 1 / -1; margin-top: 14px; max-width: 100%; border-radius: 4px; max-height: 300px; object-fit: cover; }
.dc-foot { grid-column: 1 / -1; font-size: 12px; color: #b5bac1; margin-top: 10px; }
.dc-strong { font-weight: 700; }
.dc-code { background: #1e1f22; border-radius: 3px; padding: 0 3px; font-family: var(--f-mono); font-size: 0.85em; }

/* Trascrizioni */
.transcript {
  background: var(--term-bg); color: #d7dceb; border: 1px solid #262b38; border-radius: var(--r-ctl);
  padding: 14px 16px; font: 12.5px/1.65 var(--f-mono); white-space: pre-wrap; word-break: break-word;
  max-height: 60vh; overflow: auto;
}

/* Registro a catena */
.integrity { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 12.5px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); }
.integrity.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.integrity.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 500px); }
.auth-side {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  border-right: 1px solid var(--line);
}
.auth-side canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.auth-side .brand { padding: 0; }
.auth-hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.04; letter-spacing: -0.03em; max-width: 13ch; }
.auth-hero h1 em { font-style: normal; color: var(--accent); }
.auth-hero .roles { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 22px; }
.auth-hero .roles span { font-family: var(--f-mono); font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); background: color-mix(in srgb, var(--bg) 70%, transparent); }
.auth-hero p.lead { color: var(--ink-3); font-size: 1.05rem; max-width: 46ch; margin-bottom: 24px; }
.auth-foot { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); }
.auth-foot b { color: var(--accent); font-weight: 400; }
.auth-main { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 40px 36px; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card .crumb { margin-bottom: 14px; }
.auth-card h2 { font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.02em; }
.auth-card h2 + p { color: var(--ink-3); margin-bottom: 24px; }
.auth-card .btn.primary { width: 100%; padding: 11px; font-size: 15px; }
.code-input { font: 600 26px var(--f-mono); letter-spacing: 0.4em; text-align: center; padding: 10px; }
.qr { display: block; width: 196px; height: 196px; border-radius: 12px; border: 1px solid var(--line); margin: 6px auto 12px; background: #fff; padding: 6px; }
.secret { font: 600 14px var(--f-mono); text-align: center; background: var(--bg); border: 1px dashed var(--line-2); border-radius: var(--r-ctl); padding: 9px; word-spacing: 3px; user-select: all; }
.steps { margin: 0 0 16px; padding-left: 20px; color: var(--ink-2); }
.steps li + li { margin-top: 6px; }
.steps li::marker { color: var(--accent); font-family: var(--f-mono); }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font: 600 14px var(--f-mono); background: var(--term-bg); color: #d7dceb; border: 1px solid #262b38; border-radius: var(--r-ctl); padding: 14px 18px; margin: 14px 0; user-select: all; }

.alert { padding: 10px 14px; border-radius: var(--r-ctl); font-size: 14px; margin-bottom: 14px; border: 1px solid transparent; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert.info { background: var(--accent-soft); color: var(--ink-2); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.linklike { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; }

/* ---------- Modale e toast ---------- */
dialog {
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink);
  padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
dialog[open] { animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(6px); } }
dialog.wide { width: min(880px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(8, 9, 14, 0.6); backdrop-filter: blur(4px); }
dialog h2 { margin-bottom: 8px; font-size: 1.35rem; }
dialog > div > p, dialog > form > p { color: var(--ink-3); margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  padding: 11px 16px; border-radius: var(--r-ctl); font-size: 14px; max-width: 400px; box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.loading { padding: 48px; text-align: center; color: var(--ink-3); font-family: var(--f-mono); font-size: 13px; }
.loading::after { content: "_"; animation: blink 1s steps(1) infinite; }

/* Avviso di inattività */
.idle-bar {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line)); border-radius: var(--r);
  box-shadow: var(--shadow); font-size: 14px; animation: rise 0.25s ease-out;
}

/* ---------- Correzioni layout ---------- */
.grid-2 > *, .composer > *, .cfg > *, .stack > *, .panel { min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .composer, .grid-2 { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .cfg { grid-template-columns: 1fr; }
  .cfg-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform 0.22s; background: var(--bg); }
  .rail.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, 0.5); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .main { padding: 22px 16px 56px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px; min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-hero h1 { font-size: 2.3rem; }
  .auth-hero p.lead, .auth-foot { display: none; }
  .auth-main { padding: 28px 20px 40px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-left: 0 !important; border-top: 1px solid var(--line); }
  .stat:nth-child(-n + 2) { border-top: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .table-wrap { margin: 0 -22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #fx-canvas, .scanline, #cursor-glow { display: none; }
}

/* ---------- Sezione Ticket ---------- */
.acc { padding: 0; }
.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-weight: 700; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::before { content: "▸"; color: var(--ink-3); transition: transform 0.15s; }
.acc[open] > summary::before { transform: rotate(90deg); }
.acc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--f-display); font-size: 17px; }
.acc-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.acc-body h3 { font-size: 15px; }
.q-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 1.6fr) auto auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }
.days { display: grid; gap: 6px; margin-top: 6px; max-width: 460px; }
.day-row { display: grid; grid-template-columns: 130px 1fr auto 1fr; gap: 8px; align-items: center; }
.day-row .input { min-height: 34px; padding: 5px 8px; }
.field-label { font-weight: 600; font-size: 13.5px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.bar { width: 100%; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--flare), color-mix(in srgb, var(--flare) 40%, var(--surface))); transition: filter 0.15s; }
.bar-col:hover .bar { filter: brightness(1.25); }
.hbars { display: grid; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: 34px 1fr 34px; gap: 10px; align-items: center; }
.hbar { height: 10px; border-radius: 6px; background: var(--bg-2, var(--line)); overflow: hidden; }
.hbar > div { height: 100%; background: var(--accent); border-radius: 6px; }
.embed-preview { display: flex; max-width: 520px; background: var(--bg-2, var(--surface)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ep-bar { width: 4px; flex: none; }
.ep-body { padding: 12px 14px; display: grid; gap: 8px; min-width: 0; }
.ep-body p { margin: 0; font-size: 13.5px; color: var(--ink-2, var(--ink)); white-space: pre-wrap; overflow-wrap: anywhere; }
.ep-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-btn { padding: 5px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; color: #fff; background: #5865f2; }
.ep-btn.secondary { background: #4e5058; } .ep-btn.success { background: #248046; } .ep-btn.danger { background: #da373c; }
.ep-select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; font-size: 13.5px; color: var(--ink-3); }
@media (max-width: 760px) {
  .q-row { grid-template-columns: 1fr 1fr; }
  .day-row { grid-template-columns: 110px 1fr auto 1fr; }
}

/* ---------- Moduli (community, protezione) ---------- */
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
a.alert { display: block; text-decoration: none; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.mod-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: 14px;
  transition: border-color .15s, transform .15s;
}
a.mod-chip:hover { border-color: var(--line-2); color: var(--ink); transform: translateY(-1px); }
.mod-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.mod-chip .dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.kv-list { display: grid; gap: 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.kv > span:last-child { text-align: right; overflow-wrap: anywhere; }
.bar-mini { height: 4px; border-radius: 4px; background: var(--line); margin-top: 4px; width: 90px; overflow: hidden; }
.bar-mini > span { display: block; height: 100%; background: var(--flare); }
.lockdown-on { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.lang-switch { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-switch button { border: 0; background: transparent; color: var(--ink-3, var(--ink-2)); font: 600 11px/1 var(--mono, monospace); padding: 6px 8px; border-radius: 999px; cursor: pointer; letter-spacing: .04em; }
.lang-switch button[aria-pressed="true"] { background: var(--flare-soft); color: var(--flare-ink); }
.login-lang { position: fixed; top: 16px; right: 16px; z-index: 5; }
@media (max-width: 720px) {
  .q-row { flex-wrap: wrap; }
  .q-row > .input { min-width: 0; flex: 1 1 140px; }
}
:root[data-theme="light"] .input { background-color: #fff; box-shadow: inset 0 1px 2px rgba(21, 24, 33, 0.05); }
:root[data-theme="light"] .input:hover { background-color: #fbfcfe; }

/* ---------- Passkey ---------- */
.passkey-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.auth-card .passkey-btn, dialog .passkey-btn { width: 100%; min-height: 44px; }
.passkey-btn svg { flex: none; color: var(--accent); }
.btn.primary.passkey-btn svg { color: currentColor; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--ink-3); font: 12px var(--f-mono); text-transform: lowercase; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pk-list { display: flex; flex-direction: column; gap: 8px; }
.pk-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.pk-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.pk-main { flex: 1; min-width: 0; }
.pk-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.ar-group { border-top: 1px dashed var(--line); margin: 6px 0 12px; padding-top: 12px; }
.ar-group h3 { font-size: 14px; margin: 0 0 10px; color: var(--ink-2); }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 4px; }
.guild-switch { margin: 2px 0 14px; display: flex; flex-direction: column; gap: 5px; }
.guild-switch-label { font: 11px var(--f-mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; padding-left: 2px; }
.guild-switch select.input { min-height: 38px; font-weight: 600; font-size: 13.5px; }

/* ---------- Menu cercabili ---------- */
.combo { position: relative; width: 100%; }
.combo-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; inset: 0; }
.combo-btn {
  display: flex; align-items: center; text-align: left; cursor: pointer; padding-right: 42px;
  background-image: var(--chev); background-repeat: no-repeat; background-position: right 15px center; background-size: 12px 8px;
}
.combo-btn.placeholder .combo-value { color: var(--ink-3); }
.combo-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.combo.open .combo-btn { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); background-image: var(--chev-on); }
.combo-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow), 0 2px 8px rgba(0, 0, 0, 0.2); animation: combo-in 0.12s ease-out;
}
.combo-pop.up { top: auto; bottom: calc(100% + 6px); }
@keyframes combo-in { from { opacity: 0; transform: translateY(-4px); } }
.combo-search { min-height: 38px !important; margin-bottom: 6px; font-size: 14px; }
.combo-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.combo-list li { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.combo-list li.active { background: var(--accent-soft); }
.combo-list li[aria-selected="true"] .combo-main { color: var(--accent); font-weight: 600; }
.combo-list li[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); font-weight: 700; }
.combo-list li[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.combo-list li.combo-empty .combo-main { color: var(--ink-3); font-style: italic; }
.combo-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-none { color: var(--ink-3); cursor: default !important; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .combo-pop { animation: none; } }

/* ---------- Menu essenziale ---------- */
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav a { padding: 10px 12px; gap: 12px; font-size: 14.5px; border: 0; color: var(--ink-3); }
.nav a span:first-of-type { flex: 1; }
.nav a:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); border: 0; box-shadow: inset 2px 0 0 var(--accent); }
.nav a .count { animation: none; background: var(--surface-2); color: var(--ink-2); font-weight: 600; min-width: 20px; padding: 0 6px; }
.nav a[aria-current="page"] .count { background: var(--accent-soft); color: var(--accent); }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.nav .dot.danger { background: var(--danger); box-shadow: 0 0 0 0 var(--danger); animation: dotpulse 1.8s infinite; }
@keyframes dotpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
.brand { padding: 4px 8px 16px; }
.brand-mark { filter: none; }
.guild-switch { margin: 0 0 12px; }
.guild-switch-label { display: none; }
.rail-foot { gap: 6px; padding-top: 10px; }
.rail-tools { gap: 4px; }
.rail-tools .icon-btn { width: 30px; height: 30px; border-radius: 8px; border-color: transparent; background: none; }
.rail-tools .icon-btn:hover { background: var(--surface); }
.me { padding: 4px; }

/* Sotto-pagine in cima alla pagina */
.subnav { display: flex; gap: 2px; margin: -6px 0 22px; padding-bottom: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 8px 12px 10px; color: var(--ink-3); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .nav .dot.danger { animation: none; } }

/* ---------- Spazi del sito (Plugin / Discord) ---------- */
.space-switch { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.space-switch a { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 4px; border-radius: 8px; color: var(--ink-3); text-decoration: none; font-weight: 600; font-size: 12.5px; min-width: 0; transition: background 0.15s, color 0.15s; }
.space-switch a:hover { color: var(--ink); }
.space-switch a.on { background: var(--surface-2); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.space-switch a.on svg { color: var(--accent); }

/* ---------- Plugin ---------- */
.pl-stats { grid-template-columns: repeat(4, 1fr); }
.pl-icon { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--line); }
.pl-initials { display: grid; place-items: center; font: 800 15px var(--f-display); color: #fff; background: linear-gradient(140deg, #9b7bff, #4c63f0); border: 0; letter-spacing: -0.02em; }
.pl-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; margin-bottom: 18px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: color-mix(in srgb, var(--surface) 55%, transparent); color: var(--ink-2); cursor: pointer; text-align: center; transition: border-color 0.15s, background 0.15s; overflow: hidden; }
.pl-drop svg { color: var(--accent); }
.pl-drop:hover, .pl-drop.over, .pl-drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.pl-drop.busy { pointer-events: none; opacity: 0.85; }
.pl-drop-text { font-weight: 600; color: var(--ink); }
.pl-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.pl-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #b48cff); transition: width 0.2s; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
.pl-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.pl-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-2px); }
.pl-card.muted { opacity: 0.6; }
.pl-card-head { display: flex; gap: 12px; align-items: center; }
.pl-name { font: 700 16px var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.pl-meta .mono { font-family: var(--f-mono); }
.pl-desc { font-size: 13.5px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.pl-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.pl-up { color: var(--ok); font: 600 12.5px var(--f-mono); }
.pl-platforms { display: flex; gap: 4px; flex-wrap: wrap; }
.pl-platforms span { font: 11px var(--f-mono); color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.pl-warn { font-size: 12px; color: var(--warn); }
.pl-tokens { margin-top: 4px; }
.pl-token { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.pl-head { margin-bottom: 18px; }
.pl-head-row { display: flex; align-items: center; gap: 14px; margin: 10px 0 6px; }
.pl-title { font: 800 30px/1.1 var(--f-display); letter-spacing: -0.03em; margin: 0; }
.pl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.pl-tile .panel-head { margin-bottom: 10px; }
.icon-link { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-3); }
.icon-link:hover { background: var(--surface-2); color: var(--accent); }
.pl-chart-wrap { margin-top: 6px; }
.pl-chart { width: 100%; height: 180px; display: block; }
.pl-chart-axis { display: flex; justify-content: space-between; font: 11.5px var(--f-mono); color: var(--ink-3); margin-top: 6px; }
.pl-notes { white-space: pre-wrap; max-width: 320px; max-height: 3.2em; overflow: hidden; color: var(--ink-3); }
.empty.small { padding: 22px 12px; }
@media (max-width: 760px) { .pl-stats { grid-template-columns: repeat(2, 1fr); } .pl-title { font-size: 24px; } }
.dist { display: flex; flex-direction: column; gap: 7px; }
.dist-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr 42px; align-items: center; gap: 10px; font-size: 13.5px; }
.dist-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--f-mono); font-size: 12.5px; }
.dist-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.dist-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #b48cff); }
.dist-n { text-align: right; font: 600 12px var(--f-mono); color: var(--ink-3); }
.code-block { background: var(--term-bg); color: #dfe3ee; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: 12.5px/1.6 var(--f-mono); overflow-x: auto; margin: 10px 0; }
.pl-tiles > .panel { margin-top: 0; }
.pl-pending { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Grafici, periodi, KPI (minimal) ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--ink-3); font: 600 12.5px var(--f-body); padding: 6px 10px; border-radius: 7px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface-2); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.seg button:disabled { opacity: 0.35; cursor: default; }
.seg.sm button { padding: 4px 9px; font-size: 12px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.kpi { background: var(--surface); padding: 14px 16px; min-width: 0; }
.kpi-label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font: 700 24px/1.1 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-delta, .kpi-hint { font: 500 11.5px var(--f-mono); color: var(--ink-3); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--danger); }
.chart { position: relative; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }
.chart-legend span, .chart-tip-r { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i, .chart-tip-r i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.chart-body { display: grid; grid-template-columns: 44px 1fr; gap: 6px; }
.chart-y { position: relative; font: 11px var(--f-mono); color: var(--ink-3); }
.chart-y span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.chart-plot { position: relative; touch-action: pan-y; cursor: crosshair; }
.chart-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-base { stroke: var(--line-2); stroke-width: 1; }
.chart-x { position: relative; height: 22px; font: 11px var(--f-mono); color: var(--ink-3); }
.chart-x span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; }
.chart-x span.first { transform: none; }
.chart-x span.last { transform: translateX(-100%); }
.chart-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink-3); opacity: 0.5; pointer-events: none; }
.chart-tip { position: absolute; top: 4px; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); min-width: 140px; z-index: 5; }
.chart-tip-t { font: 600 11.5px var(--f-mono); color: var(--ink-3); margin-bottom: 5px; white-space: nowrap; }
.chart-tip-r { display: flex; gap: 6px; justify-content: space-between; }
.chart-tip-r span { flex: 1; color: var(--ink-2); }
.chart-tip-r b { font-variant-numeric: tabular-nums; }
.chart-tip-r.total { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 5px; }
.chart-empty { padding: 36px 10px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.hidden { display: none !important; }
.split { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: 10px 0 8px; }
.split i { display: block; height: 100%; }
.split-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.split-legend b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 4px; }
.split-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
@media (max-width: 640px) { .chart-body { grid-template-columns: 34px 1fr; } .kpi-value { font-size: 20px; } }
.ranged { transition: opacity 0.15s; }
.ranged.busy { opacity: 0.55; pointer-events: none; }
.loading.small { padding: 30px 0; font-size: 13px; }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.panel.flush { padding: 0; overflow: hidden; }
.pl-rows { display: flex; flex-direction: column; }
.pl-row { display: grid; grid-template-columns: 36px 1fr 78px 78px; align-items: center; gap: 14px; padding: 12px 16px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); transition: background 0.12s; }
.pl-row:first-child { border-top: 0; }
.pl-row:hover, .pl-row:focus-visible { background: var(--surface-2); outline: none; }
.pl-row.muted { opacity: 0.55; }
.pl-row .pl-icon { width: 36px; height: 36px; border-radius: 9px; font-size: 12px; }
.pl-row-main { min-width: 0; }
.pl-row-name { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14.5px; }
.pl-row-name .mono { font: 12px var(--f-mono); }
.pl-row-sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pl-row-sub:empty { display: none; }
.pl-row-num { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.pl-row-num strong { font: 700 15px var(--f-display); }
.pl-row-num strong.up { color: var(--ok); }
.pl-row-num span { font: 11px var(--f-mono); color: var(--ink-3); }
@media (max-width: 560px) { .pl-row { grid-template-columns: 36px 1fr 64px; } .pl-row-num:last-child { display: none; } }
.pl-tagline { color: var(--ink-2); margin: 4px 0 10px; max-width: 70ch; }
.pl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pl-tag { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.pl-tag.hash { color: var(--ink-3); border-style: dashed; }
.pl-tag.mono { font-family: var(--f-mono); font-size: 11.5px; }
.pl-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.pl-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); text-decoration: none; }
.pl-links a:hover { color: var(--accent); }
.pl-logo { display: flex; align-items: center; gap: 18px; }
.pl-logo h2 { margin-bottom: 2px; }
.pl-logo p { margin: 0 0 10px; }
.pl-logo-drop { border-radius: 16px; padding: 4px; border: 1.5px dashed transparent; cursor: pointer; transition: border-color 0.15s; }
.pl-logo-drop:hover, .pl-logo-drop.over, .pl-logo-drop:focus-visible { border-color: var(--accent); outline: none; }
.pl-logo-drop .pl-icon { width: 72px; height: 72px; border-radius: 14px; font-size: 22px; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font: 600 12.5px var(--f-body); border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: all 0.12s; }
.tchip:hover { color: var(--ink); border-color: var(--line-2); }
.tchip[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }

/* ---------- Team, gradi, Discord, novità ---------- */
.p-av { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: none; background: linear-gradient(140deg, #9b7bff, #4c63f0); color: #fff; font: 700 12px var(--f-display); }
.p-av-wrap { position: relative; display: inline-flex; flex: none; }
.p-online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.team-row { grid-template-columns: 36px 1fr auto 96px; }
.team-flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .team-row { grid-template-columns: 36px 1fr 72px; } .team-flags { display: none; } }
.grade { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--f-body); color: var(--g); background: color-mix(in srgb, var(--g) 13%, transparent); border: 1px solid color-mix(in srgb, var(--g) 35%, transparent); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.grade i { width: 7px; height: 7px; border-radius: 50%; background: var(--g); }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.perm-item i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line-2); flex: none; }
.perm-item.on { color: var(--ink); }
.perm-item.on i { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--surface); }
.grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.grade-card { border-top: 2px solid var(--g); }
.perm-groups { display: grid; gap: 14px; margin: 6px 0 4px; max-height: 52vh; overflow: auto; padding-right: 4px; }
.perm-group-title { font: 600 11.5px var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 6px; }
.perm-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.perm-check:hover { border-color: var(--line-2); }
.perm-check input { margin-top: 3px; accent-color: var(--accent); }
.perm-check span { display: flex; flex-direction: column; gap: 2px; }
.perm-check small { color: var(--ink-3); font-size: 12px; }
.color-in { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.inline-ctl { display: flex; gap: 8px; align-items: center; }
.inline-ctl > .input { flex: 1; min-width: 0; }
.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.profile-name { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 18px; margin-bottom: 2px; }
.profile-name strong { font-family: var(--f-display); }
.updates-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 8px; border-radius: 9px; font-size: 12.5px; color: var(--ink-3); text-decoration: none; }
.updates-link:hover { background: var(--surface-2); color: var(--ink); }
.updates-link .mono { margin-left: auto; font-size: 11px; }
.updates-link .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.upd-list { display: flex; flex-direction: column; gap: 8px; max-width: 820px; }
.upd { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.upd summary { display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; list-style: none; }
.upd summary::-webkit-details-marker { display: none; }
.upd-v { font-size: 12.5px; color: var(--accent); min-width: 52px; }
.upd-title { font-weight: 600; flex: 1; min-width: 0; }
.upd-items { margin: 0; padding: 0 16px 14px 80px; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.upd-items li { display: flex; gap: 10px; align-items: baseline; }
.upd-items .chip { flex: none; min-width: 84px; justify-content: center; }
@media (max-width: 640px) { .upd-items { padding-left: 16px; } .upd-items li { flex-direction: column; gap: 4px; } .upd-date { display: none; } }
/* collegamento Discord */
.dlink-hero { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: #5865f2; color: #fff; margin-bottom: 16px; box-shadow: 0 10px 30px -10px #5865f2; }
.dlink { margin: 4px 0 6px; }
.dlink-cmd { display: flex; align-items: center; gap: 4px; background: var(--term-bg); border: 1px solid #262b38; border-radius: 12px; padding: 8px 8px 8px 14px; font: 600 17px var(--f-mono); color: #e6e9f2; }
.dlink-cmd code { flex: 1; letter-spacing: 0.04em; }
.dlink-slash { color: #8b93a7; }
.dlink-cmd.expired code { text-decoration: line-through; opacity: 0.45; }
.dlink-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 4px; flex-wrap: wrap; }
.dlink-left { font-family: var(--f-mono); }
.dlink-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.dlink-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse-dot 1.4s ease-in-out infinite; flex: none; }
.dlink-status.bad { color: var(--danger); }
.dlink-status.bad i { background: var(--danger); animation: none; }
@keyframes pulse-dot { 50% { opacity: 0.3; transform: scale(0.7); } }
.dlink-done { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 0 8px; animation: rise 0.4s ease; }
.dlink-done img { border-radius: 50%; margin-bottom: 6px; }
.dlink-ok { margin-top: 8px; color: var(--ok); font: 600 13px var(--f-mono); }
.dlink-why { margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.dlink-why summary { cursor: pointer; color: var(--ink-2); }
.dlink-why ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.dlink-why li strong { display: block; color: var(--ink); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .dlink-status i { animation: none; } }
.grades > .panel { margin: 0; }
/* emoji */
.emoji-img { display: inline-block; vertical-align: -0.2em; object-fit: contain; }
.emoji-in { position: relative; display: flex; gap: 6px; align-items: center; }
.emoji-in .emoji-text { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 13px; }
.emoji-btn { flex: none; width: 40px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); cursor: pointer; font-size: 18px; line-height: 1; }
.emoji-btn:hover:not(:disabled) { border-color: var(--accent); }
.emoji-btn:disabled { opacity: 0.5; cursor: default; }
.emoji-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(320px, 86vw); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.emoji-sec { font: 600 11px var(--f-mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 210px; overflow: auto; }
.emoji-pick { aspect-ratio: 1; border: 0; background: none; border-radius: 7px; font-size: 20px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.emoji-pick:hover, .emoji-pick:focus-visible { background: var(--surface-2); outline: none; }
.emoji-foot { display: flex; justify-content: flex-end; }
.input.sm { min-height: 32px; padding: 5px 9px; font-size: 13px; }
.ep-btn { display: inline-flex; align-items: center; gap: 6px; }
/* canale ticket pronto */
.setup-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 12px; }
.dc-welcome { background: #313338; color: #f2f3f5; border-radius: 10px; padding: 16px 18px; font-family: var(--f-body); }
.dc-hash { width: 52px; height: 52px; border-radius: 50%; background: #41434a; display: grid; place-items: center; font-size: 30px; font-weight: 300; margin-bottom: 10px; }
.dc-welcome h3 { font-size: 20px; font-weight: 800; margin: 0 0 4px; word-break: break-word; }
.dc-welcome p { color: #b5bac1; margin: 0; font-size: 13.5px; }
/* piccoli fix */
.linklike.who-id { white-space: nowrap; text-align: left; }

/* ---------- Notifiche ---------- */
.bell-btn { position: relative; }
.bell-count { position: absolute; top: -4px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font: 700 10.5px/17px var(--f-mono); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-pop { position: fixed; z-index: 2000; background-color: var(--bg); background-image: linear-gradient(var(--surface), var(--surface)); max-height: min(560px, 75vh); display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; animation: pop 0.15s ease; }
.notif-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-pop-foot { display: flex; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); }
.notif-list { overflow: auto; flex: 1; }
.notif-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; position: relative; transition: background 0.12s; }
.notif:first-child { border-top: 0; }
.notif:hover, .notif:focus-visible { background: var(--surface-2); outline: none; }
.notif.unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif.unread .notif-title { font-weight: 650; color: var(--ink); }
.notif-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.notif-ic.c-tickets { color: #7b96ff; background: color-mix(in srgb, #7b96ff 14%, transparent); }
.notif-ic.c-moderation { color: #ff6b8a; background: color-mix(in srgb, #ff6b8a 14%, transparent); }
.notif-ic.c-team { color: #b48cff; background: color-mix(in srgb, #b48cff 14%, transparent); }
.notif-ic.c-security { color: #f0a43a; background: color-mix(in srgb, #f0a43a 14%, transparent); }
.notif-ic.c-plugins { color: #2fd17a; background: color-mix(in srgb, #2fd17a 14%, transparent); }
.notif-ic.c-system { color: #5ad1e6; background: color-mix(in srgb, #5ad1e6 14%, transparent); }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; color: var(--ink-2); line-height: 1.35; }
.notif-body { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-meta { display: flex; gap: 8px; flex-wrap: wrap; font: 11px var(--f-mono); color: var(--ink-3); margin-top: 5px; }
.notif-you { color: var(--accent); }
.notif-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.notif-tools { display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.notif:hover .notif-tools, .notif:focus-within .notif-tools { opacity: 1; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm svg { width: 14px; height: 14px; }
.notif-day { margin-bottom: 16px; }
.notif-day-title { font: 600 12px var(--f-mono); color: var(--ink-3); text-transform: capitalize; margin: 0 0 8px 2px; }
.notif-page { max-width: 820px; }
.pref-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pref-table th { text-align: left; font: 600 11.5px var(--f-mono); color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.pref-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.pref-table td svg { vertical-align: -3px; color: var(--ink-3); }
.pref-table input { accent-color: var(--accent); width: 16px; height: 16px; }
@media (hover: none) { .notif-tools { opacity: 1; } }
/* team */
.team-dash { margin-bottom: 4px; }
.top-row { text-decoration: none; color: inherit; }
.top-name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-body); font-size: 13px; }
.bio { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.perm-item.add i { box-shadow: inset 0 0 0 3px var(--surface); background: var(--accent); border-color: var(--accent); }
.perm-item.del { text-decoration: line-through; }
.perm-list.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.perm-ovr { display: flex; flex-direction: column; gap: 14px; }
.ovr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.ovr-name { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.ovr-name small { color: var(--ink-3); font-size: 11.5px; }
.perm-group-title { display: flex; justify-content: space-between; align-items: center; }
.perm-group-tools { text-transform: none; letter-spacing: 0; font-weight: 400; }
.perm-check.off { opacity: 0.45; }
.sticky-col { position: sticky; top: 16px; }
@media (max-width: 900px) { .sticky-col { position: static; } }

/* ---------- Impostazioni (pannello sopra la pagina, stile Apple) ---------- */
html.st-lock, html.st-lock body { overflow: hidden; }
.st-overlay {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px;
  background: rgba(8, 9, 14, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: st-fade 0.18s ease-out;
}
.st-sheet {
  width: min(1120px, 100%); height: min(780px, calc(100vh - 48px)); display: grid; grid-template-columns: 272px 1fr;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.75);
  animation: st-pop 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes st-fade { from { opacity: 0; } }
@keyframes st-pop { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.st-side { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.st-side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 0; }
.st-side-head h2 { font-size: 20px; }
.st-close-side { display: none; }
.st-search {
  width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px;
  padding: 7px 10px 7px 30px; font: 14px var(--f-body);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa1b4' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px 50%;
}
.st-search:focus { outline: none; border-color: var(--accent); }
.st-groups { display: flex; flex-direction: column; gap: 12px; }
.st-group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.st-item, .st-me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; position: relative; }
.st-item + .st-item::before { content: ""; position: absolute; top: 0; left: 46px; right: 0; border-top: 1px solid var(--line); }
.st-item:hover, .st-me:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.st-item[aria-current="page"], .st-me[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.st-item[aria-current="page"]::before, .st-item[aria-current="page"] + .st-item::before { border-color: transparent; }
.st-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.st-ic svg { width: 15px; height: 15px; }
.st-label { flex: 1; min-width: 0; }
.st-badge { position: static !important; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font: 600 11px/20px var(--f-mono); text-align: center; }
.st-meta { font-size: 11px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.st-meta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--flare); display: inline-block; }
.st-item[aria-current="page"] .st-meta { color: inherit; opacity: 0.8; }
.st-chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); opacity: 0.35; flex: none; margin-right: 3px; }
.st-me { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.st-me-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-me-main strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-me-main span { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.st-me[aria-current="page"] .st-me-main span { color: inherit; opacity: 0.8; }
.st-logout { margin-top: auto; display: flex; align-items: center; gap: 8px; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--danger); border-radius: 10px; padding: 8px; font: 500 13.5px var(--f-body); cursor: pointer; }
.st-logout:hover { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.st-detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.st-bar { position: absolute; top: 12px; right: 14px; left: 14px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; z-index: 6; }
.st-bar > * { pointer-events: auto; }
.st-back { visibility: hidden; display: inline-flex; align-items: center; gap: 2px; color: var(--accent); text-decoration: none; font-weight: 500; }
.st-back span:first-child { font-size: 26px; line-height: 1; margin-top: -3px; }
.st-close { margin-left: auto; border-radius: 50%; width: 30px; height: 30px; }
.st-content { flex: 1; overflow-y: auto; padding: 22px 30px 40px; overscroll-behavior: contain; }
.st-content .page { max-width: none; }
.st-content .page-head { padding-right: 40px; margin-bottom: 18px; }
.st-content .page-head h1 { font-size: 26px; }
.st-content .crumb { display: none; }
.st-content .table-wrap { margin-left: 0; margin-right: 0; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; cursor: default; }
.st-row + .st-row { border-top: 1px solid var(--line); }
.st-row p { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
label.st-row { cursor: pointer; }
.rail-tools .st-btn { color: var(--ink-2); }
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; border-radius: 9px; }
.me-link:hover .me-name { color: var(--accent); }
.mobile-bar .btn-row { margin-left: auto; margin-right: 6px; gap: 4px; }
.mobile-bar .icon-btn { border-color: transparent; background: none; }
@media (min-width: 861px) { .mobile-bar .btn-row { display: none; } }
@media (max-width: 760px) {
  .st-overlay { padding: 0; }
  .st-sheet { width: 100%; height: 100%; border-radius: 0; border: 0; grid-template-columns: 1fr; }
  .st-side { border-right: 0; padding: 14px; }
  .st-close-side { display: inline-grid; }
  .st-overlay:not(.list-only) .st-side { display: none; }
  .st-overlay.list-only .st-detail { display: none; }
  .st-back { visibility: visible; }
  .st-bar { position: static; padding: 10px 12px 0; }
  .st-content { padding: 8px 16px 40px; }
  .st-content .page-head { padding-right: 0; }
  .st-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .st-overlay, .st-sheet { animation: none; } }

/* ---------- Home ---------- */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.home-head h1 { font-size: clamp(28px, 4vw, 38px); }
.home-head p { margin-top: 4px; text-transform: capitalize; }
.home-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.home-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 12.5px; text-decoration: none; }
a.home-pill:hover { border-color: var(--line-2); color: var(--ink); }
.home-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.home-pill.ok i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.home-pill.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.home-pill.bad i { background: var(--danger); }
.home-pill.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.home-pill i.new { background: var(--flare); }
.home-pill svg { width: 13px; height: 13px; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.hc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; transition: border-color 0.15s; }
.hc:hover { border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.hc.wide { grid-column: 1 / -1; }
.hc-head { display: flex; align-items: center; gap: 10px; }
.hc-head h2 { font-size: 15px; flex: 1; }
.hc-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.hc-open { display: inline-flex; gap: 5px; font-size: 12.5px; color: var(--ink-3); text-decoration: none; padding: 3px 8px; border-radius: 7px; }
.hc-open:hover { color: var(--accent); background: var(--accent-soft); }
.hc-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hc-skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 40%, var(--surface)), var(--surface-2)); background-size: 200% 100%; animation: hc-shimmer 1.2s infinite linear; }
.hc-skel.short { width: 60%; }
@keyframes hc-shimmer { to { background-position: -200% 0; } }
.hc-err { color: var(--ink-3); font-size: 13px; }
.hc-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hc-who > div { display: flex; flex-direction: column; min-width: 0; }
.hc-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-avatar { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; flex: none; }
.hc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.hc-stat { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; min-width: 0; }
.hc-stat + .hc-stat { border-left: 1px solid var(--line); }
a.hc-stat:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.hc-stat strong { font: 700 18px var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-stat span { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.hc-stat.hot strong { color: var(--flare); }
.hc-stat.up strong { color: var(--ok); }
.hc-list, .hc-notifs { display: flex; flex-direction: column; margin: 0 -8px; }
.hc-li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; color: inherit; text-decoration: none; }
.hc-li:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.hc-li .pl-icon { border-radius: 7px; }
.hc-li-main { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: baseline; }
.hc-li-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-li-main .mono { font-size: 11.5px; }
.hc-li-num { font: 600 13px var(--f-mono); color: var(--ink-2); }
.hc-li-num.up { color: var(--ok); }
.hc-faces { display: flex; }
.hc-faces > span + span { margin-left: -8px; }
.hc-faces .p-av { border: 2px solid var(--surface); }
.hc-upd { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.hc .alert { margin: 0; }

@media (max-width: 520px) {
  .hc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hc-stat:nth-child(3) { border-left: 0; }
  .hc-stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .hc-skel { animation: none; } }

.hc-meta { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.hc-li-main { flex-direction: column; align-items: flex-start; gap: 1px; }
.hc-li-main > strong, .hc-li-main > .hc-act { font-size: 13.5px; }
.hc-li-sub { font-size: 12px; color: var(--ink-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hc-act { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.hc-act .chip { font-size: 11px; padding: 1px 7px; }
.hc-num { font-size: 12px; color: var(--ink-3); min-width: 34px; }
.hc-tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.hc-tag.ok { background: var(--ok-soft); color: var(--ok); }
.hc-tag.warn { background: var(--flare-soft); color: var(--flare-ink); }
.hc-tag.bad { background: var(--danger-soft); color: var(--danger); }
.hc-empty { font-size: 13px; color: var(--ink-3); padding: 4px 0; }
.hc-more { font-size: 12.5px; color: var(--ink-3); padding: 4px 8px 0; text-decoration: none; }
.hc-more:hover { color: var(--accent); }
.hc-chart { margin: -4px 0 -6px; }
.hc-chart .chart-legend { display: none; }
.hc-chart .chart-body { grid-template-columns: 30px 1fr; }
.hc-li > .pl-icon, .hc-li > .p-av { flex: none; }

/* Lingua con bandierina */
.flag { display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.lang-btn .flag { width: 18px; height: 12px; }
.lang-pop { position: fixed; z-index: 2000; width: 170px; padding: 5px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; animation: st-pop 0.16s ease-out; }
.lang-pop button { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 13.5px var(--f-body); cursor: pointer; text-align: left; }
.lang-pop button span { flex: 1; }
.lang-pop button:hover { background: var(--surface-2); }
.lang-pop button.on svg:last-child { color: var(--accent); }
.lang-opt { display: inline-flex; align-items: center; gap: 7px; }

/* Impostazioni: vetro opaco */
.st-overlay { background: rgba(6, 7, 12, 0.32); backdrop-filter: none; -webkit-backdrop-filter: none; }
.st-sheet {
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  backdrop-filter: blur(34px) saturate(1.5); -webkit-backdrop-filter: blur(34px) saturate(1.5);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.6), inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent);
}
.st-side { background: color-mix(in srgb, var(--bg) 22%, transparent); border-right-color: color-mix(in srgb, var(--ink) 9%, transparent); }
.st-group, .st-me, .st-search, .st-logout { background-color: color-mix(in srgb, var(--surface) 70%, transparent); border-color: color-mix(in srgb, var(--ink) 9%, transparent); }
.st-content .panel, .st-content .kpis, .st-content .team-row, .st-content .notif-day .panel { background-color: color-mix(in srgb, var(--surface) 72%, transparent); border-color: color-mix(in srgb, var(--ink) 9%, transparent); }
.st-content .panel::before { display: none; }
.st-content .caret { display: none; }
.st-item[aria-current="page"], .st-me[aria-current="page"] { background: color-mix(in srgb, var(--accent) 88%, transparent); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .st-sheet { background: var(--bg); } }

/* Il mio account: profilo ordinato */
.panel.profile { align-items: flex-start; }
.panel.profile > .btn-row { flex-basis: 100%; padding-top: 14px; border-top: 1px solid var(--line); justify-content: flex-start; }
.panel.profile .inline-ctl { max-width: 360px; }

/* Menu Plugin: elenco ordinabile */
.pl-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 6px; font: 11px var(--f-mono); color: var(--ink-3); }
.pl-rail-sort { position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.pl-rail-sort:hover { background: var(--surface); color: var(--ink); }
.pl-rail-sort::after { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: 0.7; }
.pl-rail-sort select { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 14px; }
.nav a.pl-rail-item { gap: 9px; padding: 6px 10px; font-size: 13.5px; }
.pl-rail-item .pl-icon { width: 22px; height: 22px; border-radius: 6px; flex: none; font-size: 9px; }
.pl-rail-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-rail-val { font-size: 11px; color: var(--ink-3); flex: none; }
.pl-rail-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex: none; }
.pl-rail-empty { padding: 6px 10px; font-size: 12.5px; color: var(--ink-3); }
.pl-rail { overflow-y: auto; min-height: 0; flex: 1; }
.hc-li-title { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }

/* Home: numeri chiave, colonne, personalizzazione */
.home-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.home-head-side .btn-row { gap: 6px; }
.home-edit { display: inline-flex; align-items: center; gap: 6px; }
.home-kpis { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 16px; overflow: hidden; }
.home-kpi { padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; min-width: 0; position: relative; }
.home-kpi + .home-kpi { border-left: 1px solid var(--line); }
a.home-kpi:hover { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.home-kpi strong { font: 700 26px/1.15 var(--f-display); letter-spacing: -0.02em; }
.home-kpi span { font-size: 12.5px; color: var(--ink-3); }
.home-kpi em { font: normal 11.5px var(--f-mono); color: var(--ink-3); min-height: 1em; }
.home-kpi.hot strong { color: var(--flare); }
.home-kpi.up em { color: var(--ok); }
.home-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hc-line { display: flex; align-items: baseline; gap: 8px; }
.hc-line strong { font: 700 20px var(--f-display); color: var(--ok); }
.hc-line span { font-size: 12.5px; color: var(--ink-3); }
.hc-handle, .hc-hide { display: none; border: 0; background: none; color: var(--ink-3); cursor: grab; padding: 2px 4px; border-radius: 6px; line-height: 1; font-size: 16px; touch-action: none; }
.hc-hide { cursor: pointer; }
.hc-handle:hover, .hc-hide:hover { color: var(--ink); background: var(--surface-2); }
.home-grid.editing .hc-handle, .home-grid.editing .hc-hide { display: inline-grid; place-items: center; }
.home-grid.editing .hc-open { display: none; }
.home-grid.editing .hc { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.home-grid.editing .hc-body { pointer-events: none; opacity: 0.75; }
.home-grid.editing .home-col { min-height: 120px; border-radius: var(--r); outline: 1px dashed color-mix(in srgb, var(--ink) 12%, transparent); outline-offset: 6px; }
.hc.dragging { position: fixed; z-index: 3000; pointer-events: none; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6); transform: rotate(0.6deg) scale(1.01); opacity: 0.96; }
.hc-ph { border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); border-radius: var(--r); background: var(--accent-soft); }
html.hc-dragging, html.hc-dragging * { cursor: grabbing !important; user-select: none; }
.home-tray { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.home-tray:empty { display: none; }
.home-tray-label { font: 11px var(--f-mono); color: var(--ink-3); margin-right: 4px; }
.home-add { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; border: 1px dashed var(--line-2); border-radius: 999px; background: none; color: var(--ink-2); font: 500 12.5px var(--f-body); cursor: pointer; }
.home-add:hover { border-color: var(--accent); color: var(--ink); }
.home-add b { color: var(--accent); font-weight: 600; }
.hc-ic.sm { width: 22px; height: 22px; border-radius: 6px; }
.home-empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--r); }
@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-kpi:nth-child(odd) { border-left: 0; }
  .home-kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .home-head-side { align-items: flex-start; }
}

/* ---------- Impostazioni: stile "editor" più asciutto ---------- */
.st-sheet { grid-template-columns: 248px 1fr; }
.st-side { padding: 14px 10px; gap: 10px; }
.st-side-head { align-items: flex-start; padding: 2px 6px; }
.st-crumb { font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.st-crumb b { color: var(--accent); font-weight: 400; }
.st-side-head h2 { font-size: 17px; letter-spacing: -0.01em; }
.st-search-wrap { position: relative; display: block; }
.st-search-wrap kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 11px var(--f-mono); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; line-height: 17px; pointer-events: none; }
.st-search { font: 13px var(--f-mono); padding: 6px 28px 6px 28px; border-radius: 8px; }
.st-search:focus + kbd { display: none; }
.st-groups { gap: 4px; }
.st-group, .st-me { background: none !important; border: 0 !important; border-radius: 0; overflow: visible; }
.st-group-label { font: 11px var(--f-mono); color: var(--ink-3); padding: 10px 8px 4px; }
.st-group-label { color: color-mix(in srgb, var(--accent) 70%, var(--ink-3)); }
.st-item, .st-me { padding: 6px 8px; border-radius: 7px; font-size: 13.5px; gap: 9px; color: var(--ink-2); }
.st-item + .st-item::before { display: none; }
.st-item:hover, .st-me:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); color: var(--ink); }
.st-item[aria-current="page"], .st-me[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.st-ic { width: 18px; height: 18px; background: none !important; color: var(--ink-3); border-radius: 0; }
.st-item[aria-current="page"] .st-ic { color: var(--accent); }
.st-chev { display: none; }
.st-badge { min-width: 18px; height: 18px; line-height: 18px; font-size: 10.5px; background: var(--danger-soft); color: var(--danger); }
.st-meta { font-size: 10.5px; }
.st-item[aria-current="page"] .st-meta { color: var(--ink-3); opacity: 1; }
.st-me { padding: 8px; margin-bottom: 2px; }
.st-me .p-av { width: 30px !important; height: 30px !important; font-size: 11px; }
.st-me-main strong { font-size: 13.5px; }
.st-me-main span { font-size: 11px; }
.st-me[aria-current="page"] .st-me-main span { color: var(--ink-3); opacity: 1; }
.st-logout { justify-content: flex-start; padding: 7px 8px; border: 0 !important; background: none !important; font: 12.5px var(--f-mono); color: var(--ink-3); gap: 8px; }
.st-logout:hover { color: var(--danger); }
.st-content .page-head h1 { font-size: 22px; }
.st-back .mono { font-size: 13px; }
@media (max-width: 760px) {
  .st-side { padding: 10px 12px 16px; }
  .st-side-head { position: sticky; top: -10px; padding: 8px 4px; margin: -10px -4px 0; background: color-mix(in srgb, var(--surface) 75%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); z-index: 2; }
  .st-item, .st-me { padding: 9px 8px; font-size: 14px; }
  .st-search-wrap kbd { display: none; }
  .st-bar { padding: 8px 10px 0; }
  .st-content .page-head h1 { font-size: 20px; }
}
.st-me-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Barre di scorrimento sottili e discrete (Safari mostra quelle di sistema sempre visibili) */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 16%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.rail, .pl-rail, .nav { overflow-x: hidden; }
.st-content { scrollbar-gutter: stable; }
.st-side { overflow-x: hidden; }

/* Attività di una persona: filtri */
.act-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.act-search { flex: 1 1 220px; max-width: 360px; }
.act-tools .check { margin: 0; }
.act-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.act-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink-2); font: 500 12.5px var(--f-body); cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.act-chip:hover { border-color: var(--line-2); color: var(--ink); }
.act-chip b { font: 600 11px var(--f-mono); color: var(--ink-3); }
.act-chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--ink); }
.act-chip.on b { color: var(--accent); }
.act-type { font: 11.5px var(--f-mono); color: var(--ink-3); white-space: nowrap; }
.kpi-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* la barra di scorrimento resta dentro i bordi arrotondati e sotto la X */
.st-content { margin: 56px 6px 10px 0; padding: 0 24px 30px 30px; }
.st-side { margin: 0; }
@media (max-width: 760px) { .st-content { margin: 0 4px 6px 0; padding: 4px 12px 30px 16px; } }
@media (max-width: 760px) { .st-sheet { grid-template-columns: 1fr; } .panel.profile .inline-ctl { max-width: none; width: 100%; } }

/* Numeri chiave: etichetta, numero, dettaglio, minigrafico */
.home-kpi { padding: 14px 16px 12px; gap: 3px; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.kpi-label i { width: 7px; height: 7px; border-radius: 2px; background: var(--k); flex: none; }
.home-kpi strong { font: 700 26px/1.1 var(--f-display); margin-top: 2px; }
.home-kpi .kpi-sub { font: normal 11.5px var(--f-mono); color: var(--ink-3); min-height: 1.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub .up { color: var(--ok); }
.kpi-sub .down { color: var(--danger); }
.home-kpi.hot strong { color: var(--k); }
.kpi-vis { margin-top: 6px; min-height: 30px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.kpi-spark { width: 100%; height: 30px; display: block; }
.kpi-split { display: flex; height: 6px; border-radius: 4px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.kpi-split i { display: block; height: 100%; border-radius: 3px; }
.kpi-mini { font: 10.5px var(--f-mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-servers { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.kpi-servers > span { display: inline-flex; align-items: center; gap: 5px; font: 11px var(--f-mono); color: var(--ink-2); }
.kpi-servers img, .kpi-servers b { width: 16px; height: 16px; border-radius: 5px; object-fit: cover; display: inline-grid; place-items: center; font: 700 9px var(--f-body); background: var(--surface-2); }
.kpi-faces { display: flex; }
.kpi-faces > span + span { margin-left: -6px; }
.kpi-faces .p-av { border: 2px solid var(--surface); font-size: 8px; }

/* Impostazioni: lingua in fondo all'elenco */
.st-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
.st-langs { display: flex; gap: 4px; padding: 0 4px; }
.st-langs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--ink-3); font: 11.5px var(--f-mono); cursor: pointer; }
.st-langs button:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); color: var(--ink); }
.st-langs button.on { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.st-logout { margin-top: 0; }

/* Link "Vedi tutti / Registro completo" nei titoli dei riquadri: discreti, senza sottolineatura */
.panel-head > a.small, .panel-head .btn-row > a.small, .panel-head > a.linklike, .panel-head > .linklike {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-3); text-decoration: none; padding: 3px 8px; border-radius: 7px;
}
.panel-head > a.small::after, .panel-head .btn-row > a.small::after, .panel-head > a.linklike::after { content: "→"; }
.panel-head > a.small:hover, .panel-head .btn-row > a.small:hover, .panel-head > a.linklike:hover, .panel-head > .linklike:hover { color: var(--accent); background: var(--accent-soft); }
.linklike { text-decoration: none; } .linklike:hover { text-decoration: underline; }
.pl-hint { color: inherit; text-decoration: none; align-self: start; border-style: dashed; }
.pl-hint:hover { text-decoration: none; border-color: var(--accent); }
.pl-hint h2 { font-size: 16px; margin-bottom: 6px; }
.ann-tpl { padding: 14px; margin-bottom: 18px; border: 1px dashed var(--line-2); border-radius: var(--r-ctl); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.ann-tpl .row { margin-bottom: 0; }
.ann-tpl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.ann-tpl-foot .hint { margin: 0; }
.dc-link { color: #00a8fc; text-decoration: none; }
.dc-link:hover { text-decoration: underline; }

/* =====================================================================
   Selettore di data e ora (dtpicker.js)
   ===================================================================== */
.dtp-native { display: none !important; }
.dtp { position: relative; }
.dtp-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; font: inherit; }
.dtp-btn svg { color: var(--sp, var(--accent)); flex: none; }
.dtp-text { font-weight: 600; color: var(--ink); }
.dtp-hint { margin-left: auto; font: 12px var(--f-mono); color: var(--ink-3); }
.dtp-btn.is-empty .dtp-text { font-weight: 400; color: var(--ink-3); }
.dtp.open .dtp-btn { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dtp-pop {
  position: absolute; z-index: 70; top: calc(100% + 8px); left: 0; width: min(340px, calc(100vw - 32px));
  padding: 14px; border-radius: 16px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--ink) 4%, transparent) inset;
  animation: dtpIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dtp-pop.up { top: auto; bottom: calc(100% + 8px); }
@keyframes dtpIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.dtp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.dtp-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; text-align: left; transition: border-color 0.15s, transform 0.15s, background 0.15s; }
.dtp-chip strong { font-size: 12.5px; }
.dtp-chip span { font: 11px var(--f-mono); color: var(--ink-3); }
.dtp-chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-1px); }
.dtp-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.dtp-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 8px; }
.dtp-head strong { font-family: var(--f-display); font-size: 15px; text-transform: capitalize; }
.dtp-nav { display: flex; gap: 4px; }
.dtp-arrow { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--ink-2); font-size: 17px; line-height: 1; cursor: pointer; }
.dtp-arrow:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); }
.dtp-arrow:disabled { opacity: 0.3; cursor: default; }
.dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dtp-wd { text-align: center; font: 600 10.5px var(--f-mono); color: var(--ink-3); padding: 2px 0 4px; text-transform: uppercase; }
.dtp-day { height: 34px; border-radius: 9px; border: 0; background: none; color: var(--ink); font: 500 13px var(--f-body); cursor: pointer; font-variant-numeric: tabular-nums; transition: background 0.12s, color 0.12s, transform 0.12s; }
.dtp-day:hover:not(:disabled) { background: var(--surface-2); }
.dtp-day.today { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); font-weight: 700; }
.dtp-day.on { background: linear-gradient(135deg, var(--accent), #a17bff); color: #fff; font-weight: 700; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 80%, transparent); transform: scale(1.04); }
.dtp-day:disabled { opacity: 0.25; cursor: default; }
.dtp-time { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-3); flex-wrap: wrap; }
.dtp-clock { display: flex; align-items: center; gap: 2px; font: 700 18px var(--f-mono); color: var(--ink); }
.dtp-num { width: 40px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: 700 16px var(--f-mono); text-align: center; outline: none; }
.dtp-num:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dtp-quick { display: flex; gap: 4px; margin-left: auto; }
.dtp-t { border: 1px solid var(--line); background: none; color: var(--ink-3); font: 11.5px var(--f-mono); padding: 4px 7px; border-radius: 7px; cursor: pointer; }
.dtp-t:hover { color: var(--ink); border-color: var(--line-2); }
.dtp-t.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.dtp-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.dtp-sum { font-size: 12.5px; color: var(--ink-2); flex: 1; min-width: 0; }
.dtp-actions { display: flex; gap: 6px; }

/* =====================================================================
   Annunci
   ===================================================================== */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font: 600 13px var(--f-body); cursor: pointer; transition: all 0.15s; }
.pill:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.pill.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--sp, var(--accent)), var(--sp2, #a17bff)); box-shadow: 0 8px 18px -10px var(--sp, var(--accent)); }
.pills.sm .pill { padding: 4px 10px; font-size: 12px; }

.ann-form { padding: 6px 22px 0; }
.ann-step { position: relative; padding: 18px 0 18px 46px; border-bottom: 1px solid var(--line); }
.ann-step::before { content: ""; position: absolute; left: 15px; top: 52px; bottom: -1px; width: 2px; background: linear-gradient(var(--c), transparent); opacity: 0.35; border-radius: 2px; }
.ann-step-head { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px -46px; }
.ann-num { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font: 800 14px var(--f-display); color: #fff; background: var(--c); box-shadow: 0 8px 18px -8px var(--c); }
.ann-step h3 { font-size: 16px; margin-top: 6px; }
.ann-step-head p { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.ann-step-body > * + * { margin-top: 12px; }
.ann-step-body .row { margin-bottom: 0; }
.ann-chan { display: flex; align-items: center; gap: 0; position: relative; }
.ann-chan svg { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.ann-chan select { padding-left: 34px; }
.ann-title { font: 700 16px var(--f-display); }
.ann-editor { border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--bg); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.ann-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ann-editor .ann-msg { border: 0; border-radius: 0; background: none; box-shadow: none !important; min-height: 190px; resize: vertical; }
.ann-tools { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.ann-tool { min-width: 30px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font: 700 13px var(--f-body); cursor: pointer; transition: background 0.12s, color 0.12s; }
.ann-tool:hover { background: var(--surface-2); color: var(--ink); }
.ann-tool.i { font-style: italic; font-family: Georgia, serif; }
.ann-tool.u { text-decoration: underline; }
.ann-tool.s { text-decoration: line-through; }
.ann-tool.code { font: 600 11.5px var(--f-mono); }
.ann-tools-gap { flex: 1; }
.ann-meter { width: 60px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-right: 8px; }
.ann-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--accent)); transition: width 0.2s; }
.ann-meter.warn i { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.ann-tools .hint { margin: 0; }
.ann-color { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ann-swatches { display: flex; gap: 8px; align-items: center; }
.ann-sw { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); background: var(--sw); cursor: pointer; box-shadow: 0 0 0 1px var(--line); transition: transform 0.15s, box-shadow 0.15s; display: grid; place-items: center; }
.ann-sw:hover { transform: scale(1.12); }
.ann-sw.on { box-shadow: 0 0 0 2px var(--sw), 0 6px 14px -4px var(--sw); transform: scale(1.1); }
.ann-sw.custom { background: conic-gradient(#ff5c72, #f0b640, #3ddc84, #00a8fc, #7b96ff, #eb459e, #ff5c72); color: #fff; }
.ann-sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ann-sw.custom svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); pointer-events: none; }
.ann-hex { width: 110px; }
.ann-url { position: relative; display: flex; align-items: center; }
.ann-url svg { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.ann-url .input { padding-left: 34px; }
.ann-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 0 -22px; padding: 14px 22px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.ann-sum { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: baseline; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-sum-k { color: var(--ink-3); font-weight: 400; }
.ann-send svg { margin-right: 2px; transition: transform 0.25s; }
.ann-send:hover:not(:disabled) svg { transform: translate(2px, -2px) rotate(-8deg); }
.ann-send.busy svg { animation: annFly 0.7s ease-in infinite; }
@keyframes annFly { 50% { transform: translate(6px, -6px); opacity: 0; } }

.ann-tpl { position: relative; overflow: hidden; padding: 16px 18px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, #ff7ab6 10%, transparent), transparent 60%), var(--surface); }
.ann-tpl-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ann-tpl-head strong { font-family: var(--f-display); font-size: 15.5px; }
.ann-tpl-head p { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.ann-spark { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #ff7ab6); animation: annGlow 3s ease-in-out infinite; }
@keyframes annGlow { 50% { box-shadow: 0 0 22px -2px color-mix(in srgb, var(--accent) 70%, transparent); } }
.ann-plugins { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.ann-pl { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 80%, transparent); color: var(--ink); cursor: pointer; text-align: left; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.ann-pl:hover { transform: translateY(-2px); border-color: var(--line-2); }
.ann-pl.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 22px -12px var(--accent); }
.ann-pl.busy { opacity: 0.6; }
.ann-pl .pl-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 10px; }
.ann-pl span { display: flex; flex-direction: column; line-height: 1.2; }
.ann-pl strong { font-size: 13.5px; }
.ann-pl small { font: 11px var(--f-mono); color: var(--ink-3); }
.ann-versions { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; animation: dtpIn 0.2s; }
.ann-vlist { display: flex; gap: 6px; flex-wrap: wrap; }
.ann-v { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 11px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; transition: all 0.15s; }
.ann-v strong { font: 700 13px var(--f-mono); }
.ann-v span { font-size: 11px; color: var(--ink-3); }
.ann-v:hover { border-color: var(--line-2); }
.ann-v.on { border-color: var(--accent); background: var(--accent-soft); }
.ann-v.on strong { color: var(--accent); }

.ann-preview { padding: 0; overflow: hidden; transition: transform 0.4s, box-shadow 0.4s; }
.ann-preview.sent { animation: annSent 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes annSent { 20% { transform: translateY(-6px) scale(1.01); box-shadow: 0 0 0 2px var(--ok), 0 30px 60px -20px color-mix(in srgb, var(--ok) 60%, transparent); } }
.dc-chan { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(0, 0, 0, 0.25); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03); font-weight: 600; color: #f2f3f5; }
.dc-chan-hash { color: #80848e; font-size: 22px; font-weight: 400; line-height: 1; }
.dc-chan-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-live { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: #23a55a; }
.dc-live i { width: 7px; height: 7px; border-radius: 50%; background: #23a55a; animation: pulseOk 1.8s infinite; }
@keyframes pulseOk { 0%, 100% { box-shadow: 0 0 0 0 rgba(35, 165, 90, 0.6); } 50% { box-shadow: 0 0 0 5px rgba(35, 165, 90, 0); } }
.dc-msg { padding: 16px 16px 6px; }
.dc-mention-row { margin-top: 2px; }
.dc-typing { display: flex; align-items: center; gap: 3px; height: 26px; padding: 0 16px 8px; font-size: 12px; color: #b5bac1; opacity: 0; transition: opacity 0.2s; }
.dc-typing.on { opacity: 1; }
.dc-typing i { width: 5px; height: 5px; border-radius: 50%; background: #dbdee1; animation: dcDot 1s infinite; }
.dc-typing i:nth-child(2) { animation-delay: 0.15s; }
.dc-typing i:nth-child(3) { animation-delay: 0.3s; margin-right: 6px; }
@keyframes dcDot { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.dc-i { font-style: italic; }
.dc-u { text-decoration: underline; }
.dc-s { text-decoration: line-through; }
.dc-embed { transition: border-color 0.3s; }

.ann-queue { display: flex; flex-direction: column; gap: 8px; }
.ann-q { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 3px solid var(--c); background: var(--surface-2); }
.ann-q-when { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.ann-q-when strong { font: 700 16px var(--f-mono); }
.ann-q-when span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; }
.ann-q-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ann-q-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .ann-step { padding-left: 0; }
  .ann-step::before { display: none; }
  .ann-step-head { margin-left: 0; }
  .dtp-quick { margin-left: 0; }
}

/* =====================================================================
   Più vita in tutto il panel: colore dello spazio, luce, movimento
   ===================================================================== */
:root { --sp: var(--accent); --sp2: #b48cff; }
:root[data-space="plugins"] { --sp: #ff8a3d; --sp2: #ff5c8a; }
:root[data-space="site"] { --sp: #2fd17a; --sp2: #5ad1e6; }
:root[data-space="discord"] { --sp: #7b8cff; --sp2: #4fd1e8; }
:root[data-space="media"] { --sp: #ff5fa2; --sp2: #ffb03b; }
:root[data-space="home"] { --sp: #9b7bff; --sp2: #ff7ab6; }

/* aurora lenta dietro al contenuto (spenta con "effetti ridotti") */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(90px); opacity: 0.22;
  width: 46vw; height: 46vw; transition: background 1.2s;
}
body::before { top: -18vw; right: -10vw; background: var(--sp); animation: aurora1 26s ease-in-out infinite alternate; }
body::after { bottom: -22vw; left: 10vw; background: var(--sp2); opacity: 0.14; animation: aurora2 32s ease-in-out infinite alternate; }
@keyframes aurora1 { to { transform: translate(-12vw, 10vh) scale(1.15); } }
@keyframes aurora2 { to { transform: translate(14vw, -8vh) scale(0.9); } }
:root[data-theme="light"] body::before, :root[data-theme="light"] body::after { opacity: 0.12; }
html.no-fx body::before, html.no-fx body::after { display: none; }

/* titolo della pagina: sfumatura con il colore dello spazio */
.page-head h1 { background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 38%, var(--sp) 72%, var(--sp2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 130% 100%; animation: titleShine 9s ease-in-out infinite alternate; }
@keyframes titleShine { to { background-position: 100% 0; } }

/* pannelli: filo di luce in alto, ombra morbida, bordo colorato al passaggio */
.panel { box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 5%, transparent) inset, 0 18px 40px -32px rgba(0, 0, 0, 0.6); }
.panel::after { content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--sp) 60%, transparent), transparent); opacity: 0; transition: opacity 0.3s; }
.panel:hover::after { opacity: 1; }
.panel:hover { border-color: color-mix(in srgb, var(--sp) 28%, var(--line)); }
.panel-head h2 { display: flex; align-items: center; gap: 10px; }
.panel-head h2::before { content: ""; width: 4px; height: 0.95em; border-radius: 4px; background: linear-gradient(var(--sp), var(--sp2)); flex: none; }

/* KPI: numero con un filo del colore dello spazio */
.kpi { position: relative; transition: background 0.2s; }
.kpi::before { content: ""; position: absolute; left: 16px; top: 0; width: 22px; height: 2px; border-radius: 0 0 2px 2px; background: linear-gradient(90deg, var(--sp), var(--sp2)); opacity: 0.8; transition: width 0.3s; }
.kpi:hover { background: color-mix(in srgb, var(--sp) 5%, var(--surface)); }
.kpi:hover::before { width: 48px; }

/* schede e selettori: pillola attiva colorata */
.tabs button[aria-selected="true"], .tabs .on, .tabs [aria-current="page"] { background: linear-gradient(135deg, color-mix(in srgb, var(--sp) 28%, var(--surface-2)), color-mix(in srgb, var(--sp2) 18%, var(--surface-2))) !important; color: var(--ink) !important; box-shadow: 0 6px 16px -10px var(--sp), inset 0 0 0 1px color-mix(in srgb, var(--sp) 35%, transparent); }
.seg button.on { background: linear-gradient(135deg, color-mix(in srgb, var(--sp) 26%, var(--surface-2)), var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sp) 30%, transparent); }

/* menu laterale: voce attiva con il colore dello spazio */
.nav a[aria-current="page"] { background: linear-gradient(90deg, color-mix(in srgb, var(--sp) 18%, transparent), transparent); border-color: color-mix(in srgb, var(--sp) 30%, var(--line)); }
.nav a[aria-current="page"] svg { color: var(--sp); }
.nav a:hover svg { transform: scale(1.08); }
.nav a svg { transition: transform 0.15s; }

/* campi: alone al focus */
.input:hover:not(:disabled):not(:focus) { border-color: var(--line-2); }
.input:focus, .input:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--sp) 16%, transparent); border-color: color-mix(in srgb, var(--sp) 70%, var(--line)); }

/* pulsanti: piccolo rimbalzo al clic */
.btn:active:not(:disabled), .pill:active, .icon-btn:active { transform: scale(0.97); }

/* stati vuoti: un'icona che respira */
.empty strong { display: block; }
.empty::before { content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 14px; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--sp2) 55%, transparent), color-mix(in srgb, var(--sp) 30%, transparent)); opacity: 0.55; animation: breathe 3.4s ease-in-out infinite; }
.empty.small::before { width: 30px; height: 30px; border-radius: 10px; margin-bottom: 8px; }
@keyframes breathe { 50% { transform: scale(1.08) rotate(6deg); opacity: 0.85; } }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .page-head h1, .empty::before, .ann-spark, .dc-live i { animation: none !important; }
}

/* Menu a tendina, calendario ed emoji aperti: il riquadro che li contiene passa sopra a quelli dopo
   (ogni pannello ha un suo livello, senza questo il pannello successivo copriva la tendina) */
:is(.panel, .stat, .server, .kpi, .page > *, .stack > *, .grid-2 > *):has(.combo.open, .dtp.open, .emoji-pop) { position: relative; z-index: 40; }

/* ---------- Editor della wiki ---------- */
.wk-ed { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.wk-tree { position: sticky; top: 16px; padding: 10px; max-height: calc(100vh - 120px); overflow: auto; }
.wk-tree-head { padding: 2px 2px 10px; }
.wk-tree-head .input { width: 100%; }
.wk-tree-group + .wk-tree-group { margin-top: 12px; }
.wk-tree-gname { font: 600 11px var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding: 4px 6px; }
.wk-tree-proj > summary { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 8px; cursor: pointer; list-style: none; font-weight: 600; }
.wk-tree-proj > summary::-webkit-details-marker { display: none; }
.wk-tree-proj > summary:hover { background: var(--surface-2); }
.wk-tree-proj.off .wk-tree-pname { color: var(--ink-3); }
.wk-tree-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-tree-count { font-size: 11px; color: var(--ink-3); }
.wk-tree-proj > summary .icon-btn { opacity: 0; transition: opacity 0.15s; }
.wk-tree-proj > summary:hover .icon-btn, .wk-tree-proj > summary .icon-btn:focus-visible { opacity: 1; }
.icon-btn.sm { width: 24px; height: 24px; padding: 0; }
.wk-tree-pages { display: grid; gap: 1px; padding: 2px 0 6px 10px; border-left: 1px solid var(--line); margin-left: 10px; }
.wk-tree-page { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-size: 13.5px; }
.wk-tree-page:hover { background: var(--surface-2); color: var(--ink); }
.wk-tree-page.on { background: var(--accent-soft); color: var(--ink); }
.wk-tree-page.auto { color: var(--ink-3); }
.wk-tree-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--warn); }
.wk-dot.pub { background: var(--ok); }
.wk-langs { display: inline-flex; gap: 2px; }
.wk-langs b { font: 600 9.5px var(--f-mono); padding: 1px 3px; border-radius: 4px; color: var(--ink-3); opacity: 0.4; }
.wk-langs b.on { opacity: 1; background: var(--surface-2); color: var(--ink-2); }

.wk-overview { display: grid; gap: 16px; }
.wk-recent { display: grid; }
.wk-recent a { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.wk-recent a:first-child { border-top: 0; }
.wk-recent a:hover b { color: var(--accent); }
.wk-help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 18px; }
.wk-help-grid div { display: grid; gap: 3px; }
.wk-help-grid code { font: 12.5px var(--f-mono); color: var(--accent); }
.wk-help-grid span { font-size: 13px; color: var(--ink-3); }

.wk-editor { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: calc(100vh - 170px); }
.wk-ed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.wk-crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-3); }
.wk-crumbs a { color: var(--ink-3); }
.wk-ed-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.wk-langtabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; }
.wk-lt { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--ink-2); font: 600 12px var(--f-mono); padding: 5px 9px; border-radius: 7px; cursor: pointer; }
.wk-lt:hover { background: var(--surface-2); }
.wk-lt.on { background: var(--accent); color: var(--accent-ink); }
.wk-lt.missing { color: var(--ink-3); border: 1px dashed var(--line-2); }
.wk-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px) 90px; gap: 10px; padding: 12px 14px 0; align-items: end; }
.wk-title { font: 700 20px var(--f-display); padding: 8px 10px; }
.wk-slug { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); overflow: hidden; }
.wk-slug span { padding: 0 2px 0 10px; font-size: 12.5px; white-space: nowrap; }
.wk-slug .input { border: 0; background: none; padding-left: 0; min-width: 0; }
.wk-ord { display: grid; gap: 2px; }
.wk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.wk-tools { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.wk-tool { min-width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0 7px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font: 600 13px var(--f-body); cursor: pointer; }
.wk-tool:hover { background: var(--surface-2); color: var(--ink); }
.wk-tool.b { font-weight: 800; }
.wk-tool.i { font-style: italic; font-family: Georgia, serif; }
.wk-tool.mono { font-family: var(--f-mono); font-size: 12px; }
.wk-tool:disabled { opacity: 0.35; cursor: default; }
.wk-sep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; }
.wk-tpl { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink-2); font: 13px var(--f-body); padding: 0 8px; }
.wk-split { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 520px; }
.wk-split.mode-write { grid-template-columns: 1fr; }
.wk-split.mode-write .wk-pane-prev, .wk-split.mode-preview .wk-pane-md { display: none; }
.wk-split.mode-preview { grid-template-columns: 1fr; }
.wk-pane { min-width: 0; position: relative; }
.wk-pane-md { border-right: 1px solid var(--line); }
.wk-md { width: 100%; height: 100%; min-height: 520px; max-height: calc(100vh - 160px); resize: none; border: 0; outline: 0; padding: 18px 20px; background: var(--bg); color: var(--ink); font: 14px/1.7 var(--f-mono); tab-size: 2; }
.wk-pane-prev { overflow: auto; max-height: calc(100vh - 160px); background: var(--surface); }
.wk-prev-wrap { max-width: 760px; margin: 0 auto; padding: 22px 28px 40px; }
.wk-prev-title { font: 700 28px/1.2 var(--f-display); margin: 0 0 16px; }
.wk-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.wk-stat.dirty { color: var(--warn); }
.btn.pulse { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: wk-pulse 1.8s infinite; }
@keyframes wk-pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .btn.pulse { animation: none; } }

.prose { font-size: 15px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.prose > * + * { margin-top: 0.9em; }
.prose h2 { font: 700 21px/1.3 var(--f-display); color: var(--ink); margin-top: 1.6em; }
.prose h3 { font: 700 17px/1.3 var(--f-display); color: var(--ink); margin-top: 1.4em; }
.prose h4 { font: 700 15px var(--f-body); color: var(--ink); }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent); }
.prose code { font: 0.88em var(--f-mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; color: var(--ink); }
.prose pre { background: var(--term-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow: auto; }
.prose pre code { background: none; padding: 0; font-size: 13px; line-height: 1.6; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.3em; }
.prose img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.prose .table { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 8px 12px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.prose thead th { border-top: 0; background: var(--surface-2); color: var(--ink); font-weight: 600; }
.prose mark.todo { background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.prose .callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 10px 10px 0; color: var(--ink); }
.prose .callout.warning { border-color: var(--warn); background: var(--warn-soft); }
.prose .callout.todo { border-color: var(--warn); background: var(--warn-soft); }
.prose .callout.quote { border-color: var(--line-2); background: none; color: var(--ink-2); }

.wk-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wk-tpl-card { display: grid; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; font: 13.5px var(--f-body); }
.wk-tpl-card:hover { border-color: var(--line-2); }
.wk-tpl-card.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wk-rev-dlg { display: grid; gap: 10px; }
.wk-rev-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; min-height: 340px; max-height: 60vh; }
.wk-rev-list { display: grid; align-content: start; gap: 4px; overflow: auto; }
.wk-rev { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font: 13px var(--f-body); }
.wk-rev.on { border-color: var(--accent); }
.wk-rev-prev { overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; background: var(--surface); }

@media (max-width: 1080px) {
  .wk-ed { grid-template-columns: 1fr; }
  .wk-ed.editing .wk-tree { display: none; }
  .wk-tree { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .wk-fields { grid-template-columns: 1fr 90px; }
  .wk-fields .wk-title { grid-column: 1 / -1; }
  .wk-split, .wk-split.mode-split { grid-template-columns: 1fr; }
  .wk-split.mode-split .wk-pane-prev { display: none; }
  .wk-ed-actions { margin-left: 0; }
  .wk-rev-body { grid-template-columns: 1fr; max-height: none; }
  .wk-recent a { grid-template-columns: auto 1fr; }
  .wk-recent a span:last-child { grid-column: 2; }
}

/* Download dal sito (scheda Versioni del plugin) */
.pl-dist { display: grid; gap: 12px; }
.pl-dist-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pl-dist-head h2 { margin-bottom: 2px; }
.pl-dist-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.pl-dist-foot code { font-size: 12.5px; padding: 4px 8px; border-radius: 7px; background: var(--surface-2); overflow-wrap: anywhere; }

/* Licenze */
.lic-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.lic-filters .input[type="search"] { flex: 1 1 240px; }
.lic-filters select.input { width: auto; flex: 0 1 220px; }
.lic-who { min-width: 0; }
.lic-key { font-size: 13px; letter-spacing: 0.03em; text-decoration: none; color: var(--ink); }
.lic-picker { display: grid; gap: 8px; }
.lic-results { display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.lic-res { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
.lic-res:hover { border-color: var(--line-2); }
.lic-res.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.lic-keys code { font-size: 14px; line-height: 1.8; user-select: all; }

/* Pubblico del plugin */
.aud-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.aud-rel { display: grid; gap: 4px; }
.aud-rel > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.aud-rel > div:first-child { border-top: 0; }
.aud-reach { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.aud-ch { display: flex; flex-wrap: wrap; gap: 4px; }
.aud-note { margin-top: 12px; }
@media (max-width: 900px) { .aud-grid { grid-template-columns: 1fr; } }

/* Richieste dal sito (Ticket → Dal sito) */
.sup-subj.new .who-name::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--flare, #ff7a59); vertical-align: 1px; }
.sup-head { display: grid; gap: 6px; margin-bottom: 14px; }
.sup-head h2 { font: 700 22px/1.25 var(--f-display); }
.sup-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sup-thread { display: grid; gap: 10px; }
.sup-msg { max-width: 82%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.sup-msg.customer { justify-self: start; border-bottom-left-radius: 4px; }
.sup-msg.staff { justify-self: end; border-bottom-right-radius: 4px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.sup-msg.note { justify-self: end; border-style: dashed; background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.sup-msg header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.sup-msg header time { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.sup-msg p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.sup-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sup-imgs img { max-width: 220px; max-height: 160px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }
.sup-composer { display: grid; gap: 10px; }
.sup-composer.note textarea { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: var(--warn-soft); }
.sup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sup-actions select.input { width: auto; }
.sup-side { display: grid; gap: 12px; position: sticky; top: 16px; }
.sup-side h3 { font: 700 14px var(--f-display); margin-bottom: 10px; color: var(--ink-2); }
.sup-side .panel { display: grid; gap: 8px; }
.sup-lic { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sup-others { display: grid; gap: 6px; }
.sup-others a { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 1000px) { .sup-grid { grid-template-columns: 1fr; } .sup-side { position: static; } .sup-msg { max-width: 100%; } }

/* Spazio Sito */
.site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.site-list { display: grid; gap: 2px; }
.site-list > a, .site-list > div { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 6px; border-radius: 9px; color: var(--ink-2); text-decoration: none; min-width: 0; }
.site-list > a:hover { background: var(--surface-2); }
.site-list > a > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-list > a.new > span:first-child { color: var(--ink); font-weight: 700; }
.res-langs { display: flex; align-items: center; gap: 3px; }
.res-langs b { font: 600 10.5px var(--f-mono); padding: 2px 5px; border-radius: 5px; color: var(--ink-3); background: var(--surface-2); opacity: 0.5; }
.res-langs b.on { opacity: 1; color: var(--accent); background: var(--accent-soft); }
.res-langs .small { margin-left: 6px; }
.btn.ok-btn { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: var(--ok-soft); }
.icon-btn.on { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); }
.input.sm { padding: 6px 8px; font-size: 13px; width: auto; }
.res-cats { display: grid; gap: 8px; margin-top: 10px; }
.res-cat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.res-cat > div:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.res-cat.off { opacity: 0.6; }
.res-icons { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 900px) { .site-grid { grid-template-columns: 1fr; } }

/* Sito → Resources: editor della landing page */
.res-head { display: grid; gap: 6px; margin-bottom: 16px; }
.res-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.res-ed { display: grid; grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.res-form { display: grid; gap: 10px; min-width: 0; }
.res-sec { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.res-sec > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 12px 14px; cursor: pointer; list-style: none; }
.res-sec > summary::-webkit-details-marker { display: none; }
.res-sec > summary::before { content: "▸"; color: var(--ink-3); transition: transform 0.15s; }
.res-sec[open] > summary::before { transform: rotate(90deg); }
.res-sec-body { display: grid; gap: 10px; padding: 0 14px 14px; }
.res-img { display: grid; gap: 8px; justify-items: start; padding: 10px; border: 1px dashed var(--line-2); border-radius: 12px; min-height: 96px; }
.res-img img { max-width: 96px; max-height: 96px; border-radius: 14px; }
.res-img.wide img { max-width: 100%; max-height: 120px; border-radius: 10px; }
.res-rows { display: grid; gap: 8px; }
.res-row { display: flex; gap: 8px; align-items: center; }
.res-row > :first-child { flex: 1; min-width: 0; }
.res-row .row { margin: 0; }
.res-row-act { display: flex; gap: 4px; }
.res-gal-row { display: flex; gap: 8px; align-items: center; }
.res-gal-row img { width: 72px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.res-md { font: 13.5px/1.6 var(--f-mono); min-height: 260px; resize: vertical; }
.res-md-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.res-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.res-mode { display: grid; gap: 4px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.res-mode .ic { color: var(--sp); }
.res-mode.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.res-vers { display: grid; gap: 4px; }
.res-vers > div { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.res-vers > div > .muted { flex: 1; }
.res-danger { padding: 6px 2px; }
.res-prev-wrap { position: sticky; top: 14px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #0f1117; max-height: calc(100vh - 28px); overflow-y: auto; }
.res-prev-label { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font: 600 11px var(--f-mono); color: var(--ink-3); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.06em; position: sticky; top: 0; background: #0f1117; z-index: 1; }
/* anteprima: stessa grafica della pagina pubblica, in piccolo */
.rsp { padding: 14px; color: #c9cede; font-size: 13px; }
.rsp-crumb { font-size: 11.5px; color: #8a90a2; margin-bottom: 10px; }
.rsp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 12px; }
.rsp-col { min-width: 0; display: grid; gap: 10px; align-content: start; }
.rsp-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.rsp-ic { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.rsp-ic.ini { display: grid; place-items: center; background: linear-gradient(135deg, #7b96ff, #b48cff); color: #fff; font-weight: 800; }
.rsp-titles h1 { font: 700 17px/1.3 var(--f-display); color: #f1f3f9; }
.rsp-titles h1 .hl { font-weight: 500; color: #c9cede; }
.rsp-titles h1 .ver { color: #8a90a2; font-weight: 500; }
.rsp-titles p { color: #8a90a2; font-size: 12px; margin-top: 2px; }
.rsp-act { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.rsp-dl { display: grid; padding: 6px 12px; border-radius: 9px; background: linear-gradient(135deg, #7b96ff, #9b7bff); color: #fff; line-height: 1.2; }
.rsp-dl small { font-size: 10px; opacity: 0.85; }
.rsp-price { font: 700 12px var(--f-mono); color: #f1f3f9; }
.rsp-price.free { color: #2fd17a; }
.rsp-tabs { display: flex; gap: 2px; border-bottom: 1px solid #262b38; font-size: 11.5px; overflow: hidden; }
.rsp-tabs span { padding: 6px 9px; color: #8a90a2; white-space: nowrap; }
.rsp-tabs span.on { color: #f1f3f9; border-bottom: 2px solid #7b96ff; }
.rsp-fields { width: 100%; border-collapse: collapse; font-size: 12px; }
.rsp-fields th { text-align: left; font-weight: 500; color: #8a90a2; padding: 3px 10px 3px 0; width: 42%; vertical-align: top; }
.rsp-fields td { color: #c9cede; padding: 3px 0; overflow-wrap: anywhere; }
.rsp-banner { width: 100%; border-radius: 10px; }
.rsp-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.rsp-b { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 12px; background: #1f2330; color: #f1f3f9; border: 1px solid #323848; }
.rsp-b.github { background: #24292f; }
.rsp-b.discord { background: #5865f2; border-color: #5865f2; }
.rsp-b.issue { background: #f1f3f9; color: #151821; }
.rsp-note { font-size: 11.5px; color: #f0b640; }
.rsp-md { font-size: 12.5px; padding: 0 !important; }
.rsp-md h2 { font-size: 15px !important; }
.rsp-md h3 { font-size: 13.5px !important; }
.rsp-gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rsp-gal img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.rsp-side { display: grid; gap: 8px; align-content: start; }
.rsp-box { border: 1px solid #262b38; border-radius: 10px; overflow: hidden; }
.rsp-box h3 { font: 700 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 8px; background: linear-gradient(135deg, #7b96ff33, #b48cff22); color: #f1f3f9; }
.rsp-box dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 6px; padding: 8px; font-size: 11px; }
.rsp-box dt { color: #8a90a2; }
.rsp-box dd { text-align: right; color: #f1f3f9; overflow-wrap: anywhere; }
.rsp-cta { font-size: 11px; color: #8a90a2; }
.rsp-help { display: block; text-align: center; padding: 6px; border-radius: 8px; background: #1f2330; font-size: 11px; font-weight: 700; color: #f1f3f9; }
@media (max-width: 1150px) { .res-ed { grid-template-columns: 1fr; } .res-prev-wrap { position: static; max-height: none; } }
@media (max-width: 560px) { .rsp-grid { grid-template-columns: 1fr; } .res-modes { grid-template-columns: 1fr; } }

.res-btn-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; }
.res-btn-row > :last-child { grid-column: 1 / -1; }
.rsp-grid { grid-template-columns: minmax(0, 1fr) 180px; }
.rsp-box dl { grid-template-columns: 1fr; gap: 0; }
.rsp-box dt { margin-top: 5px; }
.rsp-box dd { text-align: left; }
/* Recensioni (panel) */
.rv-stars { display: inline-flex; gap: 1px; color: var(--line-2); }
.rv-stars i.on { color: #f5b301; }
.rv-stars .ic { fill: currentColor; }
.rvp-list { display: grid; gap: 10px; }
.rvp { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rvp.off { opacity: 0.6; border-style: dashed; }
.rvp header { display: flex; align-items: center; gap: 10px; }
.rvp-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.rvp-reply { padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-size: 13.5px; }
.rvp-reply p { white-space: pre-wrap; margin-top: 2px; }

/* scorciatoie al sito pubblico in fondo al menu */
.site-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 2px 2px 0; }
.site-links-label { display: inline-flex; align-items: center; gap: 4px; font: 600 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-right: 2px; }
.site-links a { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 3px 7px; border-radius: 7px; border: 1px solid var(--line); text-decoration: none; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.site-links a:hover { color: var(--ink); border-color: color-mix(in srgb, var(--sp) 45%, var(--line)); background: color-mix(in srgb, var(--sp) 10%, transparent); }
/* Wiki: riordino */
.wk-grip { cursor: grab; color: var(--ink-3); font-size: 11px; letter-spacing: -2px; opacity: 0; transition: opacity 0.15s; user-select: none; padding: 0 2px; }
.wk-tree-page:hover .wk-grip, .wk-tree-proj > summary:hover .wk-grip { opacity: 1; }
.wk-move { display: inline-flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.wk-tree-page:hover .wk-move, .wk-tree-proj > summary:hover .wk-move, .wk-move:focus-within { opacity: 1; }
.icon-btn.xs { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; padding: 0; }
.icon-btn.xs:disabled { opacity: 0.3; cursor: default; transform: none; }
.wk-tree-page.dragging, .wk-tree-proj.dragging { opacity: 0.45; outline: 1px dashed var(--accent); border-radius: 8px; }
.wk-tree-page.home { font-weight: 600; }
.wk-tree-hint { margin-top: 8px; padding: 0 2px; }
.wk-tree-projs { display: grid; gap: 2px; }
@media (hover: none) { .wk-move, .wk-grip { opacity: 1; } }
.wk-tree-sort { display: grid; gap: 1px; }

/* Bolla di spiegazione (tips.js) */
.tip-bubble { position: fixed; left: var(--x, 0); top: var(--y, 0); z-index: 9999; max-width: 240px; padding: 6px 10px; border-radius: 9px; font: 600 12.5px/1.35 var(--f-body); color: #f4f6fb; background: linear-gradient(135deg, color-mix(in srgb, var(--sp, #7b96ff) 30%, #151821), #151821 70%); border: 1px solid color-mix(in srgb, var(--sp, #7b96ff) 45%, #2a3040); box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset; pointer-events: none; opacity: 0; transform: translateY(4px) scale(0.97); transition: opacity 0.14s ease, transform 0.14s ease; }
.tip-bubble.below { transform: translateY(-4px) scale(0.97); }
.tip-bubble.on { opacity: 1; transform: none; }
:root[data-theme="light"] .tip-bubble { color: #151821; background: linear-gradient(135deg, color-mix(in srgb, var(--sp, #2f55e6) 14%, #fff), #fff 70%); border-color: color-mix(in srgb, var(--sp, #2f55e6) 35%, #d5d9e2); }
@media (prefers-reduced-motion: reduce) { .tip-bubble { transition: none; } }

/* Accesso staff: menu del sito in alto */
.auth-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.auth-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.auth-nav a { padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); text-decoration: none; transition: background 0.15s, color 0.15s; }
.auth-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.auth-nav a:last-child { border: 1px solid var(--line-2); }
/* Sito → Panoramica: classifiche e attività */
.site-bars { display: grid; gap: 4px; }
.site-bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; overflow: hidden; color: var(--ink-2); text-decoration: none; font-size: 13.5px; }
.site-bar-fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0); background: linear-gradient(90deg, color-mix(in srgb, var(--sp) 22%, transparent), color-mix(in srgb, var(--sp2) 10%, transparent)); border-radius: 9px; transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.site-bar-label { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-bar b { position: relative; color: var(--ink); }
a.site-bar:hover .site-bar-label { color: var(--ink); }
.site-conv { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.site-conv i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); position: relative; overflow: hidden; }
.site-conv i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0); border-radius: 99px; background: linear-gradient(90deg, var(--sp), var(--sp2)); }
.site-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.site-split h3 { font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 6px; }
.site-feed { display: grid; gap: 2px; }
.site-ev { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; color: var(--ink-2); text-decoration: none; }
a.site-ev:hover { background: var(--surface-2); }
.site-ev > div { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
.site-ev > div b { color: var(--ink); }
.site-ev-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; flex: none; color: var(--sp); background: color-mix(in srgb, var(--sp) 14%, transparent); }
.site-ev.review .site-ev-ic { color: #f5b301; background: color-mix(in srgb, #f5b301 14%, transparent); }
.site-ev.ticket .site-ev-ic { color: var(--warn); background: var(--warn-soft); }
.site-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.site-facts > div { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(160deg, color-mix(in srgb, var(--sp) 7%, transparent), transparent 60%); }
.site-facts b { font: 700 1.25rem var(--f-display); }
.site-privacy { margin-top: 4px; }
@media (max-width: 700px) { .site-split, .site-facts { grid-template-columns: 1fr; } }

/* ---------- Barra in alto: spazi al centro, sito pubblico a destra ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px 40px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.topbar:empty { display: none; }
.topbar .space-switch { margin: 0; padding: 4px; gap: 4px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: 0 6px 24px -12px rgba(0, 0, 0, 0.5); }
.topbar .space-switch a { padding: 8px 18px; border-radius: 999px; font-size: 13.5px; gap: 7px; }
.topbar .space-switch a.on { background: color-mix(in srgb, var(--sp, var(--accent)) 18%, var(--surface-2)); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sp, var(--accent)) 40%, transparent), 0 4px 16px -6px color-mix(in srgb, var(--sp, var(--accent)) 55%, transparent); }
.topbar .space-switch a.on svg { color: var(--sp, var(--accent)); }
.top-links { display: flex; justify-content: flex-end; gap: 2px; }
.top-links a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 9px; color: var(--ink-3); font-size: 13px; font-weight: 600; text-decoration: none; transition: color 0.15s, background 0.15s; }
.top-links a svg { opacity: 0.75; }
.top-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--sp, var(--accent)) 10%, transparent); }
.top-links a:hover svg { opacity: 1; color: var(--sp, var(--accent)); }
@media (min-width: 861px) { .rail > .space-switch { display: none; } }
@media (max-width: 1180px) { .top-links a span { display: none; } .top-links a { padding: 8px; } }
@media (max-width: 860px) {
  .topbar { display: none; }
}
/* telefono: gli spazi in una riga sotto la barra, scorrevole */
.mobile-spaces { display: none; }
@media (max-width: 860px) {
  .mobile-head { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mobile-head .mobile-bar { position: static; border-bottom: 0; background: none; backdrop-filter: none; flex-wrap: nowrap; gap: 8px; }
  .mobile-head .mobile-bar > .brand { min-width: 0; flex: 1 1 auto; }
  .mobile-head .mobile-bar > .brand .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-head .mobile-bar > .btn-row { flex-wrap: nowrap; gap: 2px; flex: none; }
  .mobile-head .mobile-bar > .btn { flex: none; padding-left: 6px; padding-right: 6px; }
  .mobile-spaces { display: block; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mobile-spaces[hidden] { display: none; }
  .mobile-spaces::-webkit-scrollbar { display: none; }
  .mobile-spaces .space-switch { display: inline-flex; gap: 4px; margin: 0; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, transparent); min-width: max-content; }
  .mobile-spaces .space-switch a { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; gap: 6px; }
  .mobile-spaces .space-switch a.on { background: color-mix(in srgb, var(--sp, var(--accent)) 18%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sp, var(--accent)) 40%, transparent); }
  .mobile-spaces .space-switch a.on svg { color: var(--sp, var(--accent)); }
  .rail > .space-switch { display: none; }
}
@media (min-width: 861px) { .rail .site-links { display: none; } }
.res-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.res-chip { font: 600 12.5px var(--f-mono); padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.res-chip:hover:not(:disabled) { color: var(--ink); border-color: color-mix(in srgb, var(--sp, var(--accent)) 50%, var(--line-2)); }
.res-chip[aria-pressed="true"] { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--sp, var(--accent)), var(--sp2, var(--accent))); }

/* ---------- Ricerca rapida (stile Spotlight) ---------- */
.top-side:first-child { display: flex; align-items: center; }
.spot-btn { display: inline-flex; align-items: center; gap: 9px; width: min(260px, 100%); padding: 8px 8px 8px 12px; border-radius: 11px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--ink-3); font: 500 13.5px var(--f-body); cursor: pointer; transition: border-color 0.15s, color 0.15s, box-shadow 0.15s; }
.spot-btn:hover { color: var(--ink); border-color: color-mix(in srgb, var(--sp, var(--accent)) 45%, var(--line)); box-shadow: 0 6px 22px -14px var(--sp, var(--accent)); }
.spot-btn span { flex: 1; text-align: left; }
.spot-btn kbd, .spot kbd { font: 600 11px var(--f-mono); color: var(--ink-3); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); }
@media (max-width: 1180px) { .spot-btn { width: auto; } .spot-btn span, .spot-btn kbd { display: none; } }
.spot-wrap { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(6, 8, 14, 0.5); backdrop-filter: blur(6px) saturate(1.2); opacity: 0; transition: opacity 0.14s ease; }
.spot-wrap.in { opacity: 1; }
.spot { width: min(680px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(24px) saturate(1.5); border: 1px solid color-mix(in srgb, var(--ink) 12%, var(--line)); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.03) inset; transform: translateY(-8px) scale(0.985); transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1); }
.spot-wrap.in .spot { transform: none; }
.spot-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.spot-in { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font: 500 19px var(--f-body); }
.spot-in::-webkit-search-cancel-button { display: none; }
.spot-list { overflow: auto; padding: 6px 8px 8px; }
.spot-group { padding: 12px 10px 5px; font: 700 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.spot-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 14px; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; }
.spot-item > .ic:last-child { opacity: 0; transition: opacity 0.1s; }
.spot-item.on { background: color-mix(in srgb, var(--sp, var(--accent)) 16%, var(--surface-2)); color: var(--ink); }
.spot-item.on > .ic:last-child { opacity: 0.8; }
.spot-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 15%, transparent); }
.spot-ic.g-0 { --c: #7b96ff; } .spot-ic.g-1 { --c: #ff9470; } .spot-ic.g-2 { --c: #8b95ff; } .spot-ic.g-3 { --c: #b48cff; } .spot-ic.g-4 { --c: #ff8a3d; } .spot-ic.g-5 { --c: #2dd4bf; } .spot-ic.g-6 { --c: #38bdf8; } .spot-ic.g-7 { --c: #3ddc84; }
.spot-txt { display: flex; flex-direction: column; min-width: 0; }
.spot-txt b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-txt small { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #ff7a59, #ff4f8b); }
.spot-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 10px; color: var(--ink-3); text-align: center; }
.spot-empty b { color: var(--ink-2); }
.spot-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.spot-foot kbd { margin-right: 2px; }
@media (max-width: 600px) { .spot-wrap { padding-top: 8px; } .spot { max-height: 86vh; } .spot-foot, .spot-esc { display: none; } }
.res-sws { display: flex; flex-wrap: wrap; gap: 8px; }
.res-sw { width: 32px; height: 32px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--c1, #8b7bff), var(--c2, #c084fc)); cursor: pointer; box-shadow: 0 0 0 1px var(--line-2); transition: transform 0.12s, box-shadow 0.12s; }
.res-sw:hover:not(:disabled) { transform: scale(1.08); }
.res-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.res-sw.auto { background: conic-gradient(#8b7bff, #4f8cff, #2dd4bf, #34d399, #fbbf24, #ff7a59, #f472b6, #f43f5e, #8b7bff); }
.res-custom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.res-custom[hidden] { display: none; }
.res-color { width: 46px; height: 34px; padding: 2px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }

/* ---------- Conversazione dei ticket Discord ---------- */
.tk-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tk-top h2 { font: 700 18px var(--f-display); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tk-thread { max-height: calc(100vh - 330px); min-height: 280px; overflow-y: auto; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 50%, var(--surface)); scroll-behavior: smooth; }
.tk-msg header .chip { font-size: 10.5px; padding: 1px 7px; }
.tk-av { width: 22px; height: 22px; border-radius: 50%; flex: none; object-fit: cover; }
.tk-av.ini { display: inline-grid; place-items: center; font: 700 11px var(--f-body); color: #fff; background: linear-gradient(135deg, #5865f2, #8b95ff); }
.sup-msg.bot { justify-self: center; max-width: 92%; background: color-mix(in srgb, var(--ink) 4%, var(--surface)); border-style: dashed; }
.tk-embed { margin-top: 6px; padding: 8px 12px; border-left: 3px solid #5865f2; border-radius: 6px; background: color-mix(in srgb, #5865f2 7%, transparent); display: grid; gap: 3px; font-size: 13.5px; }
.tk-embed p { white-space: pre-wrap; }
.tk-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; }
.tk-answer { margin-bottom: 8px; }
.tk-answer p { white-space: pre-wrap; overflow-wrap: anywhere; }
.panel.tk-urgent { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.tk-urgent-note { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--danger); background: var(--danger-soft); }
.sup-side .panel { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sup-side .panel .field { width: 100%; }

/* ---------- Ticket urgenti ---------- */
.urgent-bar { position: relative; z-index: 29; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 40px; color: #fff; background: linear-gradient(90deg, #e11d48, #f43f5e 55%, #fb7185); box-shadow: 0 10px 30px -14px #e11d48; font-size: 14px; }
.urgent-bar[hidden] { display: none; }
.urgent-bar .urgent-pulse { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: urgent-pulse 1.6s infinite; }
@keyframes urgent-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); } 70% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.urgent-links { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.urgent-links a { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 13px; background: rgba(255, 255, 255, 0.18); text-decoration: none; }
.urgent-links a:hover { background: rgba(255, 255, 255, 0.3); }
@media (max-width: 860px) { .urgent-bar { padding: 10px 16px; } }
.ar-scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ar-scope button { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s; }
.ar-scope button span { flex: 1; display: flex; flex-direction: column; }
.ar-scope button small { color: var(--ink-3); font-size: 12.5px; }
.ar-scope button.on { color: var(--ink); border-color: color-mix(in srgb, var(--sp, var(--accent)) 55%, var(--line)); background: color-mix(in srgb, var(--sp, var(--accent)) 10%, var(--surface)); }
.ar-scope button.on svg { color: var(--sp, var(--accent)); }

/* ---------- Messaggi pannello: editor + anteprima stile Discord ---------- */
.pm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .pm-grid { grid-template-columns: minmax(0, 1fr); } }
.pm-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pm-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pm-preset { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 600 12.5px var(--f-body); cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.pm-preset:hover { color: var(--ink); border-color: color-mix(in srgb, var(--sp, var(--accent)) 50%, var(--line-2)); }
.pm-group { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, var(--surface)); }
.pm-group h4 { margin: 0; font: 700 11.5px var(--f-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.pm-types { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-type { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); font: 600 13px var(--f-body); cursor: pointer; transition: all 0.12s; }
.pm-type.on { color: var(--ink); border-color: color-mix(in srgb, var(--sp, var(--accent)) 55%, var(--line-2)); background: color-mix(in srgb, var(--sp, var(--accent)) 12%, var(--surface)); }
.pm-colorrow { display: flex; gap: 8px; align-items: center; }
.pm-color { width: 44px; height: 38px; padding: 2px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; flex: none; }
.pm-more summary { cursor: pointer; font-size: 13px; color: var(--ink-3); }
.pm-more[open] summary { margin-bottom: 8px; }
.pm-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 10px; }
.pm-side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pm-send { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.pm-send-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-send .btn.ghost { align-self: flex-start; }
.dc-window { border-radius: 14px; padding: 16px 16px 18px 12px; background: #313338; color: #dbdee1; font: 15px/1.375 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8); border: 1px solid rgba(255, 255, 255, 0.04); }
.dc-msg { display: flex; gap: 14px; }
.dc-av { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; }
.dc-av.ini { display: grid; place-items: center; font-weight: 700; color: #fff; background: #5865f2; }
.dc-content { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.dc-head { display: flex; align-items: center; gap: 6px; }
.dc-head b { color: #f2f3f5; font-weight: 600; }
.dc-app { font: 700 10px/1 'gg sans', Arial, sans-serif; color: #fff; background: #5865f2; padding: 3px 5px; border-radius: 4px; }
.dc-time { font-size: 12px; color: #949ba4; }
.dc-embed { display: flex; gap: 16px; max-width: 432px; padding: 10px 16px 14px 12px; border-radius: 4px; background: #2b2d31; border-left: 4px solid var(--bar, #202225); }
.dc-embed-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.dc-embed-title { font-weight: 600; color: #f2f3f5; font-size: 16px; }
.dc-embed-desc { font-size: 14px; color: #dbdee1; display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.dc-embed-desc strong { color: #f2f3f5; }
.dc-embed-desc code { font-size: 85%; padding: 1px 4px; border-radius: 4px; background: #1e1f22; }
.dc-h { margin: 6px 0 2px; color: #f2f3f5; font-size: 15px; font-weight: 700; }
.dc-li { display: flex; gap: 8px; padding-left: 4px; }
.dc-quote { border-left: 4px solid #4e5058; padding-left: 10px; }
.dc-gap { height: 8px; }
.dc-embed-img { max-width: 100%; border-radius: 4px; margin-top: 6px; }
.dc-embed-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex: none; }
.dc-embed-foot { font-size: 12px; color: #b5bac1; margin-top: 4px; }
.dc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; max-width: 440px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #fff; background: #5865f2; }
.dc-btn.secondary { background: #4e5058; }
.dc-btn.success { background: #248046; }
.dc-btn.danger { background: #da373c; }
.dc-select { display: flex; align-items: center; justify-content: space-between; max-width: 400px; height: 40px; padding: 0 12px; margin-top: 4px; border-radius: 8px; background: #1e1f22; border: 1px solid #1e1f22; color: #949ba4; font-size: 14px; }
.dc-empty { font-size: 13px; color: #949ba4; font-style: italic; }
.pm-btnbox { display: flex; flex-direction: column; gap: 10px; }
.pm-btns { display: flex; flex-direction: column; gap: 8px; }
.pm-btn-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.pm-order { display: flex; flex-direction: column; gap: 2px; }
.pm-order .icon-btn { width: 24px; height: 18px; font-size: 11px; line-height: 1; padding: 0; }
.pm-btn-row .emoji-in .emoji-text { display: none; }
.pm-btn-row .emoji-in { flex: none; }
.pm-btn-main { display: flex; gap: 8px; align-items: center; min-width: 0; flex-wrap: wrap; }
.pm-btn-main > .input { flex: 1 1 160px; min-width: 0; }
.pm-colors { display: flex; gap: 6px; }
.pm-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: #5865f2; box-shadow: 0 0 0 1px var(--line-2); }
.pm-dot.secondary { background: #4e5058; }
.pm-dot.success { background: #248046; }
.pm-dot.danger { background: #da373c; }
.pm-dot.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.pm-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pm-group .field[hidden] { display: none; }

/* Immagini del messaggio pannello */
.pm-imgs { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
@media (max-width: 700px) { .pm-imgs { grid-template-columns: 1fr; } }
.pm-img { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pm-img-head { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.pm-img-head strong { font-size: 13px; }
.pm-img-tile { display: grid; place-items: center; height: 120px; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--surface-2, var(--surface)); color: var(--muted); cursor: pointer; overflow: hidden; padding: 0; transition: border-color .15s, background .15s; }
.pm-img-tile.thumbnail { height: 120px; }
.pm-img-tile:hover, .pm-img-tile.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); }
.pm-img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-img-tile.thumbnail img { object-fit: contain; }
.pm-img-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.pm-img-head .icon-btn[hidden] { display: none; }

/* ---------- Libreria immagini Discord (media.js) ---------- */
.pm-imgs.one { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.pm-img-acts { display: flex; align-items: center; gap: 4px; }
.pm-img-acts .icon-btn[hidden] { display: none; }
.ml-open { gap: 6px; color: var(--accent); }
.ml { display: flex; flex-direction: column; gap: 12px; min-height: 420px; border-radius: 14px; transition: box-shadow .15s; }
.ml.drag { box-shadow: 0 0 0 2px var(--accent) inset; }
.ml-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ml-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; }
.ml-head h2 svg { color: var(--accent); }
.ml-head p { margin: 0; }
.ml-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ml-bar > .input { flex: 1 1 200px; min-width: 0; }
.ml-status:empty { display: none; }
.ml-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; max-height: min(62vh, 620px); overflow: auto; padding: 2px; }
.ml-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.ml-card:hover, .ml-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--accent) 60%, transparent); outline: none; }
.ml-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.ml-thumb { position: relative; aspect-ratio: 16 / 10; background: repeating-conic-gradient(color-mix(in srgb, var(--line) 60%, transparent) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.ml-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ml-del { position: absolute; top: 6px; right: 6px; background: var(--surface); opacity: 0; transition: opacity .15s; }
.ml-card:hover .ml-del, .ml-del:focus-visible { opacity: 1; }
.ml-badge { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; }
.ml-info { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; min-width: 0; }
.ml-label { border-color: transparent; background: none; padding: 2px 4px; margin-left: -4px; font-weight: 600; font-size: 13px; }
.ml-label:hover, .ml-label:focus { border-color: var(--line); background: var(--surface-2, var(--surface)); }
.ml-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 14px; }
.ml-empty svg { color: var(--accent); }
@media (hover: none) { .ml-del { opacity: 1; } }

/* ---------- Uso: valori extra e ultimi invii (TMDStats) ---------- */
.tm-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tm-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2, var(--surface)); border: 1px solid var(--line); }
.tm-stats strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.tm-pie-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tm-pie-box { position: relative; width: 132px; height: 132px; flex: none; }
.tm-pie { width: 100%; height: 100%; transform: rotate(0deg); }
.tm-pie circle { transition: stroke-dasharray .4s; }
.tm-pie-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.tm-pie-c strong { font-size: 20px; }
.tm-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 160px; }
.tm-legend li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.tm-sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.tm-lk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; margin-right: 2px; }
.tm-dot.on { background: #2fd17a; box-shadow: 0 0 0 3px color-mix(in srgb, #2fd17a 25%, transparent); }
.tm-srvs { display: flex; flex-direction: column; gap: 6px; }
.tm-srv { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 640px) { .tm-stats { grid-template-columns: repeat(2, 1fr); } .tm-srv { grid-template-columns: 1fr auto; } }

/* Siti dove e pubblicato il plugin: nome cliccabile con il colore del sito */
.pl-site { --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-weight: 600; color: var(--ink-2, var(--ink)) !important; background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); transition: background .15s, transform .15s; }
.pl-site:hover { background: color-mix(in srgb, var(--c) 20%, transparent); transform: translateY(-1px); }
.pl-site svg { color: var(--c); opacity: .8; }
.pl-site-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pl-site.s-spigot { --c: #f0a43a; }
.pl-site.s-hangar { --c: #3a7bff; }
.pl-site.s-modrinth { --c: #1bd96a; }
.pl-site.s-polymart { --c: #22c3a6; }
.pl-site.s-builtbybit { --c: #2f7ff0; }
.pl-site.s-github { --c: #8b93a7; }
.pl-links { align-items: center; }
.pl-row-sites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pl-site.sm { padding: 2px 8px 2px 6px; font-size: 11.5px; gap: 5px; cursor: pointer; }
.pl-site.sm .pl-site-dot { width: 6px; height: 6px; }

/* ---------- Immagini (image host dello staff): minimal ---------- */
.mh-sub { display: block; margin-top: 4px; }
.mh-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.mh-search { position: relative; flex: 1 1 220px; min-width: 0; }
.mh-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.mh-search .input { width: 100%; padding-left: 34px; }
.mh-sort { width: auto; min-width: 150px; padding-right: 32px; }
.mh-prog { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; font-size: 12.5px; color: var(--muted); }
.mh-prog[hidden] { display: none; }
.mh-prog-bar { flex: 0 0 160px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mh-prog-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sp, var(--accent)), var(--sp2, #b48cff)); transition: width .2s; }
.mh-prog-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mh-card { margin: 0; cursor: pointer; border-radius: 12px; outline: none; }
.mh-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: repeating-conic-gradient(color-mix(in srgb, var(--line) 55%, transparent) 0 25%, transparent 0 50%) 0 0 / 14px 14px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.mh-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.mh-card:hover .mh-thumb, .mh-card:focus-visible .mh-thumb { border-color: color-mix(in srgb, var(--sp, var(--accent)) 60%, var(--line)); box-shadow: 0 10px 26px -16px color-mix(in srgb, var(--sp, var(--accent)) 80%, transparent); transform: translateY(-2px); }
.mh-badge { position: absolute; top: 7px; left: 7px; padding: 1px 7px; border-radius: 999px; font: 700 10px var(--f-mono); color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
.mh-hover { position: absolute; inset: auto 0 0 0; display: flex; gap: 5px; justify-content: center; padding: 8px; background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent); opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; }
.mh-card:hover .mh-hover, .mh-card:focus-within .mh-hover { opacity: 1; transform: none; }
.mh-q { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 0; font-family: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; color: #111; background: rgba(255, 255, 255, .92); cursor: pointer; }
.mh-q:hover { background: #fff; }
.mh-q:first-child { color: #fff; background: var(--sp, var(--accent)); }
.mh-card figcaption { display: flex; flex-direction: column; padding: 7px 2px 0; min-width: 0; }
.mh-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-meta { font: 11px var(--f-mono); color: var(--muted); }
.mh-more { display: flex; justify-content: center; margin-top: 16px; }
.mh-more:empty { display: none; }
.mh-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 16px; text-align: center; border-radius: 16px; border: 1.5px dashed color-mix(in srgb, var(--sp, var(--accent)) 40%, var(--line)); background: color-mix(in srgb, var(--sp, var(--accent)) 4%, transparent); color: var(--ink); font: inherit; cursor: pointer; }
.mh-empty:hover { border-color: var(--sp, var(--accent)); }
.mh-drop-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--sp, var(--accent)), var(--sp2, #b48cff)); }
.mh-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); pointer-events: none; }
.mh-overlay[hidden] { display: none; }
.mh-overlay > div { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 48px; border-radius: 20px; border: 2px dashed var(--sp, var(--accent)); background: var(--surface); color: var(--sp, var(--accent)); }
.mh-overlay strong { color: var(--ink); font-size: 16px; }
.mh-newf { margin-left: auto; width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2, var(--ink)); font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer; }
.mh-newf:hover { color: var(--sp, var(--accent)); border-color: var(--sp, var(--accent)); }
.mh-rail a.mh-drop-on { outline: 2px dashed var(--sp, var(--accent)); outline-offset: -2px; background: color-mix(in srgb, var(--sp, var(--accent)) 12%, transparent); }
body.mh-dragging .mh-rail a:not([href="#/media"]) { outline: 1px dashed color-mix(in srgb, var(--sp, var(--accent)) 45%, transparent); outline-offset: -2px; }
.mh-detail { display: flex; flex-direction: column; gap: 12px; }
.mh-big { display: grid; place-items: center; max-height: 46vh; border-radius: 12px; overflow: hidden; background: repeating-conic-gradient(color-mix(in srgb, var(--line) 60%, transparent) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.mh-big img { max-width: 100%; max-height: 46vh; object-fit: contain; display: block; }
.mh-fmts { display: flex; flex-direction: column; gap: 8px; }
.mh-fmt { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.mh-fmt-l { font-size: 13px; font-weight: 600; }
@media (hover: none) { .mh-hover { opacity: 1; transform: none; } }
@media (max-width: 640px) { .mh-fmt { grid-template-columns: 1fr auto; } .mh-fmt-l { grid-column: 1 / -1; } .mh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Email (sotto Home): posta di support@, inviate, modelli, newsletter, impostazioni ---------- */
.page:has(.mail-app) { max-width: 1520px; }
@media (max-width: 1180px) { .mail-app { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); } }
.mail-tabs a { display: inline-flex; align-items: center; gap: 7px; }
.mail-tabs .count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.mail-setup { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); color: var(--ink-2); font-size: 13.5px; }
.mail-setup > svg { color: var(--warn); flex: none; margin-top: 2px; }
.mail-setup p + p { margin-top: 6px; }

/* client di posta: elenco a sinistra, conversazione a destra, alto quanto lo schermo */
.mail-app { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); height: max(480px, calc(100vh - 100px)); scroll-margin-top: 90px; border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.mail-col { display: grid; grid-template-rows: auto minmax(0, 1fr); border-right: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 2%, var(--surface)); min-height: 0; }
.mail-tools { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.mail-folders { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.mail-folders button { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 4px; border: 0; border-radius: 9px; background: none; color: var(--ink-3); font: 600 12.5px var(--f-body); cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.mail-folders button:hover { color: var(--ink); }
.mail-folders button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.mail-folders em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.mail-folders em.hot { padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.mail-list { overflow-y: auto; padding: 6px; display: grid; align-content: start; grid-auto-rows: max-content; gap: 2px; }
.mail-item { display: flex; gap: 11px; padding: 11px 12px; border-radius: 12px; color: inherit; text-decoration: none; position: relative; transition: background 0.15s; }
.mail-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.mail-item.on { background: var(--accent-soft); }
.mail-item.on::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.mail-item.new::before { content: ""; position: absolute; right: 12px; bottom: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mail-av { --h: 230; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--f-display); color: #fff; background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 45) 75% 52%)); }
.mail-av.lg { width: 48px; height: 48px; font-size: 19px; }
.mail-av.me { background: linear-gradient(135deg, var(--accent), var(--flare)); }
.mail-item-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.mail-item-top { display: flex; gap: 8px; align-items: baseline; }
.mail-item-top b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.mail-item.new .mail-item-top b, .mail-item.new .mail-item-subj { color: var(--ink); font-weight: 700; }
.mail-item-top time { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.mail-item.new .mail-item-top time { color: var(--accent); font-weight: 600; }
.mail-item-subj { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.mail-item-prev { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.mail-item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.mail-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-3); white-space: nowrap; }
.mail-tag.num { font-family: var(--f-mono); }
.mail-tag.ok { background: var(--ok-soft); color: var(--ok); }
.mail-empty { display: grid; justify-items: center; align-content: center; gap: 8px; padding: 50px 20px; text-align: center; color: var(--ink-3); }
.mail-empty strong { color: var(--ink-2); font-family: var(--f-display); }

.mail-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.mail-pane-empty { grid-template-rows: none; place-items: center; align-content: center; gap: 8px; padding: 30px; text-align: center; color: var(--ink-3); background: radial-gradient(circle at 50% 35%, var(--accent-soft), transparent 55%); }
.mail-hero-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--flare)); box-shadow: 0 18px 40px -16px var(--accent); margin-bottom: 6px; }
.mail-pane-empty p { font: 700 19px var(--f-display); color: var(--ink); }
.mail-pane-empty > span { max-width: 420px; }
.mail-stats { display: flex; gap: 10px; margin-top: 16px; }
.mail-stats div { display: grid; gap: 2px; min-width: 104px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mail-stats b { font: 700 22px var(--f-display); color: var(--ink); }
.mail-stats span { font-size: 12px; }
.mail-pane-head { display: grid; gap: 10px; padding: 14px 20px 10px; border-bottom: 1px solid var(--line); position: relative; background: var(--surface); }
.mail-pane-head::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--flare), var(--warn)); }
.mail-head-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mail-head-row h2 { font: 700 18px/1.3 var(--f-display); overflow-wrap: anywhere; }
.mail-head-title { display: grid; gap: 1px; min-width: 0; margin-right: auto; }
.mail-head-title .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-back { display: none; }
.mail-from { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mail-from > div { display: grid; gap: 1px; min-width: 0; }
.mail-from b { font-size: 15px; }
.mail-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mail-toolbar .btn.sm { gap: 6px; }
.mail-assign-wrap { display: inline-flex; align-items: center; gap: 6px; padding-left: 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); color: var(--ink-3); }
.mail-assign-wrap select.input.mail-assign { border: 0; background-color: transparent; padding-top: 5px; padding-bottom: 5px; min-width: 140px; font-size: 13px; }

.mail-thread { overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; background: color-mix(in srgb, var(--ink) 2%, var(--surface)); }
.mail-thread > * { flex-shrink: 0; }
.mail-unfold { align-self: center; padding: 6px 14px; border: 1px dashed var(--line-2); border-radius: 99px; background: none; color: var(--ink-3); font: 600 12.5px var(--f-body); cursor: pointer; }
.mail-unfold:hover { color: var(--ink); border-color: var(--accent); }
.mail-msg { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.mail-msg.out { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.mail-msg header { display: flex; align-items: center; gap: 11px; padding: 12px 16px; }
.mail-msg.folded header { cursor: pointer; }
.mail-msg-who { display: grid; min-width: 0; }
.mail-msg-who b { font-size: 14px; }
.mail-msg-who span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-msg-meta { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.mail-msg-meta time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.mail-msg-body { padding: 2px 16px 16px 65px; }
.mail-msg-body > p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-size: 14.5px; }
.mail-msg-peek { display: none; padding: 0 16px 12px 65px; margin-top: -6px; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-msg.folded .mail-msg-body { display: none; }
.mail-msg.folded .mail-msg-peek { display: block; }
.mail-quote-btn { margin-top: 8px; }
.mail-quote { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--line-2); color: var(--ink-3); font: 12.5px/1.5 var(--f-body); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
.mail-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mail-file { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; text-decoration: none; max-width: 100%; }
.mail-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.mail-file em { font-style: normal; color: var(--ink-3); font-size: 11.5px; }
.mail-file:hover { border-color: var(--accent); color: var(--ink); }
.mail-file.off { opacity: 0.6; }

.mail-compose { display: grid; gap: 8px; padding: 10px 20px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.mail-compose-to { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mail-compose textarea { resize: vertical; min-height: 46px; max-height: 40vh; transition: min-height 0.2s; font: 14px/1.55 var(--f-body); }
.mail-compose textarea:focus { min-height: 130px; }
.mail-compose-act > .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.mail-compose-act > .btn { flex: none; }
.mail-compose-act { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.mail-note { display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-size: 13.5px; }

.mail-usages { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mail-usage { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.mail-usage b { font: 700 22px var(--f-display); }
.mail-meter { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
.mail-meter.sm { height: 4px; width: 90px; margin-top: 4px; }
.mail-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--ok)); transition: width 0.4s; }
.mail-meter i.hot { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.mail-supp { display: grid; gap: 6px; margin-top: 10px; }
.mail-supp > div { display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.mail-supp > div > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mail-tpl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mail-tpl-head h3 { font: 700 16px var(--f-display); margin-right: auto; }
.mail-tpl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 20px; align-items: start; }
.mail-tpl textarea { font: 13.5px/1.55 var(--f-body); resize: vertical; }
.mail-prev { padding: 18px 14px; border-radius: var(--r); background: #f3f4f8; position: sticky; top: 16px; }
.mail-prev-card { background: #fff; color: #151821; border-radius: 14px; overflow: hidden; font-family: -apple-system, "Segoe UI", Arial, sans-serif; box-shadow: 0 10px 30px -18px rgba(21, 24, 33, 0.4); }
.mail-prev-bar { display: block; height: 5px; background: linear-gradient(90deg, #6b5cff, #ff5fa2, #ffb03b); }
.mail-prev-brand { padding: 18px 20px 4px; font-weight: 800; font-size: 15px; }
.mail-prev-body { padding: 4px 20px 18px; font-size: 13.5px; line-height: 1.6; }
.mail-prev-body h4 { margin: 0 0 8px; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.mail-prev-body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-prev-btn { display: inline-block; margin-top: 16px; padding: 10px 18px; border-radius: 10px; background: #6b5cff; color: #fff; font-weight: 700; }
.mail-prev-foot { padding: 12px 20px; background: #f8f9fc; color: #7a8091; font-size: 11.5px; line-height: 1.5; white-space: pre-line; }
.mail-progress { display: grid; gap: 10px; }
.mail-progress .mail-tpl-head { margin-bottom: 0; }

/* impostazioni */
.mail-set { display: grid; gap: 14px; }
.mail-set-head { display: flex; gap: 12px; align-items: flex-start; }
.mail-set-head h3 { font: 700 16px var(--f-display); }
.mail-set-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.mail-set-body { display: grid; gap: 12px; }
.mail-set-body textarea { font: 13.5px/1.55 var(--f-body); resize: vertical; }
.mail-num { display: flex; align-items: center; gap: 8px; }
.mail-num .input { max-width: 140px; }
.mail-diags { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.mail-diag { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.mail-diag > i { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.mail-diag.ok > i { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.mail-diag.bad > i { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.mail-diag > div { display: grid; gap: 2px; min-width: 0; }
.mail-diag span { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.savebar-inline { display: flex; align-items: center; gap: 10px; position: sticky; bottom: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); z-index: 2; }

@media (max-width: 1000px) {
  .mail-tpl { grid-template-columns: 1fr; }
  .mail-prev { position: static; }
}
@media (max-width: 860px) {
  .mail-app { grid-template-columns: 1fr; height: auto; min-height: 0; box-shadow: none; }
  .mail-col { border-right: 0; }
  .mail-list { max-height: none; }
  .mail-app.has-thread .mail-col { display: none; }
  .mail-app:not(.has-thread) .mail-pane-empty { display: none; }
  .mail-pane { grid-template-rows: auto auto auto; }
  .mail-thread { overflow: visible; padding: 14px; }
  .mail-pane-head { padding: 16px 14px 12px; }
  .mail-compose { padding: 12px 14px 14px; }
  .mail-back { display: inline-flex; }
  .mail-msg-body { padding: 2px 14px 14px; }
  .mail-msg-peek { padding: 0 14px 12px; }
  .mail-msg header { flex-wrap: wrap; }
  .mail-msg-meta { margin-left: 49px; justify-content: flex-start; }
  .mail-toolbar .btn.sm span { display: none; }
  .mail-folders button svg { display: none; }
}
