/* Pagina ospite: mobile-first, chiara, un solo colore d'azione. Stessa famiglia
   visiva del gestore (carta calda, blu notte, terracotta), ma più leggera. */
:root {
  --paper: #f7f4ee; --card: #fffdf9; --ink: #1b2231; --ink-2: #4a5160; --muted: #7b7f8a;
  --line: #e4ded1; --navy: #1f3364; --terra: #b8552f; --terra-2: #d16a41; --terra-soft: #f7e6dd;
  --ok: #2e8b57; --ok-soft: #e4f2ea; --danger: #b3261e; --danger-soft: #f9e4e2; --sand: #efe8da;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; font-family: var(--sans); background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--navy); margin: 0; font-variation-settings: "opsz" 72, "SOFT" 0, "WONK" 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }
.g-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; gap: 10px; }
.g-brand { display: flex; flex-direction: column; min-width: 0; }
.g-org { font-family: var(--serif); font-size: 18px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-by { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.g-by em { font-style: normal; color: var(--terra); }
.g-langs { display: flex; gap: 2px; background: var(--sand); border-radius: 999px; padding: 3px; }
.g-langs button { border: none; background: none; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.g-langs button.active { background: var(--navy); color: #fff; }
.g-main { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
.g-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 16px 30px; }
.g-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(27,34,49,.05); }
.g-center { text-align: center; }
.g-hero { padding: 0; overflow: hidden; }
.g-hero img { width: 100%; height: 190px; object-fit: cover; display: block; }
.g-hero .body { padding: 18px; }
.g-dates { display: flex; gap: 12px; margin-top: 10px; }
.g-date { flex: 1; background: var(--paper); border-radius: 12px; padding: 10px 12px; }
.g-date .l { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.g-date .v { font-family: var(--serif); font-weight: 600; font-size: 18px; font-variation-settings: "opsz" 24, "SOFT" 0; color: var(--navy); font-variant-numeric: tabular-nums lining-nums; }
.g-date .t { font-size: 13px; color: var(--ink-2); }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.todo { background: var(--terra-soft); color: var(--terra); }
label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #d3cbb9; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22,35,58,.10); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row > div { min-width: 0; }
@media (max-width: 460px) { .row { grid-template-columns: 1fr; } }
.btn { display: inline-block; width: 100%; font: inherit; font-weight: 700; padding: 14px 18px; border-radius: 12px; border: none; background: var(--terra); color: #fff; cursor: pointer; text-align: center; font-size: 16px; }
.btn:hover { background: var(--terra-2); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid #d3cbb9; }
.btn.small { width: auto; padding: 9px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.msg { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: 14px; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.guest-block { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 14px; margin-top: 12px; background: #fff; }
.guest-block .gh { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.guest-block .gh h3 { font-size: 15px; }
.guest-block .rm { background: none; border: none; color: var(--danger); font-size: 13px; cursor: pointer; font-weight: 600; }
.photo-box { border: 1px dashed #d3cbb9; border-radius: 12px; padding: 14px; text-align: center; margin-top: 6px; background: var(--paper); }
.photo-box.done { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.photo-box input { display: none; }
.photo-box .pb-title { font-weight: 600; color: var(--navy); }
.photo-box .pb-hint { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.photo-box img { max-height: 120px; border-radius: 8px; margin-bottom: 8px; }
.access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
@media (max-width: 460px) { .access-grid { grid-template-columns: 1fr; } }
.access { background: var(--paper); border-radius: 12px; padding: 12px 14px; }
.access .l { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.access .v { font-family: var(--serif); font-weight: 600; font-size: 24px; font-variation-settings: "opsz" 24, "SOFT" 0; color: var(--navy); letter-spacing: 1px; word-break: break-all; font-variant-numeric: tabular-nums lining-nums; }
.access .v.small { font-size: 16px; font-family: var(--sans); }
details { border-top: 1px solid var(--line); padding: 4px 0; }
details:first-of-type { border-top: none; }
summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--navy); list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: "+"; color: var(--terra); font-size: 20px; font-weight: 400; }
details[open] summary::after { content: "–"; }
details .db { padding: 0 0 12px; white-space: pre-line; color: var(--ink-2); font-size: 15px; }
.kv { display: grid; grid-template-columns: 1fr 1.6fr; gap: 4px 12px; font-size: 14.5px; padding: 4px 0; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink); white-space: pre-line; }
.app-line { padding: 8px 0; border-top: 1px dashed var(--line); font-size: 14.5px; }
.app-line b { color: var(--navy); }
.app-line a { color: var(--terra); font-weight: 600; }
.faq-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 14px 0 2px; }
.nav-pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 4px 0 10px; }
.nav-pills a { white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--navy); background: var(--sand); padding: 6px 12px; border-radius: 999px; text-decoration: none; }

/* chat con Leo */
.chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; padding: 10px; background: #f4f6fb; border-radius: 12px; border: 1px solid #e3e8f4; min-height: 60px; }
.cb { max-width: 88%; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid #e3e8f4; font-size: 15px; }
.cb.guest { align-self: flex-end; background: #e6f6ec; border-color: #cfe9d9; border-bottom-right-radius: 4px; }
.cb.bot, .cb.staff { align-self: flex-start; border-bottom-left-radius: 4px; }
.cb.staff { background: #eef2fc; border-color: #d9e1f7; }
.cb.note { align-self: center; background: transparent; border: 0; color: #667; font-size: 13px; }
.cbh { font-size: 11.5px; font-weight: 700; color: #3452a3; margin-bottom: 2px; }
.cbt { white-space: pre-line; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1 1 auto; min-width: 0; width: 100%; min-height: 48px; }
.chat-form .btn { flex: 0 0 auto; }

/* Allegati chat (29/9/2026) */
.catts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.catts img { max-width: 200px; max-height: 200px; border-radius: 8px; border: 1px solid #e3e8f4; display: block; object-fit: cover; }
.catt-doc { display: inline-block; padding: 6px 10px; border-radius: 8px; background: #fff; border: 1px solid #e3e8f4; text-decoration: none; font-size: 14px; }
/* Ricevuta o fattura (7/10/2026) */
.bk-box { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.bk-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.bk-opts label { display: flex; align-items: center; gap: 8px; margin: 0; border: 1px solid #d3cbb9; border-radius: 12px; padding: 9px 14px; font-size: 15px; color: var(--ink); cursor: pointer; background: var(--card); }
.bk-opts label:has(input:checked) { border-color: var(--navy); background: var(--sand); }
.bk-opts input { margin: 0; accent-color: var(--navy); }
@media (max-width: 480px) { .bk-opts label { flex: 1 1 100%; } }
