/* Sito parrocchiale – stile pensato prima per il telefono. Nessuna risorsa esterna. */
:root {
  --bg: #f7f4ee; --surface: #ffffff; --surface-2: #f1ece3; --ink: #1b2330; --muted: #5a6372; --line: #e4ddd1;
  --brand: #1d4e89; --brand-2: #163c69; --brand-soft: #e3ecf7; --on-brand: #ffffff;
  --accent: #b5561f; --accent-soft: #fbe9dc; --ok: #1f7a4d; --ok-soft: #e2f3ea; --err: #b3261e; --err-soft: #fbe4e2; --gold: #b7862c;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 6px 20px rgba(20, 30, 50, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tab-h: 64px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141c; --surface: #16202b; --surface-2: #1c2835; --ink: #e9eef4; --muted: #a2adbb; --line: #263445;
    --brand: #79aee8; --brand-2: #9cc3ee; --brand-soft: #1a2c42; --on-brand: #0e141c;
    --accent: #ec9a64; --accent-soft: #3a2418; --ok: #6fd3a0; --ok-soft: #14301f; --err: #ff8a80; --err-soft: #3b1a18; --gold: #e2b65d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); overflow-x: hidden; }
@media (min-width: 900px) { body { padding-bottom: 0; } }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .9em; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; flex: none; }
.ic.big { width: 40px; height: 40px; stroke-width: 1.4; }

/* intestazione */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; flex: 1; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { width: 40px; height: 40px; flex: none; }
.logo.sm { width: 28px; height: 28px; }
.lg-bg { fill: var(--brand); } .lg-fg { fill: var(--bg); stroke: var(--bg); stroke-width: 1.2; } .lg-win { fill: var(--brand); }
.lg-wave { fill: none; stroke: #e7a25c; stroke-width: 2.2; stroke-linecap: round; } .lg-wave + .lg-wave { stroke: #9cc3ee; }
.topnav { display: none; gap: 2px; }
.topnav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; }
.topnav a:hover { background: var(--surface-2); }
.topnav a[aria-current] { background: var(--brand-soft); color: var(--brand); }
.top-act { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-size: .9rem; white-space: nowrap; }
.top-act span { display: none; }
@media (min-width: 560px) { .top-act span { display: inline; } }
@media (min-width: 900px) { .topnav { display: flex; } }

/* barra in basso (telefono) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tab-h); text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tabbar a .ic { width: 24px; height: 24px; }
.tabbar a[aria-current] { color: var(--brand); }
.tabbar a[aria-current] .ic { background: var(--brand-soft); border-radius: 999px; width: 48px; padding: 2px 12px; height: 28px; }
@media (min-width: 900px) { .tabbar { display: none; } }

/* struttura */
.wrap { max-width: 1140px; margin: 0 auto; padding: 16px; }
main.wrap { min-height: 60vh; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 12px; overflow-x: auto; white-space: nowrap; }
.crumbs a { color: var(--muted); }
.block { margin: 28px 0; }
.block-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.block-h h1, .block-h h2 { margin: 0; }
.block-h > a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.flash { max-width: 1108px; margin: 12px auto 0; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500; }
.flash-ok { background: var(--ok-soft); color: var(--ok); } .flash-err { background: var(--err-soft); color: var(--err); }
@media (max-width: 1140px) { .flash { margin: 12px 16px 0; } }

/* home */
.hero { position: relative; border-radius: calc(var(--radius) + 4px); padding: 28px 20px 64px; color: #fff; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 100% 0%, #2f6db3 0%, transparent 60%), linear-gradient(160deg, #1d4e89 0%, #12355f 70%, #0e2a4b 100%); }
.hero::after { content: ""; position: absolute; inset: auto -10% -2px -10%; height: 70px; z-index: -1; opacity: .9;
  background: radial-gradient(40px 14px at 20px 14px, transparent 98%, rgba(255,255,255,.14) 100%) 0 0/40px 28px repeat-x, radial-gradient(40px 14px at 20px 14px, transparent 98%, rgba(255,255,255,.08) 100%) 20px 22px/40px 28px repeat-x; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 6.4vw, 3rem); max-width: 18ch; }
.hero .lead { font-size: 1.08rem; opacity: .92; max-width: 46ch; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; opacity: .85; margin-bottom: 8px; }
.hero-sm { padding: 40px 0; text-align: center; }
.today { margin-top: -44px; position: relative; z-index: 2; padding: 0 8px; }
.today-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .today-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .today-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.tcard { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.tcard > .ic { width: 28px; height: 28px; color: var(--brand); margin-top: 2px; }
.tcard small { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.tcard strong { display: block; font-size: 1.02rem; line-height: 1.35; }
.tcard .muted { font-size: .88rem; }
.tcard.is-open > .ic { color: var(--ok); }
.tcard-feast > .ic { color: var(--gold); }
.times span { display: inline-block; margin-right: 10px; white-space: nowrap; }
.times em { font-style: normal; font-weight: 400; color: var(--muted); font-size: .82rem; }
.times .past { opacity: .45; text-decoration: line-through; }

/* schede */
.cards { display: grid; gap: 14px; }
.cards.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.cards.scroller { grid-auto-flow: column; grid-auto-columns: min(78%, 270px); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 12px; margin: 0 -16px; scrollbar-width: thin; }
.cards.scroller > * { scroll-snap-align: start; }
@media (min-width: 900px) { .cards.scroller { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 0; padding: 0; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.card > a, .card > div { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.card:hover { transform: translateY(-2px); }
.card.is-pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card-img { aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.grid .card-img { aspect-ratio: 4 / 3; }
.card-ph { color: var(--muted); display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; align-items: flex-start; }
.card-body h3 { margin: 0; font-size: 1.02rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .92rem; }
.card-body small { color: var(--muted); margin-top: auto; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag-pin, .tag-evento { background: var(--accent-soft); color: var(--accent); }
.tag-liturgia { background: #efe4f7; color: #6b3a8f; } .tag-catechesi { background: #e2f1f5; color: #1f6b7d; } .tag-oratorio { background: #fdf0d8; color: #8a5a00; }
.tag-comunita, .tag-avviso { background: var(--brand-soft); color: var(--brand); } .tag-lutto { background: #ebebeb; color: #444; } .tag-notiziario { background: #e6f2e8; color: #2b6b3a; }
.tag-today { background: var(--brand); color: var(--on-brand); } .tag-enroll { background: var(--ok-soft); color: var(--ok); }
@media (prefers-color-scheme: dark) {
  .tag-liturgia { background: #2e2238; color: #d7b6f0; } .tag-catechesi { background: #16323a; color: #8fd3e4; } .tag-oratorio { background: #3a2c12; color: #f0c674; }
  .tag-lutto { background: #2a2a2a; color: #ccc; } .tag-notiziario { background: #183020; color: #9fd9ad; }
}

/* eventi */
.evlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ev { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--ink); }
.ev:hover { border-color: var(--brand); }
.ev-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.ev-body strong { line-height: 1.3; }
.ev-body small { color: var(--muted); }
.chip-date { flex: none; width: 56px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: flex; flex-direction: column; align-items: center; padding: 6px 0; line-height: 1.1; }
.chip-date b { font-size: 1.45rem; font-family: var(--serif); }
.chip-date small { font-size: .68rem; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.days .day-h { font-family: var(--sans); font-size: .95rem; text-transform: capitalize; color: var(--muted); margin: 22px 0 8px; font-weight: 700; }
.days .day-h.is-today { color: var(--brand); }
.monthbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 12px; }
.monthbar h2 { margin: 0; text-transform: capitalize; }

/* pillole, tile, liste */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; margin-bottom: 8px; scrollbar-width: none; align-items: center; }
.pills a { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 500; }
.pills a[aria-current] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); min-height: 112px; }
.tile .ic { width: 28px; height: 28px; color: var(--brand); margin-bottom: 4px; }
.tile small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.tile:hover { border-color: var(--brand); }
.tile-wa .ic { color: #1f9d55; }
.linklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 6px 14px; }
.linklist a { display: flex; align-items: center; gap: 8px; padding: 8px 0; text-decoration: none; font-weight: 500; }
.menu-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 15px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-weight: 500; }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a span { flex: 1; }
.menu-list .ic { color: var(--brand); } .menu-list .chev { color: var(--muted); width: 18px; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .ic { margin: 0 auto 8px; display: block; opacity: .6; }
.empty p { margin: 0; }
.list, .plain { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li a { text-decoration: none; color: var(--ink); }
.list small, .plain small { color: var(--muted); }
.plain li { padding: 6px 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; box-shadow: var(--shadow); }
.card-box > h2 { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; }
.card-box.danger { border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.two { display: grid; gap: 16px; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; align-items: start; } .two .card-box { margin: 0; } }
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.cover { text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.cover img, .cover .card-ph { aspect-ratio: 210 / 297; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow); background: var(--surface-2); border: 1px solid var(--line); }

/* dettaglio */
.detail { max-width: 760px; }
.detail-h { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.detail-h .chip-date { width: 68px; padding: 8px 0; }
.detail-h .chip-date b { font-size: 1.9rem; }
.meta { color: var(--muted); display: flex; gap: 6px; align-items: center; margin: 0 0 4px; }
.poster { margin: 16px 0; }
.poster img { border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 auto; max-height: 82vh; width: auto; }
.poster figcaption { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 6px; }
.prose { font-size: 1.04rem; overflow-wrap: anywhere; }
.prose h3 { margin-top: 1.2em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 4px 0; }
.prose img.float { float: right; max-width: 38%; margin: 0 0 10px 14px; border-radius: var(--radius-sm); }
.legal h2 { font-size: 1.2rem; margin-top: 1.6em; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 10px 0 16px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--surface-2); }
@media (max-width: 640px) {
  .legal .tbl thead { display: none; }
  .legal .tbl tr { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 6px 0; background: var(--surface); }
  .legal .tbl td { display: block; border: 0; padding: 4px 12px; }
  .legal .tbl td:first-child { font-weight: 700; }
}
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; }
.acc summary { cursor: pointer; padding: 16px 18px; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.acc summary::after { content: "+"; font-family: var(--sans); color: var(--brand); font-size: 1.4rem; }
.acc[open] summary::after { content: "–"; }
.acc .prose { padding: 0 18px 12px; }
.acc summary::-webkit-details-marker { display: none; }

/* orari */
.sched { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.sched h3 { margin-bottom: 4px; }
.sched-list { margin: 10px 0 0; }
.sched-list > div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.sched-list > div.is-today { background: var(--brand-soft); margin: 0 -10px; padding: 8px 10px; border-radius: 10px; border-top-color: transparent; }
.sched-list dt { font-weight: 600; }
.sched-list dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.slot small { color: var(--muted); }
.note { color: var(--muted); font-size: .9rem; margin: 10px 0 0; }
.shifts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.shifts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.shifts .shift-h { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.shifts .shift-h span { color: var(--muted); font-size: .9rem; }
.shifts p { margin: 4px 0 0; }

/* gallerie */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 160px), 1fr)); gap: 6px; margin: 16px 0; }
.gallery a, .gallery figure { margin: 0; position: relative; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.admin-gallery form { position: absolute; top: 6px; right: 6px; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .14); color: #fff; border: 0; border-radius: 999px; width: 48px; height: 48px; font-size: 1.6rem; cursor: pointer; }
.lightbox .lb-x { top: calc(12px + env(safe-area-inset-top)); right: 12px; } .lightbox .lb-p { left: 8px; } .lightbox .lb-n { right: 8px; }

/* pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { background: var(--surface); color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { filter: brightness(.92); background: var(--err); border-color: var(--err); }
.btn-wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 46px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; padding: 6px 0; display: inline-flex; gap: 6px; align-items: center; }
form.inline { display: inline; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 22px 0; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }

/* moduli */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .fld { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.form label small, .help { font-weight: 400; color: var(--muted); font-size: .84rem; }
.fld .lbl { font-weight: 600; }
input, select, textarea { font: 16px/1.4 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 60%, var(--muted)); border-radius: 12px; padding: 12px 14px; width: 100%; min-height: 48px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
input[disabled] { opacity: .6; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--brand); margin: 1px 0 0; }
.form label.check, label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); margin: 10px 0; }
.alert-err { background: var(--err-soft); color: var(--err); font-weight: 500; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.file-btn { flex-direction: row !important; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; color: var(--brand); background: var(--surface); }
.file-btn.big { padding: 26px 14px; font-size: 1.05rem; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn:focus-within { border-color: var(--brand); }
.file-name { font-size: .85rem; color: var(--ok); }
.cur-file { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cur-file img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.row2 { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; }
.search { display: flex; gap: 8px; margin: 0 0 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
legend { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; padding: 0 6px; }

/* accesso */
.auth main.wrap { max-width: 480px; }
.auth-box { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 22px 20px; box-shadow: var(--shadow); margin-top: 12px; }
.steps { padding-left: 1.3em; color: var(--muted); } .steps li { margin: 4px 0; }
.code-input { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.big-code { font: 700 2.6rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 18px; background: var(--brand-soft); color: var(--brand); border-radius: var(--radius); user-select: all; }
.pw-meter .bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.pw-meter .bar span { display: block; height: 100%; width: 0; background: var(--err); transition: width .25s, background .25s; }
.pw-meter[data-s="2"] .bar span { background: #d58a1a; } .pw-meter[data-s="3"] .bar span { background: #b4a21a; } .pw-meter[data-s="4"] .bar span { background: var(--ok); }
.pw-rules { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; font-size: .84rem; color: var(--muted); }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--ok); } .pw-rules li.ok::before { content: "✓ "; }
.pw-rules li.bad { color: var(--err); } .pw-rules li.bad::before { content: "✗ "; }
.paste-hint { color: var(--err); font-size: .82rem; font-weight: 500; }

/* account */
.acc-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 14px 0; scrollbar-width: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current] { color: var(--brand); border-color: var(--brand); }
.enroll .form { margin-top: 10px; }

/* piè di pagina */
.foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 48px; color: var(--muted); font-size: .92rem; }
.foot-in { display: grid; gap: 24px; padding-top: 28px; }
@media (min-width: 800px) { .foot-in { grid-template-columns: 1.2fr 1fr; } }
.foot-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); margin-bottom: 10px; font-family: var(--serif); }
.foot p { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; }
.foot-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; align-content: start; }
.foot-links a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.foot-small { font-size: .8rem; padding-top: 0; padding-bottom: 24px; }

/* area di gestione */
.admin { display: grid; gap: 16px; }
@media (min-width: 960px) { .admin { grid-template-columns: 250px 1fr; align-items: start; } .admin-side { position: sticky; top: 80px; } }
.admin-menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-menu summary { padding: 12px 16px; cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; list-style: none; }
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu > div { display: flex; flex-direction: column; padding: 0 8px 10px; }
.admin-menu a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .95rem; }
.admin-menu a[aria-current] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.admin-menu a .ic { color: var(--brand); }
.admin-menu form { padding: 6px 10px; }
.admin-main { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 20px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(5, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.stat b { font-size: 1.8rem; font-family: var(--serif); color: var(--brand); }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.warn { border-color: var(--accent); } .stat.warn b { color: var(--accent); }
.quick { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.alist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.alist > li > a, .alist-row, .urow > summary { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; text-decoration: none; color: var(--ink); }
.alist > li > a > span:not(.tag):not(.alist-ic), .alist-row > span:first-child, .urow > summary > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.alist small { color: var(--muted); overflow-wrap: anywhere; }
.alist .note { color: var(--accent); }
.alist img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex: none; }
.alist-ic { width: 52px; height: 52px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.urow > summary { cursor: pointer; list-style: none; }
.urow > summary::-webkit-details-marker { display: none; }
.urow[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.urow > .btns, .urow > p { background: var(--surface); border: 1px solid var(--line); border-top: 0; padding: 10px 12px; margin: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.urow select { width: auto; min-height: 40px; padding: 6px 10px; }
.admin-form { max-width: 720px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: calc(var(--tab-h) * 0 + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 90%, transparent); padding: 10px 0; backdrop-filter: blur(8px); }
.is-admin { padding-bottom: env(safe-area-inset-bottom); }
.danger-zone { margin: 32px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.msg.unread { border-left: 4px solid var(--accent); }
.msg header { margin-bottom: 8px; }
.install { max-width: 720px; }
.req { list-style: none; padding: 0; } .req .ok { color: var(--ok); } .req .bad { color: var(--err); font-weight: 700; } .req .warn { color: var(--accent); }
.sel { user-select: all; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .top, .tabbar, .foot, .btns, .pills { display: none !important; } body { background: #fff; padding: 0; } }
