:root{
  --bg:#f4f6fb;--card:#fff;--text:#16202e;--muted:#6b7280;--line:#e5e7eb;
  --blue:#1d4ed8;--green:#12803c;--red:#c02626;--amber:#b45309;--soft:#f6f8fc;
}
*{box-sizing:border-box}
html,body{overscroll-behavior-y:contain}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,"Noto Sans Hebrew",sans-serif;background:var(--bg);color:var(--text);-webkit-text-size-adjust:100%}
button,a,textarea{font:inherit}
.hidden{display:none!important}

/* header */
.top{position:sticky;top:0;z-index:20;background:#101827;color:#fff;padding:calc(10px + env(safe-area-inset-top)) 14px 10px;display:flex;justify-content:space-between;align-items:center;gap:10px}
.top strong{font-size:17px}
.topActions{display:flex;align-items:center;gap:9px}
.muted{font-size:12px;color:#aeb8c7;margin-top:3px}
.smallBtn{border:0;border-radius:9px;width:38px;height:38px;background:#233047;color:#fff;font-size:17px;font-weight:700}
.netDot{width:10px;height:10px;border-radius:50%;background:#3ddc84;display:inline-block}
.netDot.off{background:#f59e0b}

.banner{background:#fef3c7;color:#7c4a03;padding:10px 14px;font-size:13px;font-weight:600;border-bottom:1px solid #fde68a}
.banner.warn{background:#fef3c7;color:#7c4a03}

.wrap{max-width:720px;margin:auto;padding:14px 14px calc(26px + env(safe-area-inset-bottom))}
.card,.summary,.listPanel,.installHint{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:16px;margin-bottom:12px;box-shadow:0 1px 3px rgba(16,24,39,.05)}

/* current stop */
.stopNo{font-size:12px;color:var(--muted)}
.name{font-size:27px;font-weight:800;margin-top:5px;line-height:1.2}
.address{font-size:16px;line-height:1.45;margin:6px 0 12px;color:#374151}
.bigFill{background:#eef4ff;border:1px solid #d5e2ff;border-radius:14px;padding:12px 14px;display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}
.bigFill span{font-size:13px;color:#2d4a86;font-weight:600}
.bigFill b{font-size:32px;color:#12306e;letter-spacing:-.5px}
.stats{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.stat{background:var(--soft);padding:11px;border-radius:12px}
.stat b{display:block;font-size:19px}
.stat span{font-size:11px;color:var(--muted)}
.next{background:#eaf3ff;padding:10px 12px;border-radius:10px;margin-top:12px;font-size:13px;color:#173b74}
.next.home{background:#eaf7ef;color:#12522f}

/* buttons */
.btn{display:block;width:100%;border:0;border-radius:13px;padding:16px;margin-top:10px;text-align:center;text-decoration:none;font-weight:800;font-size:17px;-webkit-tap-highlight-color:transparent}
.btn:active{transform:scale(.99)}
.waze{background:var(--blue);color:#fff}
.filledBtn{background:var(--green);color:#fff}
.issueBtn{background:var(--red);color:#fff}
.ghostBtn{background:#e8edf5;color:#31415c}

/* summary */
.summary{font-size:13px;line-height:1.6}
.sumGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:9px}
.sumGrid div{background:var(--soft);border-radius:12px;padding:10px;text-align:center}
.sumGrid b{display:block;font-size:17px}
.sumGrid span{font-size:11px;color:var(--muted)}
.summary .muted{color:var(--muted)}

/* list */
.listHead{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.listPanel h2{font-size:16px;margin:0}
.linkBtn{background:none;border:0;color:var(--blue);font-size:13px;font-weight:700;padding:4px}
.row{display:flex;gap:10px;align-items:flex-start;border-top:1px solid #eef1f5;padding:12px 0}
.row:first-child{border-top:0}
.row.done{background:#eaf8ef;margin:0 -8px;padding:12px 8px;border-radius:12px}
.row.issue{background:#fdeeee;margin:0 -8px;padding:12px 8px;border-radius:12px}
.num{flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:#e8edf5;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:14px}
.body{flex:1;min-width:0}
.body b{display:block;font-size:15px}
.body a{display:block;color:var(--blue);text-decoration:none;font-size:13px;margin-top:4px}
.note{background:#fff7ed;border:1px solid #fed7aa;color:#7c3b06;border-radius:9px;padding:7px 9px;margin-top:7px;font-size:13px;line-height:1.4}
.pill{display:inline-block;background:#fde68a;color:#7c4a03;border-radius:999px;padding:2px 8px;font-size:11px;font-weight:700;margin-inline-start:7px;vertical-align:middle}
.rowActions{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.rowActions button{border:0;border-radius:9px;padding:9px 12px;font-size:13px;font-weight:700;color:#fff}
.reset{background:#64748b!important}
.empty{color:var(--muted);padding:10px 0;font-size:14px}

.installHint{font-size:13px;line-height:1.6;color:#374151;background:#f8fafc}
.error{background:#fee2e2;color:#991b1b;border-radius:12px;padding:13px;margin-bottom:12px;font-size:14px}

/* issue sheet */
.sheet{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheetCard{background:#fff;width:100%;max-width:720px;border-radius:20px 20px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom));max-height:88vh;overflow:auto}
.sheetCard h3{margin:0 0 4px;font-size:19px}
.sheetCard .muted{color:var(--muted);margin-bottom:12px}
.chipRow{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:11px}
.chip{border:1px solid #d7dfea;background:#f4f7fc;color:#31415c;border-radius:999px;padding:8px 13px;font-size:13px;font-weight:600}
.chip:active{background:#e3ebf7}
#sheetNote{width:100%;border:1px solid #d7dfea;border-radius:12px;padding:12px;font-size:16px;resize:vertical;line-height:1.5}
.sheetActions{display:grid;grid-template-columns:1fr 2fr;gap:9px;margin-top:4px}
.sheetActions .btn{margin-top:8px}

@media(max-width:400px){.name{font-size:23px}.bigFill b{font-size:27px}}
@media (prefers-color-scheme: dark){
  :root{--bg:#0f1520;--card:#161f2e;--text:#e7ecf4;--muted:#93a1b5;--line:#25314a;--soft:#1b2537}
  .address{color:#c3cede}
  .bigFill{background:#16305c;border-color:#264a86}
  .bigFill span{color:#a9c4f0}.bigFill b{color:#e8f0ff}
  .next{background:#16305c;color:#cfe0ff}.next.home{background:#123a26;color:#bff0d3}
  .row.done{background:#12331f}.row.issue{background:#3a1a1a}
  .num{background:#24304a;color:#dbe4f2}
  .note{background:#3a2a12;border-color:#7c5a1a;color:#fbe0b8}
  .installHint{background:#161f2e;color:#c3cede}
  .chip{background:#1b2537;border-color:#2c3a56;color:#d3dced}
  #sheetNote{background:#111a27;border-color:#2c3a56;color:#e7ecf4}
  .sheetCard{background:#161f2e}
  .ghostBtn{background:#24304a;color:#dbe4f2}
  .sumGrid div,.stat{background:#1b2537}
}

/* PIN gate (cloud relay only) */
.pinScreen{position:fixed;inset:0;background:#101827;z-index:60;display:flex;align-items:center;justify-content:center;padding:24px}
.pinCard{width:100%;max-width:360px;text-align:center;color:#fff}
.pinLogo{width:64px;height:64px;margin:0 auto 16px;border-radius:18px;background:#1d4ed8;display:flex;align-items:center;justify-content:center;font-size:32px;font-weight:800}
.pinCard h2{margin:0 0 6px;font-size:23px}
.pinHint{margin:0 0 20px;font-size:14px;color:#9fadc2;line-height:1.5}
#pinInput{width:100%;border:1px solid #33415c;background:#1b2537;color:#fff;border-radius:13px;padding:16px;font-size:24px;text-align:center;letter-spacing:6px}
#pinInput::placeholder{letter-spacing:normal;font-size:16px;color:#6b7a91}
.pinError{background:#7f1d1d;color:#fecaca;border-radius:10px;padding:10px;margin-top:12px;font-size:14px}
.pinCard .btn{margin-top:14px}
