:root {
  color-scheme: dark;
  --bg: #080d12;
  --surface: #111922;
  --surface-2: #17232e;
  --surface-3: #0c141b;
  --line: #263541;
  --line-soft: rgba(147, 162, 175, .13);
  --text: #f4f7f9;
  --muted: #93a2af;
  --cyan: #43d6c5;
  --blue: #5794ff;
  --red: #ff6673;
  --amber: #ffbd59;
  --green: #67d49c;
  --shadow: 0 18px 50px rgba(0, 0, 0, .22);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(circle at 78% -12%, #173b47 0, transparent 34%), var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { color: inherit; }
button, label.file-button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 0 calc(64px + env(safe-area-inset-bottom));
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 3.6vw, 46px); line-height: 1; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: clamp(22px, 2.5vw, 30px); letter-spacing: -.03em; }
.eyebrow { margin: 0 0 7px; color: var(--cyan); font-size: 11px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.muted { margin-bottom: 0; color: var(--muted); line-height: 1.5; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(67, 214, 197, .28);
  border-radius: 18px;
  background: linear-gradient(145deg, #17333b, #101b23);
  color: var(--cyan);
  box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 12px 30px rgba(0, 0, 0, .25);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.08em;
}
.brand-mark.small { width: 48px; height: 48px; border-radius: 15px; font-size: 17px; }

.login-card {
  width: min(460px, 100%);
  margin: max(38px, 8vh) auto 0;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(22, 33, 44, .98), rgba(12, 20, 27, .99));
  box-shadow: var(--shadow);
}
.login-card .eyebrow { margin-top: 26px; }
.login-card h1 { margin-bottom: 14px; }
.stack { display: grid; gap: 17px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #c0ccd4; font-size: 13px; font-weight: 700; }
input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--surface-3);
  padding: 12px 14px;
  color: var(--text);
}
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(67, 214, 197, .11); }

.primary, .secondary, .ghost, .back, .compact-action, .text-action {
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 800;
  transition: border-color .16s, background .16s, color .16s, transform .16s, opacity .16s;
}
.primary {
  min-height: 48px;
  background: var(--cyan);
  padding: 12px 17px;
  color: #06110f;
  box-shadow: 0 10px 24px rgba(67, 214, 197, .14);
}
.primary:hover { background: #69e4d5; transform: translateY(-1px); }
.primary:disabled, .secondary:disabled, .ghost:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.secondary { min-height: 48px; border: 1px solid #38505e; background: #14222c; padding: 12px 17px; color: #d6e1e7; }
.secondary:hover { border-color: var(--cyan); background: rgba(67, 214, 197, .09); }
.ghost, .back { min-height: 40px; border: 1px solid var(--line-soft); background: rgba(12, 20, 27, .48); padding: 9px 13px; color: #bcc9d1; }
.ghost:hover, .back:hover { border-color: #3d5667; background: var(--surface-2); color: var(--text); }
.compact-action { min-height: 34px; border: 1px solid rgba(67, 214, 197, .34); background: rgba(67, 214, 197, .09); padding: 7px 10px; color: var(--cyan); font-size: 11px; }
.compact-action:hover { background: rgba(67, 214, 197, .17); }
.text-action { background: transparent; padding: 5px 0; color: var(--cyan); font-size: 12px; }
.text-action:hover { color: #7be8dc; }
button:focus-visible, label.file-button:focus-within { outline: 2px solid rgba(67, 214, 197, .7); outline-offset: 3px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.brand-lockup, .topbar-actions, .connection { display: flex; align-items: center; }
.brand-lockup { gap: 14px; }
.topbar-actions { gap: 10px; }
.connection { gap: 9px; border: 1px solid var(--line-soft); border-radius: 13px; background: rgba(12, 20, 27, .45); padding: 8px 11px; }
.connection > span { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.connection strong, .connection small { display: block; text-align: right; }
.connection strong { font-size: 11px; }
.connection small { margin-top: 2px; color: var(--muted); font-size: 9px; }

.status-strip {
  display: grid;
  grid-template-columns: .75fr 1fr 1.3fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .15);
}
.status-strip > div { display: grid; align-content: center; gap: 3px; min-height: 86px; background: rgba(15, 24, 32, .97); padding: 14px 17px; }
.status-strip span, .status-strip small { color: var(--muted); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.status-strip strong { font-size: 15px; }
.ready-label { color: var(--green); }
.status-action { justify-items: start; }

.app-notice { margin-bottom: 14px; border: 1px solid rgba(255, 189, 89, .4); border-radius: 12px; background: rgba(255, 189, 89, .09); padding: 12px 14px; color: #ffd28c; font-size: 12px; line-height: 1.45; }
.app-notice.error { border-color: rgba(255, 102, 115, .4); background: rgba(255, 102, 115, .09); color: #ffabb3; }
.app-notice.success { border-color: rgba(103, 212, 156, .4); background: rgba(103, 212, 156, .09); color: #9be8bd; }

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(22, 33, 44, .98), rgba(12, 20, 27, .99));
  box-shadow: var(--shadow);
}
.queue-panel { padding: 24px; }
.panel-head, .step-heading, .handover-nav, .step-footer, .upload-state-line { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-head { align-items: flex-start; }
.panel-head .muted { margin-top: 8px; font-size: 12px; }
.queue-count, .upload-total { display: grid; min-width: 84px; justify-items: end; }
.queue-count strong, .upload-total strong { color: var(--cyan); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.queue-count span, .upload-total span { margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; }

.search { position: relative; display: block; margin: 20px 0 14px; }
.search input { min-height: 52px; padding-left: 45px; background: rgba(8, 13, 18, .66); font-size: 15px; }
.search-icon { position: absolute; z-index: 1; left: 16px; top: 50%; color: var(--muted); font-size: 23px; font-weight: 400; transform: translateY(-54%); pointer-events: none; }

.vehicle-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vehicle-card {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(8, 13, 18, .47);
  padding: 17px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .16s, border-color .16s, background .16s;
}
.vehicle-card::after { content: ""; position: absolute; right: -48px; top: -58px; width: 120px; height: 120px; border-radius: 50%; background: rgba(87, 148, 255, .08); pointer-events: none; }
.vehicle-card:hover { border-color: #3e5a6d; background: rgba(23, 35, 46, .86); transform: translateY(-1px); }
.vehicle-card:focus-visible { border-color: var(--cyan); outline: 2px solid rgba(67, 214, 197, .25); outline-offset: 2px; }
.vehicle-card.in-progress { border-color: rgba(255, 189, 89, .36); }
.vehicle-card.completed { border-color: rgba(103, 212, 156, .3); }
.vehicle-main { min-width: 0; }
.plate { font-size: 24px; font-weight: 900; letter-spacing: .035em; }
.vehicle-meta { margin-top: 8px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.vehicle-client { color: #becad2; }
.vehicle-side { position: relative; z-index: 1; display: grid; align-content: space-between; justify-items: end; min-width: 104px; }
.badge { display: inline-flex; border: 1px solid rgba(103, 212, 156, .25); border-radius: 999px; background: rgba(103, 212, 156, .09); padding: 5px 8px; color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.in-progress .badge { border-color: rgba(255, 189, 89, .28); background: rgba(255, 189, 89, .09); color: var(--amber); }
.completed .badge { color: var(--green); }
.vehicle-action { color: var(--cyan); font-size: 11px; font-weight: 800; }
.empty { display: grid; justify-items: center; gap: 7px; padding: 58px 20px; color: var(--muted); text-align: center; }
.empty-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 5px; border-radius: 50%; background: rgba(67, 214, 197, .1); color: var(--cyan); font-size: 22px; }
.empty strong { color: var(--text); }
.empty p { margin: 0; font-size: 12px; }

.handover { max-width: 1040px; margin: 0 auto; }
.handover-nav { min-height: 66px; border-bottom: 1px solid var(--line); padding: 12px 20px; background: rgba(8, 13, 18, .28); }
.selected-vehicle { display: grid; justify-items: end; }
.selected-vehicle span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.selected-vehicle strong { margin-top: 3px; font-size: 16px; letter-spacing: .03em; }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-bottom: 1px solid var(--line); padding: 18px 24px; }
.stepper span { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; color: #657583; font-size: 11px; font-weight: 800; }
.stepper span:not(:last-child)::after { content: ""; position: absolute; left: calc(50% + 45px); right: calc(-50% + 45px); height: 1px; background: var(--line); }
.stepper b { position: relative; z-index: 1; display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 10px; }
.stepper em { font-style: normal; }
.stepper span.active { color: var(--text); }
.stepper span.active b { border-color: var(--cyan); background: var(--cyan); color: #06110f; box-shadow: 0 0 18px rgba(67, 214, 197, .2); }
.step-content { padding: 28px; }
.step-heading { align-items: flex-start; }
.step-heading .muted { max-width: 680px; margin-top: 9px; font-size: 12px; }
.plate-large { flex: 0 0 auto; border: 1px solid rgba(67, 214, 197, .34); border-radius: 11px; background: rgba(67, 214, 197, .08); padding: 10px 14px; color: var(--text); font-size: 20px; font-weight: 900; letter-spacing: .04em; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 22px 0; }
.facts > div, .upload-summary > div { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8, 13, 18, .42); padding: 14px; }
.facts span, .upload-summary span { color: var(--muted); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.facts strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.warning { display: grid; gap: 5px; margin: 18px 0; border: 1px solid rgba(255, 189, 89, .38); border-radius: 12px; background: rgba(255, 189, 89, .08); padding: 14px; color: #f7cf90; }
.warning strong { font-size: 12px; }
.warning span { color: #c7b28f; font-size: 11px; line-height: 1.45; }
.check { grid-template-columns: auto 1fr; align-items: start; margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(8, 13, 18, .42); padding: 15px; cursor: pointer; }
.check:hover { border-color: #3e5a6d; }
.check input { width: 20px; min-height: 20px; margin: 0; accent-color: var(--cyan); }
.check strong, .check small { display: block; }
.check strong { color: var(--text); font-size: 13px; }
.check small { margin-top: 4px; color: var(--muted); font-weight: 500; }
.step-footer { margin: 25px -28px -28px; border-top: 1px solid var(--line); background: rgba(8, 13, 18, .24); padding: 16px 28px; }
.step-footer > span { color: var(--muted); font-size: 11px; }

.shot-plan { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 18px; }
.shot-chip { min-height: 38px; border: 1px solid var(--line); border-radius: 999px; background: rgba(8, 13, 18, .42); padding: 8px 12px; color: #b8c5cd; cursor: pointer; font-size: 11px; font-weight: 750; }
.shot-chip:hover { border-color: #3e5a6d; }
.shot-chip[aria-pressed="true"] { border-color: rgba(103, 212, 156, .4); background: rgba(103, 212, 156, .1); color: var(--green); }
.shot-chip[aria-pressed="true"]::before { content: "✓ "; }
.capture-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.file-button { position: relative; display: grid; align-content: center; gap: 3px; min-height: 82px; cursor: pointer; text-align: left; }
.file-button span, .file-button small { display: block; }
.file-button span { font-size: 14px; }
.file-button small { color: inherit; opacity: .7; font-size: 10px; font-weight: 600; }
.file-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.camera-button::after { content: "＋"; position: absolute; right: 18px; color: rgba(6, 17, 15, .65); font-size: 30px; font-weight: 400; }
.upload-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 12px; }
.upload-summary strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #25333e; }
.progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .24s ease; }
.upload-state-line { min-height: 35px; margin-top: 8px; }
.upload-state-line p { margin: 0; font-size: 11px; }
.form-error { min-height: 18px; margin: 8px 0 0; color: #ffabb3; font-size: 11px; line-height: 1.45; }

.complete { max-width: 600px; margin: 0 auto; padding: 44px 28px 50px; text-align: center; }
.success-mark { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 23px; border: 1px solid rgba(103, 212, 156, .4); border-radius: 50%; background: rgba(103, 212, 156, .11); color: var(--green); font-size: 36px; font-weight: 900; box-shadow: 0 0 30px rgba(103, 212, 156, .1); }
.complete .eyebrow { margin-bottom: 9px; }
.complete p:not(.eyebrow) { margin: 12px auto 25px; color: var(--muted); line-height: 1.55; }

@media (max-width: 760px) {
  .shell { width: min(100% - 18px, 1240px); padding-top: calc(14px + env(safe-area-inset-top)); }
  .topbar { align-items: flex-start; }
  .brand-mark.small { display: none; }
  .topbar h1 { font-size: 28px; }
  .connection { display: none; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-strip > div { min-height: 73px; padding: 12px; }
  .queue-panel { padding: 18px; }
  .panel-head { gap: 10px; }
  .vehicle-list, .facts { grid-template-columns: 1fr; }
  .vehicle-card { min-height: 132px; padding: 15px; }
  .plate { font-size: 21px; }
  .handover-nav { padding: 10px 14px; }
  .selected-vehicle span { display: none; }
  .stepper { padding: 14px 9px; }
  .stepper span { gap: 5px; font-size: 10px; }
  .stepper span:not(:last-child)::after { left: calc(50% + 36px); right: calc(-50% + 36px); }
  .step-content { padding: 20px 17px; }
  .step-heading { display: grid; gap: 15px; }
  .plate-large { justify-self: start; }
  .step-footer { display: grid; margin: 22px -17px -20px; padding: 15px 17px; }
  .step-footer .primary { width: 100%; }
  .capture-actions { grid-template-columns: 1fr; }
  .file-button { min-height: 72px; }
  .upload-summary > div { padding: 11px; }
  .upload-summary strong { font-size: 21px; }
}

@media (max-width: 420px) {
  .login-card { margin-top: 16px; padding: 25px 20px; border-radius: 19px; }
  .topbar-actions { align-self: center; }
  .ghost { min-height: 36px; padding: 7px 10px; }
  .status-strip strong { font-size: 13px; }
  .vehicle-card { grid-template-columns: minmax(0, 1fr) 86px; }
  .vehicle-side { min-width: 0; }
  .queue-count strong, .upload-total strong { font-size: 29px; }
  .stepper em { display: none; }
  .stepper span:not(:last-child)::after { left: calc(50% + 24px); right: calc(-50% + 24px); }
  .shot-plan { gap: 6px; }
  .shot-chip { min-height: 36px; padding: 7px 10px; }
}
