/* Social Tool — stile comune.
   Layout: barra in alto con logo e lingue; ogni tool è un "banco di lavoro" (comandi + tavolo luminoso),
   sotto una guida breve da leggere. Font ospitati sul sito: nessuna richiesta a server esterni. */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 500; font-display: swap; src: url("fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url("fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #ECEEF3; --surface: #FFFFFF; --ink: #15171E; --muted: #5A6072; --line: #D4D8E2;
  --accent: #2D55F0; --accent-ink: #FFFFFF; --accent-soft: #E3E9FF; --zone: #FF3D7F; --table: #DDE1EA;
  --ok: #0B6E4B; --warn: #96440A; --bad: #A81F31; --track: #E4E7EE; --gap: #FFFFFF;
  --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, "SF Mono", Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101219; --surface: #181B25; --ink: #ECEEF5; --muted: #9BA1B4; --line: #2B3040;
    --accent: #6F8BFF; --accent-ink: #0B0D14; --accent-soft: #1E2645; --zone: #FF5C93; --table: #0B0D13;
    --ok: #3CCB92; --warn: #F0A050; --bad: #FF8593; --track: #252A38; --gap: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101219; --surface: #181B25; --ink: #ECEEF5; --muted: #9BA1B4; --line: #2B3040;
  --accent: #6F8BFF; --accent-ink: #0B0D14; --accent-soft: #1E2645; --zone: #FF5C93; --table: #0B0D13;
  --ok: #3CCB92; --warn: #F0A050; --bad: #FF8593; --track: #252A38; --gap: #000000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- barra del sito ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); padding-top: env(safe-area-inset-top, 0px); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.logo-mark { width: 28px; height: 28px; border: 2.5px solid var(--ink); border-radius: 5px; position: relative; flex: none; }
.logo-mark::after { content: ""; position: absolute; inset: 5px 3px; border: 2.5px solid var(--accent); border-radius: 2px; }
.topnav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.topnav > a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.topnav > a:hover { color: var(--accent); }
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.langs a { font-family: var(--f-mono); font-size: 12px; font-weight: 600; text-decoration: none; color: var(--muted); padding: 4px 9px; text-transform: uppercase; }
.langs a[aria-current="true"] { background: var(--ink); color: var(--bg); }

/* ---------- intestazione dei tool ---------- */
.toolhead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 32px; padding-block: 28px 22px; }
.toolhead h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; line-height: 1.05; margin: 0; text-wrap: balance; max-width: 18ch; }
.tagline { margin: 0 0 4px; color: var(--muted); max-width: 46ch; text-wrap: balance; }
.privacy { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ok); }
.privacy svg { flex: none; }

/* ---------- banco di lavoro ---------- */
.bench { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .bench { grid-template-columns: minmax(0, 1fr); } .table { order: -1; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.drop { border: 1.5px dashed var(--line); border-radius: 8px; padding: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { display: block; font-weight: 600; }
.drop small { color: var(--muted); font-size: 13px; }
.drop svg { flex: none; color: var(--accent); }
.visually-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.thumbname { font-family: var(--f-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.platforms { display: flex; flex-wrap: wrap; gap: 6px; }
.pf { font: inherit; font-size: 13.5px; font-weight: 500; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.pf[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.formats { display: flex; flex-direction: column; gap: 6px; }
.fmt { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.fmt:hover { border-color: var(--muted); }
.fmt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.fmt .shape { justify-self: center; border: 1.5px solid currentColor; border-radius: 2px; opacity: .8; }
.fmt[aria-pressed="true"] .shape { color: var(--accent); opacity: 1; }
.fmt .nm { font-weight: 600; font-size: 14px; }
.fmt .px { font-family: var(--f-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.35; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 13.5px; font-weight: 500; padding: 8px 6px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row label { font-size: 14px; }
input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.val { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
input[type="color"] { width: 40px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--zone); width: 16px; height: 16px; }
.note { font-size: 13px; color: var(--muted); margin: 0; }

.table { background: var(--table); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--muted) 22%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.tbar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.tbar h2 { font-family: var(--f-display); font-weight: 700; font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.dims { font-family: var(--f-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage { display: grid; place-items: center; min-height: 340px; padding: 8px; overflow: hidden; }
.frame { position: relative; line-height: 0; box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 12px 32px rgb(0 0 0 / .14); touch-action: none; cursor: grab; max-width: 100%; }
.frame.checker { background: repeating-conic-gradient(#ccd 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.frame.black { background: #000; }
.frame.dragging { cursor: grabbing; }
.frame canvas { display: block; max-width: 100%; height: auto; }
.frame .overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hint { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); justify-content: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 6px;
  background: repeating-linear-gradient(45deg, var(--zone) 0 2px, transparent 2px 5px); border: 1px solid var(--zone); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border-top: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); padding-top: 14px; }
.out { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { font: inherit; font-weight: 600; font-size: 15px; padding: 11px 18px; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.size { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.toast { font-size: 13.5px; color: var(--muted); min-height: 1.4em; margin: 0; }
.toast.good { color: var(--ok); }

/* griglia */
.tilesbar { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tilesbar h3 { font-family: var(--f-display); font-weight: 700; font-size: 17px; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.tile { font: inherit; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; text-align: left; }
.tile:hover { border-color: var(--accent); }
.tile canvas { width: 100%; height: auto; display: block; }
.tile span { font-size: 12px; padding: 4px 7px; display: flex; justify-content: space-between; gap: 4px; }
.tile b { font-family: var(--f-mono); font-weight: 600; color: var(--accent); }
.tile em { font-style: normal; color: var(--muted); }

/* video */
.deck { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.transport { display: flex; align-items: center; gap: 12px; }
.play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; }
.tc { font-family: var(--f-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trim { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 13.5px; }
.trim .val { min-width: 52px; }
.outlen { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.outlen b { font-family: var(--f-mono); color: var(--ink); font-weight: 600; }
.outlen .warn { color: var(--warn); font-weight: 600; }
.progress { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 4px; }
.pbar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.pbar span { display: block; height: 100%; width: 0; background: var(--accent); }

/* tool di testo */
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .sheet { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { font-family: var(--f-display); font-weight: 700; font-size: 22px; margin: 0; letter-spacing: -0.01em; }
textarea, input[type="text"], input[type="number"] { font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); color: var(--ink); }
textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
textarea:focus, input[type="text"]:focus, input[type="number"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-family: var(--f-mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.limits { display: flex; flex-direction: column; gap: 10px; }
.lim { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; }
.lim .nm { font-size: 14px; font-weight: 500; }
.lim .num { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lim .num.over { color: var(--bad); font-weight: 600; }
.lim .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.lim .bar span { display: block; height: 100%; background: var(--ok); }
.lim .bar span.mid { background: var(--warn); }
.lim .bar span.over { background: var(--bad); }
.cut { border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 14px; background: var(--bg); overflow-wrap: anywhere; white-space: pre-wrap; }
.cut .more { color: var(--muted); }
.fonts { display: flex; flex-direction: column; gap: 6px; }
.fontrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 8px 12px; }
.fontrow .out { font-size: 18px; overflow-wrap: anywhere; min-width: 0; display: block; }
.fontrow small { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.copy { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; }
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy.done, .btn.done { border-color: var(--ok); color: var(--ok); }
.btn.done { background: transparent; border: 1px solid var(--ok); }
.phone { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 160px; }
.phone b { font-weight: 600; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .fields { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13.5px; font-weight: 500; }
.field label small { color: var(--muted); font-weight: 400; }
.field input { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.big { font-family: var(--f-display); font-weight: 800; font-size: 56px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.verdict { display: inline-block; font-weight: 600; font-size: 14px; padding: 4px 10px; border-radius: 999px; align-self: start; }
.scale { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--bad) 0 25%, var(--warn) 25% 50%, var(--ok) 50% 75%, var(--accent) 75%); margin-top: 8px; }
.scale i { position: absolute; top: -5px; width: 4px; height: 20px; border-radius: 2px; background: var(--ink); transform: translateX(-2px); }
.ticks { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.ticks span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.ticks span:first-child { justify-content: flex-start; }
.ticks span:last-child { justify-content: flex-end; }
.breakdown { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 14px; }
.breakdown span:nth-child(2n) { font-family: var(--f-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- guida sotto il tool ---------- */
.guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 32px; padding-block: 48px 8px; }
@media (max-width: 860px) { .guide { grid-template-columns: minmax(0, 1fr); } }
.guide h2 { font-family: var(--f-display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; margin: 0 0 12px; text-wrap: balance; }
.guide h3 { font-family: var(--f-display); font-weight: 700; font-size: 18px; margin: 28px 0 8px; }
.guide p, .guide li { max-width: 65ch; }
.guide ol { padding-left: 1.3em; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.guide details { border-top: 1px solid var(--line); padding-block: 12px; max-width: 65ch; }
.guide details:last-of-type { border-bottom: 1px solid var(--line); }
.guide summary { font-weight: 600; cursor: pointer; }
.guide details p { margin: 8px 0 0; color: var(--muted); }
.aside h2 { font-size: 18px; }
.others { display: flex; flex-direction: column; gap: 6px; }
.others a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 500; font-size: 14.5px; }
.others a:hover { border-color: var(--accent); color: var(--accent); }
.others a span { color: var(--muted); font-size: 13px; font-weight: 400; }

/* ---------- home ---------- */
.hero { padding-block: 56px 36px; display: grid; gap: 18px; }
.hero h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(36px, 6vw, 64px); line-height: 1; letter-spacing: -0.03em; margin: 0; max-width: 16ch; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; font-size: 17px; color: var(--muted); max-width: 52ch; }
.promises { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 4px 0 0; list-style: none; font-weight: 600; font-size: 14px; }
.promises li { display: inline-flex; gap: 8px; align-items: center; color: var(--ok); }
.cat { padding-block: 18px; }
.cat h2 { font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tcard { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.tcard:hover { border-color: var(--accent); }
.tcard:hover strong { color: var(--accent); }
.tcard .ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tcard strong { font-family: var(--f-display); font-size: 18px; font-weight: 700; line-height: 1.2; }
.tcard span { color: var(--muted); font-size: 14px; }

/* ---------- pagine di testo (privacy) ---------- */
.prose { padding-block: 40px; max-width: 70ch; }
.prose h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.02em; margin: 0 0 16px; }
.prose h2 { font-family: var(--f-display); font-weight: 700; font-size: 20px; margin: 28px 0 8px; }

/* ---------- piè di pagina ---------- */
.sitefoot { margin-top: 56px; border-top: 1px solid var(--line); padding-block: 24px calc(32px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 13.5px; }
.sitefoot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.sitefoot p { margin: 0; max-width: 60ch; }
.sitefoot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.sitefoot a { color: var(--muted); }

/* ---------- scelta lingua ---------- */
.choose { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.choose .box { display: grid; gap: 16px; justify-items: start; }
.choose .langlist { display: flex; flex-wrap: wrap; gap: 10px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- installa come app ---------- */
.install { font: inherit; font-size: 13.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.install:hover { background: var(--accent-soft); }
.ioshint { border-top: 1px solid var(--line); background: var(--accent-soft); }
.ioshint .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; min-height: 0; flex-wrap: wrap; }
.ioshint p { margin: 0; font-size: 14px; max-width: 70ch; }
@media (display-mode: standalone) { .install, .ioshint { display: none !important; } }

/* ---------- pulizia privacy delle foto ---------- */
.flist { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.fitem { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.fitem:hover { border-color: var(--muted); }
.fitem[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.fitem img { width: 44px; height: 44px; object-fit: cover; border-radius: 5px; background: var(--table); }
.fname { min-width: 0; display: flex; flex-direction: column; }
.fname strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname small { font-size: 12.5px; color: var(--muted); }
.stag { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.chip { font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.chip-high { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.chip-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }

.summary { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.summary strong { font-family: var(--f-display); font-weight: 700; font-size: 20px; line-height: 1.2; text-wrap: balance; }
.summary p { margin: 0; color: var(--muted); font-size: 14px; }
.summary.s-high strong { color: var(--bad); }
.summary.s-mid strong { color: var(--warn); }
.summary.s-ok strong { color: var(--ok); }

.inspect { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.shot { margin: 0; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 200px; }
.shot img { max-height: 280px; width: auto; border-radius: 4px; }
.mapcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.map { width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: 6px; display: block; }
.map .sea { fill: var(--accent-soft); }
.map .land { fill: var(--surface); stroke: var(--line); stroke-width: .08; }
.map .pin { fill: var(--bad); stroke: var(--surface); stroke-width: .18; }
.map .pinring { fill: color-mix(in srgb, var(--bad) 22%, transparent); stroke: var(--bad); stroke-width: .08; }
.coords { font-family: var(--f-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mapcard a { font-weight: 600; font-size: 14px; }

.findings { display: flex; flex-direction: column; gap: 6px; }
.find { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; }
.sev { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-align: center; padding: 3px 0; border-radius: 999px; margin-top: 1px; }
.sev-high { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.sev-mid { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.sev-low { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.fbody { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fbody strong { font-size: 14.5px; }
.fval { font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; }
.fbody p { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 65ch; }
.fthumb { width: 120px; height: auto; border-radius: 4px; border: 1px solid var(--line); margin-top: 4px; }
.verify { flex: 1; min-width: 200px; }
.verify.good { color: var(--ok); font-weight: 600; }
.verify.bad { color: var(--bad); font-weight: 600; }

/* ---------- sottotitoli automatici ---------- */
select { font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--bg); color: var(--ink); }
#go { align-self: stretch; justify-content: center; }
.stylepick button { padding: 9px 4px; }
.stylepick b { font-size: 13.5px; }
.sp-pop { font-family: var(--f-display); font-weight: 800; }
.sp-hl { font-family: var(--f-display); font-weight: 800; }
.sp-box { font-weight: 600; }
.sp-min { font-weight: 500; }
.subsgrid { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .subsgrid { grid-template-columns: minmax(0, 1fr); } }
.subsview { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.subsview .stage { min-height: 0; padding: 0; }
.subsview .frame { cursor: default; }
.editor { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.editor h3 { font-family: var(--f-display); font-weight: 700; font-size: 17px; margin: 0; }
.empty { margin: 8px 0; padding: 18px; border: 1.5px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 14px; text-align: center; }
.lines { display: flex; flex-direction: column; gap: 6px; max-height: 470px; overflow-y: auto; padding-right: 2px; }
.line { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: start; border-radius: 8px; padding: 4px; }
.line.on { background: var(--accent-soft); }
.ltime { font: inherit; font-family: var(--f-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 7px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--accent); cursor: pointer; }
.ltime:hover { border-color: var(--accent); }
.ltext { min-height: 0; font-size: 14.5px; line-height: 1.45; resize: vertical; padding: 7px 10px; }
.tbox { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stylepick b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- rimozione dello sfondo ---------- */
.swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.swatch { aspect-ratio: 1; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.fmtseg button { padding: 8px 2px; font-size: 13px; }
.rmframe { cursor: default; }
.rmframe.painting { cursor: none; }
.rmframe.busy canvas { opacity: .55; }
.ring { position: absolute; left: 0; top: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0,0,0,.6); pointer-events: none; }
.peek { align-self: center; touch-action: none; user-select: none; -webkit-user-select: none; }
#stage { min-height: 0; }
#bgmode { grid-auto-columns: minmax(max-content, 1fr); }
#bgmode button { font-size: 12.5px; padding: 8px 4px; }

/* ---------- editor foto ---------- */
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.filter { font: inherit; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; }
.filter canvas { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.filter span { font-size: 11.5px; font-weight: 500; padding: 4px 2px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.filter[aria-pressed="true"] span { color: var(--accent); font-weight: 600; }
.grouphead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.small { font-size: 13px; padding: 6px 11px; }
.sliders { display: flex; flex-direction: column; gap: 4px; }
.row.adj { display: grid; grid-template-columns: 92px minmax(0, 1fr) 40px; gap: 10px; }
.row.adj label { font-size: 13.5px; }
.row.adj input { min-width: 0; }
.tools3 { gap: 8px; }

/* ---------- taglia e unisci video ---------- */
.mtgrid { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .mtgrid { grid-template-columns: minmax(0, 1fr); } }
.strip { position: relative; height: 46px; border-radius: 8px; background: var(--track); overflow: hidden; }
.blk { position: absolute; top: 0; bottom: 0; border: 0; border-right: 2px solid var(--surface); color: #fff; font: inherit; font-family: var(--f-mono); font-size: 12px; font-weight: 600; background-size: cover; background-position: center; cursor: pointer; padding: 0; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.playhead { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--ink); box-shadow: 0 0 0 1px var(--surface); pointer-events: none; z-index: 2; }
.warnline { color: var(--warn); font-weight: 600; }
.clips { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; padding-right: 2px; }
.clip { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.clip.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chead { display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; cursor: pointer; }
.cnum { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.cthumb { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; background: var(--track); }
.cname { min-width: 0; display: flex; flex-direction: column; }
.cname strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cname small { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.ctools { display: flex; gap: 4px; }
.ibtn { font: inherit; width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.ibtn:disabled { opacity: .35; cursor: default; }
.ibtn:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.cbody { display: none; flex-direction: column; gap: 6px; padding: 4px 12px 12px; border-top: 1px solid var(--line); }
.clip.on .cbody { display: flex; }
.row.crow { display: grid; grid-template-columns: 82px minmax(0, 1fr) 52px; gap: 10px; }
.row.crow label, .row.crow .lbl { font-size: 13.5px; }
.row.crow input { min-width: 0; }
.row.crow .seg { grid-column: 2 / 4; }
.speeds button { font-family: var(--f-mono); font-size: 12.5px; }
.gomsg { margin: 0; font-size: 13.5px; color: var(--muted); }
.gomsg:empty { display: none; }
.gomsg.bad { color: var(--bad); font-weight: 600; }
.gomsg small { display: block; font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }

/* sottotitoli: testo della canzone e tasto "tocca a tempo" */
.lyricsbox { display: grid; gap: 8px; }
.lyricsbox textarea { min-height: 150px; font-size: 14.5px; }
/* sincronizzazione a mano */
.syncbar { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.syncbar[hidden] { display: none; }
.tapbtn { width: 100%; min-height: 92px; font-size: 15px; white-space: normal; line-height: 1.3; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; }
.tapbtn b { font-size: 17px; }
.tapbtn small { font-weight: 500; opacity: .75; font-size: 12.5px; }
.tapbtn .tapn { font-family: var(--f-mono); font-size: 11px; opacity: .8; }
.tapbtn .taphow { font-size: 11px; font-weight: 500; opacity: .7; }
.tapbtn.down { transform: scale(0.98); filter: brightness(1.18); box-shadow: inset 0 0 0 3px rgb(255 255 255 / .55); }
.syncrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.syncrow .btn { padding: 8px 12px; font-size: 14px; }
.syncrow .btn:disabled { opacity: .45; }
/* linea del tempo */
.tline { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.tline[hidden] { display: none; }
.tline canvas { width: 100%; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: grab; }
.tline .note { margin: 0; font-size: 12px; }
.docked .tline .note, .docked .taphow { display: none; }
/* ritocchi della riga selezionata */
.lctl { display: none; grid-column: 2; gap: 6px; flex-wrap: wrap; }
.line.sel { background: var(--accent-soft); }
.line.sel .lctl { display: flex; }
.lctl button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }

/* anteprima agganciata in cima sul telefono (vedi dockPreview in common.js) */
.dockwrap { position: relative; min-width: 0; }
.dockhide { display: none; }
.docked { position: fixed !important; top: 0; left: 0; right: 0; z-index: 40; margin: 0; padding: 8px 12px 10px;
  background: var(--table); border-bottom: 1px solid var(--line); box-shadow: 0 8px 22px rgb(0 0 0 / .22);
  display: flex; flex-direction: column; align-items: center; gap: 8px; }
.docked.stage { min-height: 0; }
.docked .stage { min-height: 0; padding: 0; }
.docked .frame { width: var(--dockw) !important; }
.docked .transport, .docked .syncbar, .docked .tline { width: 100%; max-width: 520px; }
.docked .tapbtn { min-height: 76px; }
.docked .dockhide { display: grid; place-items: center; position: absolute; top: 8px; right: 10px; width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
html.has-dock { scroll-padding-top: 42vh; }

.ver { font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-left: 6px; }
.ltext { overflow: hidden; }

/* video finito, pronto da scaricare o condividere */
.result { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.result[hidden] { display: none; }
.result .rhead { margin: 0; font-weight: 700; font-family: var(--f-display); font-size: 17px; }
.result video { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; }
.result .note { margin: 0; overflow-wrap: anywhere; }
.result .row { display: flex; flex-wrap: wrap; gap: 10px; }
.docked.tapping .tline { display: none; }
/* la linea del tempo e i comandi di sincronizzazione si adattano alla larghezza del video, senza allargarla */
.subsview > .tline, .subsview > .syncbar { width: 0; min-width: 100%; }
.frame.picking, .frame.picking canvas { cursor: crosshair; }
.bench > .table.stick { position: sticky; top: 12px; }
#model button { white-space: normal; line-height: 1.2; }

/* comprimi e converti: elenco delle foto */
.czlist { display: flex; flex-direction: column; gap: 6px; max-height: 58vh; overflow-y: auto; }
.czrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.czrow img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--table); }
.czmid { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.czmid strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.czmid small { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.czrow.done small { color: var(--ok); }
.czrow.err small, .czrow.toobig small { color: var(--bad); }
.czrow.work { border-color: var(--accent); }
.czacts { display: flex; gap: 6px; align-items: center; }
.czx { font: inherit; font-size: 20px; line-height: 1; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.czx:hover { color: var(--bad); border-color: var(--bad); }
#czqrow.off { opacity: .45; }
.czrow.done.bigger small { color: var(--muted); }
@media (max-width: 860px) { .bench.panelfirst .table { order: 0; } }

/* fotogrammi e copertine */
.fstep { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
.fstep .btn { padding: 8px 6px; font-size: 13.5px; justify-content: center; }
.frauto { align-items: center; }
.frauto select { width: auto; }
.shotsbox { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.shotsbox[hidden] { display: none; }
.shotsbox h3 { margin: 0; font-size: 16px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.shotitem { position: relative; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.shotgo { padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; line-height: 0; }
.shotgo img { width: 100%; height: 76px; object-fit: contain; }
.shotitem figcaption { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.shotitem .czx { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; font-size: 16px; background: var(--surface); }
.docked .fstep { max-width: 520px; }

/* percorso (breadcrumb) */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); margin: 18px 0 -6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }

/* pulsante del tema (automatico / chiaro / scuro) */
.themebtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; flex: none; }
.themebtn:hover { border-color: var(--muted); }
.themebtn svg { display: none; }
.themebtn[data-mode="auto"] .t-auto, .themebtn:not([data-mode]) .t-auto, .themebtn[data-mode="light"] .t-light, .themebtn[data-mode="dark"] .t-dark { display: block; }

/* affiliazioni e spazio pubblicitario (visibili solo se configurati in config.py) */
.promo, .adslot { margin: 28px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.promo h2 { margin: 0 0 8px; font-size: 18px; }
.promo ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.adslot { display: grid; gap: 6px; justify-items: center; min-height: 120px; }
