/* Fantasy Café — tema chiaro fisso (professionale). Palette brand: bianco/navy/bordeaux. */
  :root{
    color-scheme: light;
    --ground:#eef0f7; --surface:#fdfdfd; --surface-2:#ffffff;
    --ink:#020c2e; --ink-2:#3a4266; --muted:#7a809b;
    --line:#e4e7f1; --line-2:#eceff6;
    --accent:#820e25; --accent-ink:#fdfdfd; --accent-soft:#f4e5e8; --accent-line:#e7cdd3;
    --navy:#020c2e; --navy-2:#0b1a3f;
    --ok:#1f7a4d; --ok-soft:#e6f1ea; --warn:#a65a12; --warn-soft:#f8ebda; --sold:#9aa0b4;
    --shadow:0 1px 2px rgba(2,12,46,.06), 0 8px 24px rgba(2,12,46,.06);
    --shadow-sm:0 1px 2px rgba(2,12,46,.08);
    --serif:"Iowan Old Style","Palatino Linotype",Palatino,"URW Palladio L",P052,Georgia,"Times New Roman",serif;
    --sans:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    --r:14px; --r-sm:10px;
  }

  *{box-sizing:border-box}
  html,body{margin:0}
  body{
    background:var(--ground); color:var(--ink); font-family:var(--sans);
    -webkit-font-smoothing:antialiased; line-height:1.45;
    background-image:radial-gradient(120% 60% at 50% -10%, rgba(130,14,37,.05), transparent 60%);
  }
  .app{
    max-width:468px; margin:0 auto; min-height:100dvh; background:var(--ground);
    display:flex; flex-direction:column; position:relative;
    box-shadow:0 0 0 1px var(--line-2), 0 30px 80px rgba(2,12,46,.10);
    /* in orizzontale la tacca della fotocamera sta di lato: niente contenuto sotto */
    padding-left:env(safe-area-inset-left, 0px); padding-right:env(safe-area-inset-right, 0px);
  }
  @media (min-width:520px){ .app{min-height:calc(100dvh - 32px); margin:16px auto; border-radius:22px; overflow:hidden} }

  /* ---- header ----
     Il padding alto somma la "safe area": sui telefoni con la tacca (o l'isola) per la fotocamera
     quello spazio è occupato dal sistema, e senza questo il logo ci finirebbe sotto. Dove la tacca
     non c'è, env() vale 0 e resta solo il margine normale — che teniamo generoso. */
  header{
    position:sticky; top:0; z-index:20; background:var(--surface);
    border-bottom:1px solid var(--line);
    padding:calc(20px + env(safe-area-inset-top, 0px)) 16px 12px;
    display:flex; flex-direction:column; gap:11px;
  }
  .bar{display:flex; align-items:center; justify-content:space-between; gap:12px}
  .logo-chip{background:transparent; padding:0; line-height:0}
  .logo-chip img{height:48px; width:auto; display:block; border-radius:8px; box-shadow:0 3px 12px rgba(2,12,46,.15)}
  .seg{display:inline-flex; background:var(--line-2); border-radius:999px; padding:3px; gap:2px}
  .seg button{
    border:0; background:transparent; color:var(--ink-2); font:inherit; font-size:12.5px; font-weight:600;
    padding:6px 13px; border-radius:999px; cursor:pointer; letter-spacing:.01em;
  }
  .seg button[aria-pressed="true"]{background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm)}

  .status{display:flex; align-items:center; gap:10px; justify-content:space-between}
  /* min-width:0 serve perché un nome lungo non spinga fuori la pillola degli orari */
  .status .when{display:flex; flex-direction:column; gap:1px; min-width:0}
  .status .day{font-size:12.5px; color:var(--muted); text-transform:capitalize; white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis}
  .status .greet{font-family:var(--serif); font-size:16px; color:var(--ink); white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis}
  .pill{display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; padding:5px 10px; border-radius:999px; white-space:nowrap}
  .pill .dot{width:7px; height:7px; border-radius:50%}
  .pill.open{background:var(--ok-soft); color:var(--ok)} .pill.open .dot{background:var(--ok)}
  .pill.closed{background:var(--warn-soft); color:var(--warn)} .pill.closed .dot{background:var(--warn)}

  /* ---- scroll body ---- */
  main{flex:1; overflow-y:auto; padding:18px 16px 120px; -webkit-overflow-scrolling:touch}
  main.nopad{padding-bottom:calc(28px + env(safe-area-inset-bottom, 0px))}
  .fade{animation:fade .22s ease both}
  @keyframes fade{from{opacity:0; transform:translateY(4px)}to{opacity:1;transform:none}}
  @media (prefers-reduced-motion:reduce){ .fade{animation:none} }

  h2.sec{font-family:var(--serif); font-weight:600; font-size:13px; letter-spacing:.14em; text-transform:uppercase; color:var(--accent); margin:22px 2px 10px; display:flex; align-items:center; gap:10px}
  h2.sec::after{content:""; flex:1; height:1px; background:var(--line)}
  h2.sec:first-child{margin-top:4px}

  /* ---- dish card ---- */
  .card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); overflow:hidden}
  .dish{display:grid; grid-template-columns:76px 1fr; gap:13px; padding:12px; align-items:stretch}
  .dish + .dish{border-top:1px solid var(--line-2)}
  .thumb{position:relative; border-radius:var(--r-sm); overflow:hidden; background:linear-gradient(150deg,#0c1738,#020c2e); aspect-ratio:1/1; display:grid; place-items:center; border:1px solid rgba(255,255,255,.04)}
  .thumb::before{content:attr(data-mono); font-family:var(--serif); font-weight:600; font-size:40px; color:rgba(253,253,253,.11); line-height:1}
  .thumb .cam{position:absolute; bottom:5px; left:0; right:0; text-align:center; font-size:8.5px; letter-spacing:.08em; text-transform:uppercase; color:rgba(253,253,253,.42)}
  .thumb .edge{position:absolute; inset:5px; border:1px solid rgba(211,60,85,.35); border-radius:7px; pointer-events:none}
  .thumb.has{background:var(--line-2)}
  .thumb.has img{width:100%; height:100%; object-fit:cover; display:block}
  .thumb.has .edge{border-color:rgba(255,255,255,.28)}
  .dish .body{display:flex; flex-direction:column; min-width:0}
  .dish .name{font-family:var(--serif); font-size:17px; font-weight:600; color:var(--ink); line-height:1.2}
  .dish .desc{font-size:12.5px; color:var(--muted); margin-top:2px; line-height:1.35}
  .dish .row{margin-top:auto; padding-top:8px; display:flex; align-items:center; justify-content:space-between; gap:8px}
  .price{font-weight:700; color:var(--ink); font-variant-numeric:tabular-nums; font-size:15px}
  .stock{font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px; white-space:nowrap}
  .stock.ok{background:var(--ok-soft); color:var(--ok)} .stock.low{background:var(--warn-soft); color:var(--warn)} .stock.no{background:var(--line-2); color:var(--sold)}

  /* stepper */
  .step{display:inline-flex; align-items:center; gap:0; border:1px solid var(--line); border-radius:999px; background:var(--surface-2); overflow:hidden}
  .step button{width:30px; height:30px; border:0; background:transparent; color:var(--accent); font-size:18px; font-weight:600; cursor:pointer; display:grid; place-items:center; line-height:1}
  .step button:disabled{color:var(--muted); cursor:not-allowed; opacity:.5}
  .step .q{min-width:24px; text-align:center; font-weight:700; font-variant-numeric:tabular-nums; font-size:14px}
  .addbtn{border:0; background:var(--accent); color:var(--accent-ink); font:inherit; font-weight:700; font-size:13px; padding:8px 15px; border-radius:999px; cursor:pointer; box-shadow:var(--shadow-sm)}
  .addbtn:disabled{background:var(--line-2); color:var(--muted); cursor:not-allowed; box-shadow:none}

  .banner{display:flex; gap:10px; align-items:flex-start; background:var(--warn-soft); color:var(--warn); border:1px solid transparent; border-radius:var(--r); padding:12px 14px; font-size:13px; font-weight:600; margin-bottom:14px}

  /* ---- tracker ordine (cliente): stato, tempo stimato, avanzamento ---- */
  #tracker:not(:empty){display:flex; flex-direction:column; gap:10px; margin-bottom:16px}
  .trk{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); padding:14px}
  .trk.closed{opacity:.7; box-shadow:none}
  .trk-top{display:flex; justify-content:space-between; align-items:flex-start; gap:10px}
  .trk-n{font-family:var(--serif); font-size:16px; font-weight:600}
  .trk-sub{font-size:12px; color:var(--muted); margin-top:1px}
  .trk-eta{display:flex; align-items:center; gap:8px; margin-top:11px; padding:9px 11px; border-radius:var(--r-sm);
    background:var(--accent-soft); color:var(--ink-2); font-size:13.5px; font-weight:600}
  .trk-eta svg{color:var(--accent); flex:none}
  .trk-eta b{font-variant-numeric:tabular-nums; color:var(--accent)}
  .trk-eta .muted{font-weight:600}
  .trk-cancel{margin-top:10px; font-size:13px; color:var(--muted)}
  .trk-steps{list-style:none; display:flex; margin:15px 0 0; padding:0}
  .trk-steps li{flex:1; position:relative; text-align:center; font-size:10.5px; font-weight:700; color:var(--muted);
    letter-spacing:.01em; line-height:1.25}
  .trk-steps li::before{content:""; position:absolute; top:6px; left:-50%; width:100%; height:2px; background:var(--line)}
  .trk-steps li:first-child::before{display:none}
  .trk-steps .d{display:block; position:relative; z-index:1; width:14px; height:14px; margin:0 auto 7px;
    border-radius:50%; background:var(--surface); border:2px solid var(--line)}
  .trk-steps li.done{color:var(--ink-2)}
  .trk-steps li.done::before, .trk-steps li.now::before{background:var(--accent)}
  .trk-steps li.done .d{background:var(--accent); border-color:var(--accent)}
  .trk-steps li.now{color:var(--accent)}
  .trk-steps li.now .d{border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft)}
  @media (prefers-reduced-motion:no-preference){
    .trk-steps li.now .d{animation:beat 1.9s ease-in-out infinite}
    @keyframes beat{0%,100%{box-shadow:0 0 0 4px var(--accent-soft)}50%{box-shadow:0 0 0 8px var(--accent-soft)}}
  }
  .trk-items{display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-top:13px;
    padding-top:10px; border-top:1px solid var(--line-2); font-size:12.5px; color:var(--muted)}
  .trk-items .price{font-size:14px; white-space:nowrap}

  /* ---- sticky cart ---- */
  .cartbar{position:sticky; bottom:0; z-index:15; padding:12px 16px calc(14px + env(safe-area-inset-bottom)); background:linear-gradient(to top, var(--surface) 68%, transparent); }
  .cartbtn{width:100%; border:0; border-radius:14px; background:var(--accent); color:var(--accent-ink); padding:14px 18px; font:inherit; font-weight:700; font-size:15px; cursor:pointer; display:flex; align-items:center; justify-content:space-between; box-shadow:0 6px 18px rgba(130,14,37,.28)}
  .cartbtn .n{background:rgba(255,255,255,.18); border-radius:999px; padding:2px 9px; font-size:12.5px}
  .cartbtn:disabled{background:var(--sold); box-shadow:none; cursor:not-allowed; opacity:.85}
  .cartbtn .tot{font-variant-numeric:tabular-nums}

  /* ---- generic buttons / inputs ---- */
  .btn{border:0; border-radius:12px; padding:13px 16px; font:inherit; font-weight:700; font-size:14.5px; cursor:pointer; width:100%; background:var(--accent); color:var(--accent-ink); box-shadow:var(--shadow-sm)}
  .btn.ghost{background:var(--surface); color:var(--ink); border:1px solid var(--line); box-shadow:none}
  .btn.mini{width:auto; padding:9px 14px; font-size:13px; border-radius:10px}
  .link{background:none; border:0; color:var(--accent); font:inherit; font-weight:600; cursor:pointer; padding:6px}
  label.fld{display:block; font-size:12px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; color:var(--muted); margin:0 0 6px 2px}
  input.txt, select.txt{width:100%; border:1px solid var(--line); background:var(--surface-2); color:var(--ink); border-radius:12px; padding:12px 13px; font:inherit; font-size:15px}
  input.txt:focus, select.txt:focus, .step button:focus-visible, button:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
  .choice{display:grid; grid-template-columns:1fr 1fr; gap:8px}
  .choice.three{grid-template-columns:1fr 1fr 1fr}
  .opt{border:1px solid var(--line); background:var(--surface); border-radius:12px; padding:12px 10px; cursor:pointer; text-align:center; font-size:13.5px; font-weight:600; color:var(--ink-2)}
  .opt small{display:block; font-weight:500; color:var(--muted); font-size:11px; margin-top:2px}
  .opt[aria-pressed="true"]{border-color:var(--accent); background:var(--accent-soft); color:var(--ink)}

  .sheet{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); padding:16px; margin-bottom:14px}
  .sheet h3{font-family:var(--serif); font-size:19px; margin:0 0 4px}
  .sheet .sub{color:var(--muted); font-size:13px; margin:0 0 14px}
  .lineitem{display:flex; justify-content:space-between; gap:10px; padding:9px 0; font-size:14px; border-bottom:1px solid var(--line-2)}
  .lineitem:last-of-type{border-bottom:0}
  .lineitem .q{color:var(--accent); font-weight:700}
  .totrow{display:flex; justify-content:space-between; align-items:baseline; margin-top:12px; padding-top:12px; border-top:1px solid var(--line)}
  .totrow .big{font-family:var(--serif); font-size:24px; font-weight:600; font-variant-numeric:tabular-nums}
  .stack{display:flex; flex-direction:column; gap:10px}

  /* confirm */
  .confirm{text-align:center; padding:24px 8px}
  .seal{width:74px; height:74px; border-radius:50%; margin:0 auto 16px; display:grid; place-items:center; background:var(--ok-soft); color:var(--ok)}
  .seal svg{width:38px; height:38px}
  .ordernum{font-family:var(--serif); font-size:15px; color:var(--muted)}
  .recap{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); padding:16px; text-align:left; margin:18px 0}
  .recap .kv{display:flex; justify-content:space-between; padding:7px 0; font-size:14px; border-bottom:1px solid var(--line-2)}
  .recap .kv:last-child{border-bottom:0}
  .recap .kv .k{color:var(--muted)}

  /* ---- gestore ---- */
  .gtabs{display:flex; gap:4px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:4px; margin-bottom:16px; position:sticky; top:0; box-shadow:var(--shadow-sm); z-index:10}
  .gtabs a{font-size:12.5px !important; padding:9px 4px !important; white-space:nowrap}
  @media (max-width:420px){ .gtabs a{font-size:11.5px !important} }
  .gtabs button{flex:1; border:0; background:transparent; color:var(--ink-2); font:inherit; font-weight:600; font-size:13px; padding:9px; border-radius:9px; cursor:pointer}
  .gtabs button[aria-pressed="true"]{background:var(--accent); color:var(--accent-ink)}
  .gcount{background:var(--accent-soft); color:var(--accent); border-radius:999px; padding:0 6px; font-size:11px; margin-left:5px}
  .gtabs button[aria-pressed="true"] .gcount{background:rgba(255,255,255,.22); color:#fff}

  .order{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); padding:13px 14px; margin-bottom:11px}
  .order .top{display:flex; justify-content:space-between; align-items:flex-start; gap:8px}
  .order .who{font-family:var(--serif); font-size:16px; font-weight:600}
  .order .meta{font-size:12px; color:var(--muted); margin-top:1px}
  .order .items{font-size:13px; color:var(--ink-2); margin:9px 0; line-height:1.5}
  .chip{font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; white-space:nowrap}
  .chip.tag{background:var(--line-2); color:var(--ink-2); font-weight:600}
  .st-nuovo{background:var(--accent-soft); color:var(--accent)}
  .st-in_preparazione{background:var(--warn-soft); color:var(--warn)}
  .st-pronto{background:var(--ok-soft); color:var(--ok)}
  .st-in_consegna{background:var(--warn-soft); color:var(--warn)}
  .st-ritirato, .st-consegnato{background:var(--ok-soft); color:var(--ok)}
  .st-annullato{background:var(--line-2); color:var(--sold)}
  .order .actions{display:flex; gap:8px; margin-top:11px; flex-wrap:wrap; align-items:center}
  .etapick{display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line); background:var(--surface-2);
    border-radius:10px; padding:0 6px 0 10px; color:var(--muted)}
  .etapick select{border:0; background:transparent; color:var(--ink); font:inherit; font-size:13px; font-weight:600;
    padding:9px 2px; cursor:pointer}
  .btn.danger{color:var(--accent); border-color:var(--accent-line)}
  .chip.tag svg{vertical-align:-.12em; margin-right:2px}
  .order .foot{display:flex; gap:6px; align-items:center; margin-top:9px; flex-wrap:wrap}

  /* ---- catalogo piatti + selezione rapida (gestore) ---- */
  .gthumb, .qthumb{position:relative; flex:none; display:block; border-radius:var(--r-sm); overflow:hidden;
    background:linear-gradient(150deg,#0c1738,#020c2e); width:46px; height:46px}
  .qthumb{width:40px; height:40px}
  .gthumb.big{width:76px; height:76px}
  .gthumb img, .qthumb img{width:100%; height:100%; object-fit:cover; display:block}
  .gthumb.noimg::before, .qthumb.noimg::before{content:attr(data-mono); position:absolute; inset:0; display:grid;
    place-items:center; font-family:var(--serif); font-size:22px; color:rgba(253,253,253,.30)}
  .qthumb.noimg::before{font-size:18px}

  .qgroup{font-size:10.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--accent);
    margin:16px 0 4px; padding-top:10px; border-top:1px solid var(--line-2)}
  .qgroup:first-of-type{margin-top:8px; border-top:0; padding-top:0}

  .qpick{display:flex; align-items:center; gap:11px; padding:9px 0; border-bottom:1px solid var(--line-2); cursor:pointer}
  .qpick:last-of-type{border-bottom:0}
  .qpick input[type=checkbox]{flex:none; width:20px; height:20px; accent-color:var(--accent); cursor:pointer}
  .qpick .qmeta{flex:1; min-width:0; display:flex; flex-direction:column}
  .qpick .nm{font-family:var(--serif); font-size:15px; font-weight:600; line-height:1.2}
  .qpick .ct{font-size:11.5px; color:var(--muted); margin-top:1px}
  .qpick .qty{display:flex; align-items:center; gap:5px; flex:none}
  .qpick input.mini{width:58px}
  .qpick:has(input:checked){background:var(--accent-soft); border-radius:var(--r-sm); padding-left:8px; padding-right:8px}

  .drow{display:flex; align-items:center; gap:11px; padding:10px 0; border-bottom:1px solid var(--line-2)}
  .drow:last-of-type{border-bottom:0}
  .drow .dmeta{flex:1; min-width:0}
  .drow .nm{font-family:var(--serif); font-size:15.5px; font-weight:600; line-height:1.2}
  .drow .ct{font-size:11.5px; color:var(--muted); margin-top:2px}
  .drow .ct b{color:var(--warn); font-weight:700}
  .drow .dact{display:flex; gap:6px; flex:none; align-items:center}
  .drow .dact a.iconbtn{display:grid; place-items:center; text-decoration:none}

  /* blocco foto del piatto: grande, con anteprima di quello che si è appena scelto */
  .photobox{border:1px solid var(--line); border-radius:var(--r); padding:12px; background:var(--surface-2)}
  .pbprev{margin-bottom:10px; border-radius:var(--r-sm); overflow:hidden; background:var(--line-2); line-height:0}
  .pbprev img{width:100%; max-height:190px; object-fit:cover; display:block}
  .pbprev[hidden]{display:none}
  .pbhint{font-size:12px; color:var(--muted); margin-top:9px; line-height:1.4; text-align:center}
  .rmphoto{display:flex; align-items:center; justify-content:center; gap:8px; margin-top:11px; font-size:13px;
    font-weight:600; color:var(--muted); cursor:pointer}
  .rmphoto input{width:17px; height:17px; accent-color:var(--accent)}
  .filepick{position:relative; display:flex; align-items:center; justify-content:center; gap:9px;
    border:1px dashed var(--accent-line); background:var(--accent-soft); color:var(--accent); border-radius:12px;
    padding:15px 12px; font-size:14px; font-weight:700; cursor:pointer; text-align:center}
  .filepick input[type=file]{position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer}
  .filepick:hover{background:var(--accent); color:#fff; border-style:solid}
  .filepick.done{border-style:solid; border-color:var(--ok); background:var(--ok-soft); color:var(--ok)}
  .tlink{text-decoration:none; color:inherit; display:block}
  a.nm.tlink:hover{color:var(--accent)}
  .iconbtn.danger{color:var(--accent); border-color:var(--accent-line)}

  .medit{display:grid; grid-template-columns:1fr auto; gap:10px; padding:12px 0; border-bottom:1px solid var(--line-2); align-items:center}
  /* Su telefono i comandi (prezzo, porzioni, tre pulsanti) mangiano tutta la riga e il nome del
     piatto si riduce a due lettere: sotto i 460px vanno a capo. */
  @media (max-width:459px){
    .medit{grid-template-columns:1fr; gap:9px}
    .medit .ctr{justify-content:flex-end}
    .medit input.mini{width:72px}
  }
  .medit .nm{font-family:var(--serif); font-size:15px; font-weight:600}
  .medit .ct{font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em}
  .medit .ctr{display:flex; align-items:center; gap:8px}
  .medit input.mini{width:64px; text-align:center; border:1px solid var(--line); background:var(--surface-2); color:var(--ink); border-radius:8px; padding:7px 4px; font:inherit; font-size:14px; font-variant-numeric:tabular-nums}
  .iconbtn{width:32px; height:32px; border:1px solid var(--line); background:var(--surface-2); border-radius:8px; cursor:pointer; color:var(--ink-2); display:grid; place-items:center; font-size:15px}
  .codeitem{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line-2)}
  .codeitem code{font-family:var(--serif); background:var(--accent-soft); color:var(--accent); padding:3px 9px; border-radius:7px; font-size:13px; font-weight:700; letter-spacing:.05em}
  .switch{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 0}
  .toggle{position:relative; width:46px; height:27px; border-radius:999px; border:0; background:var(--line); cursor:pointer; transition:background .18s; flex:none}
  .toggle::after{content:""; position:absolute; top:3px; left:3px; width:21px; height:21px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:transform .18s}
  .toggle[aria-pressed="true"]{background:var(--accent)} .toggle[aria-pressed="true"]::after{transform:translateX(19px)}
  .muted{color:var(--muted); font-size:12.5px}
  .empty{text-align:center; color:var(--muted); padding:40px 20px; font-size:14px}
  .empty .big{font-family:var(--serif); font-size:19px; color:var(--ink-2); margin-bottom:6px}

  /* ---- finestre dell'app (al posto di alert/confirm del browser) ---- */
  .fcmodal{position:fixed; inset:0; z-index:100; background:rgba(2,12,46,.5); backdrop-filter:blur(2px);
    display:flex; align-items:flex-end; justify-content:center; animation:fcin .16s ease both}
  @media (min-width:520px){ .fcmodal{align-items:center} }
  .fcmodal.out{animation:fcout .14s ease both}
  @keyframes fcin{from{opacity:0}to{opacity:1}}
  @keyframes fcout{to{opacity:0}}
  .fcbox{background:var(--surface); width:100%; max-width:400px; border-radius:18px 18px 0 0; padding:22px 20px
    calc(20px + env(safe-area-inset-bottom)); box-shadow:0 -10px 40px rgba(2,12,46,.22);
    max-height:calc(100dvh - env(safe-area-inset-top, 0px) - 28px); overflow-y:auto;
    animation:fcup .2s cubic-bezier(.2,.9,.3,1) both}
  @media (min-width:520px){ .fcbox{border-radius:18px; margin:16px; animation:fczoom .18s ease both} }
  @keyframes fcup{from{transform:translateY(18px)}to{transform:none}}
  @keyframes fczoom{from{transform:scale(.97); opacity:.6}to{transform:none; opacity:1}}
  @media (prefers-reduced-motion:reduce){ .fcmodal,.fcbox{animation:none} }
  .fcbox h3{font-family:var(--serif); font-size:20px; margin:0 0 6px}
  .fcbox p{color:var(--ink-2); font-size:14px; line-height:1.5; margin:0 0 4px}
  .fcbox .fcta{width:100%; margin-top:12px; min-height:118px; resize:vertical; font-family:var(--sans); line-height:1.45}
  .fcact{display:flex; gap:9px; margin-top:18px}
  .fcact .btn{flex:1; padding:12px 14px}

  /* segnalazioni nel pannello */
  .fbitem{border:1px solid var(--line); border-radius:var(--r); padding:12px 13px; margin-bottom:10px; background:var(--surface-2)}
  .fbitem.new{border-color:var(--accent-line); background:var(--accent-soft)}
  .fbtop{display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:11.5px}
  .fbmsg{font-size:14px; line-height:1.5; color:var(--ink); margin:9px 0 2px; white-space:pre-wrap; word-break:break-word}
  .fbact{display:flex; justify-content:flex-end; margin-top:8px}

  /* access gate — è l'unica schermata senza header, quindi la safe area la gestisce da sé */
  .gate{padding:calc(46px + env(safe-area-inset-top, 0px)) 20px 34px; text-align:center;
    display:flex; flex-direction:column; align-items:center; gap:6px}
  .gate .plate{background:transparent; padding:0; margin-bottom:26px; line-height:0}
  .gate .plate img{height:74px; width:auto; max-width:100%; border-radius:10px; box-shadow:0 6px 24px rgba(2,12,46,.16)}
  .gate h1{font-family:var(--serif); font-size:24px; font-weight:600; margin:0}
  .gate p{color:var(--muted); font-size:14px; margin:0 0 8px; max-width:30ch}
  .gate form{width:100%; max-width:280px; margin-top:14px; display:flex; flex-direction:column; gap:10px}
  .gate .hint{font-size:12px; color:var(--muted); margin-top:2px}
  .gate .hint code{background:var(--accent-soft); color:var(--accent); padding:2px 7px; border-radius:6px; font-weight:700}
  .err{color:var(--accent); font-size:13px; font-weight:600; min-height:18px}
  .installnote{margin-top:26px; font-size:12px; color:var(--muted); max-width:32ch; line-height:1.5}
