/* Posta KeyPlan: stile Future di KeyPlan (gli stessi colori del sito), chiaro e scuro */
:root {
  --bg: #ffffff; --panel: #ffffff; --panel-2: #f3f7fc;
  --card-1: #edf3fb; --card-2: #e0eaf6; --sep: #e8f0f9; --linea: #d3d8f3;
  --ink: #3d4d7c; --ink-2: #56679a; --muted: #8592bd; --title: #5379c9; --blu: #6a92dc; --blu-s: #e3ebfa; --navy: #5079cf; --navy-2: #6a92dc;
  --q-ink: #14264d; --rif: #b4465f; --rif-bg: #fbe7ec; --com: #2f8a64; --com-bg: #e2f3ec; --warn-bg: #fbf0db; --warn-tx: #8a5f10;
  --ombra: 0 1px 3px rgba(20, 38, 77, .1); --ombra-2: 0 14px 34px rgba(30, 50, 90, .14);
  --f: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d1420; --panel: #121c2b; --panel-2: #162133; --card-1: #1b2739; --card-2: #142031; --sep: #1b2739; --linea: #2b3a55;
  --ink: #c9d6f5; --ink-2: #a3b2d8; --muted: #7f8db8; --title: #86a9ee; --blu: #86a9ee; --blu-s: rgba(134, 169, 238, .16); --navy: #5d7fc4; --navy-2: #6c8ed3;
  --q-ink: #e6eeff; --rif: #ec8aa0; --rif-bg: rgba(236, 138, 160, .13); --com: #5cc59a; --com-bg: rgba(92, 197, 154, .13); --warn-bg: rgba(226, 180, 90, .12); --warn-tx: #e2b45a;
  --ombra: 0 1px 3px rgba(0, 0, 0, .5); --ombra-2: 0 14px 34px rgba(0, 0, 0, .5); color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0d1420; --panel: #121c2b; --panel-2: #162133; --card-1: #1b2739; --card-2: #142031; --sep: #1b2739; --linea: #2b3a55;
  --ink: #c9d6f5; --ink-2: #a3b2d8; --muted: #7f8db8; --title: #86a9ee; --blu: #86a9ee; --blu-s: rgba(134, 169, 238, .16); --navy: #5d7fc4; --navy-2: #6c8ed3;
  --q-ink: #e6eeff; --rif: #ec8aa0; --rif-bg: rgba(236, 138, 160, .13); --com: #5cc59a; --com-bg: rgba(92, 197, 154, .13); --warn-bg: rgba(226, 180, 90, .12); --warn-tx: #e2b45a;
  --ombra: 0 1px 3px rgba(0, 0, 0, .5); --ombra-2: 0 14px 34px rgba(0, 0, 0, .5); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, [contenteditable]:focus-visible { outline: 2px solid var(--blu); outline-offset: 2px; }
svg { flex: none; }

.avviso-prova { flex: none; padding: 5px 16px; text-align: center; font-size: 12.5px; font-weight: 500; background: var(--warn-bg); color: var(--warn-tx); }

/* ---- testata ---- */
.testa { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--sep); background: var(--bg); }
.marchio { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.logo { height: 24px; width: auto; display: block; }
.logo.scuro { display: none; }
.marchio span { padding-left: 12px; border-left: 1px solid var(--linea); font-size: 16px; font-weight: 600; color: var(--title); }
.cerca { flex: 1; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.cerca svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cerca input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; color: var(--q-ink); }
.cerca input::placeholder { color: var(--muted); }
.cerca:focus-within { box-shadow: 0 0 0 2px var(--blu); }
.ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--panel-2); color: var(--ink); cursor: pointer; }
.ic:hover { background: var(--card-2); }
.ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tema .sole { display: none; }
.indietro { display: none; }
.btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: 600 14.5px var(--f); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.sec { background: var(--panel-2); color: var(--ink); }
.btn.sec:hover { background: var(--card-2); }
.btn[disabled] { opacity: .6; cursor: default; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo.chiaro { display: none; } :root:not([data-theme="light"]) .logo.scuro { display: block; }
  :root:not([data-theme="light"]) .tema .luna { display: none; } :root:not([data-theme="light"]) .tema .sole { display: block; } }
:root[data-theme="dark"] .logo.chiaro { display: none; } :root[data-theme="dark"] .logo.scuro { display: block; }
:root[data-theme="dark"] .tema .luna { display: none; } :root[data-theme="dark"] .tema .sole { display: block; }

/* ---- tre colonne: cartelle · elenco · lettura (scrivendo: cartelle · scrittura) ---- */
.corpo { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 380px minmax(0, 1fr); }
body.scrivendo .corpo { grid-template-columns: 220px minmax(0, 1fr); }
body.scrivendo .elenco, body.scrivendo .lettura { display: none; }

.cartelle { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--sep); overflow: auto; }
.cartella { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14.5px; text-align: left; cursor: pointer; white-space: nowrap; }
.cartella svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cartella:hover { background: var(--panel-2); }
.cartella[aria-current="true"] { background: var(--blu-s); color: var(--title); font-weight: 600; }
.cartella .n { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.cartelle .conto { margin-top: auto; padding: 14px 12px 4px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.cartelle .conto b { display: block; color: var(--ink-2); font-weight: 600; }

.elenco { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--sep); }
.elenco-t { flex: none; display: grid; gap: 10px; padding: 16px 18px 10px; }
.elenco-t h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--q-ink); }
.elenco-l { flex: 1; overflow: auto; padding: 0 8px 18px; }
.voce { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 1px; width: 100%; padding: 12px 10px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; }
.voce + .voce::before { content: ""; position: absolute; left: 58px; right: 10px; top: 0; height: 1px; background: var(--sep); }
.voce:hover { background: var(--panel-2); }
.voce[aria-current="true"] { background: var(--blu-s); }
.voce:hover::before, .voce[aria-current="true"]::before, .voce:hover + .voce::before, .voce[aria-current="true"] + .voce::before { opacity: 0; }
.voce .av { grid-row: 1 / span 3; align-self: start; margin-top: 2px; }
.voce .chi { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--q-ink); font-weight: 500; }
.voce .ora { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.voce .ogg { grid-column: 2 / 4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink); }
.voce .ant { grid-column: 2 / 4; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.voce .ant span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voce.nuova .chi, .voce.nuova .ogg { font-weight: 700; color: var(--q-ink); }
.voce.nuova .chi::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--navy); vertical-align: middle; }
.tag { flex: none; padding: 0 7px; border-radius: 6px; background: var(--card-1); color: var(--ink-2); font-size: 11.5px; font-weight: 600; line-height: 19px; }
.tag.bozza { background: var(--rif-bg); color: var(--rif); }
.tag.clip { display: inline-flex; align-items: center; gap: 3px; background: transparent; padding: 0; color: var(--muted); }
.tag.clip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.vuoto { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 14px; }

.av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; }

/* filtri e scelte a pillola (al posto delle tendine) */
.pill { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--panel-2); justify-self: start; }
.pill button { padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.pill button:hover { color: var(--q-ink); }
.pill button[aria-checked="true"], .pill button[aria-pressed="true"] { background: var(--panel); color: var(--title); font-weight: 600; box-shadow: var(--ombra); }
.pill.piccola button { padding: 4px 11px; font-size: 12.5px; }

/* ---- lettura ---- */
.lettura { min-width: 0; overflow: auto; padding: 22px 28px 48px; }
.lettura:focus { outline: none; }
.niente { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); text-align: center; }
.niente svg { width: 46px; height: 46px; fill: none; stroke: var(--linea); stroke-width: 1.5; stroke-linejoin: round; }
.let-t h2 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; color: var(--q-ink); overflow-wrap: anywhere; }
.let-t p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.let-azioni { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.msg { margin-bottom: 12px; border: 1px solid var(--sep); border-radius: 16px; background: var(--panel); overflow: hidden; }
.msg-h { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.msg:not(.chiuso) .msg-h { cursor: default; }
.msg-h .chi { min-width: 0; }
.msg-h .nome { font-weight: 600; color: var(--q-ink); }
.msg-h .ind { margin-left: 6px; font-size: 13px; color: var(--muted); }
.msg-h .verso, .msg-h .riass { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.msg-h .riass { display: none; }
.msg.chiuso .msg-h .verso { display: none; }
.msg.chiuso .msg-h .riass { display: block; }
.msg-h .ora { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.msg-c { padding: 0 16px 16px; }
.msg.chiuso .msg-c { display: none; }
.msg-c iframe { display: block; width: 100%; height: 80px; border: 0; border-radius: 10px; background: #fff; }
.img-bloccate { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-tx); font-size: 13px; }
.img-bloccate button { padding: 0; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.allegati { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.allegato { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--sep); border-radius: 12px; font-size: 13px; color: var(--ink); }
.allegato svg { width: 18px; height: 18px; fill: none; stroke: var(--title); stroke-width: 1.8; stroke-linejoin: round; }
.allegato small { color: var(--muted); }
.risposta-rapida { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ---- scrittura (a sinistra) e anteprima del modello (a destra) ---- */
.scrittura { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
.scr-col { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 16px 26px 22px; border-right: 1px solid var(--sep); }
.scr-t { flex: none; display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.scr-t h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--q-ink); }
.schede { display: none; }
.scr-form { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.riga { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 7px 0; border-bottom: 1px solid var(--sep); }
.et { flex: none; width: 64px; font-size: 14px; color: var(--muted); }
.chips { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.chips input, .oggetto { flex: 1; min-width: 150px; padding: 6px 0; border: 0; outline: none; background: transparent; font: inherit; color: var(--q-ink); }
.oggetto { font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--blu-s); color: var(--title); font-size: 13.5px; font-weight: 500; }
.chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { flex: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.chip button:hover { background: rgba(83, 121, 201, .16); }
.chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.agg { flex: none; display: flex; gap: 2px; }
.mini { padding: 6px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.mini:hover { background: var(--panel-2); color: var(--ink); }
.mini.pieno { background: var(--navy); color: #fff; }
.err { margin: 6px 0 2px 76px; font-size: 13px; color: var(--rif); }
.err-gen { margin-left: 0; }
.suggerimenti { display: grid; margin: 4px 0 4px 76px; padding: 4px; border: 1px solid var(--sep); border-radius: 12px; background: var(--panel); box-shadow: var(--ombra-2); }
.suggerimenti button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.suggerimenti button:hover, .suggerimenti button[aria-selected="true"] { background: var(--blu-s); }
.suggerimenti .av { width: 28px; height: 28px; font-size: 11px; }
.suggerimenti small { display: block; font-size: 12px; color: var(--muted); }
.barra { flex: none; display: flex; gap: 4px; padding: 10px 0 4px; }
.barra button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 15px; cursor: pointer; }
.barra button:hover { background: var(--panel-2); }
.barra button[aria-pressed="true"] { background: var(--blu-s); color: var(--title); }
.barra svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.link-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0 8px; }
#link-url { flex: 1; min-width: 180px; padding: 8px 12px; border: 1px solid var(--linea); border-radius: 10px; outline: none; background: var(--panel); font: inherit; color: var(--q-ink); }
#link-url:focus { border-color: var(--blu); }
.link-bar .err { width: 100%; margin: 0; }
.editor { flex: 1 0 auto; min-height: 220px; padding: 10px 2px 16px; outline: none; font-size: 15px; line-height: 1.65; color: var(--q-ink); overflow-wrap: anywhere; cursor: text; }
.editor:focus-visible { outline: none; }
.editor:empty::before { content: attr(data-vuoto); color: var(--muted); pointer-events: none; }
.editor > div, .editor > p { margin: 0; }
.editor ul, .editor ol { margin: 6px 0; padding-left: 24px; }
.editor a { color: var(--title); }
.citato { flex: none; max-height: 170px; overflow: auto; margin: 4px 0 8px; padding-left: 12px; border-left: 2px solid var(--linea); font-size: 13px; line-height: 1.55; color: var(--muted); white-space: pre-wrap; }
.citato b { display: block; margin-bottom: 4px; font-weight: 500; }
.scr-f { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--sep); }
.scr-f .nota { margin-right: auto; font-size: 13px; color: var(--muted); }
.ant-col { display: flex; flex-direction: column; min-height: 0; background: var(--panel-2); }
.ant-t { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ant-t .pill { background: var(--card-1); }
.ant-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #f3f7fc; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px; background: var(--q-ink); color: var(--bg); font-size: 14px; font-weight: 500; opacity: 0; translate: -50% 16px; transition: opacity .3s, translate .3s; pointer-events: none; }
.toast.su { opacity: 1; translate: -50% 0; }

/* ---- schermi medi: le cartelle diventano una colonna di icone ---- */
@media (max-width: 1280px) {
  .corpo { grid-template-columns: 72px 340px minmax(0, 1fr); }
  body.scrivendo .corpo { grid-template-columns: 72px minmax(0, 1fr); }
  .cartella { justify-content: center; padding: 11px 0; }
  .cartella .nome, .cartelle .conto { display: none; }
  .cartella .n { position: absolute; top: 3px; right: 6px; min-width: 18px; padding: 0 5px; font-size: 10.5px; line-height: 16px; }
}
/* ---- scrittura e anteprima una sotto l'altra, con le schede ---- */
@media (max-width: 1060px) {
  .scrittura { display: flex; flex-direction: column; }
  .scr-col { flex: 1; border-right: 0; }
  .schede { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2); }
  .schede button { padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; }
  .schede button[aria-selected="true"] { background: var(--panel); color: var(--title); font-weight: 600; box-shadow: var(--ombra); }
  .scrittura[data-scheda="scrivi"] .ant-col { display: none; }
  .scrittura[data-scheda="anteprima"] .scr-col { flex: none; overflow: visible; padding-bottom: 6px; }
  .scrittura[data-scheda="anteprima"] .scr-form { display: none; }
  .scrittura[data-scheda="anteprima"] .ant-col { flex: 1; }
}
/* ---- telefono: una colonna sola, elenco → lettura → scrittura ---- */
@media (max-width: 760px) {
  .testa { gap: 8px; padding: 8px 12px; }
  .marchio span { display: none; }
  .logo { height: 22px; }
  .cerca { height: 38px; padding: 0 12px; }
  .scrivi span { display: none; }
  .scrivi { width: 40px; padding: 0; justify-content: center; }
  .corpo { display: flex; flex-direction: column; }
  .cartelle { flex: none; flex-direction: row; gap: 4px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--sep); overflow-x: auto; scrollbar-width: none; }
  .cartella { justify-content: flex-start; padding: 7px 12px; }
  .cartella .nome { display: inline; }
  .cartella .n { position: static; margin-left: 2px; }
  .cartelle .conto { display: none; }
  .elenco, .lettura, .scrittura { flex: 1; min-height: 0; border-right: 0; }
  .elenco-t { padding: 12px 14px 8px; }
  .elenco-l { padding: 0 4px 18px; }
  body.vista-elenco .lettura { display: none; }
  body.vista-lettura .cartelle, body.vista-lettura .elenco { display: none; }
  body.scrivendo .cartelle { display: none; }
  body:not(.vista-elenco) .indietro { display: grid; }
  body:not(.vista-elenco) .cerca, body:not(.vista-elenco) .marchio { display: none; }
  body:not(.vista-elenco) .testa .tema { margin-left: auto; }
  .lettura { padding: 16px 14px 40px; }
  .let-t h2 { font-size: 19px; }
  .msg-h { padding: 12px; gap: 10px; }
  .msg-h .ind { display: none; }
  .msg-c { padding: 0 10px 12px; }
  .scr-col { padding: 12px 14px 16px; }
  .et { width: 54px; }
  .err, .suggerimenti { margin-left: 0; }
  .agg .mini { padding: 6px 8px; }
  .chips input, .oggetto { min-width: 110px; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
.avviso-prova.vero { background: var(--com-bg); color: var(--com); }
.avviso-prova a { color: inherit; font-weight: 700; }

/* ---- editor: titolo, riquadro e tasto a pillola (come nel modello KeyPlan) ---- */
.barra { flex-wrap: wrap; align-items: center; }
.barra .sep { width: 1px; height: 20px; margin: 0 4px; background: var(--linea); }
.editor h2 { margin: 6px 0 10px; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.03em; color: var(--blu); }
.ed-riq, .ed-btn { position: relative; display: grid; gap: 4px; margin: 8px 0 12px; padding: 12px 40px 12px 16px; border-radius: 14px; background: var(--panel); box-shadow: 0 0 0 1px var(--linea), var(--ombra); user-select: none; }
.ed-riq input, .ed-btn input { width: 100%; min-width: 0; padding: 3px 0; border: 0; outline: none; background: transparent; font: inherit; color: var(--q-ink); }
.ed-riq input::placeholder, .ed-btn input::placeholder { color: var(--muted); }
.ed-riq .e1 { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ed-riq .e2 { font-size: 17px; font-weight: 700; color: var(--title); }
.ed-riq .e3 { font-size: 13px; color: var(--muted); }
.ed-btn { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; }
.ed-btn .e1 { width: auto; min-width: 150px; padding: 8px 18px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 600; text-align: center; field-sizing: content; }
.ed-btn .e1::placeholder { color: rgba(255, 255, 255, .75); }
.ed-btn .e2 { font-size: 13.5px; color: var(--title); }
.ed-x { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.ed-x:hover { background: var(--panel-2); color: var(--rif); }
.ed-x svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.ed-err { box-shadow: 0 0 0 2px var(--rif); }

/* ---- allegati mentre scrivi ---- */
.allegati-scr { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 4px; }
.all-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--panel-2); font-size: 13px; color: var(--ink); }
.all-chip svg.doc { width: 16px; height: 16px; fill: none; stroke: var(--title); stroke-width: 1.8; stroke-linejoin: round; }
.all-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-chip small { color: var(--muted); white-space: nowrap; }
.all-chip.carica small { color: var(--title); }
.all-chip.no { background: var(--rif-bg); color: var(--rif); }
.all-chip.no small { color: var(--rif); }
.all-chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.all-chip button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
a.allegato { text-decoration: none; cursor: pointer; }
a.allegato:hover { border-color: var(--blu); color: var(--title); }

/* ---- invio programmato ---- */
.programma { flex: none; display: grid; gap: 10px; margin-top: 8px; padding: 14px 16px; border-radius: 16px; background: var(--panel-2); }
.prg-t { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--q-ink); }
.programma .pill { background: var(--card-1); }
.prg-scelta { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px 10px; }
.et-p { font-size: 13px; color: var(--muted); }
.prg-giorni, .prg-ore { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.prg-giorni button, .prg-ore button { flex: none; padding: 6px 11px; border: 0; border-radius: 999px; background: var(--card-1); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.prg-giorni button[aria-checked="true"], .prg-ore button[aria-checked="true"] { background: var(--navy); color: #fff; font-weight: 600; }
.prg-riass { margin: 0; font-size: 13.5px; color: var(--title); font-weight: 600; }
.prg-riass:empty { display: none; }
.btn.sec[aria-pressed="true"] { background: var(--blu-s); color: var(--title); }
@media (max-width: 760px) { .prg-scelta { grid-template-columns: 1fr; } .scr-f .btn span { display: none; } .scr-f .btn { padding: 0 14px; } .scr-f [data-invia] span { display: inline; } }
