/* 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);
  }
  @media (min-width:520px){ .app{min-height:calc(100dvh - 32px); margin:16px auto; border-radius:22px; overflow:hidden} }

  /* ---- header ---- */
  header{
    position:sticky; top:0; z-index:20; background:var(--surface);
    border-bottom:1px solid var(--line); padding:12px 16px 10px;
    display:flex; flex-direction:column; gap:10px;
  }
  .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}
  .status .when{display:flex; flex-direction:column; gap:1px}
  .status .day{font-size:12.5px; color:var(--muted); text-transform:capitalize}
  .status .greet{font-family:var(--serif); font-size:16px; color:var(--ink)}
  .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:16px 16px 120px; -webkit-overflow-scrolling:touch}
  main.nopad{padding-bottom:24px}
  .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}
  .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}

  /* ---- 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:6px; 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)}
  .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-pronto{background:var(--warn-soft); color:var(--warn)}
  .st-ritirato{background:var(--ok-soft); color:var(--ok)}
  .order .actions{display:flex; gap:8px; margin-top:10px; flex-wrap:wrap}
  .order .foot{display:flex; gap:6px; align-items:center; margin-top:9px; flex-wrap:wrap}

  .medit{display:grid; grid-template-columns:1fr auto; gap:10px; padding:12px 0; border-bottom:1px solid var(--line-2); align-items:center}
  .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}

  /* access gate */
  .gate{padding:34px 20px; 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}
