/* ==================================================================
   AREA CLIENTI — design system
   Token del sito marcomarchisio.com · testi in Inter, titoli in Dazzle,
   dettagli tecnici in Martian Mono (identità "Camera OS").
   ================================================================== */
@font-face {
  font-family: "Inter";
  src: url(../fonts/inter.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url(../fonts/inter-ext.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0A0B0D;
  --panel: #111316;
  --panel-2: #15181c;
  --panel-3: #1b1f24;
  --line: #24282e;
  --line-2: #343a42;
  --text: #F2F3F5;
  --text-2: #C4C8CE;
  --muted: #8A9099;
  --cyan: #5CC5E8;
  --green: #39D98A;
  --red: #FF453A;
  --red-soft: #FF6B61;
  --on-acc: #06222d;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "martian-mono-variable", "martian-mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --dz: "dazzle-unicase", var(--sans);

  --pad: clamp(16px, 3.4vw, 48px);
  --maxw: 1480px;
  --ease: cubic-bezier(.22, .8, .28, 1);
  --panel-w: 360px;
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .4; }
::selection { background: var(--cyan); color: var(--on-acc); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
svg { flex: 0 0 auto; }
[hidden] { display: none !important; }

.dz { font-family: var(--dz); font-weight: 500; letter-spacing: .01em; line-height: 1.02; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.cyan { color: var(--cyan); }
.small { font-size: 13px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.idx { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.idx b { color: var(--cyan); font-weight: 500; }
.err { color: var(--red-soft); font-size: 13px; }
code { font-family: var(--mono); color: var(--cyan); font-size: .9em; }

/* ---------- pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: transparent;
  font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.btn.acc { border-color: var(--cyan); color: var(--cyan); }
.btn.solid { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.danger { border-color: #5a2a27; color: var(--red-soft); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 36px; }
.btn svg { width: 16px; height: 16px; }
.ib { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r); color: var(--text-2); flex: 0 0 auto; }
.ib svg { width: 19px; height: 19px; }
.ib[aria-pressed="true"] { background: var(--panel-3); color: var(--text); }
.ib.txt { width: auto; padding: 0 12px; display: inline-flex; gap: 8px; font-size: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip svg { width: 13px; height: 13px; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { border-color: var(--text); }
  .btn.acc:hover:not(:disabled) { background: var(--cyan); color: var(--on-acc); }
  .btn.solid:hover:not(:disabled) { background: var(--cyan); border-color: var(--cyan); color: var(--on-acc); }
  .btn.ghost:hover:not(:disabled) { color: var(--text); border-color: transparent; background: var(--panel-2); }
  .btn.danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #1a0504; }
  .ib:hover { background: var(--panel-2); color: var(--text); }
}

/* ---------- campi ---------- */
.field { display: grid; gap: 7px; }
.field > span, .lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select, .inp {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: var(--r);
  padding: 11px 13px; min-height: 46px; font-size: 15px; resize: vertical;
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible, .inp:focus-visible { outline: none; border-color: var(--cyan); }
textarea { line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px !important; }
.sortsel { min-height: 38px; height: 38px; padding: 0 12px; background: transparent; border: 1px solid var(--line-2); border-radius: var(--r); font-size: 12px; color: var(--text); }
.checkrow { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; line-height: 1.5; font-size: 14px; }
.checkrow input { margin-top: 4px; accent-color: var(--cyan); width: 16px; height: 16px; }
.checkrow small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.switch { position: relative; display: inline-flex; flex: 0 0 auto; width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s; }
.switch[aria-checked="true"] { background: var(--cyan); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--bg); }

/* ---------- barra superiore ---------- */
.hud-top { position: sticky; top: 0; z-index: 60; background: rgba(10,11,13,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.navbar { display: flex; align-items: center; gap: 12px 18px; min-height: 58px; padding: 8px var(--pad); }
.brand { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; font-variation-settings: "wdth" 112.5, "wght" 600; white-space: nowrap; }
.brand b { color: var(--cyan); font-weight: inherit; }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; margin-right: 6px; }
.lang button { padding: 6px 3px; color: var(--muted); border-bottom: 1px solid transparent; }
.lang button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--cyan); }
.lang i { font-style: normal; color: var(--line-2); }

.vf-c { position: absolute; width: 24px; height: 24px; border: 0 solid rgba(242,243,245,.6); pointer-events: none; z-index: 2; }
.vf-c.tl { top: 18px; left: 18px; border-top-width: 1.5px; border-left-width: 1.5px; }
.vf-c.tr { top: 18px; right: 18px; border-top-width: 1.5px; border-right-width: 1.5px; }
.vf-c.bl { bottom: 18px; left: 18px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.vf-c.br { bottom: 18px; right: 18px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* ==================================================================
   ACCESSO CLIENTE e pagine messaggio
   ================================================================== */
.login { position: relative; min-height: 100svh; display: grid; grid-template-columns: 1.2fr .8fr; }
.login-media { position: relative; overflow: hidden; background: var(--panel); }
.login-media img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.85); }
.login-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,11,13,0) 55%, rgba(10,11,13,.9)); }
.login-media .exif { display: none; }
.login-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 28px var(--pad) 32px; }
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-body { display: grid; gap: 30px; max-width: 420px; width: 100%; }
.login-body .kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: var(--cyan); }
.login-title { font-size: clamp(40px, 5vw, 64px); margin-top: 8px; }
.login-meta { font-size: 14px; color: var(--muted); margin-top: 12px; text-transform: none !important; }
.login form { display: grid; gap: 18px; }
.pw-wrap { display: flex; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); }
.pw-wrap:focus-within { border-color: var(--cyan); }
.pw-wrap input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; }
.pw-wrap button { width: 48px; display: grid; place-items: center; color: var(--muted); }
.login .btn.solid { min-height: 52px; font-size: 15px; }
.login-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }

.msg-page { min-height: 100svh; display: grid; place-items: center; padding: 40px var(--pad); position: relative; }
.msg-box { max-width: 520px; display: grid; gap: 16px; text-align: center; justify-items: center; }
.msg-box .kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: var(--cyan); }
.msg-box h1 { font-size: clamp(36px, 6vw, 60px); }
.msg-box p { color: var(--text-2); font-size: 16px; line-height: 1.65; }
.msg-page .brand { position: absolute; top: 26px; left: var(--pad); }

/* ==================================================================
   GALLERIA CLIENTE
   ================================================================== */
.hero { position: relative; height: clamp(320px, 62svh, 600px); overflow: hidden; background: var(--panel); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,13,.2) 0%, rgba(10,11,13,0) 35%, rgba(10,11,13,.85) 100%); }
.hero-in { position: absolute; z-index: 2; left: var(--pad); right: var(--pad); bottom: clamp(28px, 6vh, 56px); display: grid; gap: 12px; }
.hero-kicker { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; color: var(--cyan); }
.hero-title { font-size: clamp(42px, 8vw, 104px); font-weight: 700; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--text-2); }
.hero.no-cover { height: auto; padding: 60px 0 30px; background: var(--bg); }
.hero.no-cover::after { display: none; }
.hero.no-cover .hero-in { position: static; }

.welcome { padding-top: clamp(32px, 5vh, 52px); padding-bottom: 8px; }
.welcome-text { max-width: 680px; font-size: clamp(16px, 1.4vw, 18px); line-height: 1.7; color: var(--text-2); white-space: pre-line; }

.subnav { margin-top: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav-in { display: flex; gap: 28px; min-width: max-content; }
.subtab { display: flex; align-items: baseline; gap: 10px; padding: 14px 0 12px; border-bottom: 2px solid transparent; color: var(--muted); text-align: left; }
.subtab .nm { font-size: 16px; font-weight: 600; }
.subtab .ty { font-size: 12px; color: var(--muted); }
.subtab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }

.banner { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 13px 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); font-size: 14px; line-height: 1.55; color: var(--text-2); }
.banner .dot { flex: 0 0 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--green); }

/* barra strumenti: filtri + vista/ordinamento, compatta e secondaria */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding-top: 22px; }
.tb-filters { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.flt { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.flt .n { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }
.flt .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.flt[aria-pressed="true"] { background: var(--panel-3); color: var(--text); }
.flt[aria-pressed="true"] .n { color: var(--text-2); }
.tb-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.tb-prog { font-size: 12px; color: var(--muted); margin-right: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-icons { display: flex; gap: 2px; }
.tb-icons .ib, .tb-tools .ib { width: 34px; height: 34px; }
.tb-icons .ib svg, .tb-tools .ib svg { width: 17px; height: 17px; }
.selbtn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; margin-left: 6px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; color: var(--text); }
.selbtn svg { width: 16px; height: 16px; }
.selbtn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.tb-sort { display: inline-flex; align-items: center; gap: 2px; padding-left: 8px; border-radius: var(--r); color: var(--muted); }
.tb-sort svg { width: 15px; height: 15px; }
.tb-sort select { width: auto; height: 34px; padding: 0 8px 0 4px !important; background: transparent; border: 0; font-size: 13px; color: var(--text-2); cursor: pointer; }
.tb-bar { flex: 1 0 100%; display: flex; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.tb-bar i { display: block; height: 100%; background: var(--st); transition: width .4s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .flt:hover { color: var(--text); }
  .tb-sort:hover { background-color: var(--panel-2); }
}

/* stati */
.st-edit { --st: var(--cyan); }
.st-original { --st: var(--green); }
.st-reject { --st: var(--red); }
.st-approved { --st: var(--green); }
.st-retouch { --st: var(--cyan); }
.badge { animation: pop .3s var(--ease) backwards; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 4px; background: var(--st, var(--text)); color: #06090b; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge.ghost { background: rgba(10,11,13,.75); color: var(--text); border: 1px solid rgba(242,243,245,.25); }
.chip.st-edit, .chip.st-original, .chip.st-reject, .chip.st-approved, .chip.st-retouch { color: var(--st); }
.chip.st-edit[aria-pressed="true"], .chip.st-original[aria-pressed="true"], .chip.st-reject[aria-pressed="true"], .chip.st-approved[aria-pressed="true"], .chip.st-retouch[aria-pressed="true"] { background: var(--st); border-color: var(--st); color: #06090b; }

/* ---------- griglie ---------- */
.photos { padding-top: 20px; padding-bottom: 120px; }
.empty { padding: 70px 0; text-align: center; color: var(--muted); font-size: 15px; }
.v-grid, .v-mosaic, .v-list { animation: fadeUp .35s var(--ease) both; }
.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 240px), 1fr)); gap: 24px 14px; }
.v-mosaic { display: flex; flex-wrap: wrap; gap: 8px; }
.v-mosaic::after { content: ""; flex-grow: 999; }
.v-list { display: grid; }

.tile { position: relative; margin: 0; display: flex; flex-direction: column; gap: 8px; content-visibility: auto; contain-intrinsic-size: auto 240px; }
.tile .fr { position: relative; aspect-ratio: 3 / 2; background: var(--panel); overflow: hidden; border-radius: 4px; cursor: zoom-in; }
.tile .fr img { width: 100%; height: 100%; object-fit: contain; transition: opacity .35s; }
.tile .fr img.lz { opacity: 0; }
.tile .open { position: absolute; inset: 0; z-index: 1; }
.tile .cap { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--muted); min-width: 0; }
.tile .cap .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .cc { display: inline-flex; align-items: center; gap: 4px; color: var(--text); flex: 0 0 auto; font-family: var(--sans); font-size: 12px; }
.tile .cc svg { width: 13px; height: 13px; }
.tile .bdg { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; gap: 4px; pointer-events: none; }
.tile.is-reject .fr img { opacity: .32; filter: grayscale(.6); }
.tile .chk { position: absolute; top: 8px; right: 8px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--text); background: rgba(10,11,13,.45); display: none; place-items: center; pointer-events: none; }
.tile .chk svg { width: 14px; height: 14px; opacity: 0; }
.selecting .tile .chk { display: grid; }
.selecting .tile .fr { cursor: pointer; }
.tile.sel .chk { background: var(--text); }
.tile.sel .chk svg { opacity: 1; color: var(--bg); }
.tile.sel .fr { outline: 2px solid var(--text); outline-offset: -2px; }
.tile .acts { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: none; gap: 6px; padding: 8px; background: linear-gradient(to top, rgba(6,7,9,.9), rgba(6,7,9,0)); }
.tile .acts button { flex: 1; height: 38px; display: grid; place-items: center; border-radius: 4px; border: 1px solid rgba(242,243,245,.22); color: var(--st, var(--text)); background: rgba(10,11,13,.55); }
.tile .acts button svg { width: 17px; height: 17px; }
.tile .acts button[aria-pressed="true"] { background: var(--st); color: #06090b; border-color: var(--st); }
@media (hover: hover) and (pointer: fine) {
  .tile .acts { display: flex; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
  .tile:hover .acts, .tile:focus-within .acts { opacity: 1; transform: none; }
  .selecting .tile .acts { display: none; }
  .tile .acts button:hover { border-color: var(--st, var(--text)); }
}

.v-mosaic .tile { flex-grow: var(--ar); flex-basis: calc(var(--ar) * 210px); gap: 0; }
.v-mosaic .tile .fr { aspect-ratio: var(--ar); border-radius: 0; }
.v-mosaic .tile .fr img { object-fit: cover; }
.v-mosaic .tile .cap { display: none; }

.v-list .tile { flex-direction: row; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); contain-intrinsic-size: auto 84px; }
.v-list .tile .fr { flex: 0 0 110px; height: 74px; aspect-ratio: auto; }
.v-list .tile .meta { flex: 1; min-width: 0; display: grid; gap: 3px; }
.v-list .tile .meta .fn { font-family: var(--mono); font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-list .tile .meta .ex { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-list .tile .chk { position: static; flex: 0 0 26px; }
.v-list .tile .lstat { display: flex; align-items: center; gap: 10px; }
.v-list .tile .bdg { position: static; }
.v-list .tile .acts { position: static; display: flex; opacity: 1; transform: none; background: none; padding: 0; }
.v-list .tile .acts button { width: 40px; flex: 0 0 40px; }

/* ---------- barre flottanti ---------- */
.floatbar { animation: floatIn .32s var(--ease) both; position: fixed; left: 50%; bottom: 18px; z-index: 50; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; max-width: calc(100vw - 24px); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.55); font-size: 13px; }
.floatbar .cnt { padding: 0 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.submitbar { animation: slideUp .4s var(--ease) both; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom)); background: rgba(14,16,19,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.submitbar .tally { display: flex; gap: 14px; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.submitbar .tally span { display: inline-flex; align-items: center; gap: 5px; color: var(--st); }
.submitbar .tally svg { width: 14px; height: 14px; }
.menu { position: relative; }
.menu-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5; min-width: 190px; display: grid; padding: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.menu-pop button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; text-align: left; font-size: 14px; border-radius: 4px; color: var(--st, var(--text)); }
.menu-pop button:hover { background: var(--panel-3); }
.menu-pop svg { width: 15px; height: 15px; }

/* ==================================================================
   VISTA FOTO
   ================================================================== */
#lb[hidden] { display: none; }
.lb { position: fixed; inset: 0; z-index: 100; background: #050607; display: grid; grid-template-rows: auto minmax(0, 1fr); touch-action: none; overscroll-behavior: none; animation: lbIn .32s var(--ease) both; }
.lb .lb-stage { animation: zoomIn .4s var(--ease) backwards; }
.lb.closing { animation: lbOut .2s ease both; }
@keyframes lbIn { from { opacity: 0; } }
@keyframes floatIn { from { opacity: 0; transform: translate(-50%, 20px); } }
@keyframes floatInM { from { opacity: 0; transform: translateY(20px); } }
@keyframes lbOut { to { opacity: 0; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.96); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideUp { from { transform: translate3d(0, 120%, 0); } }
.lb .side-b { touch-action: pan-y; }
.lb textarea { touch-action: manipulation; }
.lb-top { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); }
.lb-top .tt { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1; }
.lb-top .ct { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-top .fn { font-family: var(--mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-top .ver { font-size: 11px; font-weight: 600; border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; }
.lb-top .act { display: flex; align-items: center; gap: 2px; }
.lb-top .ib[aria-pressed="true"] { color: var(--cyan); }
.lb-body { display: grid; grid-template-columns: minmax(0, 1fr) 0px; min-height: 0; overflow: hidden; transition: grid-template-columns .38s var(--ease); }
.lb.panel-open .lb-body { grid-template-columns: minmax(0, 1fr) var(--panel-w); }
.lb-main { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.lb-stage { position: relative; min-height: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.lb-track { display: flex; height: 100%; transform: translate3d(-100%, 0, 0); will-change: transform; }
.lb-slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; padding: 8px clamp(8px, 4vw, 64px); container-type: size; }
.lb-frame { position: relative; width: min(100cqw, calc(100cqh * var(--ar))); aspect-ratio: var(--ar); transform-origin: center; }
.lb-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; pointer-events: none; }
.lb-frame .lo { filter: blur(6px); }
.lb-frame.pinning { cursor: crosshair; }
.lb.zoomed .lb-frame.pinning { cursor: crosshair; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 44px; height: 64px; display: grid; place-items: center; color: var(--text); border-radius: var(--r); background: rgba(10,11,13,.35); opacity: .65; transition: opacity .2s; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
.lb-nav svg { width: 22px; height: 22px; }
.lb-rail { position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.rb { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(10,11,13,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(242,243,245,.14); color: var(--text); }
.rb svg { width: 19px; height: 19px; }
.rb b { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--cyan); color: var(--on-acc); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.rb[aria-pressed="true"] { background: var(--text); color: var(--bg); }
@media (hover: hover) and (pointer: fine) {
  .lb-nav:hover { opacity: 1; background: rgba(10,11,13,.6); }
  .rb:hover { border-color: rgba(242,243,245,.4); }
  .stbtn:hover:not(:disabled):not([aria-pressed="true"]) { border-color: var(--st); }
}

.pin { animation: pop .3s var(--ease) backwards; position: absolute; z-index: 3; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; box-shadow: 0 0 0 4px rgba(242,243,245,.25), 0 4px 14px rgba(0,0,0,.5); cursor: pointer; transition: transform .15s; }
.pin.admin { background: var(--cyan); }
.pin.new { background: var(--cyan); box-shadow: 0 0 0 5px rgba(92,197,232,.35); animation: pinpulse 1.4s ease-in-out infinite; }
.pin.hl { transform: scale(1.2); }
@keyframes pinpulse { 50% { box-shadow: 0 0 0 9px rgba(92,197,232,.12); } }

.lb-status { display: flex; justify-content: center; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
.stbtn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 150px; height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--st); font-size: 15px; font-weight: 600; transition: background-color .22s var(--ease), border-color .22s, color .22s, transform .15s var(--ease); }
.stbtn:active:not(:disabled) { transform: scale(.95); }
.stbtn[aria-pressed="true"] svg { animation: pop .35s var(--ease); }
.rb, .ib, .btn, .flt { transition: background-color .2s, color .2s, border-color .2s, transform .15s var(--ease); }
.rb:active, .ib:active, .btn:active:not(:disabled), .flt:active { transform: scale(.94); }
.stbtn svg { width: 18px; height: 18px; }
.stbtn kbd { font: 500 11px var(--sans); color: var(--muted); margin-left: 4px; }
.stbtn[aria-pressed="true"] { background: var(--st); border-color: var(--st); color: #06090b; }
.stbtn[aria-pressed="true"] kbd { color: rgba(6,9,11,.55); }

.cmp-after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 2px; margin-left: -1px; background: var(--text); z-index: 3; pointer-events: none; }
.cmp-knob { position: absolute; top: 50%; left: var(--cut, 50%); z-index: 3; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; pointer-events: none; }
.cmp-knob svg { width: 18px; height: 18px; }
.cmp-lbl { position: absolute; top: 12px; z-index: 3; padding: 3px 9px; border-radius: 4px; background: rgba(10,11,13,.75); font-size: 12px; font-weight: 600; }
.cmp-lbl.a { left: 12px; } .cmp-lbl.b { right: 12px; }
.lb-frame.comparing { cursor: ew-resize; }

/* pannello commenti / info / versioni */
.lb-side { display: flex; flex-direction: column; min-height: 0; min-width: var(--panel-w); border-left: 1px solid var(--line); background: #0c0e11; visibility: hidden; transition: visibility 0s linear .38s; }
.lb.panel-open .lb-side { visibility: visible; transition: visibility 0s; }
.side-b > * { animation: fadeUp .3s var(--ease) both; }
.side-h { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 6px 4px 18px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; flex: 0 0 auto; }
.side-h span { flex: 1; }
.side-h .grip { display: none; }
.side-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; }
.cmts { display: grid; gap: 18px; }
.cmt { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 11px; }
.cmt .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--panel-3); color: var(--muted); }
.cmt .num.pinned { background: var(--text); color: var(--bg); cursor: pointer; }
.cmt.admin .num { background: var(--cyan); color: var(--on-acc); }
.cmt .hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.cmt .hd b { color: var(--text); font-weight: 600; font-size: 14px; }
.cmt .hd .del { color: var(--muted); text-decoration: underline; font-size: 12px; }
.cmt .bd { margin-top: 3px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt .replies { margin-top: 12px; padding-left: 12px; border-left: 1px solid var(--line-2); display: grid; gap: 12px; }
.cmt .replies .r .hd b { color: var(--cyan); }
.cmt .rbtn { margin-top: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.ver-sep { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.no-cmt { color: var(--muted); font-size: 14px; line-height: 1.6; }
.cform { flex: 0 0 auto; display: grid; gap: 8px; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #0c0e11; }
.cform .ctx { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.cform .ctx button { color: var(--muted); text-decoration: underline; }
.cform .pinref i { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); }
.cform .row { display: flex; align-items: flex-end; gap: 8px; }
.cform textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; padding: 11px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; color: var(--text); font-size: 15px; resize: none; }
.cform textarea:focus-visible { outline: none; border-color: var(--cyan); }
.cform .send { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); }
.cform .send svg { width: 18px; height: 18px; }
.exif-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.exif-t th { text-align: left; font-weight: 400; color: var(--muted); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; width: 42%; }
.exif-t td { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.exif-t a { color: var(--cyan); }
.vers { display: grid; gap: 10px; }
.vcard { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); text-align: left; font-size: 13px; }
.vcard.cur { border-color: var(--text); }
.vcard img { width: 84px; height: 56px; object-fit: cover; background: var(--panel); border-radius: 3px; }
.vcard .h { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.vcard .n { margin-top: 4px; color: var(--text-2); line-height: 1.5; }
.note { margin-bottom: 16px; padding: 12px 14px; border-radius: var(--r); background: var(--panel); font-size: 14px; line-height: 1.55; color: var(--text-2); }
.note b { color: var(--cyan); font-weight: 600; font-size: 12px; display: block; margin-bottom: 3px; }

/* ==================================================================
   DIALOGHI E NOTIFICHE
   ================================================================== */
.dlg-bg { position: fixed; inset: 0; z-index: 200; background: rgba(4,5,6,.78); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); animation: lbIn .22s ease both; }
.dlg { animation: fadeUp .32s var(--ease) both; }
.dlg { width: min(520px, 100%); max-height: calc(100svh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: clamp(20px, 3vw, 28px); display: grid; gap: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.dlg h2 { font-size: clamp(26px, 3vw, 32px); }
.dlg p { color: var(--text-2); line-height: 1.6; font-size: 15px; }
.dlg .acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tally-t { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tally-t > div { padding: 14px; background: var(--panel); display: grid; gap: 4px; }
.tally-t .k { font-size: 13px; font-weight: 500; color: var(--st, var(--muted)); display: flex; align-items: center; gap: 6px; }
.tally-t .k svg { width: 13px; height: 13px; }
.tally-t .v { font-family: var(--dz); font-size: 32px; line-height: 1; font-weight: 200; }
.warn-box { padding: 13px 15px; border-radius: var(--r); border: 1px solid rgba(255,69,58,.45); background: rgba(255,69,58,.07); font-size: 14px; line-height: 1.55; }
.warn-box.neutral { border-color: var(--line-2); background: none; }
.parts { display: grid; gap: 8px; }
.parts a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line-2); border-radius: var(--r); font-size: 14px; font-weight: 500; }
.parts a:hover { border-color: var(--cyan); color: var(--cyan); }
.toast { position: fixed; left: 50%; top: 18px; z-index: 300; transform: translate(-50%, -20px); opacity: 0; padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; transition: opacity .25s, transform .25s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); color: #fff; }
.preview-bar { position: sticky; top: 0; z-index: 70; padding: 8px var(--pad); background: var(--cyan); color: var(--on-acc); font-size: 13px; font-weight: 500; display: flex; justify-content: space-between; gap: 12px; }
.preview-bar a { text-decoration: underline; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 24px var(--pad) 30px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ==================================================================
   RESPONSIVE — cliente
   ================================================================== */
@media (pointer: coarse) { input, textarea, select, .inp, .cform textarea { font-size: 16px !important; } }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; grid-template-rows: 44svh auto; }
  .login-media::after { background: linear-gradient(180deg, rgba(10,11,13,0) 40%, var(--bg)); }
  .login-panel { margin-top: -80px; position: relative; z-index: 2; padding-top: 0; }
  .login-top { position: absolute; top: calc(-44svh + 70px); left: var(--pad); right: var(--pad); }
}
@media (max-width: 760px) {
  .hide-m { display: none !important; }
  .navbar { min-height: 52px; }
  .submitbar { display: flex; }
  .submitbar .btn { min-height: 44px; }
  .photos { padding-bottom: 110px; }
  .floatbar { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); transform: none; max-width: none; justify-content: space-between; gap: 4px; padding: 6px; z-index: 55; animation-name: floatInM; }
  .floatbar .cnt { padding: 0 4px 0 6px; font-weight: 600; }
  .floatbar .btn.sm { padding: 0 10px; }
  .floatbar .lbl-m { display: none; }
  .selecting-on .submitbar { display: none; }
  .toolbar { gap: 8px; padding-top: 16px; }
  .tb-filters { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); scrollbar-width: none; }
  .tb-filters::-webkit-scrollbar { display: none; }
  .tb-tools { width: 100%; justify-content: space-between; gap: 2px; }
  .tb-prog { display: none; }
  .selbtn { margin-left: 0; order: -1; }
  .v-grid { gap: 14px 8px; }
  .v-mosaic { gap: 4px; }
  .v-mosaic .tile { flex-basis: calc(var(--ar) * 120px); }
  .v-list .tile { gap: 12px; }
  .v-list .tile .fr { flex-basis: 84px; height: 58px; }
  .v-list .tile .acts { display: none; }
  .tile .cap { font-size: 9px; }

  /* vista foto: la foto occupa quasi tutto lo schermo */
  .lb-top { min-height: 48px; padding: 4px 4px; padding-top: max(4px, env(safe-area-inset-top)); }
  .lb-top .tt { flex-direction: column; gap: 0; }
  .lb-slide { padding: 0; }
  .lb-nav { display: none; }
  .lb-rail { top: 10px; right: 10px; }
  .rb { width: 42px; height: 42px; }
  .lb-status { gap: 6px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .stbtn { flex: 1; min-width: 0; height: 46px; padding: 0 6px; gap: 6px; font-size: 14px; }
  .stbtn kbd { display: none; }
  .lb-body, .lb.panel-open .lb-body { grid-template-columns: minmax(0, 1fr); transition: none; }
  .lb-side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 110; min-width: 0; height: min(58svh, 520px); border-left: 0; border-top: 1px solid var(--line-2); border-radius: 16px 16px 0 0; box-shadow: 0 -16px 40px rgba(0,0,0,.5); transform: translate3d(0, 105%, 0); transition: transform .38s var(--ease), visibility 0s linear .38s; }
  .lb.panel-open .lb-side { transform: none; transition: transform .38s var(--ease), visibility 0s; }
  .lb-main { transition: padding-bottom .38s var(--ease); }
  .lb.panel-open .lb-main { padding-bottom: min(58svh, 520px); }
  .lb-status { transition: opacity .2s; }
  .lb.panel-open .lb-status { opacity: 0; pointer-events: none; }
  .side-h { position: relative; min-height: 50px; padding-top: 10px; }
  .side-h .grip { display: block; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-2); }
  .side-b { padding: 14px 16px; }
  .dlg .acts .btn { flex: 1 1 auto; }
}

/* ==================================================================
   AREA ADMIN
   ================================================================== */
.adm { font-size: 14px; }
.adm .btn { font-size: 12px; letter-spacing: .04em; }
.topbar { position: sticky; top: 0; z-index: 60; background: rgba(10,11,13,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; min-height: 56px; padding: 6px var(--pad); font-size: 12px; letter-spacing: .08em; }
.topbar-in .muted { font-family: var(--mono); font-size: 11px; }
.topbar-in .r { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.adm main { padding-top: 34px; padding-bottom: 80px; }
.h1 { font-size: clamp(34px, 4.6vw, 56px); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.page-head .t { display: grid; gap: 10px; min-width: 0; }
.page-head .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.panel { border: 1px solid var(--line); background: var(--panel); }
.panel.pad { padding: 22px; display: grid; gap: 14px; }
.sec-h { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sec-h b { color: var(--cyan); font-weight: 400; }

.phase { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 4px; font-size: 10px; letter-spacing: .1em; font-weight: 600; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.phase.sel_sent { background: var(--cyan); border-color: var(--cyan); color: var(--on-acc); font-weight: 700; }
.phase.review_sent { background: var(--cyan); border-color: var(--cyan); color: var(--on-acc); font-weight: 700; }
.phase.review { border-color: var(--cyan); color: var(--cyan); }
.phase.approved { border-color: var(--green); color: var(--green); }
.phase.selection { border-color: var(--text-2); color: var(--text); }
.phase.expired, .phase.archived { color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 30px; }
.kpi { padding: 18px 20px; background: var(--panel); display: grid; gap: 8px; }
.kpi .k { font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.kpi .v { font-family: var(--dz); font-weight: 200; font-size: clamp(30px, 3.4vw, 44px); line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi.hot .k { color: var(--cyan); }
.kpi.hot .v { color: var(--cyan); }

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 34px; align-items: start; }
.dash-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.gl { display: grid; }
.gl-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 190px auto; gap: 16px 22px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.gl-row .cov { width: 132px; height: 88px; background: var(--panel); object-fit: cover; }
.gl-row .cov.ph { display: grid; place-items: center; font-size: 10px; letter-spacing: .14em; color: var(--muted); border: 1px dashed var(--line-2); }
.gl-row .ti { display: grid; gap: 6px; min-width: 0; }
.gl-row .ti a.nm { font-size: 17px; font-weight: 600; }
.gl-row .ti a.nm:hover { color: var(--cyan); }
.gl-row .ti .line1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.gl-row .ti .sub { font-size: 10px; letter-spacing: .12em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-row .ti .last { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-row .pr { display: grid; gap: 8px; font-size: 10px; letter-spacing: .1em; color: var(--text-2); }
.gl-row .acts { display: flex; gap: 6px; }
.gl-row.dim { opacity: .55; }
.ubadge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--cyan); letter-spacing: .08em; }
.ubadge svg { width: 12px; height: 12px; }
.pbar { height: 2px; background: var(--line); position: relative; }
.pbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text); }
.feed { display: grid; }
.feed .it { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed .it .tm { font-size: 10px; color: var(--muted); letter-spacing: .06em; padding-top: 2px; }
.feed .it .tx { font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.feed .it .tx b { font-weight: 500; color: var(--text); }
.feed .it .gn { display: block; margin-top: 3px; font-size: 9px; letter-spacing: .14em; color: var(--muted); }

.form-grid { display: grid; gap: 18px; padding: 24px; }
.form-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* --- gestione galleria --- */
.gm { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 30px; align-items: start; }
.linkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 26px; font-size: 12px; }
.linkbar .k { font-size: 9px; letter-spacing: .18em; color: var(--muted); margin-right: 8px; }
.linkbar .url { flex: 1 1 320px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbar .pw { white-space: nowrap; }
.subcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 26px; }
.subcard { border: 1px solid var(--line); background: var(--panel); padding: 16px; display: grid; gap: 12px; }
.subcard .h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.subcard .h .nm { font-size: 15px; font-weight: 600; }
.subcard .h .ty { font-size: 9px; letter-spacing: .16em; color: var(--muted); }
.subcard .cnts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11px; font-variant-numeric: tabular-nums; }
.subcard .cnts span { display: inline-flex; align-items: center; gap: 5px; color: var(--st, var(--text-2)); }
.subcard .cnts svg { width: 12px; height: 12px; }
.subcard .sent { font-size: 10px; letter-spacing: .08em; color: var(--green); }
.subcard .bar3 { display: flex; height: 4px; gap: 2px; background: var(--line); }
.subcard .bar3 i { display: block; background: var(--st); }
.lr { border: 1px solid var(--line-2); padding: 18px; display: grid; gap: 14px; margin-bottom: 26px; background: var(--panel); }
.lr .h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.lr .h h2 { font-size: 12px; letter-spacing: .12em; font-weight: 700; }
.lr .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lr .btns .btn { color: var(--st, var(--text)); }
.lr .btns .btn.done { background: var(--st); border-color: var(--st); color: #06090b; }
.lr pre { margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); font: 11px/1.7 var(--mono); color: var(--text-2); white-space: pre-wrap; word-break: break-all; max-height: 140px; overflow: auto; }
.lr .how { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.lr .how b { color: var(--text-2); font-weight: 400; }

.mtabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.mtabs button { padding: 14px 0 12px; font-size: 11px; letter-spacing: .16em; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.mtabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.mtabs .n { color: var(--cyan); margin-left: 4px; }

.drop { border: 1px dashed var(--line-2); padding: 30px 20px; display: grid; justify-items: center; gap: 10px; text-align: center; transition: border-color .2s, background .2s; margin-bottom: 18px; }
.drop.over { border-color: var(--cyan); background: rgba(92,197,232,.05); }
.drop .t { font-size: 15px; }
.drop .s { font-size: 12px; color: var(--muted); max-width: 560px; line-height: 1.6; }
.drop svg { width: 26px; height: 26px; }
.drop .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.uplist { display: grid; gap: 6px; margin-bottom: 18px; }
.uplist .sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 11px; letter-spacing: .08em; }
.uplist .sum .bar { flex: 1 0 100%; height: 2px; background: var(--line); position: relative; }
.uplist .sum .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cyan); transition: width .2s; }
.upitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; font-size: 11px; color: var(--text-2); padding: 3px 0; }
.upitem .s { color: var(--muted); }
.upitem.ok .s { color: var(--green); }
.upitem.ko .s { color: var(--red-soft); }

.ptools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 10px; }
.agrid .tile .fr { cursor: pointer; }
.agrid .tile .cap { font-size: 9px; }
.agrid .tile .ver { position: absolute; right: 6px; bottom: 6px; z-index: 2; }
.agrid .tile .cover-mark { position: absolute; right: 6px; top: 6px; z-index: 2; }
.agrid .tile .chk { display: grid; opacity: 0; transition: opacity .15s; }
.agrid .tile:hover .chk, .agrid.selecting .tile .chk, .agrid .tile.sel .chk { opacity: 1; }

.subrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.subrow .mv { display: grid; gap: 2px; }
.subrow .mv button { width: 30px; height: 22px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); font-size: 10px; }
.subrow .mv button:hover { color: var(--text); }
.subrow .f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.subrow .f .inp { flex: 1 1 200px; min-height: 40px; padding: 8px 10px; }
.subrow .f select.inp { flex: 0 0 170px; }
.subrow .o { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: flex-end; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.subrow .o label { display: inline-flex; align-items: center; gap: 8px; }

.hist-f { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.hist-f select { min-height: 40px; height: 40px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line-2); font-size: 11px; }
.hist { display: grid; }
.hist .day { padding: 18px 0 6px; font-size: 10px; letter-spacing: .2em; color: var(--cyan); }
.hist .it { display: grid; grid-template-columns: 50px 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.55; }
.hist .it .tm { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hist .it .who { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .it.admin .who { color: var(--cyan); }
.hist .it .tx { color: var(--text-2); overflow-wrap: anywhere; }
.hist .it .tx button { color: var(--muted); text-decoration: underline; font-size: 11px; margin-left: 6px; }
.hist .it .tx .more { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.people { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.people span { border: 1px solid var(--line); padding: 6px 10px; font-size: 11px; color: var(--text-2); }
.people span small { color: var(--muted); margin-left: 6px; }

.cthreads { display: grid; gap: 0; }
.cth { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cth .th { position: relative; width: 96px; height: 64px; background: var(--panel); }
.cth .th img { width: 100%; height: 100%; object-fit: cover; }
.cth .th .pin { width: 18px; height: 18px; margin: -9px 0 0 -9px; font-size: 9px; box-shadow: none; }
.cth .bd { display: grid; gap: 10px; min-width: 0; }
.cth .fn { font-size: 11px; letter-spacing: .06em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cth .fn b { color: var(--text); font-weight: 400; }
.cth .unread { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); display: inline-block; }
.cth .rep { display: flex; gap: 8px; }
.cth .rep input { flex: 1; min-width: 0; min-height: 40px; padding: 8px 10px; }

.side { display: grid; border: 1px solid var(--line); background: var(--panel); position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; }
.side section { padding: 18px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.side section:last-child { border-bottom: 0; }
.side .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.side .row small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.side .help { font-size: 11px; color: var(--muted); line-height: 1.55; }
.cover-ed { position: relative; cursor: crosshair; background: var(--bg); }
.cover-ed img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cover-ed .fp { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 2px solid var(--text); border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.45); pointer-events: none; }
.cover-ed .ph { aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--muted); font-size: 11px; border: 1px dashed var(--line-2); }
.posgrid { display: grid; grid-template-columns: repeat(3, 26px); gap: 3px; }
.posgrid button { height: 22px; background: var(--panel-3); border: 1px solid var(--line-2); }
.posgrid button[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); }
.wm-prev { position: relative; overflow: hidden; background: var(--bg); }
.wm-prev img.base { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.wm-prev .mk { position: absolute; pointer-events: none; }
.range { width: 100%; accent-color: var(--cyan); height: 28px; }
.saved { font-size: 10px; letter-spacing: .14em; color: var(--green); opacity: 0; transition: opacity .3s; }
.saved.on { opacity: 1; }
.seg2 { display: flex; border: 1px solid var(--line-2); }
.seg2 button { flex: 1; min-height: 40px; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.seg2 button + button { border-left: 1px solid var(--line-2); }
.seg2 button[aria-pressed="true"] { background: var(--panel-3); color: var(--text); }

.install { max-width: 860px; display: grid; gap: 22px; }
.install .lead { font-size: 15px; }
.checks { width: 100%; border-collapse: collapse; font-size: 12px; }
.checks td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.checks td:first-child { width: 30px; }
.checks .ok { color: var(--green); } .checks .ko { color: var(--red); } .checks .warn { color: var(--cyan); }
.install .panel { padding: 0; }
.install form.panel { padding: 24px; }
.install .opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); cursor: pointer; line-height: 1.5; }
.install .opt:has(input:checked) { border-color: var(--cyan); }
.install .opt input { margin-top: 4px; accent-color: var(--cyan); }
.install .opt b { font-weight: 500; }
.install form .sec-h { margin-top: 10px; color: var(--text); }
.install section.panel .sec-h { padding: 18px 14px 6px; }
.install .err { padding: 0 14px 14px; }

.alogin { min-height: 100svh; display: grid; place-items: center; padding: 30px var(--pad); }
.alogin form { width: min(380px, 100%); display: grid; gap: 18px; }

@media (max-width: 1180px) {
  .gm { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .gl-row { grid-template-columns: 88px minmax(0, 1fr); }
  .gl-row .cov { width: 88px; height: 60px; }
  .gl-row .pr, .gl-row .acts { grid-column: 1 / -1; }
  .gl-row .acts { justify-content: flex-start; }
  .form-2 { grid-template-columns: 1fr; }
  .hist .it { grid-template-columns: 44px minmax(0, 1fr); }
  .hist .it .who { grid-column: 2; }
  .hist .it .tx { grid-column: 2; }
  .subrow { grid-template-columns: minmax(0, 1fr); }
  .subrow .mv { display: flex; }
  .subrow .o { justify-content: flex-start; }
  .agrid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .cth { grid-template-columns: 72px minmax(0, 1fr); }
  .cth .th { width: 72px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
