:root{--terra:#C84C22;--blu:#203E6D;--crema:#FAF4E5;--marrone:#735239;--line:#e7ddca;--bg:#F4EFE3;--ok:#2f6b43;}
*{box-sizing:border-box}
body{margin:0;font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--blu);-webkit-font-smoothing:antialiased}
#app{max-width:480px;margin:0 auto;min-height:100dvh}
button{font:inherit;cursor:pointer;border:none;background:none}
.muted{color:var(--marrone)}.center{text-align:center;padding:34px}
svg.ic{width:18px;height:18px;flex:0 0 auto;vertical-align:middle}

/* LOGIN */
.login{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:30px;text-align:center;background:linear-gradient(160deg,#244a82,#16294a)}
.login .logo{height:120px;max-width:88%;margin-bottom:6px}
.login-tag{color:#fff;font-weight:700;letter-spacing:.14em;text-transform:uppercase;font-size:13px;margin-bottom:14px}
.ag-input{width:100%;max-width:320px;border:1px solid rgba(255,255,255,.25);border-radius:14px;padding:14px;font:inherit;font-size:16px;color:var(--blu);background:#fff;outline:none;text-align:center;margin-bottom:10px}
.ag-input::placeholder{color:#a9966f}
.ag-input:focus{border-color:var(--terra);box-shadow:0 0 0 3px rgba(200,76,34,.25)}
.ag-btn{width:100%;max-width:320px;background:var(--terra);color:#fff;border:none;border-radius:14px;padding:15px;font:inherit;font-weight:700;font-size:16px;cursor:pointer;margin-top:4px}
.ag-btn:active{transform:scale(.99)}
.ag-err{color:#ffd2c7;font-size:13px;font-weight:600;min-height:18px;margin-top:12px}
.login .muted{color:#b9c6db;margin:10px 0 2px}
.drv-btns{display:flex;flex-direction:column;gap:12px;width:100%;max-width:300px;margin-top:16px}
.drv{display:flex;align-items:center;gap:14px;background:#fff;border-radius:16px;padding:14px 16px;color:var(--blu);font-size:17px;font-weight:600}
.drv .av{width:42px;height:42px;border-radius:50%;background:var(--terra);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:18px}

/* HEADER */
.hdr{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:10px;background:var(--blu);color:#fff;padding:12px 14px;padding-top:max(12px,env(safe-area-inset-top))}
.hdr .logo-sm{height:24px;filter:brightness(0) invert(1)}
.hdr .logout{margin-left:auto;color:#fff;background:rgba(255,255,255,.15);border-radius:999px;padding:6px 13px;font-size:13px;font-weight:600}
.hdr .back{color:#fff;display:flex}.hdr .back svg{width:22px;height:22px}
.hdr .htitle{font-weight:700;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hdr .badge{margin-left:auto;font-size:11px;font-weight:700;padding:5px 10px;border-radius:999px;white-space:nowrap}
.badge.todo{background:#e7ddca;color:var(--marrone)}.badge.going{background:#ffe2b0;color:#9a5a12}.badge.done{background:#cdeccf;color:var(--ok)}

.rmeta{background:#fff;border-bottom:1px solid var(--line);padding:13px 16px;display:flex;align-items:center;gap:10px}
.rmeta b{display:block;font-size:18px}.rmeta span{color:var(--marrone);font-size:13px}
.rmeta-t{flex:1;min-width:0}
.reorderbtn{flex:0 0 auto;background:#fff;border:1.5px solid var(--terra);color:var(--terra);border-radius:999px;padding:8px 14px;font-weight:600;font-size:13px}
.reorderbtn.on{background:var(--terra);color:#fff}
.customnote{background:#fff3ec;color:#9a4a23;font-size:12.5px;font-weight:600;padding:8px 16px;border-bottom:1px solid var(--line)}
.priobadge{display:inline-block;background:#fdecea;color:#b3261e;font-size:11px;font-weight:700;border-radius:999px;padding:1px 7px;margin-right:6px;vertical-align:middle}
.stop.reordering{cursor:default}
.movebtns{flex:0 0 auto;display:flex;flex-direction:column;gap:4px}
.movebtn{width:36px;height:28px;border:1px solid var(--line);background:var(--crema);color:var(--blu);border-radius:8px;font-size:13px;font-weight:700;line-height:1}
.movebtn:disabled{opacity:.35}

/* LIST */
.list{padding:12px}
.stop{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:#fff;border:1px solid var(--line);border-radius:14px;padding:13px;margin-bottom:9px}
.stop .snum{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;flex:0 0 auto;border:2px solid var(--line);color:var(--marrone);font-size:15px}
.stop.going .snum{border-color:#e5975c;color:#9a5a12;background:#ffe2b0}
.stop.done .snum{border-color:var(--ok);color:#fff;background:var(--ok)}
.stop .sbody{flex:1;min-width:0;line-height:1.3}
.stop .sbody b{display:block;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stop .sbody small{display:block;color:var(--marrone);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stop .sitems{color:var(--blu)!important;font-weight:600;margin-top:2px}
.stop .shours{color:var(--terra)!important;font-weight:600;margin-top:2px}
.stop .shours.nohours{color:var(--marrone)!important;font-weight:400;opacity:.75}
.stop .seta{color:var(--blu)!important;font-weight:700;margin-top:2px}
.stop.done{opacity:.6}
.stop .schev{color:var(--marrone)}.stop .schev svg{width:18px;height:18px}
/* box orari nel dettaglio */
.hoursbox{display:flex;gap:10px;margin-bottom:12px}
.hoursbox>div{flex:1;background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 12px}
.hoursbox span{display:block;font-size:11px;color:var(--marrone)}
.hoursbox b{font-size:15px;color:var(--blu)}

/* DETAIL */
.screen{padding:14px}
.addr{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px;margin-bottom:14px}
.addr>div:first-child{display:flex;gap:8px;color:var(--blu);font-size:14.5px;align-items:flex-start;line-height:1.35}
.addr svg{color:var(--terra);width:20px;height:20px;flex:0 0 auto}
.addr-act{display:flex;gap:10px;margin-top:12px}
.abtn{flex:1;display:flex;align-items:center;justify-content:center;gap:7px;background:var(--crema);color:var(--blu);border-radius:11px;padding:11px;font-weight:600;font-size:14px;text-decoration:none}
.abtn svg{width:18px;height:18px;color:var(--terra)}
.card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:4px 14px;margin-bottom:16px}
.card-h{font-weight:700;font-size:13px;color:var(--marrone);padding:11px 0;border-bottom:1px solid var(--line)}
.line{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid #f1e9d7;font-size:14px}
.line:last-child{border-bottom:none}.line b{white-space:nowrap}
.line.tot{font-weight:700;color:var(--blu)}
.sec-h{font-weight:700;font-size:13px;color:var(--marrone);margin:6px 2px 8px}
.seg{display:flex;gap:8px;margin-bottom:12px}
.seg button{flex:1;background:#fff;border:1px solid var(--line);border-radius:11px;padding:11px;font-weight:600;font-size:14px;color:var(--marrone)}
.seg button.on{border-color:var(--terra);color:var(--terra);background:#fff3ec}
.inp{width:100%;border:1px solid var(--line);border-radius:11px;padding:12px;font:inherit;font-size:15px;margin-bottom:12px;background:#fff;color:var(--blu)}
.sigwrap{position:relative;margin-bottom:12px}
.sig{width:100%;height:165px;background:#fff;border:1.5px dashed #c9bda0;border-radius:12px;touch-action:none;display:block}
.sigclear{position:absolute;top:8px;right:8px;background:var(--crema);border:1px solid var(--line);border-radius:8px;padding:5px 11px;font-size:12px;color:var(--marrone)}
.bigbtn{width:100%;display:flex;align-items:center;justify-content:center;gap:9px;border-radius:14px;padding:15px;font-weight:700;font-size:16px;margin-top:4px}
.bigbtn svg{width:20px;height:20px}
.bigbtn.solid{background:var(--terra);color:#fff;box-shadow:0 10px 22px -8px rgba(200,76,34,.5)}
.bigbtn.ghost{background:#fff;border:1.5px solid var(--terra);color:var(--terra);margin-bottom:10px}
.going-note{display:flex;align-items:center;gap:9px;background:#fff3ec;color:#9a5a12;border-radius:12px;padding:12px;font-weight:600;font-size:14px;margin-bottom:10px}
.going-note svg{width:20px;height:20px}
.donebox{display:flex;align-items:center;gap:10px;background:#cdeccf;color:var(--ok);border-radius:14px;padding:16px;font-weight:700;margin-top:10px}
.donebox svg{width:22px;height:22px}

.toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);background:var(--blu);color:#fff;padding:12px 20px;border-radius:999px;font-weight:600;font-size:14px;z-index:50;box-shadow:0 12px 30px rgba(0,0,0,.32)}
