
/* Layout: one column of vehicle cards under a sticky stage pipeline; stock numbers drawn like windshield grease-pencil tags. */
:root {
  --bg: #f2f3f1;
  --surface: #ffffff;
  --line: #d9dcd6;
  --fg: #1d2421;
  --muted: #5f6a64;
  --accent: #1f5f8b;
  --accent-fg: #ffffff;
  --tag: #f4c430;
  --tag-fg: #1d2421;
  --done: #2f7d5b;
  --warn: #b7791f;
  --crit: #b83a2e;
  --track: #e3e6e1;
  --hazard: #f7c600;
  --hazard-ink: #121212;
  --alarm: #d7261e;
  --alarm-ink: #ffffff;
  --scrim: rgba(10, 12, 11, .72);
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141917; --surface: #1c2320; --line: #2f3833; --fg: #e8ece9; --muted: #9aa69f;
    --accent: #6fb0dd; --accent-fg: #0f1a22; --tag: #e8b923; --tag-fg: #141917;
    --done: #5cbf8f; --warn: #e0a64a; --crit: #ef7b6e; --track: #29312d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141917; --surface: #1c2320; --line: #2f3833; --fg: #e8ece9; --muted: #9aa69f;
  --accent: #6fb0dd; --accent-fg: #0f1a22; --tag: #e8b923; --tag-fg: #141917;
  --done: #5cbf8f; --warn: #e0a64a; --crit: #ef7b6e; --track: #29312d; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 48px;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: 1800px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
h1 { font-family: var(--display); font-weight: 700; font-size: 2.2rem; letter-spacing: .01em; line-height: 1; margin: 0; text-transform: uppercase; }
.sub { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.stats { display: flex; gap: 18px; font-variant-numeric: tabular-nums; }
.stat b { display: block; font-family: var(--display); font-size: 1.6rem; line-height: 1; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.pipe { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-block: 6px; margin-inline: -4px; }
.pipe-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 2px 4px 6px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 999px; padding: 6px 12px; font: 500 .85rem var(--body); cursor: pointer; display: flex; gap: 6px; align-items: center; }
.chip .n { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip[aria-pressed="true"] .n { color: var(--bg); opacity: .75; }
.chip:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toolbar .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.btn { border: 0; border-radius: 8px; padding: 9px 14px; font: 600 .9rem var(--body); cursor: pointer; background: var(--accent); color: var(--accent-fg); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--crit); border: 1px solid var(--crit); }
.btn:disabled { opacity: .5; cursor: default; }

.add { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.add .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
input, select, textarea { font: 400 .95rem var(--body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; min-height: 64px; }
.add .actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.err { color: var(--crit); font-size: .85rem; }

.list { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(14px, 1.4vw, 22px); display: flex; flex-direction: column; gap: 10px; }
.card.listed { opacity: .82; }
.row1 { display: flex; align-items: center; gap: 12px; }
.tag { font-family: var(--mono); font-weight: 600; font-size: clamp(1rem, 1.3vw, 1.35rem); background: var(--tag); color: var(--tag-fg); padding: 3px 9px; border-radius: 4px; transform: rotate(-1.5deg); letter-spacing: .02em; flex: none; }
.veh { min-width: 0; flex: 1; }
.veh .name { font-weight: 600; font-size: clamp(1.02rem, 1.3vw, 1.35rem); overflow-wrap: anywhere; }
.veh .meta { font-size: .8rem; color: var(--muted); }
.age { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.age b { font-family: var(--display); font-size: clamp(1.5rem, 2vw, 2.2rem); line-height: 1; display: block; }
.age span { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.age.warn b { color: var(--warn); } .age.crit b { color: var(--crit); }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(3px, .4vw, 6px); }
.steps .seg { font-family: var(--body); border: 0; cursor: pointer; font-style: normal; min-width: 0; height: clamp(30px, 3.4vw, 52px); border-radius: 6px; background: var(--track); color: var(--muted); font-size: clamp(.74rem, 1.15vw, 1.15rem); font-weight: 600; letter-spacing: .02em; display: flex; align-items: center; justify-content: center; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps .seg.d { background: var(--done); color: var(--surface); }
.steps .seg.c { background: var(--accent); color: var(--accent-fg); }
.steps .seg.na { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-weight: 500; }
.steps .seg.r { background: transparent; border: 1.5px solid var(--done); color: var(--done); }
.steps .seg::after { content: "▾"; margin-left: 3px; font-size: .62rem; opacity: .7; }
.steps .seg[aria-expanded="true"] { outline: 2px solid var(--fg); outline-offset: 1px; }
.steps .seg.split { padding: 0; gap: 2px; background: transparent; display: flex; overflow: visible; }
.steps .seg.split::after { content: none; }
.steps .sub { flex: 1; min-width: 0; height: 100%; border-radius: 5px; background: var(--track); color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps .sub.d { background: var(--done); color: var(--surface); }
.steps .sub.c { background: var(--accent); color: var(--accent-fg); }
.steps .seg:disabled { cursor: default; } .steps .seg:disabled::after { content: none; }
.menu { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.menu .mt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.menu .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 8px; padding: 8px 12px; font: 500 .88rem var(--body); cursor: pointer; }
.rrow { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: center; }
.rrow > b { font-size: .9rem; font-weight: 600; }
.opt.small { padding: 6px 10px; font-size: .82rem; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--fg); }
.checks input { width: auto; }
.opt[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.now { font-size: clamp(.9rem, 1.1vw, 1.1rem); }
.now b { font-weight: 600; }
.now .next { color: var(--muted); }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--done); color: var(--surface); }
.btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.more { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 12px; }
.hist { margin: 0; padding: 0; list-style: none; font-size: .82rem; color: var(--muted); display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.hist b { color: var(--fg); font-weight: 500; }
.more .actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.note { font-size: .85rem; color: var(--warn); }
/* "Nope" sign: one fixed look in both themes, painted entirely from its own tokens. */
.nope { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sign { width: min(520px, 100%); border-radius: 18px; padding: 14px; text-align: center;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 22px, var(--hazard-ink) 22px 44px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: shake .5s ease-in-out 2; }
.sign-in { border-radius: 10px; padding: 26px 20px 22px; background: var(--alarm); color: var(--alarm-ink); display: grid; gap: 12px; justify-items: center; animation: flash .45s steps(1) infinite; }
.sign .bang { width: 72px; height: 64px; }
.sign h2 { font-family: var(--display); font-weight: 700; font-size: clamp(2.4rem, 11vw, 3.6rem); line-height: .95; margin: 0; text-transform: uppercase; letter-spacing: .02em; text-wrap: balance; }
.sign p { margin: 0; font-size: 1.05rem; font-weight: 600; max-width: 34ch; text-wrap: balance; }
.sign .quip { font-weight: 400; font-size: .92rem; opacity: .95; }
.sign .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.sign button { border: 0; border-radius: 8px; padding: 11px 16px; font: 700 .95rem var(--body); cursor: pointer; }
.sign .go { background: var(--hazard); color: var(--hazard-ink); }
.sign .ok { background: transparent; color: var(--alarm-ink); border: 2px solid var(--alarm-ink); }
@keyframes flash { 0%, 100% { background: var(--alarm); color: var(--alarm-ink); } 50% { background: var(--hazard); color: var(--hazard-ink); } }
@keyframes shake { 0%, 100% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-10px) rotate(-2deg); } 40% { transform: translateX(10px) rotate(2deg); } 60% { transform: translateX(-6px) rotate(-1deg); } 80% { transform: translateX(6px) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .sign, .sign-in { animation: none; } }

/* ── App shell (standalone site) ─────────────────────────────── */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent); }

.brand { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.dealer { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.topbtns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sign-in and setup screens */
.gate { min-height: calc(100vh - 80px); display: grid; place-items: center; }
.panel { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 14px; }
.panel h1 { font-size: 2.6rem; }
.panel h2 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; margin: 0; text-transform: uppercase; }
.panel .lede { color: var(--muted); margin: 0; }
.panel form { display: grid; gap: 12px; }
.panel .btn { width: 100%; padding: 12px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.linkbtn { background: none; border: 0; color: var(--accent); font: 500 .9rem var(--body); cursor: pointer; padding: 0; justify-self: start; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tabs button { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 8px; padding: 9px; font: 600 .9rem var(--body); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.ok-msg { color: var(--done); font-size: .9rem; }

/* Team panel */
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: grid; place-items: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet .panel { width: min(560px, 100%); max-height: 100%; overflow-y: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.people .who { min-width: 0; }
.people .who b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.people .who span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.role { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); flex: none; }
.role.owner { color: var(--accent); border-color: var(--accent); }
.invite-out { display: grid; gap: 8px; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; }
.code { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; letter-spacing: .12em; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline .field { flex: 1; min-width: 140px; }
.inline .btn { width: auto; }
.small-note { font-size: .82rem; color: var(--muted); margin: 0; }
