:root {
  --bg: #0b0d11;
  --card: #171b22;
  --card2: #242a35;
  --line: #8b95a7;
  --tx: #f7f8fa;
  --mut: #d0d7e2;
  --acc: #f6c453;
  --btn: #1d4ed8;
  --ready: #16a34a;
  --hot: #fecaca;
  --warn: #fdba74;
  --r: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
button, a, .chip, input, textarea { touch-action: manipulation; }
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  border-bottom: 1px solid var(--line);
}
.hbar { display: flex; align-items: center; gap: 8px; }
header h1 { font-size: 22px; margin: 0; flex: 1; letter-spacing: .2px; }
header h1 b { color: var(--acc); }
.hbtn {
  background: none; border: 0; color: var(--acc); font-size: 18px; font-weight: 700;
  padding: 10px 8px; min-height: 48px; font-family: inherit; cursor: pointer;
}
main { padding: 12px 14px calc(env(safe-area-inset-bottom) + 96px); max-width: 640px; margin: 0 auto; }
nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; background: #12151b; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav a {
  flex: 1; text-align: center; color: var(--mut); text-decoration: none;
  font-size: 12px; font-weight: 750; padding: 6px 0 8px; min-height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
nav a .i { font-size: 20px; line-height: 24px; }
nav a.on { color: var(--tx); }
nav a.on .i { color: var(--acc); }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--tx);
  border-radius: 12px; padding: 10px 8px; font-size: 15px; font-weight: 750;
  min-height: 48px; font-family: inherit; cursor: pointer;
}
.chip.wide { grid-column: 1 / -1; }
.chip.on { background: var(--btn); border-color: var(--btn); color: #fff; }
.chip:active { background: #2a3344; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.job .top {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer;
}
.job .ttl { display: block; font-weight: 800; font-size: 20px; }
.job .sub { display: block; color: var(--mut); font-size: 16px; margin-top: 2px; }
.job .px { font-weight: 800; font-size: 18px; white-space: nowrap; }
.wait {
  flex: none; text-align: center; min-width: 72px; border-radius: 14px;
  background: var(--card2); padding: 8px 6px 6px;
}
.wait b { display: block; font-size: 26px; line-height: 1; }
.wait small { font-size: 12px; color: var(--mut); font-weight: 750; letter-spacing: .2px; }
.wait.warn { background: #3b2a12; color: var(--warn); }
.wait.warn small { color: var(--warn); }
.wait.hot { background: #3f1d1d; color: var(--hot); }
.wait.hot small { color: var(--hot); }
.meta { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.meta .phone {
  flex: 1; display: flex; align-items: center; min-height: 48px; padding: 8px 12px;
  background: var(--card2); border-radius: 12px; color: var(--tx); text-decoration: none; font-weight: 750; font-size: 17px;
}
.call {
  flex: none; display: flex; align-items: center; justify-content: center; min-width: 72px; min-height: 48px;
  padding: 8px 12px; border-radius: 12px; background: var(--card2); color: var(--acc);
  text-decoration: none; font-weight: 800; border: 1px solid var(--line);
}
.past { display: inline-flex; align-items: center; min-height: 44px; color: var(--acc); font-weight: 750; text-decoration: none; }
.note {
  display: block; width: 100%; margin-top: 8px; font: inherit; font-size: 16px; text-align: left;
  color: var(--tx); background: var(--card2); border: 0; border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.prom { margin: 6px 0 0; color: var(--tx); font-weight: 650; }
.prom.late { color: var(--hot); }
.st { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.st button {
  min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
  color: var(--tx); font-size: 15px; font-weight: 800; padding: 8px 6px; font-family: inherit; cursor: pointer;
}
.st button:active { background: #2a3344; }
.st button.on[data-s="waiting"] { background: var(--acc); border-color: var(--acc); color: #1a1203; }
.st button.on[data-s="bay"] { background: #2563eb; border-color: #2563eb; color: #fff; }
.st button.on[data-s="parts"] { background: #c2410c; border-color: #c2410c; color: #fff; }
.st button.on[data-s="picked"] { background: #334155; border-color: #334155; color: #fff; }
.pill {
  display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .2px;
  border-radius: 6px; padding: 3px 8px; vertical-align: 1px;
}
.p-waiting { background: rgba(246, 196, 83, .2); color: var(--acc); }
.p-bay { background: rgba(37, 99, 235, .28); color: #bfdbfe; }
.p-parts { background: rgba(194, 65, 12, .28); color: #fdba74; }
.p-ready { background: rgba(22, 163, 74, .28); color: #86efac; }
.p-picked { background: rgba(148, 163, 184, .28); color: #e2e8f0; }
.p-owner { background: rgba(246, 196, 83, .2); color: var(--acc); }
.p-member { background: rgba(100, 116, 139, .35); color: #e2e8f0; }
.p-invited, .pill.invited { background: rgba(245, 158, 11, .2); color: #fdba74; }
.flag {
  display: inline-block; background: #7f1d1d; color: #fee2e2; font-weight: 800;
  border-radius: 8px; padding: 4px 8px; font-size: 13px; letter-spacing: .3px;
}
h2 { font-size: 16px; color: var(--mut); margin: 16px 2px 8px; font-weight: 750; }
.empty { text-align: center; color: var(--mut); padding: 36px 12px; }
.empty .big { font-size: 40px; }
label { display: block; font-size: 15px; font-weight: 700; color: var(--mut); margin: 12px 2px 6px; }
.opt { font-weight: 500; }
input, textarea, select {
  width: 100%; background: var(--card2); color: var(--tx); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font-size: 18px; min-height: 52px; font-family: inherit;
}
::placeholder { color: #b7c0cc; opacity: 1; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--acc); border-color: transparent; }
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picks button {
  min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
  color: var(--tx); font-size: 16px; font-weight: 800; font-family: inherit; cursor: pointer;
}
.picks button.on { background: var(--acc); border-color: var(--acc); color: #1a1203; }
.picks button.wide { grid-column: 1 / -1; }
.hint { font-size: 15px; margin: 8px 2px 0; color: var(--mut); min-height: 20px; }
.hint.ok { color: #86efac; }
.hint.err { color: var(--hot); }
.hint.warn { color: var(--warn); }
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px;
  border-radius: 12px; border: 0; background: var(--btn); color: #fff; font-size: 18px; font-weight: 800;
  margin-top: 12px; cursor: pointer; text-align: center; text-decoration: none; font-family: inherit; padding: 12px 16px;
}
.btn.ready { background: var(--ready); font-size: 20px; min-height: 56px; }
.btn.sec { background: var(--card2); color: var(--tx); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--hot); border: 1px solid #f87171; }
.btn:disabled { background: #334155; color: #e2e8f0; }
.sms {
  background: var(--card2); border: 1px dashed var(--line); border-radius: 12px;
  padding: 12px; font-size: 16px; line-height: 1.4; margin-top: 8px;
}
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; text-align: center; }
.summary b { display: block; font-size: 32px; letter-spacing: -.3px; }
.summary small { color: var(--mut); font-size: 14px; font-weight: 750; }
.dayjob { display: block; text-decoration: none; color: inherit; }
.dayjob b { display: block; font-size: 18px; }
.dayjob span { color: var(--mut); font-size: 16px; }
.tire .size { font-size: 20px; font-weight: 800; }
.tire .brand { color: var(--mut); font-size: 16px; margin-top: 2px; }
.qtyrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.qty { flex: 1; text-align: center; font-size: 28px; font-weight: 800; }
.step {
  width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card2); color: var(--tx); font-size: 28px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.flagbtn {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
  color: var(--tx); font-weight: 800; font-family: inherit; padding: 8px 12px; cursor: pointer;
}
.flagbtn.on { background: #7f1d1d; border-color: #7f1d1d; color: #fee2e2; }
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 78px); transform: translateX(-50%);
  background: #f4f6f8; color: #0b0d11; padding: 14px 18px; border-radius: 14px; font-weight: 800;
  font-size: 16px; line-height: 1.35; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 9;
  max-width: 92vw; text-align: center;
}
.toast.on { opacity: 1; }
body.out nav { display: none; }
body.out main { padding-bottom: calc(env(safe-area-inset-bottom) + 28px); }
.sync {
  display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--mut);
  background: none; border: 0; padding: 8px 4px; min-height: 48px; white-space: nowrap; font-family: inherit; cursor: pointer;
}
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #64748b; display: inline-block; }
.sync.ok i { background: #4ade80; }
.sync.busy i { background: var(--acc); animation: pulse 1s infinite; }
.sync.off i { background: var(--warn); }
.sync.err i { background: var(--hot); }
@keyframes pulse { 50% { opacity: .3; } }
.devbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20; background: #facc15; color: #111;
  font-weight: 800; font-size: 16px; text-align: center; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  border-bottom: 3px dashed #111; cursor: pointer;
}
.devbar b { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: 3px; margin-left: 6px; }
.devbar small { display: block; font-weight: 650; font-size: 14px; }
.demobar {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; background: #2a220f;
  border: 1px solid var(--acc); color: var(--tx); border-radius: 10px; padding: 8px 8px 8px 12px;
  font-size: 15px; font-weight: 700;
}
.demobar[hidden] { display: none !important; }
.demobar button {
  margin-left: auto; flex: none; background: var(--btn); color: #fff; border: 0; border-radius: 999px;
  padding: 8px 12px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.demo-want {
  display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  min-height: 48px; margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--btn);
  color: #fff; font-weight: 800; font-size: 16px;
}
.auth h3 { margin: 2px 0 4px; font-size: 26px; }
.auth p { margin: 0; color: var(--mut); font-size: 17px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 28px; letter-spacing: 8px; text-align: center; }
.lnk { background: none; border: 0; color: var(--acc); font-size: 16px; padding: 12px 4px; min-height: 48px; font-family: inherit; cursor: pointer; }
.mem { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.mem:first-of-type { border-top: 0; }
.mem .e { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mem button {
  background: var(--card2); border: 1px solid var(--line); color: var(--tx); border-radius: 10px;
  padding: 8px 12px; font-size: 15px; font-weight: 800; min-height: 48px; font-family: inherit; cursor: pointer;
}
.shopbtn {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; background: var(--card);
  color: var(--tx); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 52px;
  font: inherit; font-size: 17px; font-weight: 800; text-align: left; cursor: pointer;
}
.shopbtn[hidden] { display: none !important; }
.shopbtn .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopbtn .chev { color: var(--mut); font-size: 18px; }
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet[hidden] { display: none !important; }
.sheetbg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.sheetcard {
  position: relative; background: #171b22; border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px); max-height: 88vh; overflow: auto;
  border-top: 1px solid var(--line);
}
.sheethandle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 6px auto 8px; }
.shoppick {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card2);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 64px; margin: 0 0 8px;
  color: var(--tx); font: inherit; font-size: 17px; cursor: pointer;
}
.shoppick.on { border-color: var(--acc); background: #2a220f; }
.shoppick b { display: block; font-size: 18px; }
.shoppick small { color: var(--mut); font-size: 15px; }
.dotmark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.shoppick.on .dotmark { border-color: var(--acc); background: var(--acc); box-shadow: inset 0 0 0 5px #2a220f; }
.vin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1px; text-transform: uppercase; }
button:focus-visible, a:focus-visible, .chip:focus-visible, .shoppick:focus-visible, nav a:focus-visible {
  outline: 3px solid var(--acc); outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
