:root {
  --bg: #f4f6f8;
  --card: #fff;
  --ink: #16202b;
  --dim: #6b7a89;
  --line: #dde4ea;
  --accent: #1b6ac9;
  --ok: #1f8a4c;
  --warn: #b8730d;
  --bad: #c0392b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 72px;
}
#bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--accent); color: #fff;
}
#bar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; }
#back {
  background: none; border: 0; color: #fff; font-size: 28px;
  line-height: 1; padding: 0 6px; cursor: pointer;
}
.net { font-size: 26px; line-height: 1; opacity: .9; }
.net.off { color: #ffd0d0; }

main { padding: 12px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 10px;
}
.card.tap { cursor: pointer; }
.card h2 { margin: 0 0 4px; font-size: 17px; }
.muted { color: var(--dim); font-size: 14px; }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 12px; background: #eef2f6; color: var(--dim);
}
.tag.work { background: #e7f1fb; color: var(--accent); }
.tag.done { background: #e6f4ec; color: var(--ok); }

h3 { margin: 18px 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }

label { display: block; margin: 10px 0 4px; font-size: 14px; color: var(--dim); }
input, textarea, button, select {
  font: inherit; width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
button {
  background: var(--accent); color: #fff; border: 0; font-weight: 600; cursor: pointer;
}
button.ghost { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
button.wide { margin-top: 12px; }
.jobline { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.jobline:last-child { border-bottom: 0; }
.jobline input[type=checkbox] { width: 22px; height: 22px; margin-top: 3px; flex: 0 0 auto; }
.jobline .body { flex: 1; }
.jobline input[type=number] { width: 110px; padding: 7px 9px; }

#map { width: 100%; height: 260px; overflow: hidden; position: relative; border-radius: 12px; background: #dfe6ec; touch-action: none; }
#map .tiles { position: absolute; inset: 0; }
#map img { position: absolute; width: 256px; height: 256px; }
#map .pin {
  position: absolute; width: 26px; height: 26px; margin: -26px 0 0 -13px;
  background: var(--bad); border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 3px solid #fff;
}
#map .hint {
  position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,.9);
  padding: 4px 8px; border-radius: 8px; font-size: 12px; color: var(--dim);
}

#queue {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #232f3b; color: #fff;
}
#queue-text { flex: 1; font-size: 14px; }
#queue button { width: auto; padding: 8px 16px; background: var(--accent); }

.qr { text-align: center; }
.qr img { width: min(74vw, 320px); height: auto; background: #fff; padding: 10px; border-radius: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: #232f3b; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; z-index: 50; max-width: 90vw;
}
.empty { text-align: center; color: var(--dim); padding: 40px 20px; }


#tabs { display:flex; background:#fff; border-bottom:1px solid #e3e7ee; position:sticky; top:52px; z-index:5 }
#tabs a { flex:1; text-align:center; padding:12px 8px; color:#5b6472; text-decoration:none; font-size:15px;
          border-bottom:2px solid transparent }
#tabs a.on { color:#1b6ac9; border-bottom-color:#1b6ac9; font-weight:600 }
.goods-row { display:flex; justify-content:space-between; gap:10px; padding:7px 0; border-bottom:1px solid #f0f2f6 }
.goods-row:last-child { border-bottom:0 }
.goods-row .qty { white-space:nowrap; color:#5b6472; font-size:13px }
.mv { margin-top:10px; padding-top:8px; border-top:1px dashed #dfe4ec }
.tag.wait { background:#fdf0d5; color:#8a5a00 }
.tag.got { background:#e4f4e8; color:#1c6b32 }


.dates { display:flex; gap:10px; margin-top:6px }
.dates label { flex:1; font-size:12px; color:#5b6472; display:block }
.dates input { margin-top:2px }

#who { background:rgba(255,255,255,.16); border:0; color:#fff; font-size:13px;
       padding:6px 10px; border-radius:14px; cursor:pointer; max-width:46vw;
       overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
#who.ask { background:#c0392b }
