/* Identità Nozio (palette di nozio.biz): blu notte, quasi nero, avorio, oro, giallo.
   Testi in Livvic, titoli e pulsanti in Figtree (file in /static/fonts, licenza SIL OFL). */
@font-face { font-family: "Figtree"; src: url(fonts/figtree-latin.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Livvic"; src: url(fonts/livvic-400-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Livvic"; src: url(fonts/livvic-500-latin.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Livvic"; src: url(fonts/livvic-600-latin.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
:root {
  --navy: #001d3d; --ink: #000815; --cream: #f9f8f2; --gold: #ffb600; --yellow: #ffd60a;
  --bg: var(--cream); --card: #fff; --text: var(--ink); --muted: #5b6372; --line: #e6e3d6; --field: #cfd3da;
  --accent: var(--navy); --accent-text: #fff; --sel-bg: #fff4cc;   /* selezioni attive di Aspetto: giallo chiaro */
  --green: #1e7a43; --green-bg: #e3f3e8; --red: #b0322a; --red-bg: #fbe7e5;
  --amber: #8a5a00; --amber-bg: #fff3d1; --blue: #1e6d96; --blue-bg: #e2f0f7; --grey-bg: #efede4;
  --head: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Livvic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* anche per pulsanti e riquadri che hanno un display proprio */
body { margin: 0; font: 15px/1.55 var(--body); background: var(--bg); color: var(--text); }
a { color: var(--navy); text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #003a78; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3, legend, .brand, th, button, .button { font-family: var(--head); }
header.top { display: flex; gap: 28px; align-items: center; padding: 10px 28px; background: var(--navy); color: var(--cream); flex-wrap: wrap; }
header.top .brand { display: flex; align-items: center; text-decoration: none; }
header.top .brand img { height: 38px; width: auto; display: block; }
header.top nav { display: flex; gap: 22px; flex: 1; }
header.top nav a, header.top .me a { color: var(--cream); text-decoration: none; font-family: var(--head); font-weight: 600; font-size: .95rem; padding: 4px 0; border-bottom: 2px solid transparent; }
header.top nav a:hover, header.top .me a:hover { border-bottom-color: var(--gold); color: #fff; }
header.top .me { display: flex; gap: 16px; align-items: center; }
header.top button.link { color: var(--cream); text-decoration-color: var(--gold); }
main { max-width: 1100px; margin: 0 auto; padding: 28px 16px 64px; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.01em; color: var(--navy); margin: 0 0 8px; }
h2 { font-size: 1.2rem; font-weight: 700; color: var(--navy); margin: 32px 0 10px; }
.muted, small.muted { color: var(--muted); }
.back-link { margin: 0 0 6px; font-size: .88rem; }
.back-link a { color: var(--muted); text-decoration: none; }
.narrow { max-width: 420px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.box.err { background: var(--red-bg); border-color: #efc4bf; }
.box.ok { background: var(--green-bg); border-color: #bfe3cb; }
.err { color: var(--red); }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list th { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); background: #f3f1e7; }
table.list tbody tr:hover td { background: #fcfbf6; }
table.list tr.current td { background: var(--green-bg); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font: 600 .78rem/1.5 var(--head); background: var(--grey-bg); color: var(--muted); vertical-align: middle; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
form.inline { display: inline; }
form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), select, textarea {
  font: inherit; padding: 9px 12px; border: 1.5px solid var(--field); border-radius: 10px; background: #fff; font-weight: 400; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid rgba(255, 182, 0, .45); outline-offset: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--navy); width: 17px; height: 17px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
legend { font-weight: 700; color: var(--navy); padding: 0 6px; }
/* pulsanti a pillola */
button, .button { font-size: .95rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 8px 20px;
  border-radius: 999px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); cursor: pointer; text-decoration: none;
  line-height: 1.3; transition: background .15s, border-color .15s, color .15s; }
/* passaggio del mouse: fondo appena tinto e testo che resta blu (prima fondo blu pieno e testo bianco: a metà
   transizione testo e fondo avevano lo stesso colore e la scritta spariva per un attimo, un «lampo») */
button:hover, .button:hover { background: #e8edf4; color: var(--navy); }
button, .button { justify-content: center; }
/* nei form in colonna i pulsanti restano larghi quanto il testo */
form.stack > button, form.stack > .button, .form-actions { align-self: flex-start; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
button.primary, .button.primary { background: var(--gold); border-color: var(--gold); color: var(--navy); }
button.primary:hover, .button.primary:hover { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
button[disabled], button[disabled]:hover { opacity: .45; cursor: not-allowed; background: #fff; color: var(--navy); }
button.small, .button.small { padding: 4px 14px; font-size: .85rem; }
button.link, button.link:hover { border: 0; background: none; color: var(--navy); padding: 0; text-decoration: underline;
  text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; font-family: var(--body); font-weight: 400; border-radius: 0; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
pre { white-space: pre-wrap; word-break: break-word; }
pre.files { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .85rem; max-height: 320px; overflow: auto; }
pre.log { background: var(--ink); color: #eceadf; border-radius: var(--radius); padding: 12px 16px; min-height: 200px; max-height: 60vh; overflow: auto; font-size: .85rem; }
code { font-size: .85rem; }
@media (max-width: 700px) { table.list { display: block; overflow-x: auto; } header.top nav { order: 3; flex-basis: 100%; } }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.indent { margin: 4px 0 8px 26px; display: flex; flex-direction: column; gap: 8px; }
.box.warn { background: var(--amber-bg); border-color: #f0d9a8; }
.box ul { margin: 6px 0 0; padding-left: 20px; }
ul.report { font-size: .85rem; max-height: 260px; overflow: auto; }
form.stack.wide { max-width: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
input.todo { background: var(--amber-bg); }
label.invalid input, label.invalid textarea { border-color: var(--red); background: var(--red-bg); }
button.danger { background: var(--red); border-color: var(--red); color: #fff; }
button.danger:hover { background: #8c241e; border-color: #8c241e; }
.button.danger-link { color: var(--red); border-color: var(--red); }
.button.danger-link:hover { background: var(--red); color: #fff; }
details.discard { margin: 8px 0; }
details.discard summary { cursor: pointer; color: var(--red); }
/* editor dei contenuti */
fieldset.cgroup { display: flex; flex-direction: column; gap: 14px; }
fieldset.cgroup legend { font-weight: 700; }
.cfield { display: flex; flex-direction: column; gap: 6px; }
.clabel { font-weight: 600; font-size: .9rem; }
.clangs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.clangs label { font-weight: 400; }
.clangs .lang { font-size: .75rem; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.clangs textarea { resize: vertical; min-height: 2.4em; }
label.check.small { font-size: .85rem; font-weight: 400; }
.cphoto { display: flex; gap: 12px; align-items: center; }
.cphoto img { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; background: var(--grey-bg); }
.cphoto.invalid { color: var(--red); }
.savebar { position: sticky; bottom: 0; z-index: 10; background: var(--bg); padding: 10px 0; display: flex; gap: 16px; align-items: center; border-top: 1px solid var(--line); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pitem { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; color: inherit; font-weight: 400; cursor: pointer; }
.pitem img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 4px; background: var(--grey-bg); }
.pitem input[type=radio] { align-self: flex-start; }
.pitem:has(input:checked), .pitem.current { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold); }
.cats a[aria-current] { font-weight: 700; }
.photo-detail { display: grid; grid-template-columns: minmax(200px, 360px) 1fr; gap: 20px; align-items: start; }
.photo-detail img { width: 100%; border-radius: 6px; }
@media (max-width: 700px) { .photo-detail { grid-template-columns: 1fr; } }

/* accesso */
/* intestazione del sito: azioni a destra, schede sotto */
.thead { margin-bottom: 22px; }
.thead-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.thead h1 { margin: 0; }
.thead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.button.ghost { border-color: transparent; }
.button.ghost:hover { border-color: var(--navy); }
.tabs { display: flex; gap: 4px; margin-top: 14px; overflow-x: auto; overflow-y: hidden;
  background: linear-gradient(var(--line), var(--line)) left bottom / 100% 1px no-repeat; }   /* linea da 1px: il bordo oro della scheda attiva ci passa sopra */
.tabs a { padding: 9px 16px; font-family: var(--head); font-weight: 600; font-size: .95rem; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tabs a:hover { color: var(--navy); background: #f3f1e7; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--gold); background: var(--card); }
h2.page-title { margin: 0 0 8px; font-size: 1.35rem; }
.titlebar h2.page-title { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 8px; }
.facts > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.facts span { font: 700 .72rem/1.4 var(--head); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* chat AI: pagina a tutto schermo, chat a sinistra e anteprima sul resto */
/* pagine di un sito: larghezza piena; Chat AI e Aspetto (app) anche altezza piena, con l'anteprima accanto */
body.wide main { max-width: none; width: 100%; padding: 18px 28px 64px; }
body.app { height: 100vh; display: flex; flex-direction: column; }
body.app header.top { flex: 0 0 auto; }
body.app main { padding: 18px 28px 18px; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chat-layout { flex: 1 1 auto; min-height: 520px; display: grid; grid-template-columns: minmax(360px, 480px) minmax(0, 1fr); gap: 20px; }
.chat-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.chat-col h1 { font-size: 1.4rem; margin: 0; }
.chat-log { flex: 1 1 auto; min-height: 160px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 9px 13px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; max-width: 92%; font-size: .95rem; }
.msg.user { align-self: flex-end; background: var(--navy); color: var(--cream); }
.msg.agent { align-self: flex-start; background: #f3f1e7; }
.msg.tool { align-self: flex-start; background: none; color: var(--muted); font-size: .82rem; padding: 0 12px; }
.msg.tool::before { content: "• "; color: var(--gold); }
.msg.blocked { align-self: flex-start; background: var(--amber-bg); color: var(--amber); font-size: .85rem; }
.msg.error { align-self: flex-start; background: var(--red-bg); color: var(--red); font-size: .88rem; }
.msg.done { align-self: center; background: none; color: var(--muted); font-size: .78rem; font-family: var(--head); }
.msg.hint { align-self: stretch; max-width: none; background: none; color: var(--muted); border: 1px dashed var(--line);  white-space: normal; }
.chat-form { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; }
.chat-form textarea { width: 100%; min-height: 120px; resize: vertical; font-size: 1rem; line-height: 1.5; padding: 12px 14px; }
.chat-actions { display: flex; gap: 12px; align-items: center; }
.chat-actions .primary { padding: 10px 28px; }
.chat-actions .attach-btn { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; font-weight: 500; color: inherit; cursor: pointer; padding: 8px 14px; border: 1px solid var(--line, #ccc);
  border-radius: 8px; font-size: .92rem; background: transparent; }
.attach-btn:hover { background: rgba(0,0,0,.04); }
.attach-btn.disabled { opacity: .5; pointer-events: none; }
.attach-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.attach-btn:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.chat-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chat-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 10px; border-radius: 16px;
  background: rgba(0,0,0,.06); font-size: .88rem; position: relative; overflow: hidden; }
.chat-file .nm { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file .st { color: var(--muted, #666); font-size: .8rem; }
.chat-file.err { background: #fbe3e3; color: #8a1c1c; }
.chat-file .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--navy); transition: width .2s; }
.chat-file button { border: 0; background: none; padding: 0 4px; font-size: 1.1rem; line-height: 1; cursor: pointer; color: inherit; }
.chat-form.drop { outline: 2px dashed var(--navy); outline-offset: 4px; border-radius: 8px; }
.msg-files { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.msg-file { display: inline-block; padding: 1px 8px; border-radius: 10px; background: rgba(255,255,255,.15); font-size: .85rem; }
#chat-side { flex: 0 0 auto; max-height: 30vh; overflow-y: auto; }
#chat-side pre.files { max-height: 110px; }
details.convs summary { cursor: pointer; color: var(--muted); }
details.convs ul { margin: 6px 0; padding-left: 18px; max-height: 160px; overflow-y: auto; }
.preview-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.pv-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pv-devices { display: inline-flex; gap: 4px; }
.pv-frame { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; background: #e9e6da; border-radius: var(--radius); padding: 0; }
.pv-frame iframe { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: width .2s; }
.pv-frame.tablet, .pv-frame.mobile { padding: 12px 0; }
.pv-frame.tablet iframe { width: 820px; max-width: 100%; }
.pv-frame.mobile iframe { width: 390px; max-width: 100%; }
@media (max-width: 1000px) {
  body.app { height: auto; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-log { height: 50vh; }
  .pv-frame { height: 75vh; }
}
.tr-btn { align-self: flex-start; }
textarea.translated { background: var(--blue-bg); }
/* catalogo sezioni */
.cat-index { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.cat-index a { padding: 5px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font: 600 .9rem var(--head); color: var(--navy); }
.cat-index a:hover { border-color: var(--gold); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.cat-card img { width: 100%; aspect-ratio: 16/9; object-fit: contain; object-position: center top; background: #f3f1e7; border-bottom: 1px solid var(--line); }
.cat-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.cat-body h3 { margin: 0; font-size: 1.05rem; color: var(--navy); }
.cat-body h3 code { font-size: .75rem; color: var(--muted); font-weight: 400; margin-left: 4px; }
.cat-body p { margin: 2px 0; font-size: .92rem; }
.cat-body details summary { cursor: pointer; font: 600 .88rem var(--head); color: var(--navy); margin-top: 6px; }
table.fields td { font-size: .85rem; padding: 6px 10px; }
/* scheda Aspetto */
.look-layout { flex: 1 1 auto; min-height: 520px; display: grid; grid-template-columns: minmax(380px, 540px) minmax(0, 1fr); gap: 20px; }
.look-col { overflow-y: auto; min-height: 0; padding-right: 6px; }
.look-col fieldset { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.font-sample { margin: -4px 0 6px; padding: 10px 14px; background: #f3f1e7; border-radius: 10px; font-size: 1.25rem; line-height: 1.3; }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.colors .color { display: flex; flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.colors .color input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1.5px solid var(--field); border-radius: 8px; background: #fff; flex: none; cursor: pointer; }
.colors .color > span { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.c-state { font-size: .75rem; }
.c-state .c-follow { color: var(--muted); }
.c-state .c-custom { color: var(--navy); font-weight: 600; }
.color[data-follow="1"] .c-custom, .color[data-follow="0"] .c-follow { display: none; }
.color[data-follow="1"] .c-reset { visibility: hidden; }
.color.invalid input[type=color] { border-color: var(--red); }
.palettes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.palettes > p { flex-basis: 100%; margin: 0 0 2px; }
.palette { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border: 1.5px solid var(--field); border-radius: 10px; background: #fff; color: inherit; cursor: pointer; font-weight: 400; }
.palette:hover { border-color: var(--gold); }
.palette.on { border-color: var(--gold); background: var(--sel-bg); box-shadow: 0 0 0 1px var(--gold); }
.pal-sw { display: inline-flex; border-radius: 5px; overflow: hidden; border: 1px solid rgba(0, 25, 60, .2); }
.pal-sw i { width: 14px; height: 22px; display: block; }
.choice-row { display: flex; flex-direction: column; gap: 6px; }
.choice-label { font-weight: 600; font-size: .9rem; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
label.pill { flex-direction: row; font-weight: 400; position: relative; }
/* il pulsante nascosto resta dentro la sua etichetta: altrimenti, ricevendo il fuoco, fa scorrere la pagina altrove */
label.pill input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
label.pill span { padding: 5px 14px; border: 1.5px solid var(--field); border-radius: 999px; cursor: pointer; font-size: .9rem; background: #fff; }
label.pill input:checked + span { border-color: var(--gold); background: var(--sel-bg); color: var(--ink); box-shadow: 0 0 0 1px var(--gold); }
label.pill input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }
label.pill small { opacity: .7; }
label.slide input { max-width: 120px; }
@media (max-width: 1000px) { .look-layout { grid-template-columns: 1fr; } .look-col { overflow: visible; } }
.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label.style-card { flex-direction: column; gap: 6px; padding: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 400; position: relative; }
label.style-card input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
label.style-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; object-position: top; border-radius: 8px; background: #f3f1e7; }
label.style-card span { font-size: .88rem; line-height: 1.35; }
/* Aspetto: campione di ogni stile, una mini-pagina con le sue scelte (font, colori, pulsanti, foto, ombre, etichette)
   e il suo tratto di impaginazione (spec-st-<stile>): sovrapposizioni, foto al bordo, capolettera, schede morbide */
label.style-card .spec { --sp-pad: 10px; display: flex; flex-direction: column; gap: 8px; padding: var(--sp-pad); border-radius: 8px; overflow: hidden;
  background: var(--sp-paper, #faf7f2); color: var(--sp-text, #1c1814); border: 1px solid rgba(0, 25, 60, .12); line-height: 1.2; }
label.style-card .spec span, label.style-card .spec small { font-size: inherit; line-height: inherit; }
.spec .sp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.spec i { display: block; font-style: normal; }
.spec .sp-img, .spec .sp-band i { min-height: 84px; background:
  radial-gradient(circle at 72% 28%, var(--sp-gold-light, #d9c08b) 0 9%, transparent 10%),
  linear-gradient(170deg, var(--sp-accent-2, #ead9c6) 0 38%, var(--sp-accent-1, #5d6b59) 39% 72%, var(--sp-dark, #16120f) 73%); }
.spec .sp-box { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; position: relative; }
.spec .sp-kick { font-size: .52rem; letter-spacing: .18em; text-transform: uppercase; color: var(--sp-gold, #a8843f); }
.spec .sp-title { font-size: 1.2rem; font-weight: 500; line-height: 1.05; }
.spec-head-light .sp-title { font-weight: 300; }
.spec-head-bold .sp-title { font-weight: 700; }
.spec .sp-text { font-size: .66rem; opacity: .8; }
.spec .sp-cap { font-weight: inherit; }
.spec .sp-cta { font-style: normal; font-size: .56rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; margin-top: 3px;
  padding: 5px 10px; background: var(--sp-gold, #a8843f); color: #fff; }
.spec-labels-normal .sp-cta, .spec-labels-normal .sp-kick { text-transform: none; letter-spacing: .03em; }
.spec-btn-rounded .sp-cta { border-radius: 7px; }
.spec-btn-pill .sp-cta { border-radius: 999px; }
.spec-photo-rounded .sp-img, .spec-photo-rounded .sp-band i { border-radius: 10px; }
.spec-shadow-soft .sp-img { box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .45); }
.spec .sp-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 calc(-1 * var(--sp-pad)) calc(-1 * var(--sp-pad));
  padding: 10px var(--sp-pad); background: var(--sp-dark, #16120f); }
.spec .sp-band i { min-height: 30px; }
/* Morbido: testo in una scheda bianca arrotondata con ombra, occhiello a pillola */
.spec-st-morbido .sp-box { background: #fff; border-radius: 12px; padding: 8px; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .35); }
.spec-st-morbido .sp-kick { background: color-mix(in srgb, var(--sp-gold, #a8843f) 15%, transparent); border-radius: 999px; padding: 2px 7px; letter-spacing: .06em; }
.spec-st-morbido .sp-band { background: var(--sp-soft, #f2ece2); }
/* Magazine: filetto sopra, titolo grande, capolettera, molto bianco, fascia chiara */
.spec-st-magazine { --sp-pad: 14px !important; }
.spec-st-magazine .sp-split { border-top: 1px solid currentColor; padding-top: 10px; grid-template-columns: 4fr 5fr; }
.spec-st-magazine .sp-title { font-size: 1.32rem; letter-spacing: -.01em; }
.spec-st-magazine .sp-kick { color: inherit; opacity: .7; }
.spec-st-magazine .sp-cap { float: left; font-size: 2.3em; line-height: .8; margin: .05em .08em 0 0; color: var(--sp-gold-dark, #8a6a2e); }
.spec-st-magazine .sp-band { background: none; border-top: 1px solid currentColor; margin-top: 2px; padding-top: 10px; }
/* Dinamico: il testo scavalca la foto, fascia scura inclinata, foto sfalsate */
.spec-st-dinamico .sp-split { grid-template-columns: 7fr 5fr; gap: 0; }
.spec-st-dinamico .sp-img { min-height: 96px; }
.spec-st-dinamico .sp-box { margin-left: -38%; background: var(--sp-paper, #faf7f2); padding: 8px; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .5); z-index: 1; }
.spec-st-dinamico .sp-kick::before { content: ""; display: inline-block; width: 12px; height: 1.5px; background: currentColor; vertical-align: middle; margin: -2px 5px 0 0; }
.spec-st-dinamico .sp-title { letter-spacing: -.03em; }
.spec-st-dinamico .sp-band { clip-path: polygon(0 14px, 100% 0, 100% 100%, 0 100%); padding-top: 18px; margin-top: -8px;
  background: linear-gradient(115deg, var(--sp-dark, #16120f) 55%, color-mix(in srgb, var(--sp-gold, #a8843f) 60%, var(--sp-dark, #16120f))); }
.spec-st-dinamico .sp-band i:nth-child(2) { transform: translateY(8px); }
/* Panorama: foto grande che parte dal bordo, foto della fascia attaccate e a tutta larghezza */
.spec-st-panorama .sp-split { grid-template-columns: 3fr 2fr; margin: calc(-1 * var(--sp-pad)) 0 0 calc(-1 * var(--sp-pad)); gap: 10px; }
.spec-st-panorama .sp-img { min-height: 112px; border-radius: 0 !important; box-shadow: none !important; }
.spec-st-panorama .sp-split { border-top: 0; }
.spec-st-panorama .sp-box { border-top: 1px solid currentColor; padding-top: 5px; }
.spec-st-panorama .sp-kick { color: inherit; opacity: .7; }
.spec-st-panorama .sp-band { gap: 2px; padding: 0; background: none; }
.spec-st-panorama .sp-band i { min-height: 40px; border-radius: 0 !important; }
label.style-card:has(input:checked) { border-color: var(--gold); background: var(--sel-bg); box-shadow: 0 0 0 2px var(--gold); }
label.style-card:has(input:focus-visible) { outline: 3px solid var(--navy); outline-offset: 2px; }
.small-note { font-size: .88rem; margin: 0; }
/* cronologia */
.point-new { margin: 6px 0 18px; max-width: 720px; }
.point-new .row { display: flex; gap: 8px; margin-top: 4px; }
.point-new input { flex: 1; }
.point-view { margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.point-view .pv-frame { height: 70vh; }
.point-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.inline-details summary { cursor: pointer; display: inline-block; padding: 4px 12px; border: 1.5px solid var(--navy); border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--navy); }
.inline-details[open] { flex-basis: 100%; }
.inline-details[open] > :not(summary) { margin-top: 8px; padding: 10px 12px; background: #f3f1e7; border-radius: 10px; }
.point-diff { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow-y: auto; font-size: .88rem; }
.point-diff li { padding: 2px 0; }
button.danger-link { color: var(--red); border-color: var(--red); }
button.danger-link:hover { background: var(--red); color: #fff; }
.styles.models { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 4px 0 8px; }
/* indirizzi delle pagine */
fieldset.slugs { display: flex; flex-direction: column; gap: 8px; }
label.slug { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 400; }
label.slug .lang { min-width: 2.2em; font-weight: 700; }
/* indirizzo della pagina: la parte fissa (dominio, lingua, pagina madre) fuori dal campo, il campo a larghezza fissa */
.slug-row { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 260px; }
.slug-prefix { color: var(--muted); font: .85rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto;
  direction: rtl; text-align: left; }   /* se non ci sta si accorcia a sinistra (dominio), la fine resta visibile */
.slug-row input { flex: 1 1 160px; min-width: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
label.slug.invalid .slug-row input, .slugs.invalid .slug-row input { border-color: var(--red); }
label.slug small.err { flex-basis: 100%; color: var(--red); }
input.translated { background: #fffbe6; }
.menu-table select { min-width: 220px; }
.menu-table input.order { width: 5em; }
.menu-table tr.sub-row td:first-child { padding-left: 28px; }
/* Contenuti: riquadri in evidenza, pagine ad albero, raccolte */
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin: 18px 0 8px; }
.hub-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .2s; }
.hub-card:hover { border-color: var(--gold); box-shadow: 0 8px 24px rgba(0, 25, 60, .08); }
.hub-title { font: 700 1.2rem var(--head); color: var(--navy); display: flex; gap: 8px; align-items: center; }
.hub-thumbs { display: flex; gap: 6px; min-height: 64px; align-items: center; overflow: hidden; }
.hub-thumbs img { flex: 1 1 0; min-width: 0; max-width: 64px; aspect-ratio: 1; height: auto; object-fit: cover; border-radius: 8px; background: #f3f1e7; }
.hub-nav { display: flex; flex-wrap: wrap; gap: 6px; min-height: 64px; align-content: center; }
.hub-pill { padding: 5px 12px; border-radius: 999px; background: #f3f1e7; font-size: .9rem; }
.hub-text { color: var(--muted); font-size: .92rem; }
.hub.hub-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 1000px) { .hub.hub-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
.hub-head { margin: 26px 0 0; font: 700 1.05rem var(--head); color: var(--navy); }
.hub-thumbs.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; overflow: visible; }
.hub-thumbs.hub-grid img { max-width: none; width: 100%; }
.hub-more { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 8px; background: #f3f1e7;
  font: 600 .9rem var(--head); color: var(--navy); }
.hub-go { font: 600 .92rem var(--head); color: var(--navy); margin-top: auto; }
.pages-tree .indent { display: inline-block; padding-left: calc(var(--d) * 22px); }
.pages-tree code.path { font-size: .82rem; color: var(--muted); }
/* Raccolte (SPEC §75): menu a sinistra, voci con i comandi, voce nuova */
.coll-nav .pn-path { font-family: var(--body); }
.coll-new { margin: 10px 4px 0; }
.coll-new summary { cursor: pointer; padding: 6px 8px; font: 600 .85rem var(--head); color: var(--navy); }
.coll-new ul { padding: 4px 0 0; }
.pages-nav .coll-new li > a { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.pages-nav .coll-new li > a strong { font: 600 .88rem var(--head); }
.pages-nav .coll-new li small { display: block; font-size: .75rem; line-height: 1.3; white-space: normal; }
.coll-desc { flex-basis: 100%; margin: 4px 0 0; }
/* servizi e loghi (SPEC §76): icona nel titolo della voce, finestra dell'elenco */
.coll-ico { flex: none; display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; }
.coll-ico img { max-width: 100%; max-height: 100%; object-fit: contain; }
.presets-dialog .presets-body { max-height: 58vh; overflow: auto; padding-right: 4px; }
.preset-group { border: 0; padding: 0; margin: 0 0 14px; }
.preset-group legend { font: 700 .82rem var(--head); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 0 6px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.preset { display: flex; flex-direction: row; font-weight: 400; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: .9rem; background: #fff; }
.preset:hover { border-color: var(--navy); }
.preset:has(input:checked) { border-color: var(--navy); background: #eef2f7; }
.preset.have { opacity: .55; cursor: default; }
.preset input { margin: 0; }
/* servizi di una camera (SPEC §76 fase 3): elenco a gruppi apribile, icone scelte nel riassunto */
.svcpick { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; }
.svcpick[open] { padding-bottom: 12px; }
.svcpick > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; cursor: pointer; }
.svcpick-now { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.svcpick-now img { width: 20px; height: 20px; }
/* foto delle camere: miniature medie (~177 px), sempre trascinabili */
.coll-item .pg-grid { grid-template-columns: repeat(auto-fill, minmax(177px, 1fr)); gap: 10px; }
.coll-item .pg-del { width: 27px; height: 27px; }
.coll-item .pg-del svg { width: 14px; height: 14px; }
.coll-item .pg-moves button { width: 25px; height: 23px; }
.coll-add-row { display: flex; gap: 8px; align-items: center; max-width: 560px; }
.coll-add-row input { flex: 1; min-width: 0; }
.coll-add.invalid input { border-color: var(--red); }
.coll-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.coll-links a.hub-pill { color: var(--navy); text-decoration: none; }
.coll-links a.hub-pill:hover { background: #ebe7d6; }
.todo-n { color: var(--red); }
/* lingue */
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin: 10px 0 16px; }
.card-row h3 { margin: 0 0 8px; font-size: 1rem; }
.lang-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.lang-chip { padding: 6px 14px; border-radius: 999px; background: #f3f1e7; font-size: .92rem; }
.lang-chip b { color: var(--navy); margin-right: 2px; }
.lang-chip.main { background: var(--navy); color: #fff; }
.lang-chip.main b { color: var(--gold); }
.lang-chip small { opacity: .8; margin-left: 4px; }
.lang-form h3 { margin: 22px 0 10px; font-size: 1.05rem; }
.lang-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.lang-tile { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.lang-tile:has(.lt-check input:checked) { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.lang-tile .lt-check { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 400; cursor: pointer; }
.lang-tile .lt-name { flex: 1; font-size: 1rem; }
.lang-tile .lt-new { display: none; }
.lang-tile:has(.lt-check input:checked) .lt-new { display: inline-block; }
.lang-tile .lt-main { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; font-size: .88rem; color: var(--muted); }
.lang-tile:not(:has(.lt-check input:checked)) .lt-main { opacity: .35; pointer-events: none; }
.lang-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.lang-info > div { background: #f3f1e7; border-radius: var(--radius); padding: 14px 16px; }
.lang-info p { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.lang-tile .lt-drop { display: none; }
.lang-tile:not(:has(.lt-check input:checked)) .lt-drop { display: inline-block; }
.lang-tile:not(:has(.lt-check input:checked)) .lt-keep { display: none; }
/* barra dell'anteprima (Chat AI, Aspetto): titolo a sinistra, ricarica e dispositivi a destra */
.pv-bar { justify-content: space-between; }
.pv-tools { display: inline-flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.pv-reload { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px; color: var(--navy);
  font: 600 .88rem var(--head); cursor: pointer; border-radius: 6px; }
.pv-reload:hover { background: #f3f1e7; }
.pv-reload:active svg { transform: rotate(90deg); }
.pv-reload svg { transition: transform .3s; }
.pv-open { font-size: .88rem; margin-left: 10px; }
.chat-cost { margin: 0; }
/* Nuovo sito: passi, scelte a schede, finestra di aiuto */
.wizard { display: flex; flex-direction: column; gap: 18px; max-width: 1000px; }
.wz-step { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 22px 20px; }
.wz-step h2 { margin: 0 0 14px; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.wz-step h3 { margin: 18px 0 10px; font-size: 1rem; }
.wz-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .9rem; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.choice-card { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer; font-weight: 400; }
.choice-card > span { display: flex; flex-direction: column; gap: 4px; }
.choice-card strong { color: var(--navy); }
.choice-card small { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.choice-card:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.choice-card.disabled { cursor: default; background: #faf9f4; }
.choice-card.disabled input, .choice-card.disabled strong { opacity: .55; }
.wizard input[type=radio], .wizard input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.wz-sub { display: none; }
.wizard:has(input[name=mode][value=model]:checked) .wz-sub[data-for=model],
.wizard:has(input[name=mode][value=clone]:checked) .wz-sub[data-for=clone] { display: block; }
.model-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 10px; }
.model-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: .82rem; }
.wz-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.linklike, .linklike:hover { display: inline; text-align: left; background: none; border: 0; padding: 0; color: var(--navy);
  font: inherit; font-weight: 400; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; cursor: pointer; }
.linklike:hover { text-decoration-color: var(--navy); }
dialog.help-dialog { max-width: 720px; width: calc(100% - 32px); border: 0; border-radius: var(--radius); padding: 24px 28px; box-shadow: 0 24px 64px rgba(0, 25, 60, .3); }
dialog.help-dialog::backdrop { background: rgba(0, 25, 60, .45); }
dialog.help-dialog h2 { margin-top: 0; padding-right: 30px; }
dialog.help-dialog pre { background: #f3f1e7; padding: 8px 12px; border-radius: 8px; white-space: pre-wrap; margin: 6px 0; }
dialog.help-dialog li { margin-bottom: 10px; }
.help-close { position: absolute; top: 10px; right: 12px; }
.help-close button { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.row-actions { text-align: right; width: 1%; white-space: nowrap; }
.row-actions .inline-details summary { border-color: var(--line); color: var(--muted); font-weight: 400; }
.row-actions .inline-details summary:hover { border-color: var(--red); color: var(--red); }
.row-actions .inline-details[open] form { white-space: normal; max-width: 340px; margin-left: auto; text-align: left; }
/* conversazioni: elenco con rinomina ed eliminazione */
.conv-head { display: flex; align-items: center; gap: 6px; min-height: 32px; }
.conv-head .conv-title { font: 600 .98rem var(--head); color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn, .icon-btn:hover { background: none; border: 0; padding: 4px 6px; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: #f3f1e7; color: var(--navy); }
.icon-btn.del:hover { color: var(--red); }
.rename-form { display: flex; gap: 6px; flex: 1; }
.rename-form input { flex: 1; padding: 4px 8px; min-height: 0; }
details.convs ul { list-style: none; padding-left: 0; }
details.convs li { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
details.convs li a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Aspetto: scelta predefinita dello stile */
.style-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); vertical-align: middle; margin: 0 3px 2px; }
label.pill.is-style span { border-style: dashed; border-color: var(--gold); }
label.pill.is-style span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-right: 6px; vertical-align: middle; }
label.pill.is-style input:checked + span { border-style: solid; border-color: var(--gold); }
label.pill.is-style input:checked + span::before { background: var(--navy); }   /* il pallino oro non si vedrebbe sul giallo */
/* Aspetto: slider delle dimensioni, a tacche (una ogni 10%), con una «A» piccola e una grande ai lati */
.size-row { display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 8px; }
.size-ctl { display: flex; align-items: flex-start; gap: 10px; }
.sz-a { font-family: var(--head); font-weight: 600; color: var(--muted); line-height: 1; flex: none; }
.sz-min { font-size: .78rem; padding-top: 5px; }
.sz-max { font-size: 1.25rem; }
.size-track { flex: 1; min-width: 0; }
.size-row input[type=range] { width: 100%; accent-color: var(--gold); margin: 2px 0 0; padding: 0; min-height: 0; border: 0; }
.size-row .ticks { display: flex; justify-content: space-between; height: 18px; margin: 0 8px; }   /* 8px ≈ metà cursore */
.size-row .tick { position: relative; width: 2px; height: 8px; background: var(--field); border-radius: 1px; cursor: pointer; }
.size-row .tick::after { content: ""; position: absolute; inset: -4px -7px; }                         /* più facile da cliccare */
.size-row .tick.is-normal { height: 12px; width: 3px; background: var(--muted); }                   /* 100% */
.size-row .tick.is-style::before { content: ""; position: absolute; top: 15px; left: 50%; transform: translateX(-50%); width: 7px; height: 7px;
  border-radius: 50%; background: var(--gold); }
.size-row .ticks { height: 24px; }
/* Aspetto: sotto-schede (un solo modulo) */
.look-tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); flex-wrap: wrap; }
.look-tabs a { padding: 8px 12px; }
/* Aspetto: ogni scelta mostra cosa rappresenta */
label.pill span { display: inline-flex; align-items: center; gap: 6px; }
label.pill .opt-text { font-weight: 400; }
label.pill .opt-icon { display: inline-grid; place-items: center; font-style: normal; line-height: 0; }
.opt-buttons[data-value=square] span { border-radius: 3px; }
.opt-buttons[data-value=rounded] span { border-radius: 10px; }
.opt-headings .opt-text { font-family: var(--head); font-size: 1rem; }
.opt-headings[data-value=light] .opt-text { font-weight: 300; }
.opt-headings[data-value=normal] .opt-text { font-weight: 500; }
.opt-headings[data-value=bold] .opt-text { font-weight: 800; }
.opt-labels[data-value=uppercase] .opt-text { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
/* barra dell'anteprima: ricarica leggibile al passaggio, dispositivi come icone */
.pv-reload:hover { background: #f3f1e7; color: var(--navy); }
.pv-devices { display: inline-flex; gap: 4px; }
.pv-dev, .pv-dev:hover { display: inline-grid; place-items: center; width: 36px; height: 32px; padding: 0; border: 1.5px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--muted); }
.pv-dev:hover { border-color: var(--navy); color: var(--navy); }
.pv-dev[aria-pressed="true"], .pv-dev[aria-pressed="true"]:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.pv-frame { position: relative; }
.pv-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .85); color: var(--navy);
  font: 600 1rem var(--head); border-radius: var(--radius); z-index: 1; }
.opt-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0, 25, 60, .25); }
.opt-mini { font: 600 .72rem var(--head); letter-spacing: .06em; opacity: .8; }
.opt-logo { font-family: var(--head); letter-spacing: .12em; font-weight: 700; }
/* titoli delle conversazioni: una riga, con «…» se lunghi; icone, data e costo non vanno mai a capo */
.conv-head .rename-view, details.convs li .rename-view { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.conv-head .conv-title, details.convs li .conv-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-head .icon-btn, details.convs li .icon-btn, .conv-head form.inline { flex: none; }
details.convs li { flex-wrap: nowrap; }
details.convs li > small { flex: none; white-space: nowrap; }
.conv-head .rename-form, details.convs li .rename-form { min-width: 0; }
label.cchoice { flex-direction: row; align-items: center; gap: 12px; font-weight: 400; }
label.cchoice .clabel { min-width: 120px; }
label.cchoice select { max-width: 260px; }
/* Panoramica: dati, scorciatoie, operazioni (a sinistra) e anteprima (a destra) */
.overview-col .facts { grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.go-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.go-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .2s; }
.go-card:hover { border-color: var(--gold); box-shadow: 0 6px 18px rgba(0, 25, 60, .08); color: inherit; }
.go-card > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.go-card strong { font: 700 1.02rem var(--head); color: var(--navy); }
.go-card small { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.go-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--navy); color: var(--gold); }
.overview-col h2 { font-size: 1.1rem; margin: 22px 0 8px; }
ul.ops { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
ul.ops li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
ul.ops li small { flex-basis: 100%; }
.overview-col pre.files { max-height: 220px; overflow: auto; }
/* Aspetto: layout del footer come schede con miniatura */
.fl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label.fl-card { flex-direction: column; gap: 6px; padding: 6px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 400; position: relative; }
label.fl-card input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
/* mini-disegni dei layout del footer: righe = testi, trattini = voci di menu, pallini = social, riquadro = pulsante */
.fl-mini { display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; height: 84px; padding: 10px 11px 6px; border-radius: 6px; background: #1f2433; color: #fff; overflow: hidden; }
.fl-mini i, .fl-mini b { display: block; font-style: normal; }
.fl-mini .fl-l { height: 2px; border-radius: 1px; background: currentColor; opacity: .45; }
.fl-mini .w15 { width: 15%; } .fl-mini .w30 { width: 30%; } .fl-mini .w40 { width: 40%; } .fl-mini .w45 { width: 45%; }
.fl-mini .w50 { width: 50%; } .fl-mini .w60 { width: 60%; } .fl-mini .w70 { width: 70%; } .fl-mini .w90 { width: 90%; }
.fl-mini .fl-logo { width: 20px; height: 6px; border-radius: 1px; background: currentColor; opacity: .9; flex: none; }
.fl-mini .fl-h { width: 34%; height: 2px; background: currentColor; opacity: .9; margin-bottom: 1px; }
.fl-mini .fl-dots { display: flex; gap: 2px; }
.fl-mini .fl-dots b { width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; opacity: .7; }
.fl-mini .fl-menu { display: flex; gap: 3px; }
.fl-mini .fl-menu b { width: 8px; height: 2px; background: currentColor; opacity: .6; }
.fl-mini .fl-btn { width: 22px; height: 7px; border: 1px solid currentColor; opacity: .85; flex: none; }
.fl-mini .fl-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; flex: 1; align-items: start; }
.fl-mini .fl-c { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fl-mini .fl-center { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.fl-mini .fl-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex: 1; }
.fl-mini .fl-row-end { display: flex; align-items: center; gap: 4px; }
.fl-mini .fl-bottom { display: flex; justify-content: space-between; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, .15); }
.fl-mini .fl-bottom .fl-l { opacity: .3; }
.fl-mini-cta { padding-top: 0; }
.fl-mini.fl-light { color: #2a2a2a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.fl-mini.fl-light .fl-bottom { border-top-color: rgba(0, 0, 0, .12); }
.fl-mini.fl-light .fl-band { background: rgba(0, 0, 0, .06); }
.fl-mini .fl-band { display: flex; align-items: center; justify-content: space-between; margin: 0 -10px; padding: 7px 10px; background: rgba(255, 255, 255, .1); }
.fl-mini .fl-big { width: 38%; height: 4px; background: currentColor; opacity: .9; }
.fl-mini .fl-btn-gold { border: 0; background: #b08d48; opacity: 1; }
.fl-mini-cta .fl-cols { gap: 6px; } .fl-mini-cta .fl-c { gap: 2px; } .fl-mini-cta .fl-c .fl-l.w45, .fl-mini-cta .fl-c .fl-dots { display: none; }
label.fl-card > span:not(.fl-mini) { font-size: .88rem; padding: 0 2px 2px; }
label.fl-card.is-style > span:not(.fl-mini)::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-right: 6px; vertical-align: middle; }
label.fl-card:has(input:checked) { border-color: var(--gold); background: var(--sel-bg); box-shadow: 0 0 0 2px var(--gold); }
label.fl-card:has(input:focus-visible) { outline: 3px solid var(--navy); outline-offset: 2px; }

/* link al controllo nell'intestazione del sito */
.check-link { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: currentColor; box-shadow: none; }
.check-link:hover, .check-link:focus-visible { background: none; color: var(--ink); }
.check-link::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #b8b4a6; vertical-align: 1px; }
.check-link.is-ok::before { background: #2e9d5b; }
.check-link.is-warn::before { background: #e0a100; }
.check-link.is-err { color: #b3261e; }
.check-link.is-err::before { background: #b3261e; }
.check-link.is-running::before { background: #2f6fd6; animation: check-pulse 1s ease-in-out infinite alternate; }
@keyframes check-pulse { to { opacity: .25; } }
.save-msg { font-size: .78rem; color: var(--muted); transition: opacity .6s; }
.save-msg.fade { opacity: 0; }
.save-msg.err { color: #b3261e; }

/* elenco dei siti: miniatura e filtro */
.list-filter { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.list-filter input { width: 100%; max-width: 520px; }
table.sites-list td { vertical-align: middle; }
table.sites-list th.c, table.sites-list td.c { text-align: center; }
table.sites-list .badge { white-space: nowrap; }
.site-links { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
table.sites-list td:last-child { white-space: nowrap; }
a.link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font: 600 .78rem/1.4 var(--head); text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s; }
a.link-btn:hover, a.link-btn:focus-visible { border-color: var(--navy); background: #f3f1e7; }
.sites-list .thumb-col { width: 176px; padding-right: 0; }
.site-thumb { display: block; width: 160px; height: 100px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); background: #ece8dc; }
.site-thumb.empty { display: flex; align-items: center; justify-content: center; font-size: .75rem; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Impostazioni: indice a sinistra, schede delle sezioni, campi a larghezza proporzionata, lingue a schede */
.data-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 18px; }
.data-layout.single { grid-template-columns: minmax(0, 1fr); }
.data-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.data-nav a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--navy); font: 600 .9rem var(--head); }
.data-nav a:hover { background: #f3f1e7; }
.data-nav a.has-err { color: var(--red); }
.data-nav a.has-err::after { content: " •"; }
.data-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.data-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; scroll-margin-top: 16px; }
.data-card h3 { margin: 0 0 2px; font-size: 1.05rem; color: var(--navy); }
.data-card > .small-note { margin: 0 0 14px; }
.data-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 16px; }
.data-grid .field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.data-grid .field > label, .ml-label { font-weight: 600; font-size: .92rem; }
.data-grid .field input, .data-grid .field textarea { width: 100%; }
.data-grid .field small { font-size: .78rem; }
.data-grid .field.invalid input, .data-grid .field.invalid textarea { border-color: var(--red); }
.w1 { grid-column: span 1; } .w2 { grid-column: span 2; } .w3 { grid-column: span 3; } .w4 { grid-column: span 4; } .w6 { grid-column: span 6; }
.pay-choices { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 0 6px; }
.data-grid .field .pay-choices input { width: auto; }
.pay-choices label.check { font-weight: 400; font-size: .92rem; }
.ml-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ml-tabs { display: none; gap: 2px; background: #f3f1e7; border-radius: 999px; padding: 2px; }
.ml-ready .ml-tabs { display: inline-flex; }
button.ml-tab { position: relative; padding: 1px 8px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 700 .72rem/1.6 var(--head); letter-spacing: .03em; box-shadow: none; }
button.ml-tab:hover { background: #fff; color: var(--navy); }
button.ml-tab.on { background: var(--navy); color: #fff; }
button.ml-tab.empty::after { content: ""; position: absolute; top: 1px; right: 1px; width: 6px; height: 6px; border-radius: 50%; background: #e0a100; }
button.ml-tab.err::after { background: var(--red); }
.ml-lang { font-size: .78rem; color: var(--muted); }
.ml-ready .ml-lang { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.data-form .savebar { margin-top: 4px; }
@media (max-width: 900px) {
  .data-layout { grid-template-columns: 1fr; }
  .data-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .data-grid { grid-template-columns: 1fr; }
  .data-grid .field { grid-column: auto; }
}

/* Contenuti › Pagine: elenco a sinistra, pagina a destra in tre blocchi (nome e indirizzo, meta tag, sezioni) */
.pages-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: start; margin-top: 18px; }
.coll-layout { margin-top: 18px; }
.pages-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; }
.pages-nav-head { margin: -12px -8px 8px; padding: 14px 18px 12px; background: #eaeff6; border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; color: var(--navy); font-family: var(--head); font-size: 1.12rem; }
.pages-nav-head strong { font-weight: 700; letter-spacing: .01em; }
.pages-nav-head > small.muted { font-size: .8rem; margin-left: 2px; }
.pages-nav > .nav-toggle { position: relative; z-index: 1; }
.pages-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.pages-nav li > a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--navy); }
.pages-nav li > a:hover { background: #f3f1e7; }
.pages-nav li > a.on { background: var(--navy); color: #fff; }
.pages-nav li > a.on .pn-path { color: rgba(255, 255, 255, .7); }
.pages-nav .depth-1 a { margin-left: 14px; } .pages-nav .depth-2 a { margin-left: 28px; } .pages-nav .depth-3 a { margin-left: 42px; }
.pages-nav .depth-1 .pn-title::before, .pages-nav .depth-2 .pn-title::before, .pages-nav .depth-3 .pn-title::before { content: "↳ "; opacity: .5; }
.pn-title { font: 600 .9rem var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-path { grid-column: 1; display: flex; align-items: center; gap: 5px; min-width: 0; font-family: ui-monospace, monospace; font-size: .72rem; color: var(--muted); }
.pn-url { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-path .pn-draft { flex: none; font-family: var(--body); line-height: 1.5; }
.pages-nav li > a.on .pn-draft { background: #fff1c2; color: #6b4700; }
.pn-manage { float: right; font-family: var(--body); font-weight: 400; }
.pn-filter { padding: 0 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.pn-filter input { width: 100%; padding: 5px 9px; font-size: .85rem; }
.pn-sep { margin: 10px 10px 2px; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pn-todo { grid-column: 2; grid-row: 1 / span 2; align-self: center; flex: none; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber-bg); color: #8a5a00; font: 700 .72rem/20px var(--head); text-align: center; }
.pages-nav .small-note { padding: 10px 10px 0; margin: 0; }
.editor-col { min-width: 0; }
.editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.editor-head .page-title { margin: 0; }
.editor-head .head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.editor-head .draft-note { flex-basis: 100%; margin: -6px 0 0; font-size: .85rem; color: #8a5a00; }
@media (min-width: 900px) and (min-height: 560px) {      /* titolo fermo in alto mentre si scorrono campi e sezioni */
  .editor-head { position: sticky; top: var(--sticky-h, 58px); z-index: 30; background: var(--bg);
    margin-top: -18px; padding: 18px 0 12px; border-bottom: 1px solid var(--line); }
}
.editor-head .page-title small { font-size: .8rem; font-weight: 400; }
.editor-head .inline-details summary { border-color: var(--line); color: var(--muted); font-weight: 400; }
.editor-head .inline-details summary:hover { border-color: var(--red); color: var(--red); }
.editor-head .inline-details[open] form { max-width: 380px; }
/* «Cambia ID» ed «Elimina»: la conferma si apre in un riquadro sospeso sotto il pulsante, senza spostare il resto */
.editor-head .inline-details { position: relative; }
.editor-head .inline-details[open] { flex-basis: auto; }
.editor-head .inline-details[open] > :not(summary) { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 340px;
  max-width: calc(100vw - 32px); margin: 0; padding: 14px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }
.editor-head .inline-details[open] > summary { border-color: var(--navy); color: var(--navy); }
.editor-head .inline-details.del[open] > summary { border-color: var(--red); color: var(--red); }
.editor-head .inline-details:not(.del) summary:hover { border-color: var(--navy); color: var(--navy); }
/* avvisi subito sotto l'intestazione dell'editor (es. testi da tradurre): un po' di respiro */
.editor-head ~ .box, .editor-head ~ .draft-note { margin-top: 12px; }
.editor-form { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; }
.ed-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.ed-card > h3 { margin: 0; font-size: 1.08rem; color: var(--navy); display: flex; align-items: baseline; gap: 8px; }
.ed-card > h3 small { font-weight: 400; font-size: .85rem; }
.ed-card > .small-note { margin: -10px 0 0; }
.ed-ico { color: var(--gold); font-size: 1.1rem; }
.ed-card .cfield textarea { width: 100%; }
.ed-card .ml-field .ml-pane { display: flex; flex-direction: column; gap: 4px; }
.ed-card .slug-row { min-width: 0; }
.sec-block { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; background: #fdfcf8; }
.sec-block[open] { padding-bottom: 16px; }
.sec-block > :not(summary) + * { margin-top: 12px; }
.sec-head { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.sec-head::-webkit-details-marker { display: none; }
details.sec-block > .sec-head::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.sec-block:not([open]) > .sec-head::after { transform: rotate(-90deg); }
.sec-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font: 700 .75rem/24px var(--head); text-align: center; }
.sec-name { font: 700 .98rem var(--head); color: var(--navy); }
.sec-coll { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: #eef3fa; border: 1px dashed #9db4d3; font-size: .9rem; }
.sec-coll + .sec-coll { margin-top: 8px; }
@media (max-width: 900px) {
  .pages-layout { grid-template-columns: 1fr; }
  .pages-nav { position: static; max-height: 260px; }
}

/* Form del sito (SPEC §37) */
.forms-table td { vertical-align: top; }
.forms-table td.actions { white-space: nowrap; text-align: right; }
.form-edit { display: grid; gap: 16px; max-width: 860px; }
.form-edit .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: grid; gap: 14px; }
.form-edit .card h3 { margin: 0; }
.form-edit .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-edit small.muted { font-weight: 400; }
.form-edit span.err { font-weight: 400; font-size: .85rem; }
.form-edit label.check { align-items: flex-start; font-weight: 400; }
.noindex-check { margin-top: 14px; }
.seo-adv { margin-top: 16px; border-top: 1px solid var(--line, #e6e1d6); padding-top: 12px; }
.seo-adv > summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--navy); }
.head-code { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.head-mode { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.head-code textarea { width: 100%; }
.form-edit label.check input { margin-top: 4px; }
.model-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.model-choice legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.form-requests { display: grid; gap: 6px; }
.form-requests details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.form-requests summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.form-requests .fr-when { font-variant-numeric: tabular-nums; color: var(--muted); }
.form-requests .fr-form { margin-left: auto; color: var(--muted); font-size: .9rem; }
.fr-rows { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0 6px; }
.fr-rows dt { color: var(--muted); }
.fr-rows dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 600px) { .fr-rows { grid-template-columns: 1fr; } .fr-rows dd { margin-bottom: 6px; } .form-requests .fr-form { margin-left: 0; } }

/* destinazioni di pulsanti e link (editor) */
.href-field [hidden] { display: none !important; }
.href-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.href-mode { max-width: 240px; font-size: .85rem; }
.href-slot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.href-slot select { max-width: 280px; }
.href-slot .href-anchor { width: 13em; }
.href-slot .href-text { flex: 1 1 260px; min-width: 0; }
.hrefs .ml-pane { margin-top: 6px; }

/* libreria: schede Foto / Documenti PDF */
.lib-tabs { display: flex; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.lib-tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px;
  border-radius: 8px 8px 0 0; }
.lib-tabs a:hover { color: var(--navy); background: #f3f1e7; }                 /* come le schede principali */
.lib-tabs a.on { color: var(--navy); border-bottom-color: var(--gold); background: var(--card); }
.doc-ico { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; color: #fff; background: #b8452f;
  border-radius: 4px; padding: 2px 5px; vertical-align: 1px; }
.docs-list td { vertical-align: middle; }
.doc-actions { white-space: nowrap; text-align: right; }
.doc-actions form.inline { display: inline; }
@media (max-width: 700px) { .href-slot select, .href-mode { max-width: 100%; width: 100%; } .doc-actions { white-space: normal; } }

/* campi brevi per lingua (testo alternativo, categorie) a tutta larghezza */
.ml-field .ml-pane input, .ml-field .ml-pane textarea { width: 100%; box-sizing: border-box; }
.ml-field .ml-pane textarea[data-oneline] { resize: vertical; min-height: 64px; }
.newcat { margin-top: 4px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.cat-rows { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.cat-row .cat-meta { font-size: .82rem; color: var(--muted); text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
@media (max-width: 700px) { .cat-row { grid-template-columns: 1fr; } .cat-row .cat-meta { align-items: flex-start; text-align: left; } }
/* video nella libreria */
.vthumb { position: relative; display: block; aspect-ratio: 3 / 2; background: #1c1814; border-radius: 6px; overflow: hidden; }
.vthumb img, .pitem .vthumb img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; display: block; border-radius: 0; }
.vthumb.vnone { display: grid; place-items: center; color: #fff; font-size: .85rem; background: #6b6458; }
.vbadge { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 999px; }
.vpreview { width: 100%; border-radius: 6px; background: #000; display: block; }
/* Aspetto › Decorazioni (SPEC §48) */
.deco-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 8px; }
.deco-card { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.deco-card img, .deco-none { width: 96px; height: 56px; flex: none; border-radius: 8px; background: #f3f1e7 repeating-conic-gradient(#e9e6da 0 25%, #f6f4ec 0 50%) 0 0 / 12px 12px; }
.deco-card img.deco-button { object-fit: contain; }
.deco-card img.deco-texture { object-fit: cover; }
.deco-none { display: flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--muted, #777); }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.45; }

/* Contenuti › Blog (SPEC §50) */
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 10px 0 16px; }
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.new-post summary { cursor: pointer; }
.post-table .thumb-cell { width: 76px; }
.post-table .thumb-cell img { border-radius: 6px; display: block; }
/* lingua dell'elenco degli articoli: schede come quelle dei campi */
.posts-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 12px; }
.posts-bar .filters { margin: 0; }
.posts-langs { display: inline-flex; }
a.ml-tab { padding: 3px 11px; border-radius: 999px; color: var(--muted); font: 700 .78rem/1.6 var(--head); letter-spacing: .03em; text-decoration: none; }
a.ml-tab:hover { background: #fff; color: var(--navy); }
a.ml-tab.on { background: var(--navy); color: #fff; }
/* editor dell'articolo: elenco a sinistra più largo, titoli su due righe */
.pages-layout.posts-layout { grid-template-columns: 340px minmax(0, 1fr); }
.posts-layout .pn-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.posts-layout .pn-missing { color: var(--muted); font-style: italic; }
.posts-layout li > a.on .pn-missing, .posts-layout li > a.on .pn-date { color: rgba(255, 255, 255, .75); }
.pages-nav-head .small-note { float: right; font-size: .75rem; padding: 0; }
@media (max-width: 900px) { .pages-layout.posts-layout { grid-template-columns: 1fr; } }
.pn-date { font-size: .75rem; color: var(--muted); }
/* elenco di articoli/eventi/offerte: titolo su tutta la riga, date sotto (anche lunghe, es. eventi ricorrenti) */
.posts-layout .pn-title { grid-column: 1; grid-row: 1; }
.posts-layout .pn-date { grid-column: 1; grid-row: 2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; margin-top: 2px; }
.pn-draft, .badge.draft { background: var(--amber-bg); color: var(--amber); border-radius: 99px; padding: 0 7px; font-size: .72rem; font-weight: 700; }
.draft-box { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius); background: var(--amber-bg); margin: 8px 0; }
.cdate input { max-width: 220px; }
/* campi propri di offerte ed eventi (SPEC §50): sì/no, numeri, codice, date, giorni */
.cfield.cnum input { max-width: 160px; }
.cfield.cstring input { max-width: 280px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.cfield.cdates textarea { max-width: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; }
fieldset.cchoices { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: flex-start; }
fieldset.cchoices legend { width: 100%; margin-bottom: 4px; }
.check.inline { display: inline-flex; width: auto; margin: 0; gap: 5px; align-items: center; font-size: .9rem; }
.cbool { display: flex; gap: 8px; align-items: flex-start; }
.post-table tr.row-expired td { opacity: .6; }
/* interruttore dei moduli blog, offerte, eventi (SPEC §50.3) */
.module-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.module-title { display: inline-flex; gap: 10px; align-items: center; font-size: 1.05rem; }
button.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; color: var(--navy); font-weight: 600; box-shadow: none; cursor: pointer; }
button.switch span { width: 40px; height: 22px; border-radius: 999px; background: #c9c5b8; position: relative; transition: background .2s; }
button.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
button.switch.on span { background: #2e9d5b; }
button.switch.on span::after { left: 21px; }
.module-card.is-on { border-left: 3px solid #2e9d5b; }
/* barra delle sotto-schede: pallino dei moduli, lingua di visualizzazione a destra */
.content-tabs-bar { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--line); margin: 4px 0 14px; }
.content-tabs-bar .content-tabs { border-bottom: 0; margin: 0; flex: 1; flex-wrap: wrap; }
.tabs-row { display: flex; align-items: flex-end; gap: 12px; margin-top: 14px;
  background: linear-gradient(var(--line), var(--line)) left bottom / 100% 1px no-repeat; }
.tabs-row .tabs { margin-top: 0; flex: 1 1 auto; min-width: 0; background: none; }
.tabs-row .view-lang { flex: none; margin: 0 0 6px; }
.tabs-row .view-lang select { padding: 4px 8px; font-size: .85rem; min-width: 0; }
.mod-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9c5b8; margin-right: 6px; vertical-align: 1px; }
.mod-dot.on { background: #2e9d5b; }
.posts-bar .new-entry { margin-left: auto; }
/* Media e Foto/Video/PDF: barra con il pulsante di caricamento */
.lib-bar { align-items: flex-end; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.lib-bar .lib-tabs { border-bottom: 0; margin: 0; }
.lib-bar > .button { margin-bottom: 6px; }
div.hub-card a.hub-title, div.hub-card a.hub-go { text-decoration: none; }
div.hub-card a.hub-pill { color: inherit; text-decoration: none; }
div.hub-card a.hub-pill:hover { background: #ebe7d6; }
.photo-move { align-items: center; gap: 8px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }

/* Navigazione: opzioni in Impostazioni (breadcrumbs) */
.nav-opts .choices { margin: 2px 0 6px; }

/* Navigazione: albero del menu da trascinare, a colonne fisse */
.nav-tree-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 22px; }
.nav-tree-head { display: flex; align-items: center; gap: 16px; }
.nav-tree-head h3 { margin: 0; font-size: 1rem; }
.nav-tree { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; overflow-x: auto; }
/* solo la colonna del titolo si allarga o si stringe: le sottovoci rientrano e le altre colonne restano allineate */
.nt-row { display: grid; grid-template-columns: 18px minmax(220px, 1fr) 210px var(--nt-vis, 360px) 300px; position: relative;
  align-items: center; column-gap: 14px; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px;
  min-height: 40px; }
.nt-zone { min-width: calc(var(--nt-vis, 360px) + 845px); padding: 8px; border: 1px solid transparent; border-radius: 8px; }
.nav-tree > .nt-row { min-width: calc(var(--nt-vis, 360px) + 827px); margin: 0 9px; }      /* intestazione e Home: allineate alle righe dei riquadri */
.nt-head { background: none; border-color: transparent; font-size: .76rem; font-weight: 600; color: var(--muted); min-height: 0; padding-bottom: 0; }
.nt-home { background: var(--bg); }
.nt-c { min-width: 0; display: flex; align-items: center; gap: 6px; }
.nt-c-title { flex-direction: column; align-items: stretch; gap: 1px; }
.nt-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nt-c-title .nt-title, .nt-path, .nt-nest span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-home-in { margin-left: 10px; }
.nt-row:not(.nt-head):not(.nt-home) { cursor: grab; }
.nt-row:active { cursor: grabbing; }
.nt-grip { color: var(--field); font-size: 1rem; text-align: center; user-select: none; }
.nt-path { color: var(--muted); font-family: ui-monospace, monospace; font-size: .78rem; }
.nt-path.nt-changed { color: var(--amber); font-weight: 600; }
.nt-badge { font-size: .7rem; padding: 1px 7px; border-radius: 999px; background: var(--grey-bg); color: var(--muted); flex: none; }
.nt-nest { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 400; cursor: pointer; min-width: 0; white-space: nowrap; }
.nt-nest input { flex: none; margin: 0; }
.nt-acts { justify-content: flex-end; gap: 4px; }
.nt-btn { padding: 1px 0; width: 30px; font-size: .9rem; line-height: 1.5; background: #fff; border: 1px solid var(--field); border-radius: 5px; cursor: pointer; }
.nt-btn:disabled { opacity: .25; cursor: default; }
.nt-btn.nt-void { visibility: hidden; }
.nt-edit { margin-left: 8px; font-size: .82rem; white-space: nowrap; }
.nt-edit-btn { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; font: inherit; font-size: .82rem; }
.nt-badge-link { background: var(--blue-bg); color: var(--blue); }
.nav-tree-head .small { margin-left: auto; }
.link-dialog [data-url-same], .link-dialog [data-url-per] { display: flex; flex-direction: column; gap: 8px; }
.link-dialog [hidden] { display: none !important; }
.nt-zone-title { font-weight: 600; font-size: .85rem; margin: 0 0 6px; color: var(--muted); }
.nt-zone-out { background: var(--bg); border-color: var(--line); }
.nt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-height: 34px; }
.nt-kids { margin: 4px 0 0 36px; min-height: 0; }
.nt-item.dragging > .nt-row { opacity: .4; }
/* linea gialla dove cadrà la pagina: a filo della riga (stesso livello) o rientrata (sottovoce) */
.nt-row.drop-before::before, .nt-row.drop-after::after, .nt-row.drop-into::after { content: ""; position: absolute; left: -1px; right: -1px;
  height: 4px; border-radius: 2px; background: var(--gold); pointer-events: none; }
.nt-row.drop-before::before { top: -4px; }
.nt-row.drop-after::after { bottom: -4px; }
.nt-row.drop-into::after { bottom: -4px; left: 36px; }
.nt-list.drop-end { outline: 2px dashed var(--gold); outline-offset: 2px; border-radius: 6px; }
.nt-vis { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; font-size: .82rem; }
.nt-vis select { font-size: .82rem; padding: 3px 6px; width: 250px; min-width: 0; flex: none; }
.nt-vis select.nt-vis-draft, .nt-vis select.nt-vis-some { border-color: var(--amber); background: var(--amber-bg); }
.nt-lang { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: .78rem; cursor: pointer; }
.nt-c-vis { flex-direction: column; align-items: flex-start; gap: 2px; }
.nt-inh { color: var(--amber); font-size: .76rem; }

/* barra blu sempre in cima; nelle pagine di un sito resta ferma anche l'intestazione (nome, pulsanti, schede).
   --top-h e --sticky-h (altezze) li misura panel.js; sotto restano fermi gli elenchi laterali */
@media (min-width: 900px) and (min-height: 560px) {
  header.top { position: sticky; top: 0; z-index: 60; }
  main:has(> .thead:first-child) { padding-top: 0; }   /* l'intestazione parte già dove resta ferma: niente scatti */
  body main:has([data-layout]) { padding-bottom: 0; }   /* editor: niente spazio sotto, sennò in fondo elenco e anteprima risalgono */
  .thead { position: sticky; top: var(--top-h, 58px); z-index: 50; background: var(--bg); padding: 18px 0 16px; margin: 0;
    box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax); }      /* fondo anche sui margini laterali */
  .content-tabs-bar { position: sticky; top: var(--head-h, 120px); z-index: 45; background: var(--bg); margin-top: 0;
    box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax -1px); }   /* sotto-schede di Contenuti ferme */
  .data-nav { top: calc(var(--sticky-h, 58px) + 16px); }
  .pages-nav { top: calc(var(--sticky-h, 58px) + 18px); }        /* = distanza naturale dalle sotto-schede: non si muove */
  .pages-nav { max-height: calc(100vh - var(--sticky-h, 58px) - 32px); }
  .data-card, [id] { scroll-margin-top: calc(var(--sticky-h, 58px) + 16px); }
}

/* editor: voci degli elenchi (SPEC §54) */
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.item-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0 6px; padding: 6px 0 4px;
  border-top: 1px dashed var(--line); }
.item-name { font-family: var(--head); font-weight: 600; font-size: .9rem; color: var(--navy); }
.item-ops { display: inline-flex; gap: 4px; }
.item-ops button.ghost { border-color: transparent; background: none; padding: 2px 10px; }
.item-ops button.ghost:hover { border-color: var(--navy); background: none; color: var(--navy); }
.item-ops button.danger-text { color: var(--red); }
.list-add { margin: 10px 0 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* sezioni dell'editor: chiuse, con riassunto, frecce, elimina e trascinamento (SPEC §54 fase 2) */
.sec-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.sec-tools button.link { font-size: .85rem; }
.sec-list { display: flex; flex-direction: column; gap: 10px; }
.sec-head { flex-wrap: nowrap; min-width: 0; }
.sec-name { flex: 0 1 auto; min-width: 3em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-excerpt { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .88rem; }
.sec-ops { display: inline-flex; gap: 2px; margin-left: auto; flex: none; }
details.sec-block > .sec-head:has(.sec-ops)::after { margin-left: 6px; }
.sec-ops button.ghost { border-color: transparent; background: none; padding: 2px 9px; }
.sec-ops button.ghost:hover { border-color: var(--navy); background: none; color: var(--navy); }
.sec-ops button.danger-text { color: var(--red); }
.sec-drag, .sec-drag-demo { flex: none; color: var(--muted); font-size: 1.1rem; line-height: 1; letter-spacing: -1px; }
.sec-drag { cursor: grab; padding: 4px 2px; user-select: none; }
.sec-drag:hover { color: var(--navy); }
.sec-block.dragging { opacity: .45; border-style: dashed; border-color: var(--navy); }
.sec-list.moving, .sec-block.moving { pointer-events: none; opacity: .7; }
.sec-block { scroll-margin-top: calc(var(--sticky-h, 0px) + 12px); }
@media (max-width: 640px) { .sec-excerpt { display: none; } }
.sec-gap { display: inline-block; width: 33px; }
/* «Aggiungi sezione»: finestra con il catalogo (SPEC §54 fase 3) */
.sec-add { margin: 14px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.add-dialog { width: min(1040px, 94vw); max-height: 88vh; border: 0; border-radius: 14px; padding: 0 22px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.add-dialog::backdrop { background: rgba(10, 25, 50, .45); }
.add-head { position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: center; padding: 16px 0 10px; background: #fff; }
.add-head h3 { margin: 0; flex: none; }
.add-head input[type=search] { flex: 1; min-width: 0; }
.add-group { margin: 18px 0 8px; font: 700 .85rem var(--head); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.add-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left; padding: 8px 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: #fdfcf8; color: inherit; font: inherit; cursor: pointer; }
.add-card:hover:not(:disabled), .add-card:focus-visible { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(20, 40, 80, .12); background: #fff; }
.add-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: #eee; }
.add-card strong { font: 700 .95rem var(--head); color: var(--navy); }
.add-card small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.add-card.off { cursor: not-allowed; opacity: .55; }
.add-card.off small { color: var(--red); }
textarea.todo::placeholder { color: #b0703a; font-style: italic; opacity: 1; }
/* da completare in una sezione chiusa */
.sec-todo { flex: none; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber-bg); color: #8a5a00; font: 700 .72rem/20px var(--head); text-align: center; }
/* editor delle pagine: elenco comprimibile e anteprima accanto */
.nav-toggle, .nav-toggle:hover, .nav-toggle:focus-visible { float: right; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  margin: -2px 4px 0 6px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--navy); cursor: pointer; box-shadow: none; }
.nav-toggle:hover, .nav-toggle:focus-visible { background: #f3f1e7; border-color: var(--navy); }
.nav-toggle svg { transition: transform .2s; }
.nav-collapsed .nav-toggle svg { transform: rotate(180deg); }
.pages-layout.nav-collapsed { grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
.pages-layout.nav-collapsed .pages-nav { padding: 6px 0 0; overflow: visible; background: none; border: 0; }
.pages-layout.nav-collapsed .pages-nav > :not(.nav-toggle) { display: none; }
.pages-layout.nav-collapsed .nav-toggle { float: none; display: flex; margin: 0 auto; width: 32px; height: 32px;
  box-shadow: 0 1px 4px rgba(0, 29, 61, .18); }
.pages-layout.has-pv { grid-template-columns: 250px minmax(360px, 2fr) minmax(0, 3fr); gap: 22px; }   /* anteprima ~60% */
.pages-layout.posts-layout.has-pv { grid-template-columns: 300px minmax(360px, 2fr) minmax(0, 3fr); }
.pages-layout.has-pv.nav-collapsed { grid-template-columns: 40px minmax(360px, 2fr) minmax(0, 3fr); }
.pages-layout.has-pv.pv-off { grid-template-columns: 250px minmax(0, 1fr); }
.pages-layout.posts-layout.has-pv.pv-off { grid-template-columns: 340px minmax(0, 1fr); }
.pages-layout.has-pv.pv-off.nav-collapsed { grid-template-columns: 40px minmax(0, 1fr); }
.pages-layout.pv-off .ed-preview { display: none; }
.ed-preview { position: sticky; top: calc(var(--sticky-h, 58px) + 18px); height: calc(100vh - var(--sticky-h, 58px) - 32px); }
.ed-preview .pv-bar strong { font-family: var(--head); color: var(--navy); }
.pv-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; }
.pv-foot .check { margin: 0; font-size: .8rem; color: var(--muted); }
.pv-hide { font-size: .8rem; }
.ed-preview .pv-frame { flex: 1 1 0; min-height: 0; overflow: hidden; position: relative; }   /* altezza dalla colonna, non dal contenuto */
.pv-frame.scaled { overflow: hidden; }   /* «Desktop» rimpicciolito (editor.js, chat.js) */
.pv-frame.scaled iframe { position: absolute; top: 0; left: 0; transform-origin: 0 0; transition: none; border: 0; border-radius: 0; }
.ed-preview .pv-foot { flex: none; }
.savebar .pv-show { margin-left: auto; flex: none; }
@media (max-width: 1100px) {
  .pages-layout.has-pv, .pages-layout.has-pv.nav-collapsed { grid-template-columns: 250px minmax(0, 1fr); }
  .pages-layout.has-pv.nav-collapsed { grid-template-columns: 40px minmax(0, 1fr); }
  .pages-layout.posts-layout.has-pv { grid-template-columns: 340px minmax(0, 1fr); }
  .ed-preview, .savebar .pv-show { display: none; }
}
@media (max-width: 900px) {
  .pages-layout.has-pv, .pages-layout.nav-collapsed, .pages-layout.has-pv.nav-collapsed { grid-template-columns: 1fr; }
  .nav-toggle { display: none; }
  .pages-layout.nav-collapsed .pages-nav > :not(.nav-toggle) { display: revert; }
}
.spec .sp-band i:nth-child(2) { background: linear-gradient(160deg, var(--sp-gold-light, #d9c08b), var(--sp-gold, #a8843f) 60%, var(--sp-gold-dark, #8a6a2e)); }
.spec .sp-band i:nth-child(3) { background: linear-gradient(200deg, var(--sp-soft, #f2ece2) 0 45%, var(--sp-accent-1, #5d6b59) 46%); }
.spec-st-panorama .sp-title { font-size: 1.02rem; }
.sz-a.sz-logo.sz-min { font-size: .7rem; padding-top: 4px; }
.sz-a.sz-logo.sz-max { font-size: 1.3rem; }
/* avvisi a comparsa in basso a destra (panel.js): fondo bianco, ombra, icona verde o rossa, ✕ per chiudere (colori con gli avvisi della card di accesso) */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  max-width: min(420px, calc(100vw - 40px)); pointer-events: none; }
.toast { position: relative; pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 10px 12px 15px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px -8px rgba(0, 20, 50, .28), 0 2px 6px rgba(0, 20, 50, .08);
  font-size: .9rem; line-height: 1.45; animation: toast-in .2s ease-out; max-height: 50vh; overflow-y: auto; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.toast-dot { flex: none; width: 20px; height: 20px; background: var(--ico-ok) center / contain no-repeat; }
.toast-body { flex: 1; min-width: 0; }
.toast-body ul { margin: 4px 0 0; padding-left: 18px; }
.toast-body p { margin: 0; }
.toast-x { flex: none; border: 0; background: none; color: var(--muted); font-size: .85rem; line-height: 1; padding: 4px 6px; margin: -2px 0 0; cursor: pointer;
  border-radius: 6px; min-height: 0; }
.toast-x:hover { background: #f3f1e7; color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Redirect (SPEC §60) */
.rd-form h3 { margin-top: 0; }
.rd-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.rd-fields label { display: flex; flex-direction: column; gap: 4px; }
.rd-from { flex: 1 1 340px; }
.rd-from input { width: 100%; font-family: var(--mono, monospace); }
.rd-to select { max-width: 340px; }
.rd-table tr.rd-group th { background: #f7f5ec; text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); }
.rd-table tr.rd-group th a { color: var(--navy); }
.rd-table tbody + tbody tr.rd-group th { border-top: 2px solid var(--line); }
.rd-path { word-break: break-all; }
.rd-arrow { color: var(--muted); }
.rd-table tr.rd-off td { color: var(--muted); }
.rd-table tr.rd-off .rd-path { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.rd-table td .badge { margin-top: 4px; white-space: normal; }
.rd-table td.actions { white-space: nowrap; text-align: right; }
/* celle con i pulsanti: restano celle della tabella (la regola generica .actions le farebbe flex, con margine) */
table.list td.actions { display: table-cell; margin: 0; }
table.list td.actions > * + * { margin-left: 6px; }
/* Identità (SPEC §61) */
.id-logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 12px 0 18px; }
.id-logo p { margin: 2px 0 8px; }
.id-stage { display: flex; align-items: center; justify-content: center; min-height: 150px; padding: 22px; border-radius: var(--radius);
  border: 1px solid var(--line); }
.id-stage img { max-width: 100%; max-height: 120px; width: auto; height: auto; }
.id-stage-light { background: #1f1b17; border-color: #1f1b17; }   /* come i fondi scuri del tema */
.id-stage-dark { background: #faf7f2; }
.id-upload { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 10px 0 4px; }
.id-upload label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.id-upload .box { flex-basis: 100%; margin: 0; }
.id-alt { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }
.id-alt > label, .id-alt fieldset { flex: 1 1 360px; display: flex; flex-direction: column; gap: 4px; }
.id-alt fieldset label { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.id-icon { display: flex; align-items: center; gap: 24px; margin: 12px 0; }
.id-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: #ece9df; border-radius: 10px 10px 0 0;
  font-size: .85rem; max-width: 260px; }
.id-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id-phone { border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.id-share { max-width: 420px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 12px 0; background: var(--card); }
.id-share img, .id-share-empty { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.id-share-empty { display: flex; align-items: center; justify-content: center; background: #f3f1e7; }
.id-share-text { display: flex; flex-direction: column; padding: 8px 12px; background: #f6f6f4; }
.id-share-text small { color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .03em; }
.id-google { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; padding: 0; margin: 12px 0; }
.id-google li { display: flex; flex-direction: column; gap: 4px; width: 200px; }
.id-google img { width: 200px; height: 133px; object-fit: cover; border-radius: 6px; }
.id-google-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Loghi di guide e premi (SPEC §62): anteprima come nel footer scuro (piccoli, in grigio chiaro) */
.bd-preview { display: flex; gap: 14px; flex-wrap: wrap; padding: 18px 22px; margin: 12px 0 16px; background: #1f1b17; border-radius: var(--radius); }
.bd-preview img { width: 40px; height: 40px; filter: grayscale(1) brightness(1.6); opacity: .8; }
.bd-table td.bd-img { width: 80px; }
.bd-table td.bd-img img { background: #1f1b17; border-radius: 6px; padding: 6px; object-fit: contain; }   /* anche i loghi bianchi */
table.list.bd-table td { vertical-align: middle; }
.bd-add { margin-top: 18px; }
.bd-add h3 { margin-top: 0; }
.bd-add-name { flex: 0 1 340px; }
.bd-add-name input { width: 100%; }
.bd-name { display: flex; gap: 8px; align-items: center; }
.bd-name input { flex: 1; min-width: 200px; }
/* Testo legale (SPEC §63): PDF per lingua */
.pdf-langs { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.pdf-langs label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; }
/* Mini editor visuale (SPEC §64, richedit.js) */
.re-wrap { border: 1px solid var(--line); border-radius: 10px; background: #fff; position: relative; }
.re-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line);
  background: #f7f5ec; border-radius: 10px 10px 0 0; position: sticky; top: 0; z-index: 2; }
.re-bar select.re-block { margin-right: 6px; width: 64px; min-height: 30px; padding: 2px 4px; font-size: .82rem; }
.re-bar { gap: 0; }
.re-btn { min-height: 30px; padding: 2px 5px; border: 1px solid transparent; background: transparent; border-radius: 6px;
  font-size: .85rem; color: var(--ink); cursor: pointer; }
.re-btn:hover { background: #ece9df; }
.re-btn.on { background: var(--navy); color: #fff; }
.re-btn.re-ico { padding: 2px 3px; display: inline-flex; align-items: center; justify-content: center; }
.re-btn.re-ico svg { display: block; }
.re-b { font-weight: 800; }
.re-i { font-style: italic; font-family: Georgia, serif; }
.re-clear { text-decoration: line-through; }
.re-html { margin-left: auto; padding: 2px 5px; font-size: .78rem; letter-spacing: .02em; }
.re-src-on .re-btn:not(.re-html), .re-src-on select { opacity: .35; pointer-events: none; }
.re-area { min-height: 160px; max-height: 65vh; overflow: auto; padding: 12px 16px; outline: none; line-height: 1.55; font-size: .95rem; }
.re-area:focus { box-shadow: inset 0 0 0 2px var(--amber-bg); }
.re-area h2 { font-size: 1.3rem; margin: 1em 0 .4em; color: var(--navy); }
.re-area h3 { font-size: 1.12rem; margin: .9em 0 .35em; color: var(--navy); }
.re-area h4 { font-size: 1rem; margin: .8em 0 .3em; color: var(--navy); }
.re-area p { margin: 0 0 .7em; }
.re-area ul, .re-area ol { margin: 0 0 .7em; padding-left: 1.4em; }
.re-area a { color: #1d5fb0; text-decoration: underline; }
.re-area a[target="_blank"]::after { content: " ↗"; font-size: .8em; }
.re-area :first-child { margin-top: 0; }
.re-raw { display: block; margin: .6em 0; padding: 8px 12px; background: #e9e7df; color: var(--muted); border: 1px dashed #b9b4a6;
  border-radius: 6px; font: 600 .82rem/1.3 ui-monospace, monospace; user-select: all; }
.re-raw::before { content: "⚙ "; }
.re-wrap > textarea.re-source { border: 0; border-radius: 0 0 10px 10px; min-height: 260px; width: 100%; }
.re-pop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: #fffbe9;
  border-bottom: 1px solid var(--line); }
.re-pop input[type=text] { flex: 1 1 260px; min-width: 200px; }
.re-pop .err { flex-basis: 100%; }
/* modalità ridotte (fase 3): testi delle sezioni */
.re-inline .re-area, .re-lists .re-area, .re-heads .re-area { min-height: 0; max-height: 40vh; padding: 8px 12px; font-size: .92rem; }
.re-inline .re-area { min-height: 2.6em; }
.re-lists .re-area, .re-heads .re-area { min-height: 4.5em; }
.re-heads .re-area { max-height: 60vh; }
.re-inline .re-bar, .re-lists .re-bar, .re-heads .re-bar { padding: 3px 4px; }
.re-inline .re-btn, .re-lists .re-btn, .re-heads .re-btn { min-height: 26px; }
.re-area:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }
/* finestra dei link (fase 4) */
.re-pop { flex-direction: column; align-items: stretch; }
.re-pop-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.re-pop select, .re-pop input[type=text], .re-pop input[type=email], .re-pop input[type=tel] { min-height: 32px; font-size: .88rem; }
.re-pop select { max-width: 100%; }
.re-pop input[type=email], .re-pop input[type=tel], .re-pop input[type=text] { flex: 1 1 160px; min-width: 120px; }
.re-pop [hidden] { display: none !important; }
.re-pop .re-blank { flex: 1 0 100%; gap: 6px; font-weight: 400; font-size: .88rem; white-space: nowrap; }
.re-pop .re-blank input { width: auto; min-height: 0; margin: 0; flex: none; }
.re-area a.re-broken { color: var(--red); text-decoration: wavy underline; }
/* «Nuova pagina» (SPEC §68) */
.newpage-dialog form { gap: 12px; }
.newpage-dialog fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.newpage-dialog legend { font-weight: 600; padding: 0 4px; }
.np-name { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.np-name span { width: 2.2em; font-weight: 700; font-size: .85rem; }
.np-name input { flex: 1; }
.newpage-dialog .check { font-weight: 400; }
.dup-form { display: inline-flex; align-items: center; margin: 0; }
.newpage-dialog .add-head { justify-content: space-between; }
.newpage-dialog { width: min(640px, 94vw); }
/* attesa dell'anteprima dopo un salvataggio (SPEC §70) */
.pv-frame { position: relative; }
.pv-wait { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px; background: #f4f2ea; border-radius: var(--radius); color: var(--navy); }
.pv-wait[hidden] { display: none; }
.pv-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #d9d4c3; border-top-color: var(--gold, #f5b800);
  animation: pv-spin .8s linear infinite; }
@keyframes pv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pv-spinner { animation-duration: 2.4s; } }

/* foto a griglia nell'editor e finestra della libreria (SPEC §71) */
.pgrid-field { display: flex; flex-direction: column; gap: 6px; }
.pg-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.pg-changed { color: var(--amber); font-weight: 600; }
.pgrid-field { container-type: inline-size; }
.pg-grid { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@container (max-width: 560px) { .pg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 300px) { .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pg-item, .pg-add { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--grey-bg); }
.pg-item { cursor: grab; box-shadow: 0 0 0 1px var(--line); }
.pg-item img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.pg-item.dragging { opacity: .35; }
.pg-item.missing { box-shadow: 0 0 0 2px var(--red); }
.pg-missing { display: flex; height: 100%; align-items: center; justify-content: center; text-align: center; padding: 6px; color: var(--red); font-size: .8rem; }
.pg-n { position: absolute; left: 6px; top: 6px; padding: 1px 7px; border-radius: 10px; background: rgba(0, 29, 61, .78); color: #fff; font: 700 .75rem var(--head); }
.pg-del { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); box-shadow: 0 1px 4px rgba(0,0,0,.25); color: var(--red); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pg-del svg { width: 16px; height: 16px; }
.pg-del:hover:not(:disabled) { background: var(--red-bg); }
.pg-del:disabled { opacity: .4; cursor: not-allowed; }
.pg-moves { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.pg-item:hover .pg-moves, .pg-item:focus-within .pg-moves { opacity: 1; }
@media (hover: none) { .pg-moves { opacity: 1; } }
.pg-moves button { width: 28px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .92); font-weight: 700; cursor: pointer; }
.pg-moves button:disabled { opacity: .35; cursor: default; }
.pg-add button { width: 100%; height: 100%; border: 2px dashed var(--field); border-radius: 8px; background: transparent; color: var(--navy);
  font: 700 .9rem var(--head); cursor: pointer; }
.pg-add button:hover:not(:disabled) { border-color: var(--navy); background: #fff; }
.pg-add button:disabled { opacity: .5; cursor: not-allowed; }
.pg-hint { font-size: .8rem; }

.pone { align-items: flex-start; }
.pone-thumb { flex: none; width: 120px; height: 80px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--grey-bg); cursor: pointer;
  box-shadow: 0 0 0 1px var(--line); }
.pone-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.pone-empty { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; }
.pone .small { margin-top: 4px; }

.pd-search { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.pd-search input { width: 100%; max-width: 420px; }
.photo-dialog .pd-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pd-item { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 5px; border: 2px solid transparent; border-radius: 9px;
  background: var(--grey-bg); text-align: left; cursor: pointer; }
.pd-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.pd-item small { font-size: .72rem; line-height: 1.3; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }   /* nome lungo: va a capo */
.pd-item:hover:not(:disabled) { border-color: var(--field); }
.pd-item.current { border-color: var(--blue); }
.pd-item.on { border-color: var(--navy); background: var(--sel-bg); }
.pd-check { position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff;
  display: none; align-items: center; justify-content: center; font-weight: 700; }
.pd-item.on .pd-check { display: flex; }
.pd-item:disabled { cursor: not-allowed; opacity: .5; }
.pd-in { position: absolute; left: 10px; top: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.92); font-size: .72rem; }
.pd-item[hidden], .pd-in[hidden] { display: none; }
.pd-foot { position: sticky; bottom: -18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 14px -22px -18px; padding: 12px 22px;
  background: #fff; border-top: 1px solid var(--line); }
.photo-dialog .add-head [data-pd-close] { margin-left: auto; }
.pd-cats button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* scelta di più categorie in ordine (galleria, SPEC §72) */
.refm-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.refm-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 6px; background: var(--grey-bg); }
.refm-moves { display: flex; gap: 4px; }
.refm-moves button { min-width: 30px; padding: 2px 6px; }

/* elenco delle sezioni: duplica ed elimina come icone (copia, cestino) */
.sec-ops .sec-ico { display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0; }
.sec-ops .sec-ico svg { display: block; }

/* Verifica in due passaggi (SPEC §89 fase C) */
input.otp { font: 600 1.4rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .2em; max-width: 12ch; }
.twofa-setup ol.steps { padding-left: 22px; }
.twofa-setup ol.steps > li { margin-bottom: 18px; }
.twofa-setup .qr { margin: 12px 0; }
/* card larga (dal login): QR a destra delle istruzioni, così la pagina non diventa lunghissima */
.auth-card.wide .step-qr { display: flex; gap: 24px; align-items: flex-start; }
.auth-card.wide .step-qr-text { flex: 1; min-width: 0; }
.auth-card.wide .step-qr .qr { flex: none; margin: 0; }
@media (max-width: 640px) { .auth-card.wide .step-qr { flex-direction: column; gap: 0; } .auth-card.wide .step-qr .qr { margin: 12px 0; } }
.twofa-setup .qr svg { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.twofa-setup .secret code { font-size: 1.05rem; letter-spacing: .05em; word-break: break-all; }
ul.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 12ch)); gap: 8px 32px; }
ul.recovery-codes code { font-size: 1.15rem; letter-spacing: .05em; }
details.muted-help { margin: 18px 0; color: var(--muted); }
details.muted-help summary { cursor: pointer; }
@media print { header.top, .twofa-print-hide { display: none; } }
/* Schermate di accesso (senza sessione): card bianca con la fascia blu del logo, sfondo con rete animata */
body.auth-page { min-height: 100vh; overflow-x: hidden;
  background: radial-gradient(1200px 700px at 15% -10%, #dfe8f5 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 110%, #fbf1d6 0%, transparent 55%),
              linear-gradient(160deg, #f3f5f9 0%, #eef1f6 45%, #f9f8f2 100%); }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.auth-bg .glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.auth-bg .g1 { width: 520px; height: 520px; left: -140px; top: -120px; background: radial-gradient(circle, #9fc0e8, transparent 70%);
  animation: auth-drift1 22s ease-in-out infinite alternate; }
.auth-bg .g2 { width: 460px; height: 460px; right: -120px; bottom: -140px; background: radial-gradient(circle, #ffd27a, transparent 70%);
  opacity: .45; animation: auth-drift2 26s ease-in-out infinite alternate; }
.auth-bg .g3 { width: 380px; height: 380px; left: 55%; top: 20%; background: radial-gradient(circle, #b9d3f0, transparent 70%);
  opacity: .35; animation: auth-drift3 30s ease-in-out infinite alternate; }
@keyframes auth-drift1 { to { transform: translate(180px, 140px) scale(1.15); } }
@keyframes auth-drift2 { to { transform: translate(-200px, -120px) scale(1.1); } }
@keyframes auth-drift3 { to { transform: translate(-260px, 160px) scale(.9); } }
.auth-main { position: relative; z-index: 1; max-width: none; min-height: 100vh; margin: 0; padding: 40px 16px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.auth-card { width: min(460px, 100%); background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 8, 21, .06), 0 24px 60px -12px rgba(0, 29, 61, .28);
  animation: auth-in .5s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card.wide { width: min(720px, 100%); }
.auth-card.wide .stack { max-width: 380px; }
.auth-card-head { background: var(--navy); padding: 26px 24px; display: flex; justify-content: center; }
.auth-card-head img { height: 56px; width: auto; display: block; }
.auth-card-body { padding: 28px 32px 30px; }
.auth-card-body > h1:first-child, .auth-card-body > :first-child h1:first-child { margin-top: 0; }
.auth-card-body > :last-child { margin-bottom: 0; }
.auth-card-body h1 { font-size: 1.45rem; line-height: 1.25; }
/* avvisi nella card di accesso e avvisi a comparsa: fondo chiaro, icona tonda colorata, filo laterale e lieve sfumatura */
:root { --ico-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23001d3d'/%3E%3Ccircle cx='10' cy='5.6' r='1.3' fill='%23fff'/%3E%3Cpath d='M10 8.8v6' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); --ico-err: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23d1453b'/%3E%3Cpath d='M10 5.2v6' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='14.6' r='1.3' fill='%23fff'/%3E%3C/svg%3E"); --ico-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%231e9a55'/%3E%3Cpath d='M5.8 10.4l2.8 2.8 5.6-5.8' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --ico-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23e0a100'/%3E%3Cpath d='M10 5.2v6' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='14.6' r='1.3' fill='%23fff'/%3E%3C/svg%3E"); }
.auth-card-body .box { position: relative; display: block; padding: 11px 14px 11px 44px; margin: 0 0 16px; font-size: .9rem; line-height: 1.45;
  color: var(--ink); background: #f7f8fb; border: 1px solid #e8ebf1; border-radius: 12px; overflow: hidden;
  animation: auth-note-in .35s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card-body .box > :first-child { margin-top: 0; }
.auth-card-body .box > :last-child { margin-bottom: 0; }
.auth-card-body .box::before { content: ""; position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; background: var(--ico-info) center / contain no-repeat; }
.auth-card-body .box::after, .toast::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--navy); opacity: .85; }
.box.err, .toast.is-err { background: linear-gradient(90deg, rgba(209, 69, 59, .07), rgba(209, 69, 59, 0) 70%), #fff; border-color: #f0dcda; }
.box.err::before, .toast.is-err .toast-dot { background-image: var(--ico-err); }
.box.err::after, .toast.is-err::after { background: #d1453b; }
.box.ok, .toast.is-ok { background: linear-gradient(90deg, rgba(30, 154, 85, .07), rgba(30, 154, 85, 0) 70%), #fff; border-color: #d8ebdf; }
.box.ok::before, .toast.is-ok .toast-dot { background-image: var(--ico-ok); }
.box.ok::after, .toast.is-ok::after { background: #1e9a55; }
.box.warn { background: linear-gradient(90deg, rgba(224, 161, 0, .09), rgba(224, 161, 0, 0) 70%), #fff; border-color: #f1e4c2; }
.box.warn::before { background-image: var(--ico-warn); }
.box.warn::after { background: #e0a100; }
.box.err { animation: auth-note-in .35s cubic-bezier(.2, .7, .2, 1) both, auth-shake .4s .1s ease-in-out; }
@keyframes auth-note-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes auth-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .auth-card-body .box, .box.err { animation: none; } }
.auth-card-body .stack button.primary { width: 100%; padding-top: 11px; padding-bottom: 11px; }
.auth-foot { margin: 18px 0 0; font: 500 .9rem var(--head); letter-spacing: .02em; color: rgba(0, 29, 61, .55); }
@keyframes auth-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@media (max-width: 520px) { .auth-card-body { padding: 22px 20px 24px; } .auth-main { padding-top: 20px; } }
@media (prefers-reduced-motion: reduce) { .auth-bg .glow, .auth-card { animation: none; } }

/* Menu dell'account sul nome in alto a destra */
header.top .user-menu { position: relative; margin-left: auto; }
header.top .user-menu > summary { list-style: none; cursor: pointer; color: var(--cream); font: 600 .95rem var(--head); padding: 6px 12px;
  border-radius: 8px; display: flex; align-items: center; gap: 6px; user-select: none; }
header.top .user-menu > summary::-webkit-details-marker { display: none; }
header.top .user-menu > summary:hover, header.top .user-menu[open] > summary { background: rgba(255, 255, 255, .1); color: #fff; }
header.top .user-menu .um-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
header.top .user-menu[open] .um-caret { transform: translateY(2px) rotate(225deg); }
.user-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; background: var(--card); color: var(--navy);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 8, 21, .18); padding: 6px; }
.user-menu-pop .um-head { padding: 10px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.user-menu-pop .um-head small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.user-menu-pop a, .user-menu-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px;
  background: none; color: var(--navy); font: 600 .92rem var(--head); text-decoration: none; cursor: pointer; justify-content: flex-start; }
.user-menu-pop a:hover, .user-menu-pop button:hover { background: #f3f1e7; color: var(--navy); }
.user-menu-pop form { margin: 0; }

/* Impostazioni account: menu delle sezioni a sinistra */
.account-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 8px; }
.account-nav { position: sticky; top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; }
.account-nav .an-head { margin: -12px -8px 8px; padding: 14px 16px 12px; background: #eaeff6; border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; color: var(--navy); display: flex; flex-direction: column; font-family: var(--head); }
.account-nav .an-head small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.account-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.account-nav a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--navy); font: 600 .92rem var(--head); }
.account-nav a:hover { background: #f3f1e7; }
.account-nav a.on { background: var(--navy); color: #fff; }
.account-main { min-width: 0; max-width: 820px; }
.account-main > h2:first-child { margin-top: 0; }
.account-facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 18px; margin: 0 0 18px; }
.account-facts dt { font-weight: 600; color: var(--muted); }
.account-facts dd { margin: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.account-status p { margin: 4px 0; }
.account-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 18px; }
.account-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; }
.account-card h3 { margin: 0 0 6px; font-size: 1rem; }
.account-card p { margin: 0 0 12px; font-size: .9rem; }
.account-card form { margin-top: auto; }
.account-main table.list + form { margin-top: 14px; }
@media (max-width: 760px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-nav { position: static; }
  .account-nav ul { flex-direction: row; flex-wrap: wrap; }
  .account-facts { grid-template-columns: 1fr; gap: 2px; }
  .account-facts dd { margin-bottom: 10px; }
}

/* ================================================================== stile «card» moderno (03/12)
   Le card del pannello come quelle di accesso: niente bordo, ombra morbida, angoli più tondi. Dentro una card, i
   riquadri annidati non hanno ombra (solo un fondo appena più scuro o un filo leggerissimo). Le tessere che si
   selezionano (stili, preset, scelte) tengono il bordo: serve a mostrare quella scelta. */
:root { --shadow-card: 0 1px 2px rgba(0, 8, 21, .05), 0 6px 20px -8px rgba(0, 29, 61, .16);
        --shadow-card-hover: 0 2px 4px rgba(0, 8, 21, .06), 0 16px 34px -12px rgba(0, 29, 61, .26); --radius-card: 16px; }
.box:not(.err):not(.ok):not(.warn), table.list, fieldset, .facts > div, .chat-log, .cat-card, .hub-card, .card-row, .lang-tile,
.wz-step, .go-card, .data-card, .pages-nav, .ed-card, .form-edit .card, .form-requests details, .cat-row, .nav-tree-form, .id-share,
.account-nav, .account-card, .pv-frame iframe, pre.files, .pitem {
  border-color: transparent; box-shadow: var(--shadow-card); border-radius: var(--radius-card); }
.box.err, .box.ok, .box.warn { position: relative; padding-left: 44px; border-radius: 12px; overflow: hidden; color: var(--ink); }
.box.err::before, .box.ok::before, .box.warn::before { content: ""; position: absolute; left: 14px; top: 14px; width: 20px; height: 20px;
  background-position: center; background-size: contain; background-repeat: no-repeat; }
.box.err::after, .box.ok::after, .box.warn::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
/* card cliccabili: si sollevano un poco al passaggio */
.hub-card, .go-card, .cat-card, .pitem { transition: box-shadow .2s, transform .2s; }
a.hub-card:hover, div.hub-card:hover, a.go-card:hover, .go-card:hover, .cat-card:hover, .pitem:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-1px); border-color: transparent; }
/* fieldset senza bordo: il titolo (legend) entra nella card */
fieldset > legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; }
fieldset > legend + * { clear: both; }
/* annidati: niente ombra dentro un'altra card */
:is(.box, fieldset, .data-card, .ed-card, .wz-step, .account-card, .form-edit .card, .card-row, .nav-tree-form, .hub-card, dialog)
  :is(.box:not(.err):not(.ok):not(.warn), fieldset, table.list, .card-row, .lang-tile, .facts > div, .cat-row, pre.files) {
  box-shadow: none; border: 1px solid #eceef3; border-radius: 12px; }
table.list thead th { background: #f6f7f9; border-bottom-color: #eceef3; }

/* ------------------------------------------------------------------ schede
   Schede principali del sito: barra bianca con ombra, scheda attiva come pillola blu.
   Sotto-schede (Contenuti, Media, Aspetto…): binario chiaro, scheda attiva bianca in rilievo. */
.tabs-row { background: #fff; box-shadow: var(--shadow-card); border-radius: 14px; padding: 5px; align-items: center; }
.tabs, .tabs-row .tabs { background: none; gap: 2px; margin-top: 0; }
.tabs a { padding: 8px 14px; border: 0; border-radius: 10px; font-size: .93rem; transition: background .15s, color .15s; }
.tabs a:hover { background: #f1f3f7; color: var(--navy); }
.tabs a.active { background: var(--navy); color: #fff; box-shadow: 0 4px 12px -4px rgba(0, 29, 61, .45); }
.tabs a.active:hover { background: var(--navy); color: #fff; }
.tabs-row .view-lang { margin: 0 4px 0 0; }
.lib-tabs { display: flex; flex-wrap: wrap; gap: 2px; width: fit-content; max-width: 100%; padding: 4px; margin: 4px 0 16px;
  background: #eeece4; border: 0; border-radius: 12px; }
.lib-tabs a { padding: 6px 13px; margin: 0; border: 0; border-radius: 9px; color: var(--muted); font-family: var(--head); font-size: .9rem;
  transition: background .15s, color .15s, box-shadow .15s; }
.lib-tabs a:hover { background: rgba(255, 255, 255, .6); color: var(--navy); }
.lib-tabs a.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0, 8, 21, .08), 0 3px 10px -4px rgba(0, 29, 61, .2); }
.lib-tabs .badge { background: rgba(0, 29, 61, .07); }
.lib-tabs a.on .badge { background: #e8eef6; color: var(--navy); }
.content-tabs-bar, .lib-bar { border-bottom: 0; padding-bottom: 2px; }
.content-tabs-bar .content-tabs, .lib-bar .lib-tabs { margin: 0; flex: 0 1 auto; }
.look-tabs { background: #eeece4; }
.pitem:has(input:checked), .pitem.current, .pitem:has(input:checked):hover, .pitem.current:hover { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold); }

/* ------------------------------------------------------------------ menu a tendina a card (lingua di visualizzazione) */
.dd-menu { position: relative; }
.dd-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 11px;
  border-radius: 10px; font: 600 .85rem var(--head); color: var(--navy); user-select: none; transition: background .15s; }
.dd-menu > summary::-webkit-details-marker { display: none; }
.dd-menu > summary:hover, .dd-menu[open] > summary { background: #f1f3f7; }
.dd-menu .um-caret { width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s; opacity: .7; }
.dd-menu[open] .um-caret { transform: translateY(1px) rotate(225deg); }
.dd-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 230px; padding: 6px; background: #fff;
  border-radius: 14px; box-shadow: 0 2px 6px rgba(0, 8, 21, .08), 0 18px 40px -12px rgba(0, 29, 61, .3); animation: dd-in .14s ease-out; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.dd-head { padding: 8px 10px 6px; font: 600 .72rem var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dd-foot { margin: 4px 4px 2px; padding: 8px 6px 4px; border-top: 1px solid #eef0f4; font-size: .75rem; line-height: 1.35; color: var(--muted); }
.dd-pop > a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.dd-pop > a:hover { background: #f1f3f7; }
.dd-pop > a.on { background: #e8eef6; color: var(--navy); font-weight: 600; }
.dd-pop > a.on::after { content: ""; margin-left: auto; width: 5px; height: 10px; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg) translate(-2px, -1px); }
.lang-menu .lang-code { font: 700 .74rem var(--head); letter-spacing: .04em; }
.dd-pop .lang-code { display: inline-grid; place-items: center; min-width: 30px; height: 22px; border-radius: 6px; background: #eef0f4; color: var(--navy); }
.dd-pop > a.on .lang-code { background: var(--navy); color: #fff; }
.tabs-row .lang-menu { flex: none; margin-right: 2px; }

/* ------------------------------------------------------------------ intestazione del sito: anteprima e copia link */
.pv-group { display: inline-flex; align-items: stretch; border: 1.5px solid var(--navy); border-radius: 999px; overflow: hidden; background: #fff; }
/* bordo sul contenitore (overflow nascosto): lo sfondo al passaggio riempie tutta la pillola e il bordo resta */
.pv-group > .button, .pv-group > button, .pv-group > .button:hover, .pv-group > button:hover, .pv-group > .button:focus-visible, .pv-group > button:focus-visible {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 0; color: var(--navy); }
.pv-group > .button, .pv-group > button { background: none; }
.pv-group > .pv-open { padding: 4px 12px 4px 14px; }
.pv-group > .pv-copy { padding: 0 11px 0 9px; border-left: 1.5px solid rgba(0, 29, 61, .2); }
.pv-group > .pv-copy:hover { border-left: 1.5px solid rgba(0, 29, 61, .2); }
.pv-group > .pv-open:hover, .pv-group > .pv-copy:hover, .pv-group > .pv-open:focus-visible, .pv-group > .pv-copy:focus-visible { background: #e8eef6; }
.pv-group:has(:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.pv-group > :focus-visible { outline: none; }
/* pagina d'attesa mentre si rigenera l'anteprima */
.pv-wait-card { max-width: 460px; margin: 60px auto; padding: 34px 32px 28px; text-align: center; background: #fff; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 8, 21, .06), 0 24px 60px -12px rgba(0, 29, 61, .22); }
.pv-wait-card h1 { font-size: 1.35rem; margin: 18px 0 6px; }
.pv-wait-spin { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; border: 3px solid #e8eef6; border-top-color: var(--gold); animation: pv-spin .9s linear infinite; }
.pv-wait-card.is-err .pv-wait-spin { animation: none; border-color: #f0dcda; border-top-color: #d1453b; }
.pv-wait-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
@keyframes pv-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ elenco pagine/post comprimibile */
.nav-toggle, .nav-toggle:hover, .nav-toggle:focus-visible { width: 28px; height: 28px; margin: -3px 2px 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--navy); }
.nav-toggle:hover, .nav-toggle:focus-visible { background: rgba(0, 29, 61, .08); }
.pages-layout.nav-collapsed .pages-nav { padding: 0; background: none; box-shadow: none; }
/* chiuso: una linguetta verticale con il nome dell'elenco, che si riapre con un clic */
.pages-layout.nav-collapsed .nav-toggle { flex-direction: column; gap: 12px; width: 40px; height: auto; min-height: 150px; margin: 0; padding: 14px 0;
  border-radius: 12px; background: #fff; box-shadow: var(--shadow-card); transition: box-shadow .2s, transform .2s; }
.pages-layout.nav-collapsed .nav-toggle::after { content: attr(data-label); writing-mode: vertical-rl; transform: rotate(180deg);
  font: 600 .85rem var(--head); letter-spacing: .02em; color: var(--navy); }
.pages-layout.nav-collapsed .nav-toggle:hover { background: #fff; box-shadow: var(--shadow-card-hover); transform: translateX(1px); }

/* ------------------------------------------------------------------ rete animata nella parte alta del pannello
   La tela sta ferma sotto l'header e sfuma verso il basso; l'intestazione del sito è trasparente finché la pagina non
   scorre, poi diventa «vetro» (fondo chiaro sfocato) per coprire i contenuti che le passano sotto. */
header.top { z-index: 60; }
@media (max-width: 899px), (max-height: 559px) { header.top { position: relative; } }
main { position: relative; z-index: 1; }
.panel-net { position: fixed; left: 0; right: 0; top: 0; height: 380px; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 0, #000 30%, transparent 100%); mask-image: linear-gradient(#000 0, #000 30%, transparent 100%); }
.panel-net canvas { display: block; width: 100%; height: 100%; }
@media (min-width: 900px) and (min-height: 560px) {
  body:not(.scrolled) .thead, body:not(.scrolled) .content-tabs-bar, body:not(.scrolled) .editor-head { background: transparent; box-shadow: none; }
  body.scrolled .thead, body.scrolled .content-tabs-bar, body.scrolled .editor-head {
    background: rgba(249, 248, 242, .88); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }
  body.scrolled .thead, body.scrolled .content-tabs-bar { box-shadow: 0 0 0 100vmax rgba(249, 248, 242, .88); }   /* tagliata da clip-path */
  body .thead:has(details[open]) { clip-path: none; box-shadow: none; }   /* il menu della lingua deve poter uscire dall'intestazione */
  .thead, .content-tabs-bar, .editor-head { transition: background .2s; }
}
@media (prefers-reduced-motion: reduce) { .dd-pop, .pv-wait-spin { animation: none; } }

/* Impostazioni della piattaforma: voce attiva nella barra in alto, sotto-schede sotto il titolo */
header.top nav a[aria-current] { border-bottom-color: var(--gold); color: #fff; }
.settings-tabs { margin: 0 0 18px; }

/* Impostazioni › Backup e ripristino */
.backup-restore { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 16px 20px; margin: 0 0 18px; }
.backup-restore h3 { margin-top: 0; }
.backup-removed { margin: 0 0 18px; }
.backup-removed ul { columns: 2; font-size: .85rem; }
table.backup-files code { word-break: break-all; }
