:root {
  --bg:#f5f6f8; --card:#fff; --ink:#141920; --muted:#6b7480; --line:#e2e6ea;
  --accent:#1b6ef3; --good:#0f8a68; --warn:#c2410c; --bad:#c0392b; --radius:10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0e1116; --card:#161a20; --ink:#e7ebef; --muted:#98a2ae; --line:#252b33;
          --accent:#5b9bff; --good:#34d39e; --warn:#fb923c; --bad:#f87171; }
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink);
       font:14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; }
h1 { font-size:22px; margin:0 0 6px; }
h2 { font-size:17px; margin:0; letter-spacing:-.01em; }
h3 { font-size:14px; margin:32px 0 12px; color:var(--muted);
     text-transform:uppercase; letter-spacing:.05em; }
a { color:var(--accent); }
.sub { color:var(--muted); font-size:13px; }
.err { color:var(--bad); }
.center { max-width:400px; margin:18vh auto; text-align:center; background:var(--card);
          border:1px solid var(--line); border-radius:var(--radius); padding:40px 28px; }
.center .btn { margin-top:22px; }

nav { display:flex; align-items:center; gap:4px; padding:0 18px; height:52px;
      background:var(--card); border-bottom:1px solid var(--line);
      position:sticky; top:0; z-index:5; overflow-x:auto; }
nav b { margin-right:18px; white-space:nowrap; }
nav a { padding:7px 12px; border-radius:7px; text-decoration:none; color:var(--muted);
        font-size:13.5px; white-space:nowrap; }
nav a.on { background:var(--bg); color:var(--ink); font-weight:500; }
nav .spacer { flex:1; }
nav .who { color:var(--muted); font-size:12.5px; margin-right:10px; white-space:nowrap; }
main { max-width:1240px; margin:0 auto; padding:24px 18px 80px; }
section { margin-bottom:8px; }
.head { display:flex; align-items:center; justify-content:space-between; gap:14px;
        margin-bottom:14px; flex-wrap:wrap; }

.btn { background:var(--accent); color:#fff; border:0; border-radius:7px; cursor:pointer;
       padding:10px 18px; font-size:14px; font-weight:500; text-decoration:none;
       display:inline-block; }
.btn.sm { padding:7px 14px; font-size:13px; }
.ghost { background:none; border:1px solid var(--line); color:var(--muted);
         border-radius:7px; padding:7px 13px; font-size:13px; cursor:pointer; }
.ghost:hover { color:var(--ink); }
.pill { background:var(--warn); color:#fff; border-radius:99px; padding:1px 7px;
        font-size:11px; font-weight:600; margin-left:4px; }

.card { background:var(--card); border:1px solid var(--line);
        border-radius:var(--radius); padding:18px; margin-bottom:16px; }
.filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
select, input[type=text], input[type=date], input[type=search], input[type=email], input[type=number] {
  background:var(--card); color:var(--ink); border:1px solid var(--line);
  border-radius:7px; padding:7px 10px; font-size:13px; font-family:inherit; }
.chk { display:flex; align-items:center; gap:5px; font-size:13px; color:var(--muted); }

.scroll { overflow-x:auto; background:var(--card); border:1px solid var(--line);
          border-radius:var(--radius); }
table { width:100%; border-collapse:collapse; font-size:13.5px; }
th { text-align:left; color:var(--muted); font-weight:500; font-size:11.5px;
     text-transform:uppercase; letter-spacing:.05em; padding:12px 12px;
     border-bottom:1px solid var(--line); white-space:nowrap; }
td { padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background:var(--bg); }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
td select, td input { padding:5px 7px; font-size:12.5px; max-width:170px; }
td.desc { max-width:340px; }

.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
         gap:1px; background:var(--line); border:1px solid var(--line);
         border-radius:var(--radius); overflow:hidden; margin-bottom:16px; }
.stat { background:var(--card); padding:15px 17px; }
.stat .k { color:var(--muted); font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; }
.stat .v { font-size:23px; font-weight:600; margin-top:3px; letter-spacing:-.02em;
           font-variant-numeric:tabular-nums; }
.stat .v.good { color:var(--good); } .stat .v.bad { color:var(--bad); }
.stat .n { font-size:12px; color:var(--muted); margin-top:3px; }

.bar { height:8px; background:var(--line); border-radius:99px; overflow:hidden; }
.bar > i { display:block; height:100%; background:var(--accent); }
.tag { display:inline-block; background:var(--bg); border:1px solid var(--line); white-space:nowrap;
       padding:1px 8px; border-radius:99px; font-size:11.5px; color:var(--muted); }
.tag.warn { border-color:var(--warn); color:var(--warn); }
.tag.good { border-color:var(--good); color:var(--good); }
.note { border-left:3px solid var(--warn); background:var(--card); border-radius:0 8px 8px 0;
        padding:12px 16px; margin-bottom:16px; font-size:13.5px; }
[hidden] { display:none !important; }

/* one line per row: a wrapped supplier name makes the statement unreadable */
td.one { max-width:0; width:40%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
td.nw, th.nw { white-space:nowrap; }
tr.in td { background:color-mix(in srgb, var(--good) 7%, transparent); }
td.num.good { color:var(--good); }

tr.done td { background:color-mix(in srgb, var(--good) 5%, transparent); }

/* ── WOW Sales additions ── */
.reg { display:inline-block; font-weight:700; letter-spacing:.06em; background:#f7d117; color:#111;
       border:1px solid #c9a900; border-radius:4px; padding:1px 7px; font-size:12.5px; white-space:nowrap; }
a.rowlink { color:inherit; text-decoration:none; }
tbody tr.click { cursor:pointer; }
.status { display:inline-block; padding:1px 8px; border-radius:99px; font-size:11.5px; border:1px solid var(--line); color:var(--muted); }
.status.stock { border-color:var(--accent); color:var(--accent); }
.status.prep { border-color:var(--warn); color:var(--warn); }
.status.listed { border-color:var(--good); color:var(--good); }
.status.reserved { border-color:#8b5cf6; color:#8b5cf6; }
.status.sold { background:var(--good); border-color:var(--good); color:#fff; }
.status.written_off, .status.kept { opacity:.7; }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px; }
.kv { display:grid; grid-template-columns:150px 1fr; gap:6px 12px; font-size:13.5px; }
.kv b { color:var(--muted); font-weight:500; }
.kv span { word-break:break-word; }
dialog { border:1px solid var(--line); border-radius:var(--radius); background:var(--card); color:var(--ink);
         padding:0; width:min(720px, 94vw); }
dialog::backdrop { background:rgba(0,0,0,.45); }
dialog form { padding:22px 24px; }
dialog h2 { margin-bottom:14px; }
.fgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:10px 14px; }
.fgrid label { display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted); }
.fgrid label.wide { grid-column:1 / -1; }
.fgrid input, .fgrid select, .fgrid textarea { width:100%; background:var(--card); color:var(--ink); border:1px solid var(--line);
  border-radius:7px; padding:7px 10px; font-size:13px; font-family:inherit; }
.fgrid textarea { min-height:64px; resize:vertical; }
.actions { display:flex; gap:8px; justify-content:flex-end; margin-top:18px; align-items:center; }
.actions .left { margin-right:auto; }
.danger { color:var(--bad); border-color:var(--bad); }
.muted { color:var(--muted); }
.neg { color:var(--bad); } .pos { color:var(--good); }
.crumb { color:var(--muted); font-size:13px; margin-bottom:8px; display:inline-block; text-decoration:none; }
.emptyrow td { text-align:center; color:var(--muted); padding:24px; }
h2 .reg { font-size:15px; vertical-align:middle; margin-right:8px; }
.warnbox { border-left:3px solid var(--bad); }
@media (max-width:640px) { .kv { grid-template-columns:120px 1fr; } .stat .v { font-size:19px; } }

.thumb { display:inline-block; height:44px; border-radius:6px; object-fit:cover; vertical-align:middle; background:var(--line); }
.thumb.none { height:44px; }
td.pic { width:72px; padding-right:0; }
h2 .thumb { height:64px; margin-right:10px; }

/* ── vehicle page 2026 ── */
.hero { display:grid; grid-template-columns:minmax(220px,380px) 1fr; gap:22px; background:var(--card); border:1px solid var(--line);
        border-radius:16px; padding:18px; margin-bottom:16px; }
.hero-pic img { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:12px; display:block; background:var(--line); }
.hero-pic .nopic { aspect-ratio:4/3; border-radius:12px; background:var(--bg); border:1px dashed var(--line); display:flex; align-items:center; justify-content:center; color:var(--muted); }
.hero-top { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.hero-title { font-size:26px; margin:0 0 2px; letter-spacing:-.02em; }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin:14px 0; }
.chip { background:var(--bg); border:1px solid var(--line); border-radius:99px; padding:4px 11px; font-size:12.5px; }
.chip b { color:var(--muted); font-weight:500; margin-right:5px; font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.hero-actions { display:flex; gap:8px; flex-wrap:wrap; }
.card { border-radius:14px; }
.cardhead { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.cardhead h3 { margin:0; }
.grid3 { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; margin-bottom:16px; }
.grid2 { margin-bottom:16px; }
.kv { grid-template-columns:110px 1fr; }
.notes { font-size:13px; color:var(--muted); margin:10px 0 0; line-height:1.5; }
.cbar { display:flex; height:14px; border-radius:99px; overflow:hidden; background:var(--line); }
.cbar i, .legend i { display:block; height:100%; }
.legend { display:flex; flex-wrap:wrap; gap:6px 16px; margin-top:12px; font-size:12.5px; color:var(--muted); }
.legend span { display:flex; align-items:center; gap:6px; }
.legend i { width:10px; height:10px; border-radius:3px; }
.legend b { color:var(--ink); font-weight:600; }
.c1 { background:#3b82f6; } .c2 { background:#93c5fd; } .c3 { background:#f59e0b; } .c4 { background:#10b981; } .c5 { background:#ef4444; } .c6 { background:#a78bfa; }
.checks { list-style:none; margin:0; padding:0; }
.checks li { display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid var(--line); font-size:13.5px; color:var(--muted); }
.checks li:last-child { border-bottom:0; }
.checks li.ok { color:var(--ink); }
.tick { width:20px; height:20px; border-radius:50%; border:1.5px solid var(--line); display:inline-flex; align-items:center; justify-content:center; font-size:12px; flex:none; }
.checks li.ok .tick { background:var(--good); border-color:var(--good); color:#fff; }
button.link { background:none; border:0; color:var(--accent); cursor:pointer; font-size:12.5px; padding:0 4px; font-family:inherit; }
.doclist { list-style:none; margin:0; padding:0; }
.doclist li { display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--line); font-size:13.5px; }
.doclist li:last-child { border-bottom:0; }
.doclist a { flex:1; text-decoration:none; color:var(--ink); display:flex; align-items:center; gap:8px; }
.doclist a:hover { color:var(--accent); }
.dicon { width:26px; height:26px; border-radius:7px; background:var(--bg); border:1px solid var(--line); display:inline-flex; align-items:center; justify-content:center; font-size:13px; }
button.x { background:none; border:0; color:var(--muted); cursor:pointer; font-size:16px; line-height:1; padding:2px 6px; }
button.x:hover { color:var(--bad); }
.scroll.flat { border:0; border-radius:0; background:transparent; }
.tag.cat-transport { border-color:#10b981; color:#10b981; } .tag.cat-auction_fees { border-color:#f59e0b; color:#f59e0b; }
.tag.cat-parts, .tag.cat-repair, .tag.cat-labour { border-color:#ef4444; color:#ef4444; } .tag.cat-advertising { border-color:#a78bfa; color:#a78bfa; }
@media (max-width:700px) { .hero { grid-template-columns:1fr; } .hero-title { font-size:21px; } }
.chip.bad { border-color:var(--bad); color:var(--bad); } .chip.warn { border-color:var(--warn); color:var(--warn); } .chip.good { border-color:var(--good); }
.warnc { color:var(--warn); }

/* ── phone: cards instead of wide tables ── */
.cards { display:none; }
.vcard { display:grid; grid-template-columns:96px 1fr; gap:12px; background:var(--card); border:1px solid var(--line); border-radius:14px;
         padding:12px; margin-bottom:10px; text-decoration:none; color:var(--ink); }
.vcard:active { background:var(--bg); }
.vpic .thumb { width:96px; height:72px; border-radius:10px; }
.vrow { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-bottom:4px; }
.vtitle { font-weight:600; font-size:14.5px; line-height:1.3; }
.vtitle .muted { font-weight:400; font-size:12.5px; }
.vmeta { color:var(--muted); font-size:12.5px; margin-top:3px; }
.vmoney { display:flex; gap:12px; flex-wrap:wrap; margin-top:7px; font-size:13px; color:var(--muted); }
.vmoney b { color:var(--ink); font-size:14px; }
.vmoney .pos b { color:var(--good); } .vmoney .neg b { color:var(--bad); }
.vflags { margin-top:6px; }
.ecard { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:11px 13px; margin-bottom:8px; }
.erow { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.erow > span { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.edesc { margin-top:6px; font-size:13.5px; }
.emeta { margin-top:3px; font-size:12px; color:var(--muted); }
@media (max-width:700px) {
  .tbl { display:none; }
  .cards { display:block; }
  main { padding:14px 12px 60px; }
  nav { padding:0 12px; scrollbar-width:none; }
  nav::-webkit-scrollbar { display:none; }
  nav b { margin-right:8px; }
  .head h2 { font-size:19px; }
  .stats { grid-template-columns:1fr 1fr; }
  .stat { padding:12px 13px; }
  .stat .v { font-size:19px; }
  .filters select, .filters input { flex:1; min-width:0; }
  dialog { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; border:0; border-radius:0; }
  dialog form { padding:18px 16px 40px; }
  .fgrid { grid-template-columns:1fr 1fr; }
}

/* ══════════════════════════════ workshop app ══════════════════════════════ */

/* role visibility */
body[data-role="mechanic"] .staff { display:none !important; }
body:not([data-role="mechanic"]) .mech { display:none !important; }
body:not([data-role="admin"]) .admin { display:none !important; }

a.stat { text-decoration:none; color:inherit; } a.stat:hover { background:var(--bg); }
.hbtns { display:flex; gap:8px; flex-wrap:wrap; }
.btn.good, .ghost.good { background:var(--good); color:#fff; border-color:var(--good); }
.tag.bad { border-color:var(--bad); color:var(--bad); }
.tag.live { border-color:var(--good); color:var(--good); animation:pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity:.45; } }
.btnrow { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; align-items:center; }
.btnrow.end { justify-content:flex-end; margin-top:18px; }
.btnrow a.btn, .btnrow a.ghost { text-decoration:none; }
nav .bell { position:relative; font-size:16px; }
nav .bell .pill { position:absolute; top:0; right:0; }

/* segmented control */
.seg { display:inline-flex; background:var(--card); border:1px solid var(--line); border-radius:9px; padding:3px; gap:2px; flex-wrap:wrap; }
.seg button { background:none; border:0; padding:6px 12px; border-radius:7px; font-size:13px; color:var(--muted); cursor:pointer; font-family:inherit; }
.seg button.on { background:var(--accent); color:#fff; }
.seg.big { display:flex; width:100%; margin:0 0 12px; }
.seg.big button { flex:1; padding:12px 6px; font-size:14px; font-weight:500; }
.seg.big button.on.new { background:#64748b; } .seg.big button.on.in_progress { background:var(--accent); }
.seg.big button.on.waiting_parts { background:var(--warn); } .seg.big button.on.done { background:var(--good); }

/* status pills */
.jst, .pst, .stg { display:inline-block; padding:1px 8px; border-radius:99px; font-size:11.5px; border:1px solid var(--line); color:var(--muted); white-space:nowrap; }
.jst.in_progress { border-color:var(--accent); color:var(--accent); } .jst.waiting_parts { border-color:var(--warn); color:var(--warn); }
.jst.done { background:var(--good); border-color:var(--good); color:#fff; } .jst.cancelled { text-decoration:line-through; }
.pst.requested { border-color:var(--bad); color:var(--bad); } .pst.approved { border-color:var(--warn); color:var(--warn); }
.pst.ordered { border-color:var(--accent); color:var(--accent); } .pst.arrived { border-color:var(--good); color:var(--good); }
.pst.fitted { background:var(--good); border-color:var(--good); color:#fff; } .pst.rejected { text-decoration:line-through; }
.stg { border-color:#8b5cf6; color:#8b5cf6; } .stg.awaiting_approval { border-color:var(--warn); color:var(--warn); }
.stg.ready, .stg.ready_paid { border-color:var(--good); color:var(--good); } .stg.collected { opacity:.6; }

/* workshop board */
.board { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; align-items:start; }
.board .col { background:color-mix(in srgb, var(--line) 35%, transparent); border-radius:14px; padding:10px; min-height:120px; }
.colhead { font-weight:600; font-size:13px; margin:2px 4px 10px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.board .empty { text-align:center; }
.jcard { display:grid; grid-template-columns:72px 1fr; gap:10px; background:var(--card); border:1px solid var(--line); border-radius:12px;
         padding:10px; margin-bottom:8px; text-decoration:none; color:var(--ink); }
.jcard.urgent { border-left:3px solid var(--bad); }
.jcard:active { background:var(--bg); }
.jpic .thumb { width:72px; height:56px; border-radius:9px; }
.thumb.cust { display:inline-flex; align-items:center; justify-content:center; font-size:22px; height:56px; }
.jbody .vtitle { margin:2px 0; }

/* job page */
.jhero { display:flex; gap:16px; align-items:flex-start; }
.jhero-pic { width:150px; aspect-ratio:4/3; object-fit:cover; border-radius:12px; flex:none; }
.jhero-body { flex:1; min-width:0; }
.custline { margin-top:6px; font-size:14px; }
.assign { margin-top:10px; font-size:13.5px; color:var(--muted); }
.assign select { margin-left:4px; }
.timerrow { display:flex; align-items:center; gap:14px; margin-bottom:16px; flex-wrap:wrap; }
.btn.go { background:var(--good); font-size:16px; padding:13px 26px; border-radius:12px; }
.btn.stop { background:var(--bad); font-size:16px; padding:13px 26px; border-radius:12px; font-variant-numeric:tabular-nums; }
.notesin { width:100%; min-height:84px; background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:9px; padding:9px 11px; font:inherit; resize:vertical; }
.stepper { display:flex; gap:4px; margin:0 0 12px; overflow-x:auto; scrollbar-width:none; }
.stepper span { flex:1; min-width:86px; text-align:center; font-size:11.5px; padding:7px 4px; border-radius:8px; background:var(--card); border:1px solid var(--line); color:var(--muted); white-space:nowrap; }
.stepper span.done { background:color-mix(in srgb, var(--good) 14%, var(--card)); color:var(--good); border-color:transparent; }
.stepper span.now { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600; }
.doclist li > span { flex:1; }
.doclist li > b { font-variant-numeric:tabular-nums; }

/* running-timer bar */
.timerbar { position:sticky; top:52px; z-index:4; display:flex; align-items:center; gap:12px; padding:8px 18px; background:color-mix(in srgb, var(--good) 14%, var(--card)); border-bottom:1px solid var(--line); }
.timerbar a { flex:1; color:var(--ink); text-decoration:none; font-weight:500; display:flex; align-items:center; gap:8px; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.timerbar b { font-variant-numeric:tabular-nums; font-size:15px; }
.timerbar .btn { background:var(--bad); }
.dot { width:9px; height:9px; border-radius:50%; background:var(--good); flex:none; animation:pulse 1.4s infinite; }

/* photos */
.pgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(92px,1fr)); gap:8px; }
.pgrid .ph { position:relative; padding:0; border:0; background:var(--line); border-radius:10px; overflow:hidden; cursor:pointer; aspect-ratio:1; }
.pgrid .ph img { width:100%; height:100%; object-fit:cover; display:block; }
.pgrid .ph span { position:absolute; left:5px; bottom:5px; background:rgba(0,0,0,.6); color:#fff; font-size:10.5px; padding:1px 6px; border-radius:99px; }
dialog.photoview { width:min(960px,96vw); padding:12px; }
dialog.photoview img { width:100%; max-height:76vh; object-fit:contain; border-radius:10px; display:block; background:#000; }
.photo-in input[type=file] { padding:9px; border:1px dashed var(--line); border-radius:9px; background:var(--bg); }

/* parts, notifications, customers */
.pcard, .ncard, .ccard { display:block; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:11px 13px; margin-bottom:8px; color:var(--ink); text-decoration:none; }
.pcard .erow, .pcard .edesc { cursor:pointer; }
.pcard.dim { opacity:.6; }
.ncard.unread { border-left:3px solid var(--accent); }
.ncard.unread b { color:var(--ink); }
.ncard b { font-weight:500; }
.card .pcard { border-radius:10px; }

/* checklist */
.checksum { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-bottom:12px; }
.checklist { background:var(--card); border:1px solid var(--line); border-radius:14px; margin-bottom:16px; }
.citem { padding:12px 14px; border-bottom:1px solid var(--line); }
.citem:last-child { border-bottom:0; }
.citem.ok { background:color-mix(in srgb, var(--good) 6%, transparent); }
.citem.advise { background:color-mix(in srgb, var(--warn) 8%, transparent); }
.citem.fail { background:color-mix(in srgb, var(--bad) 8%, transparent); }
.clabel { font-size:14.5px; margin-bottom:8px; }
.cbtns { display:flex; gap:6px; }
.cbtns button { flex:1; padding:10px 4px; border-radius:9px; border:1px solid var(--line); background:var(--card); color:var(--muted); font:inherit; font-size:13.5px; cursor:pointer; }
.cbtns button.ok.on { background:var(--good); border-color:var(--good); color:#fff; }
.cbtns button.advise.on { background:var(--warn); border-color:var(--warn); color:#fff; }
.cbtns button.fail.on { background:var(--bad); border-color:var(--bad); color:#fff; }
.cnote { width:100%; margin-top:8px; padding:9px 11px; border-radius:9px; border:1px solid var(--line); background:var(--card); color:var(--ink); font:inherit; }

/* mechanic home */
.hello { font-size:21px; margin:4px 0 14px; }
.tiles { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:6px; }
.tiles button { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px 8px; font:inherit; font-size:13.5px; font-weight:500; color:var(--ink); cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:6px; }
.tiles button i { font-style:normal; font-size:26px; }
.tiles button:active { background:var(--bg); }
.install { border-left:3px solid var(--accent); }

/* check-in */
.typeahead { display:flex; flex-direction:column; gap:2px; margin-top:4px; }
.typeahead button { text-align:left; background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:8px 10px; color:var(--ink); font:inherit; font-size:13.5px; cursor:pointer; }
.picked { background:var(--bg); border:1px solid var(--line); border-radius:9px; padding:9px 12px; font-size:14px; }
.chipsel { display:flex; flex-wrap:wrap; gap:6px; margin-top:-4px; }
.chipbtn { background:var(--bg); border:1px solid var(--line); border-radius:99px; padding:5px 11px; font:inherit; font-size:12.5px; color:var(--ink); cursor:pointer; }
.chipbtn:active { background:var(--accent); color:#fff; }
.sigpad { width:100%; max-width:640px; height:auto; aspect-ratio:640/180; background:#fff; border:1px solid var(--line); border-radius:10px; touch-action:none; display:block; }

/* sheet dialog */
dialog.sheet { width:min(520px,96vw); }
.sheetbody { padding:20px 22px; }
.sheetbody h2 { margin-bottom:10px; }
.morelist { display:flex; flex-direction:column; }
.morelist a { padding:13px 4px; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none; font-size:15px; }
#toast { position:fixed; left:50%; bottom:90px; transform:translateX(-50%) translateY(20px); background:#141920; color:#fff; padding:10px 18px; border-radius:99px;
         font-size:14px; opacity:0; pointer-events:none; transition:.2s; z-index:50; max-width:90vw; text-align:center; }
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* bottom tab bar — phones only */
.tabbar { display:none; }
@media (max-width:700px) {
  body { padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
  nav { padding-top:env(safe-area-inset-top); height:calc(52px + env(safe-area-inset-top)); }
  nav a:not(.bell):not(.langbtn), nav .who, nav .signout { display:none; }
  .timerbar { top:calc(52px + env(safe-area-inset-top)); padding:8px 12px; }
  .tabbar { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:20; background:var(--card); border-top:1px solid var(--line);
            padding:6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex:1; display:flex; flex-direction:column; align-items:center; gap:1px; font-size:11px; color:var(--muted); text-decoration:none; position:relative; padding:2px 0; }
  .tabbar a i { font-style:normal; font-size:21px; line-height:1.2; filter:grayscale(1); opacity:.75; }
  .tabbar a.on { color:var(--accent); font-weight:600; }
  .tabbar a.on i { filter:none; opacity:1; }
  .tabbar a b { position:absolute; top:-2px; left:calc(50% + 6px); background:var(--bad); color:#fff; font-size:10px; border-radius:99px; padding:0 5px; }
  .board { grid-template-columns:1fr; }
  .board .col { background:none; padding:0; min-height:0; }
  .tiles { grid-template-columns:1fr 1fr; }
  .jhero { flex-direction:column; }
  .jhero-pic { width:100%; }
  .seg.big button { font-size:12.5px; padding:12px 2px; }
  #toast { bottom:calc(84px + env(safe-area-inset-bottom)); }
  dialog.sheet { width:100vw; max-width:100vw; margin:auto 0 0; border-radius:16px 16px 0 0; }
}
.fgrid > .wide { grid-column:1 / -1; }
.fgrid > .fgrid { gap:10px 14px; }
.fgrid label.chk { flex-direction:row; align-items:center; gap:8px; font-size:13.5px; color:var(--ink); }
.fgrid label.chk input { width:auto; }
.doclist a { flex-wrap:wrap; row-gap:2px; }
.cardhead > span { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:2px 6px; }

nav .langbtn { font-weight:600; font-size:12px; letter-spacing:.04em; border:1px solid var(--line); }

/* install-to-home-screen bar (phones, browser only) */
.installbar { display:flex; align-items:center; gap:12px; padding:10px 12px; padding-top:calc(10px + env(safe-area-inset-top));
              background:color-mix(in srgb, var(--accent) 14%, var(--card)); border-bottom:1px solid var(--line); font-size:13.5px; }
.installbar img { width:40px; height:40px; border-radius:9px; flex:none; }
.installbar > div { flex:1; min-width:0; }
.installbar .how { color:var(--muted); margin-top:2px; }
.installbar .how .btn { margin-top:4px; }
.installbar .shareic { display:inline-block; transform:rotate(-90deg); }
.installbar .x { font-size:22px; }

/* × on every dialog */
.dlgclose { position:sticky; top:0; float:right; z-index:3; width:38px; height:38px; margin:-6px -6px 0 8px; border-radius:50%;
            border:1px solid var(--line); background:var(--card); color:var(--ink); font-size:22px; line-height:1; cursor:pointer; }
.sheetbody > .dlgclose, .photoview .dlgclose { margin:0 0 6px 8px; }
