/* ── token di design ─────────────────────────────────────────────────────── */
:root {
  --navy: #1f3a6b;          /* blu del logo Lex Iuris */
  --navy-deep: #0b2143;
  --navy-soft: #05315f;
  --sky: #578ccd;           /* azzurro del sito lexiuris.it */
  --gold: #c9a227;
  --ink: #16233a;
  --ink-2: #5b6b83;
  --line: rgba(15, 35, 70, .10);
  --surface: #f5f7fb;
  --card: #ffffff;
  --civile: #1f3a6b;
  --penale: #8b2f3c;
  --amministrativo: #1f6b5a;
  --altro: #5b6b83;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(11, 33, 67, .25);
  --shadow-sm: 0 4px 14px -6px rgba(11, 33, 67, .18);
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--surface);
  --bs-link-color: var(--navy);
}
html, body { height: 100%; }
body { background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .auth-title, .theme-title { letter-spacing: -.01em; }
.font-serif { font-family: "Cormorant Garamond", Georgia, serif; }
code { color: var(--navy); background: rgba(31,58,107,.08); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.min-w-0 { min-width: 0; }

/* ── bottoni e utility ───────────────────────────────────────────────────── */
.btn-brand { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--navy-deep); --bs-btn-hover-border-color: var(--navy-deep); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--navy-deep); --bs-btn-active-border-color: var(--navy-deep); --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: var(--navy); --bs-btn-disabled-border-color: var(--navy); --bs-btn-disabled-color: #fff; font-weight: 600; }
.link-brand { color: var(--navy); text-decoration: none; } .link-brand:hover { text-decoration: underline; }
.text-brand { color: var(--navy); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); }
.card-soft { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; background: var(--card); }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; color: #fff; background: var(--altro); }
.pill-civile { background: var(--civile); } .pill-penale { background: var(--penale); } .pill-amministrativo { background: var(--amministrativo); }
.form-control:focus, .form-select:focus { border-color: var(--sky); box-shadow: 0 0 0 .25rem rgba(87,140,205,.2); }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }

/* ── navbar ──────────────────────────────────────────────────────────────── */
.topbar { background: linear-gradient(90deg, var(--navy-deep), var(--navy) 60%, #2a4d8a); box-shadow: 0 6px 24px -12px rgba(0,0,0,.5); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.brand-text { font-weight: 700; letter-spacing: .01em; } .brand-dot { color: var(--gold); }
.topbar .nav-link { color: rgba(255,255,255,.75); border-radius: 999px; padding: .4rem .9rem; font-weight: 500; }
.topbar .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar .nav-link.active { color: #fff; background: rgba(255,255,255,.14); }

/* ── auth ────────────────────────────────────────────────────────────────── */
.auth-body { background: radial-gradient(1200px 600px at 10% -10%, #2a4d8a 0%, transparent 60%),
  radial-gradient(900px 500px at 100% 110%, #578ccd55 0%, transparent 60%), linear-gradient(160deg, var(--navy-deep), var(--navy-soft)); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-radius: 24px; padding: 2.5rem 2.25rem; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.4) inset; }
.auth-logo { height: 64px; }
.auth-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 2rem; color: var(--navy); }
.auth-foot { color: rgba(255,255,255,.6); font-size: .8rem; margin-top: 1.5rem; }
.auth-foot code { color: #fff; background: rgba(255,255,255,.12); }
.flash-wrap { max-width: 720px; margin-left: auto; margin-right: auto; }
.auth-body .flash-wrap { position: absolute; top: 0; left: 0; right: 0; }

/* ── temi ────────────────────────────────────────────────────────────────── */
.hero .lead { max-width: 640px; }
.theme-card { display: flex; flex-direction: column; gap: 1rem; height: 100%; padding: 1.75rem; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease; }
.theme-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--accent, var(--navy)); }
.theme-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: var(--accent, var(--navy)); opacity: .06; transition: transform .3s ease; }
.theme-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: inherit; }
.theme-card:hover::after { transform: scale(1.4); }
.theme-civile { --accent: var(--civile); } .theme-penale { --accent: var(--penale); } .theme-amministrativo { --accent: var(--amministrativo); } .theme-altro { --accent: var(--altro); }
.theme-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; color: #fff; background: var(--accent, var(--navy)); box-shadow: 0 10px 20px -10px var(--accent, var(--navy)); }
.theme-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.9rem; font-weight: 700; margin: 0 0 .25rem; color: var(--ink); }
.theme-tag { color: var(--ink-2); margin: 0 0 .75rem; min-height: 3em; }
.theme-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .8rem; color: var(--ink-2); }
.theme-cta { margin-top: auto; font-weight: 600; color: var(--accent, var(--navy)); display: flex; align-items: center; gap: .1rem; }
.theme-cta .bi { font-size: 1.4rem; transition: transform .2s; } .theme-card:hover .theme-cta .bi { transform: translateX(4px); }
.theme-badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--accent, var(--navy)); flex: none; }

.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow-sm); height: 100%; }
.stat-label { font-size: .75rem; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--navy); line-height: 1.15; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .9rem; color: var(--ink-2); margin-left: .1rem; }
.stat-sub { font-size: .78rem; color: var(--ink-2); margin-top: .15rem; }
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--ink-2); } .empty-state .bi { font-size: 3rem; color: var(--sky); }

/* ── chat ────────────────────────────────────────────────────────────────── */
.chat-body { overflow: hidden; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - 62px); }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: var(--card); }
.chat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); background: #fff; }
.back-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); }
.chat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-btn { padding: .3rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.btn-check:checked + .seg-btn { background: var(--navy); color: #fff; box-shadow: 0 6px 14px -8px var(--navy); }
.chat-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.5rem 1.25rem; background:
  radial-gradient(800px 300px at 50% -100px, rgba(87,140,205,.08), transparent 70%); }
.msg { display: flex; margin-bottom: 1.1rem; }
.msg-user { justify-content: flex-end; }
.msg-bubble { max-width: min(820px, 92%); padding: .9rem 1.15rem; border-radius: 18px; line-height: 1.55; }
.msg-user .msg-bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 8px 20px -12px var(--navy); }
.msg-assistant .msg-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow-sm); width: 100%; }
.msg-system .msg-bubble { background: rgba(87,140,205,.08); border: 1px dashed rgba(87,140,205,.4); max-width: 100%; }
.msg-error .msg-bubble { background: #fff3f4; border: 1px solid #f1c0c6; color: #8b2f3c; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { font-size: 1.05rem; font-weight: 700; margin: 1rem 0 .4rem; color: var(--navy); }
.md ul, .md ol { padding-left: 1.3rem; } .md table { width: 100%; font-size: .9rem; margin-bottom: .75rem; } .md th, .md td { border: 1px solid var(--line); padding: .3rem .5rem; }
.md blockquote { border-left: 3px solid var(--sky); padding-left: .8rem; color: var(--ink-2); }
.cite, .cite-demo { display: inline-block; background: rgba(201,162,39,.16); color: #7a5c00; border: 1px solid rgba(201,162,39,.4); border-radius: 6px; padding: 0 .4em; font-size: .8em; font-weight: 600; cursor: pointer; text-decoration: none; margin: 0 .05em; vertical-align: baseline; }
.cite:hover { background: rgba(201,162,39,.32); }
.msg-footer { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin-top: .7rem; padding-top: .6rem; border-top: 1px dashed var(--line); font-size: .78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.msg-footer strong { color: var(--ink); }
.reasoning { margin-bottom: .6rem; } .reasoning summary { font-size: .8rem; color: var(--ink-2); cursor: pointer; }
.reasoning pre { white-space: pre-wrap; font-size: .78rem; color: var(--ink-2); background: var(--surface); padding: .6rem .8rem; border-radius: 10px; margin: .4rem 0 0; max-height: 240px; overflow: auto; }
.chip { border: 1px solid rgba(87,140,205,.5); background: #fff; color: var(--navy); border-radius: 999px; padding: .15rem .7rem; font-size: .78rem; margin: .15rem .15rem 0 0; cursor: pointer; }
.chip:hover { background: var(--navy); color: #fff; }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 1.2em; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--sky); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.composer { display: flex; gap: .6rem; align-items: flex-end; padding: .9rem 1.25rem .4rem; border-top: 1px solid var(--line); background: #fff; }
.composer textarea { resize: none; border-radius: 16px; padding: .75rem 1rem; max-height: 180px; line-height: 1.45; border-color: var(--line); background: var(--surface); }
.send-btn { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; font-size: 1.1rem; }
.composer-status { padding: 0 1.4rem .6rem; background: #fff; min-height: 1.6rem; }

.chat-side { overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; background: var(--surface); }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow-sm); }
.side-card-muted { background: transparent; box-shadow: none; }
.side-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-bottom: .75rem; display: flex; align-items: center; }
.side-sep { height: 1px; background: var(--line); margin: 1rem 0; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
.kpi { background: var(--surface); border-radius: 12px; padding: .55rem .7rem; }
.kpi-label { font-size: .68rem; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 1.25rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-sub { font-size: .7rem; color: var(--ink-2); }
.mini-table { width: 100%; font-size: .82rem; } .mini-table td { padding: .18rem 0; vertical-align: top; }
.mini-table td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.mini-table tr.sub td { color: var(--ink-2); font-weight: 400; padding-left: .8rem; font-size: .78rem; } .mini-table tr.sub td:last-child { padding-left: 0; }
.cache-bar { height: 6px; background: var(--surface); border-radius: 999px; overflow: hidden; margin-top: .6rem; }
.cache-fill { height: 100%; background: linear-gradient(90deg, var(--sky), #2fa27a); border-radius: 999px; transition: width .4s ease; }
.kpi-value.flash { animation: pop .5s ease; } @keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); color: var(--sky); } 100% { transform: scale(1); } }
.page-text { white-space: pre-wrap; font-family: "Inter", sans-serif; font-size: .9rem; line-height: 1.55; margin: 0; }

/* ── tabelle statistiche ─────────────────────────────────────────────────── */
.table-stats { font-size: .86rem; font-variant-numeric: tabular-nums; }
.table-stats th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 700; border-bottom-width: 1px; white-space: nowrap; }
.table-stats td { white-space: nowrap; }
.q-cell { white-space: normal !important; max-width: 420px; }
.collapse-row > td { border-top: 0; }
.answer-box { padding: 1rem 1.25rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); white-space: normal; }
.chart-box { position: relative; height: 240px; }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .chat-body { overflow: auto; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-main { border-right: 0; height: calc(100vh - 62px); }
  .chat-side { border-top: 1px solid var(--line); }
  .kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 575.98px) {
  .auth-card { padding: 2rem 1.4rem; }
  .chat-head { padding: .7rem .9rem; } .chat-scroll { padding: 1rem .8rem; } .composer { padding: .7rem .8rem .3rem; }
  .msg-bubble { max-width: 96%; }
}

/* ── auth split ──────────────────────────────────────────────────────────── */
.auth-body { background: var(--surface); overflow-x: hidden; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; }
.auth-panel { position: relative; overflow: hidden; color: #fff; padding: clamp(1.5rem, 4vw, 4rem);
  background: linear-gradient(155deg, #071a3a 0%, var(--navy-deep) 35%, var(--navy) 75%, #2a4d8a 100%); display: flex; align-items: center; }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
.orb-1 { width: 520px; height: 520px; background: #578ccd; top: -160px; right: -120px; }
.orb-2 { width: 420px; height: 420px; background: #c9a227; bottom: -200px; left: -120px; opacity: .28; animation-duration: 24s; }
.orb-3 { width: 300px; height: 300px; background: #7fb2ff; top: 45%; left: 45%; opacity: .25; animation-duration: 30s; animation-direction: alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 40px) scale(1.15); } }
.auth-panel-inner { position: relative; max-width: 620px; width: 100%; margin: 0 auto; animation: rise .7s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.auth-panel-logo { height: 58px; filter: brightness(0) invert(1); opacity: .95; margin-bottom: 2.5rem; }
.auth-headline { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -.02em; margin-bottom: 1.25rem; }
.auth-headline em { font-style: italic; color: #f3d77a; background: linear-gradient(90deg, #f3d77a, #c9a227); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-sub { color: rgba(255,255,255,.72); font-size: 1.05rem; max-width: 520px; line-height: 1.6; margin-bottom: 2rem; }
.auth-themes { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.5rem; }
.auth-theme { display: flex; align-items: center; gap: .65rem; padding: .55rem .9rem .55rem .55rem; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px); animation: rise .6s ease both; transition: background .2s, transform .2s; }
.auth-theme:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
.auth-theme span:last-child { display: flex; flex-direction: column; line-height: 1.1; } .auth-theme small { color: rgba(255,255,255,.6); font-size: .72rem; }
.auth-theme-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent, var(--sky)); font-size: 1rem; box-shadow: 0 6px 14px -6px var(--accent, var(--sky)); }
.auth-theme.theme-civile { --accent: #578ccd; } .auth-theme.theme-penale { --accent: #c9525f; } .auth-theme.theme-amministrativo { --accent: #2fa27a; }
.auth-quote { border-left: 2px solid rgba(243,215,122,.7); padding-left: 1rem; margin-bottom: 2.5rem; transition: opacity .5s ease, transform .5s ease; min-height: 3.4rem; }
.auth-quote.fade { opacity: 0; transform: translateY(6px); }
.auth-quote-text { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.5rem; font-style: italic; }
.auth-quote-src { display: block; font-size: .78rem; color: rgba(255,255,255,.55); letter-spacing: .06em; text-transform: uppercase; }
.auth-panel-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-size: .8rem; color: rgba(255,255,255,.6); }
.auth-panel-foot code { color: #fff; background: rgba(255,255,255,.12); }

.auth-form-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.25rem;
  background: radial-gradient(700px 400px at 100% 0%, rgba(87,140,205,.12), transparent 60%), var(--surface); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 26px; padding: 2.5rem 2.25rem;
  box-shadow: 0 30px 60px -30px rgba(11,33,67,.35), 0 0 0 1px var(--line); animation: rise .7s .15s ease both; }
.auth-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 2.2rem; color: var(--navy); }
.auth-foot { color: var(--ink-2); font-size: .78rem; margin-top: 1.5rem; }
.auth-card .form-control { border-radius: 14px; background: var(--surface); border-color: transparent; }
.auth-card .form-control:focus { background: #fff; border-color: var(--sky); }
.has-toggle { position: relative; }
.pwd-toggle { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-2); padding: .4rem; border-radius: 8px; }
.pwd-toggle:hover { color: var(--navy); background: rgba(31,58,107,.08); }
.has-toggle .form-control { padding-right: 3rem; }
.btn-glow { position: relative; box-shadow: 0 14px 30px -12px var(--navy); transition: transform .15s ease, box-shadow .15s ease; }
.btn-glow:hover { transform: translateY(-1px); box-shadow: 0 18px 34px -12px var(--navy); }
.auth-body .flash-wrap { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 20; width: min(560px, 92vw); margin: 0; padding: 0; }

@media (max-width: 991.98px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-panel { min-height: auto; padding: 2.25rem 1.5rem; }
  .auth-panel-logo { height: 44px; margin-bottom: 1.5rem; }
  .auth-headline { font-size: 2.4rem; } .auth-sub { font-size: .95rem; margin-bottom: 1.25rem; }
  .auth-quote, .auth-panel-foot { display: none; } .auth-themes { margin-bottom: 0; }
  .auth-form-side { padding: 2rem 1rem 3rem; }
}

/* ── post-login: hero scuro, card sovrapposte, chat ─────────────────────── */
.temi-body { background: var(--surface); }
.hero-dark { position: relative; overflow: hidden; color: #fff; padding: 3.5rem 0 7rem;
  background: linear-gradient(155deg, #071a3a 0%, var(--navy-deep) 35%, var(--navy) 75%, #2a4d8a 100%); }
.hero-dark .orb { opacity: .4; } .hero-dark .auth-grid { mask-image: radial-gradient(ellipse at 20% 30%, #000 10%, transparent 70%); }
.hero-dark-inner { position: relative; animation: rise .6s ease both; }
.eyebrow-light { color: #f3d77a; }
.hero-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: clamp(2.4rem, 4.5vw, 3.8rem); line-height: 1.05; letter-spacing: -.02em; margin-bottom: .75rem; }
.hero-title em { font-style: italic; background: linear-gradient(90deg, #f3d77a, #c9a227); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: rgba(255,255,255,.72); font-size: 1.05rem; max-width: 620px; margin-bottom: 1.75rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; }
.hero-stats > div { display: flex; flex-direction: column; }
.hs-num { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hs-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.6); }
.cards-overlap { margin-top: -4.5rem; position: relative; z-index: 2; }
.cards-overlap .theme-card { animation: rise .6s ease both; }
.theme-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent, var(--navy)); opacity: .8; }
.theme-card .theme-title { font-size: 2.2rem; }
.stat-tile-icon { display: flex; gap: .9rem; align-items: flex-start; }
.stat-tile-icon > .bi { font-size: 1.3rem; color: var(--sky); background: rgba(87,140,205,.12); border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; flex: none; }

/* chat: fascia colorata per materia + benvenuto */
.chat-layout.theme-civile { --accent: var(--civile); } .chat-layout.theme-penale { --accent: var(--penale); } .chat-layout.theme-amministrativo { --accent: var(--amministrativo); } .chat-layout.theme-altro { --accent: var(--altro); }
.chat-head { position: relative; }
.chat-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent, var(--navy)), var(--sky)); }
.welcome { position: relative; max-width: 760px; margin: 2rem auto 1.5rem; padding: 2rem 2rem 1.75rem; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; text-align: center; transition: opacity .35s ease, transform .35s ease, max-height .4s ease; animation: rise .6s ease both; }
.welcome::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: var(--accent, var(--navy)); opacity: .07; }
.welcome-gone { opacity: 0; transform: translateY(-10px); max-height: 0; margin: 0; padding: 0; border: 0; pointer-events: none; }
.welcome-icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 20px; display: grid; place-items: center; font-size: 1.8rem; color: #fff; background: var(--accent, var(--navy)); box-shadow: 0 14px 28px -14px var(--accent, var(--navy)); }
.welcome-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2rem; color: var(--ink); margin-bottom: .5rem; }
.welcome-title em { font-style: italic; color: var(--accent, var(--navy)); }
.welcome-sub { color: var(--ink-2); max-width: 560px; margin: 0 auto 1.25rem; }
.welcome-examples { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.chip-lg { padding: .45rem 1rem; font-size: .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: all .15s; }
.chip-lg:hover { background: var(--accent, var(--navy)); border-color: var(--accent, var(--navy)); color: #fff; transform: translateY(-1px); }
.msg { animation: rise .35s ease both; }
.msg-user .msg-bubble { background: linear-gradient(135deg, var(--navy), #2a4d8a); }
.side-card:first-child { background: linear-gradient(160deg, #fff, #f7f9fd); border-top: 3px solid var(--accent, var(--navy)); }
@media (max-width: 991.98px) { .hero-dark { padding: 2.5rem 0 6rem; } .welcome { margin: 1rem .25rem; padding: 1.5rem 1.25rem; } .welcome-title { font-size: 1.6rem; } }

/* ── effetti ─────────────────────────────────────────────────────────────── */
.theme-card { transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
.theme-card:hover { box-shadow: 0 30px 50px -24px rgba(11,33,67,.45); }
.theme-card::after { background: radial-gradient(circle at var(--mx, 80%) var(--my, 20%), var(--accent, var(--navy)), transparent 60%); opacity: .12; inset: 0; width: auto; height: auto; border-radius: 0; right: 0; top: 0; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2fa27a; box-shadow: 0 0 0 0 rgba(47,162,122,.6); animation: ping 1.2s infinite; vertical-align: middle; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(47,162,122,.6); } 70% { box-shadow: 0 0 0 8px rgba(47,162,122,0); } 100% { box-shadow: 0 0 0 0 rgba(47,162,122,0); } }
.msg.streaming .msg-bubble { position: relative; border-color: transparent; background-clip: padding-box; }
.msg.streaming .msg-bubble::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1;
  background: linear-gradient(120deg, var(--sky), #f3d77a, var(--accent, var(--navy)), var(--sky)); background-size: 300% 300%; animation: sheen 2.2s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.msg.streaming .msg-bubble::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #fff; z-index: -2; }
@keyframes sheen { to { background-position: 300% 0; } }
.msg.streaming .msg-bubble { box-shadow: 0 12px 34px -16px rgba(87,140,205,.55); }
.kpi-value { transition: color .2s; }
.msg-footer { animation: rise .4s ease both; }
.chat-layout-plain { grid-template-columns: 1fr; }
.chat-layout-plain .chat-main { border-right: 0; }
.chat-layout-plain .chat-scroll, .chat-layout-plain .composer, .chat-layout-plain .chat-head { padding-left: max(1.25rem, calc((100% - 960px) / 2)); padding-right: max(1.25rem, calc((100% - 960px) / 2)); }
/* anteprima pagina */
.page-body { font-size: .97rem; line-height: 1.65; color: var(--ink); max-width: 68ch; margin: 0 auto; }
.page-body p { margin: 0 0 .9rem; text-align: justify; hyphens: auto; }
.page-caption { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: .35rem; }
.page-caption + .page-caption { margin-bottom: 1.25rem; }
.page-heading { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 1.25rem; color: var(--navy); margin: 1.4rem 0 .5rem; }
.page-heading:first-child { margin-top: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   NEGOZIO
   ══════════════════════════════════════════════════════════════════════════ */
:root { --gold-ink: #7a5c00; --ok: #17694d; --ok-bg: #e3f4ec; --att-bg: #fdf1d3; --no: #8b2f3c; --no-bg: #fbe3e6; }
.shop-body { display: flex; flex-direction: column; min-height: 100vh; height: auto; }
.shop-body > main { flex: 1 0 auto; }
.shop-wrap { max-width: 1560px; margin-left: auto; margin-right: auto; width: 100%; }
.text-gold { color: var(--gold); }
.btn-gold { --bs-btn-bg: var(--gold); --bs-btn-border-color: var(--gold); --bs-btn-color: #1b1400;
  --bs-btn-hover-bg: #b8931f; --bs-btn-hover-border-color: #b8931f; --bs-btn-hover-color: #1b1400;
  --bs-btn-active-bg: #a8861c; --bs-btn-active-border-color: #a8861c; --bs-btn-active-color: #1b1400; font-weight: 600; }
.btn-ok { --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-color: #fff;
  --bs-btn-hover-bg: #125640; --bs-btn-hover-border-color: #125640; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #0e4533; --bs-btn-active-border-color: #0e4533; --bs-btn-active-color: #fff; font-weight: 600; }
.nav-link-plain { color: rgba(255,255,255,.75); text-decoration: none; white-space: nowrap; } .nav-link-plain:hover { color: #fff; }
.topbar .nav-link, .topbar .navbar-brand { white-space: nowrap; }
.nav-chi { display: none; white-space: nowrap; } @media (min-width: 1700px) { .nav-chi { display: inline; } }
@media (min-width: 992px) and (max-width: 1499.98px) { .topbar-bo .nav-link { padding: .4rem .6rem; } .topbar-bo .nav-link > .bi:first-child { display: none; } }
.nav-search { align-items: center; gap: .4rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: .25rem .8rem; color: rgba(255,255,255,.7); }
.nav-search input { background: transparent; border: 0; outline: 0; color: #fff; width: 13rem; font-size: .875rem; }
.nav-search input::placeholder { color: rgba(255,255,255,.55); }
.nav-search:focus-within { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }
.cart-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #1b1400; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: .4rem; font-size: .9rem; }
.dropdown-item { border-radius: 9px; padding: .45rem .7rem; } .dropdown-item:active { background: var(--navy); }

/* vetrina */
.section-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: clamp(1.6rem, 2.2vw, 2.1rem); color: var(--ink); letter-spacing: -.01em; }
.page-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: clamp(2rem, 3vw, 2.7rem); color: var(--ink); line-height: 1.08; letter-spacing: -.01em; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); text-decoration: none; } .crumbs a:hover { color: var(--navy); text-decoration: underline; }
.crumbs .bi { font-size: .65rem; opacity: .6; } .crumbs span { color: var(--ink); font-weight: 500; }

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 1.5rem; }
.prod-card { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; color: inherit; text-decoration: none; transition: transform .22s ease, box-shadow .22s ease; }
.prod-card:hover { transform: translateY(-4px); box-shadow: 0 26px 44px -24px rgba(11,33,67,.42); color: inherit; }
.prod-cover { position: relative; aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #f3f6fb 0%, #e4eaf4 100%); }
/* l'immagine sta tutta dentro il riquadro, qualunque sia il suo formato */
.prod-cover img { position: absolute; inset: 1.1rem; width: calc(100% - 2.2rem); height: calc(100% - 2.2rem); object-fit: contain; filter: drop-shadow(0 12px 14px rgba(11,33,67,.28)); transition: transform .3s ease; }
.prod-card:hover .prod-cover img { transform: scale(1.04) rotate(-.6deg); }
.prod-cover > .bi { font-size: 3.2rem; color: var(--sky); opacity: .45; }
.prod-badges { position: absolute; top: .7rem; left: .7rem; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .6rem; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .02em; background: #fff; color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag-gold { background: #fbf3d9; color: var(--gold-ink); border-color: rgba(201,162,39,.45); }
.tag-sale { background: var(--penale); color: #fff; border-color: transparent; }
.prod-body { display: flex; flex-direction: column; gap: .35rem; flex: 1; padding: 1rem 1.1rem 1.1rem; }
.prod-kicker { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); }
.prod-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 1.28rem; line-height: 1.14; color: var(--ink); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prod-price { margin-top: auto; padding-top: .55rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; font-weight: 700; font-size: 1.05rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.prod-price s { color: var(--ink-2); font-weight: 400; font-size: .85rem; }
.prod-extra { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
/* una sola fila: tante schede quante sono le colonne */
.prod-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.prod-row > :nth-child(n+6) { display: none; }
@media (max-width: 1199.98px) { .prod-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } .prod-row > :nth-child(n+5) { display: none; } }
@media (max-width: 899.98px) { .prod-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .prod-row > :nth-child(n+4) { display: none; } }
@media (max-width: 575.98px) { .prod-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prod-row > :nth-child(n+5) { display: none; } .prod-row > :nth-child(4) { display: flex; } }

/* catalogo */
.cat-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2rem; align-items: start; }
.cat-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: .1rem; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: .25rem; }
.cat-link { display: flex; justify-content: space-between; gap: .5rem; padding: .38rem .7rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 600; }
.cat-link:hover { background: rgba(31,58,107,.06); color: var(--navy); }
.cat-link.active { background: var(--navy); color: #fff; }
.cat-sub { font-weight: 400; padding-left: 1.4rem; color: var(--ink-2); } .cat-sub span { font-size: .78rem; opacity: .7; }
.search-box { display: flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .32rem .9rem; color: var(--ink-2); }
.search-box input { border: 0; outline: 0; background: transparent; font-size: .9rem; width: 15rem; max-width: 60vw; color: var(--ink); }
.search-box:focus-within { border-color: var(--sky); box-shadow: 0 0 0 .2rem rgba(87,140,205,.18); }

/* scheda prodotto */
/* a sinistra la copertina resta ferma mentre a destra si legge: titolo, acquisto, assistente, descrizione */
.pd-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 4vw, 4.5rem); align-items: start; }
.pd-info { max-width: 44rem; padding-top: .4rem; }
.pd-cover { position: sticky; top: 84px; display: grid; place-items: center; min-height: 340px; padding: clamp(1.5rem, 4vw, 3.5rem); border-radius: 26px;
  background: radial-gradient(120% 90% at 50% 0%, #f3f6fb 0%, #dfe6f2 100%); border: 1px solid var(--line); }
.pd-cover img { max-width: 100%; max-height: min(66vh, 720px); object-fit: contain; border-radius: 4px; filter: drop-shadow(0 28px 34px rgba(11,33,67,.36)); }
.pd-cover > .bi { font-size: 6rem; color: var(--sky); opacity: .4; }
/* sotto la copertina, l'anteprima gratuita (indice e prime pagine) */
.pd-cover:has(.pd-leggi) { gap: 1.4rem; } .pd-cover:has(.pd-leggi) img { max-height: min(58vh, 640px); }
.pd-leggi { display: inline-flex; align-items: center; gap: .75rem; padding: .6rem 1.3rem .6rem 1rem; border-radius: 999px; background: #fff;
  border: 1.5px solid rgba(31,58,107,.25); color: var(--navy); text-decoration: none; font-weight: 600; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.pd-leggi:hover { color: var(--navy); border-color: var(--navy); box-shadow: 0 14px 26px -16px rgba(11,33,67,.5); transform: translateY(-1px); }
.pd-leggi:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.pd-leggi > .bi { font-size: 1.35rem; }
.pd-leggi span { display: flex; flex-direction: column; line-height: 1.2; } .pd-leggi small { font-weight: 400; font-size: .78rem; color: var(--ink-2); }
.pd-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: clamp(2rem, 3.1vw, 3rem); line-height: 1.05; letter-spacing: -.015em; color: var(--ink); margin-bottom: .9rem; }
.pd-lead { color: var(--ink-2); font-size: 1.04rem; line-height: 1.6; max-width: 62ch; } .pd-lead > :last-child { margin-bottom: 0; }
.buy-box { margin-top: 1.5rem; padding: 1.25rem 1.3rem; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.buy-label { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .55rem; }
.fmt-list { display: grid; gap: .55rem; }
.fmt-opt input { position: absolute; opacity: 0; pointer-events: none; }
.fmt-opt label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.fmt-opt label:hover { border-color: rgba(31,58,107,.4); }
.fmt-opt input:checked + label { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,58,107,.12); }
.fmt-opt input:focus-visible + label { outline: 2px solid var(--sky); outline-offset: 2px; }
.fmt-opt input:disabled + label { opacity: .5; cursor: not-allowed; }
.fmt-name { display: flex; align-items: center; gap: .8rem; min-width: 0; } .fmt-name > .bi { font-size: 1.35rem; color: var(--navy); }
.fmt-name > span { display: flex; flex-direction: column; line-height: 1.25; } .fmt-name small { color: var(--ink-2); font-size: .8rem; }
.fmt-price { font-weight: 700; font-size: 1.1rem; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; } .fmt-price s { font-weight: 400; font-size: .85rem; color: var(--ink-2); margin-right: .45rem; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; }
.qty input { width: 3rem; border: 0; text-align: center; font-weight: 600; outline: 0; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-btn { width: 2.5rem; height: 2.9rem; border: 0; background: transparent; font-size: 1.2rem; color: var(--navy); } .qty-btn:hover { background: rgba(31,58,107,.07); }
.buy-notes { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 1rem 0 0; padding: 0; font-size: .84rem; color: var(--ink-2); } .buy-notes .bi { margin-right: .35rem; color: var(--sky); }
.assist-box { display: flex; gap: .9rem; margin-top: 1rem; padding: 1rem 1.15rem; border-radius: 18px; border: 1px solid rgba(201,162,39,.45);
  background: linear-gradient(160deg, #fdf8e6, #fffdf6); } .assist-box p { color: #5c4a12; font-size: .93rem; margin-top: .15rem; }
.assist-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; color: var(--gold-ink); background: #f6e7b1; }
.pd-desc { margin-top: 2.25rem; padding-top: 1.9rem; border-top: 1px solid var(--line); }
.pd-h { margin: 0 0 .8rem; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 1.6rem; color: var(--ink); }
.pd-desc .prose { max-width: none; color: var(--ink-2); } .pd-desc .prose p:last-child { margin-bottom: 0; }
/* il grassetto dei testi della scheda: più scuro del testo grigio, così l'enfasi si vede */
.pd-lead strong, .pd-lead b, .pd-desc .prose strong, .pd-desc .prose b { color: var(--ink); font-weight: 600; }
.prose { line-height: 1.7; color: var(--ink); max-width: 74ch; } .prose h3, .prose h4, .prose h5 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; color: var(--navy); margin: 1.6rem 0 .5rem; font-size: 1.35rem; }
.prose h4 { font-size: 1.2rem; } .prose h5 { font-size: 1.1rem; } .prose blockquote { border-left: 3px solid var(--gold); padding-left: 1rem; color: var(--ink-2); } .prose a { color: var(--navy); }
.prose > :first-child { margin-top: 0; } .page-article { max-width: 940px; margin: 0 auto; }

/* carrello, cassa, ordine */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 1.5rem; align-items: start; }
.cart-list { overflow: visible; }
.cart-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 5.2rem 7rem 2rem; gap: 1rem; align-items: center; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
.cart-row-order { grid-template-columns: 64px minmax(0, 1fr) auto auto; } .cart-row:last-child { border-bottom: 0; }
.cart-thumb { position: relative; width: 64px; height: 80px; display: grid; place-items: center; border-radius: 10px; background: #edf1f7; overflow: hidden; color: var(--sky); font-size: 1.4rem; }
.cart-thumb img { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); object-fit: contain; }
.cart-title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.25; } a.cart-title:hover { color: var(--navy); text-decoration: underline; }
.cart-meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; align-items: center; font-size: .82rem; color: var(--ink-2); margin-top: .25rem; }
.cart-tot { text-align: right; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; } .cart-act { text-align: right; min-width: 9rem; }
.cart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1.2rem; background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }
.fmt { display: inline-flex; align-items: center; gap: .3rem; padding: .08rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.fmt-pdf { background: #fbe9ea; color: #8b2f3c; } .fmt-fis { background: #e8eef7; color: var(--navy); }
.sum-card { position: sticky; top: 84px; padding: 1.25rem 1.3rem; overflow: visible; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: 1rem; }
.sum-total strong { font-size: 1.6rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.sum-hint { margin: .8rem 0 0; padding: .5rem .75rem; border-radius: 10px; background: var(--att-bg); color: var(--gold-ink); font-size: .84rem; }
.sum-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .4rem 0; font-size: .88rem; }
.sum-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; } .sum-row small { display: block; color: var(--ink-2); }
.sum-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-thumb { position: relative; width: 40px; height: 50px; display: grid; place-items: center; border-radius: 6px; background: #edf1f7; overflow: hidden; color: var(--sky); }
.sum-thumb img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.step-title { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: .85rem; }
.card-head { padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.pay-card { max-width: 620px; margin: 0 auto; } .pay-banner { padding: .7rem 1.2rem; background: var(--att-bg); color: var(--gold-ink); font-weight: 600; font-size: .9rem; }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.code-input::placeholder { letter-spacing: .04em; opacity: .5; }
.code-big { font-size: 1.05rem; font-weight: 700; letter-spacing: .06em; padding: .25em .6em; background: #fbf3d9; color: var(--gold-ink); }
.code-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); } .code-row:last-of-type { border-bottom: 0; }
.todo-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding: .9rem 1.2rem; margin-bottom: 1.5rem; border-radius: 16px; background: var(--att-bg); border: 1px solid rgba(201,162,39,.45); color: #4d3d0c; }
.todo-gold { background: linear-gradient(160deg, #fdf8e6, #fffdf6); }
.empty-mini { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: 1.4rem 1.2rem; color: var(--ink-2); font-size: .93rem; } .empty-mini > .bi { font-size: 1.3rem; color: var(--sky); }
.tab-ordini th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.tab-ordini td, .tab-ordini th { padding: .65rem 1.2rem; }

/* stati */
.st { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.st-ok { background: var(--ok-bg); color: var(--ok); } .st-att { background: var(--att-bg); color: var(--gold-ink); } .st-no { background: var(--no-bg); color: var(--no); } .st-neutro { background: #eceff4; color: var(--ink-2); }

/* piè di pagina */
.shop-foot { flex: none; margin-top: 4rem; padding: 3rem 0 1.5rem; background: linear-gradient(160deg, #071a3a, var(--navy-deep)); color: rgba(255,255,255,.68); font-size: .9rem; }
.shop-foot a { display: block; color: rgba(255,255,255,.82); text-decoration: none; padding: .16rem 0; } .shop-foot a:hover { color: #fff; text-decoration: underline; }
.foot-logo { height: 40px; filter: brightness(0) invert(1); opacity: .92; }
.foot-title { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #f3d77a; margin-bottom: .5rem; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .8rem; color: rgba(255,255,255,.5); }

/* ══════════════════════════════════════════════════════════════════════════
   AMMINISTRAZIONE DEL NEGOZIO — elenchi fitti: una riga per voce, colonne fisse
   ══════════════════════════════════════════════════════════════════════════ */
.bo-wrap { max-width: 1760px; margin: 0 auto; } .bo-narrow { max-width: 1480px; }
.bo-h { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 0 0 .6rem; scroll-margin-top: 130px; }
.card-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-list > .card-head:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.tab-fitta { table-layout: fixed; width: 100%; margin: 0; font-size: .875rem; font-variant-numeric: tabular-nums; }
.tab-fitta th { position: sticky; top: 61px; z-index: 3; background: #f7f9fc; padding: .45rem .75rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; }
.tab-fitta td { height: 38px; padding: .3rem .75rem; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-color: rgba(15,35,70,.07); }
.tab-fitta tbody tr:last-child td { border-bottom: 0; } .tab-fitta tfoot td { border: 0; height: 30px; background: #fafbfd; }
.tab-fitta td.text-end form { justify-content: flex-end; } .tab-fitta .form-control-sm { padding-top: .15rem; padding-bottom: .15rem; }
.tab-hover tbody tr[data-href] { cursor: pointer; } .tab-hover tbody tr:hover td { background: #f4f7fc; }
.riga-vuota td { color: #a3adbd; } .td-thumb { padding: 2px .5rem !important; } .td-thumb img { height: 32px; width: 26px; object-fit: contain; display: block; } .td-thumb .bi { color: var(--sky); }
.tab-form td { overflow: visible; } .riga-nuova td { background: #fafbfd; }
.bo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: .9rem; }
.bo-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.bo-tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .32rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-size: .87rem; font-weight: 600; }
.bo-tabs a span { font-weight: 500; color: var(--ink-2); font-size: .8rem; } .bo-tabs a:hover { border-color: rgba(31,58,107,.35); }
.bo-tabs a.active { background: var(--ink); border-color: var(--ink); color: #fff; } .bo-tabs a.active span { color: rgba(255,255,255,.7); }
.bo-counters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 1rem; }
.bo-counters > * { display: inline-flex; align-items: center; gap: .45rem; padding: .38rem .85rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: .87rem; text-decoration: none; }
.bo-counters a:hover { border-color: rgba(31,58,107,.35); color: var(--ink); } .bo-counters strong { color: var(--ink); } .bo-counters .bi { color: var(--sky); }
.todo-none { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; margin-bottom: 1rem; border-radius: 14px; background: var(--ok-bg); color: var(--ok); font-weight: 600; } .todo-none code { font-weight: 400; }
.bo-sticky { position: sticky; top: 61px; z-index: 5; margin: 0 -.75rem 1rem; padding: .8rem .75rem; background: rgba(245,247,251,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bo-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .7rem; padding: .7rem 1rem; border-radius: 12px; background: var(--no-bg); color: var(--no); font-size: .9rem; } .bo-confirm input { max-width: 24rem; }
.chain { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 0; margin: 0 0 1.25rem; padding: 0; }
.chain li { display: flex; align-items: center; gap: .7rem; padding-right: 2.4rem; position: relative; color: #9aa5b6; }
.chain li:not(:last-child)::after { content: ""; position: absolute; right: .6rem; top: 50%; width: 1.2rem; height: 2px; background: currentColor; opacity: .5; }
.chain-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #e9edf3; font-size: 1.05rem; }
.chain strong { display: block; line-height: 1.2; } .chain small { display: block; font-size: .8rem; }
.chain li.done { color: var(--ok); } .chain li.done .chain-dot { background: var(--ok-bg); } .chain li.done small { color: var(--ink-2); }
.chain li.now { color: var(--gold-ink); } .chain li.now .chain-dot { background: var(--att-bg); box-shadow: 0 0 0 3px rgba(201,162,39,.25); }
.chain li.stop { color: var(--no); } .chain li.stop .chain-dot { background: var(--no-bg); } .chain li.stop small { color: var(--ink-2); }
.mail-item { border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; background: #fff; } .mail-item summary { cursor: pointer; }
.mail-item pre { white-space: pre-wrap; font-family: inherit; font-size: .88rem; margin: .7rem 0 .2rem; padding: .8rem 1rem; background: var(--surface); border-radius: 10px; color: var(--ink); }
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fafbfd; }
.file-ico { font-size: 2rem; color: var(--penale); }
.cover-edit { display: grid; place-items: center; height: 220px; border-radius: 14px; background: #edf1f7; color: var(--sky); font-size: 3rem; } .cover-edit img { max-height: 200px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(11,33,67,.3)); }
.cat-checks { max-height: 320px; overflow-y: auto; }
/* editor di testo dell'amministrazione: grassetto, elenchi, titoletti senza scrivere HTML */
.rich { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); background: #fff; }
.rich-bar { display: flex; flex-wrap: wrap; gap: .15rem; padding: .3rem .4rem; border-bottom: 1px solid var(--line); background: #f7f9fc; border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0; }
.rich-bar button { border: 0; background: transparent; border-radius: 7px; padding: .2rem .55rem; color: var(--ink); font-size: .9rem; } .rich-bar button:hover { background: rgba(31,58,107,.1); }
.rich-area { min-height: 5.5rem; max-height: 60vh; overflow-y: auto; padding: .7rem .9rem; outline: 0; line-height: 1.6; } .rich-area:focus { box-shadow: inset 0 0 0 2px rgba(87,140,205,.35); border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius); }
.rich-area > :last-child { margin-bottom: 0; } .rich-area h3 { font-size: 1.15rem; font-weight: 700; color: var(--navy); } .rich-lunga .rich-area { min-height: 13rem; }
.theme-card.is-locked { background: #fafbfd; } .theme-card.is-locked .theme-icon { background: #c5ccd8; box-shadow: none; } .theme-card.is-locked .theme-title { color: var(--ink-2); }

@media (max-width: 1399.98px) { .col-sec { display: none; } .tab-fitta col.col-sec { display: none; width: 0 !important; } }
@media (max-width: 1199.98px) { .cart-layout { grid-template-columns: 1fr; } .sum-card { position: static; } }
@media (max-width: 991.98px) {
  .cat-layout { grid-template-columns: 1fr; gap: 1rem; } .cat-side { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; } .cat-sub { display: none; }
  .pd-layout { grid-template-columns: 1fr; } .pd-cover { position: static; min-height: 0; } .pd-cover img { max-height: 46vh; }
  .tab-fitta th { position: static; } .bo-sticky { position: static; } .card-list { overflow-x: auto; } .tab-fitta { min-width: 760px; }
}
@media (max-width: 575.98px) {
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; } .prod-body { padding: .75rem .8rem .9rem; } .prod-title { font-size: 1.08rem; }
  .cart-row { grid-template-columns: 48px minmax(0, 1fr) 4.2rem; row-gap: .4rem; padding: .8rem; } .cart-thumb { width: 48px; height: 60px; }
  .cart-row .cart-tot { grid-column: 2; text-align: left; } .cart-row .cart-del { grid-column: 3; grid-row: 2; }
  .cart-row-order { grid-template-columns: 48px minmax(0, 1fr); } .cart-row-order .cart-tot, .cart-row-order .cart-act { grid-column: 2; text-align: left; min-width: 0; }
  .buy-box { padding: 1rem; } .search-box input { width: 9rem; }
}
