/* ═══════════════════════════════════════════════════════════════════
   RepairIQ — Public View
   Modern AI-product aesthetic: dark canvas, glass cards, gradient
   accents, generous motion. Inspired by current-gen AI app design
   language (Linear, Vercel, Perplexity-style surfaces).
═══════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The [hidden] attribute must always win over any class's `display` value.
   Without this, any element that is both `hidden` and has a class setting
   display:flex/grid/block (e.g. .error-banner, .dz-grid, .total-loss-flag)
   stays visible — the class and the attribute have equal specificity, and
   source order decides the tie. This rule removes that ambiguity globally. */
[hidden] { display: none !important; }

:root {
  /* Aligned to workshop/app.css's palette — same brand across both surfaces.
     Amber/orange primary, steel-blue secondary; see that file's --info/-2
     for the extra secondary tone Workshop uses that Public doesn't need yet. */
  --bg:        #0b0c0f;
  --bg-2:      #111318;
  --surface:   rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.06);
  --border:    rgba(255,255,255,0.085);
  --border-hi: rgba(255,255,255,0.18);
  --text:      #f2f3f5;
  --text-dim:  #9fa5b1;
  --text-faint:#5c6270;

  --accent:      #f2994a;
  --accent-2:    #f7b955;
  --accent-glow: rgba(242,153,74,0.32);
  --success:     #34d399;
  --warning:     #fbbf24;
  --danger:      #f87171;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;

  --font-ui:    'Inter', system-ui, -apple-system, sans-serif;
  --font-head:  'Space Grotesk', 'Inter', system-ui, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Ambient background ──────────────────────────────────────────── */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 {
  width: 600px; height: 600px;
  top: -200px; left: -150px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.18;
}
.bg-glow-2 {
  width: 700px; height: 700px;
  bottom: -300px; right: -200px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  opacity: 0.14;
}
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Shell / layout ───────────────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 24px;
}

/* ── Nav ──────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.brand-name {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.brand-name strong { font-weight: 700; color: var(--accent-2); }
.nav-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ── Main / stages ────────────────────────────────────────────────── */
.main { flex: 1; padding-bottom: 60px; }

.stage { display: none; animation: fadeUp 0.5s var(--ease); }
.stage.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 28px 0 36px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(242,153,74,0.1);
  border: 1px solid rgba(242,153,74,0.25);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 22px;
}
.dot-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52,211,153,0.6);
  animation: dotPulse 2s infinite;
}
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

.hero-title {
  font-family: var(--font-head);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 18px;
}
.grad-text {
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 15.5px;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Upload card ──────────────────────────────────────────────────── */
.upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.5);
}

.dropzone {
  position: relative;
  border: 1.5px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  background: rgba(255,255,255,0.015);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(242,153,74,0.06);
}
.dropzone.has-images { padding: 18px; text-align: left; cursor: default; }

.dz-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dz-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(242,153,74,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-2);
}
.dz-text { display: flex; flex-direction: column; gap: 4px; }
.dz-text strong { font-size: 15px; font-weight: 600; }
.dz-text span { font-size: 12.5px; color: var(--text-faint); }

.dz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.dz-tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  background: #000;
}
.dz-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-tile-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.dz-tile-remove:hover { background: var(--danger); }
.dz-tile-angle {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 9.5px;
  text-align: center;
  padding: 3px 2px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  width: 100%;
  text-transform: capitalize;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.dz-tile-add {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border-hi);
  border-radius: 10px;
  aspect-ratio: 1;
  cursor: pointer;
  color: var(--text-faint);
  font-size: 22px;
  transition: all 0.2s;
  background: rgba(255,255,255,0.015);
}
.dz-tile-add:hover { border-color: var(--accent); color: var(--accent-2); }

.dz-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: 9px;
  border: 1px solid var(--border);
}

/* Low-resolution rejection — lives inside the dropzone itself, not a
   toast/panel elsewhere on the page, so it can't be missed or time out
   before the user reads it. */
.dz-reject-msg {
  font-size: 12.5px;
  color: var(--warning);
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(251,191,36,0.1);
  border-radius: 9px;
  border: 1px solid rgba(251,191,36,0.3);
}

.dz-camera-btn { margin-top: 10px; width: 100%; }

/* ── Form ─────────────────────────────────────────────────────────── */
.form-section { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 90px; }
.field.grow { flex: 1; }
.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}
.field .optional { font-weight: 400; color: var(--text-faint); text-transform: none; }

.vin-input-wrap { position: relative; }
.vin-input-wrap input { width: 100%; padding-right: 42px; }
.vin-scan-icon-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.vin-scan-icon-btn:hover { background: var(--surface-2); color: var(--accent-2); }
.btn-vin-lookup { margin-top: 8px; width: 100%; }

input[type=text], input[type=number], select, textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 14px;
  font-family: var(--font-ui);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(242,153,74,0.05);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9aab' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 32px;
}
select option { background: #1a1a24; color: var(--text); }
textarea { resize: vertical; min-height: 56px; font-family: var(--font-ui); }

/* ── Collapsible sections (e.g. Parts Sourcing) ──────────────────── */
.collapsible-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  user-select: none;
}
.collapsible-summary::-webkit-details-marker { display: none; }
.collapsible-summary .optional { margin-left: 6px; font-weight: 400; color: var(--text-faint); }
.collapsible-chevron { flex-shrink: 0; transition: transform 0.15s; color: var(--text-faint); }
.collapsible-section[open] .collapsible-chevron { transform: rotate(180deg); }
.collapsible-body {
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.collapsible-hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; margin: 0; }

/* ── Submit button ────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  margin-top: 22px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px -8px var(--accent-glow); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-arrow { transition: transform 0.2s; }
.btn-primary:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

.btn-ghost {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface); }

.submit-hint {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 10px;
}

/* ── Trust strip ──────────────────────────────────────────────────── */
.trust-strip {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.trust-num { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--accent-2); }
.trust-lbl { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; }

/* ════════════════════════════════════════════════════════════════
   STAGE 2 — PROGRESS
═══════════════════════════════════════════════════════════════ */
.progress-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 70px 20px 40px;
}

.progress-visual { margin-bottom: 36px; }
.orb-wrap { position: relative; width: 100px; height: 100px; }
.orb {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  filter: blur(2px);
  animation: orbPulse 2.4s ease-in-out infinite;
}
@keyframes orbPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.85; }
  50%      { transform: scale(1.05); opacity: 1; }
}
.orb-ring {
  position: absolute; inset: -10px;
  border: 1.5px solid rgba(242,153,74,0.4);
  border-radius: 50%;
  animation: ringExpand 2.4s ease-out infinite;
}
.orb-ring-2 { animation-delay: 1.2s; }
@keyframes ringExpand {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.progress-title {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}
.progress-sub { font-size: 14px; color: var(--text-dim); margin-bottom: 40px; }

.steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 320px;
}
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 13.5px;
  color: var(--text-faint);
  transition: all 0.3s var(--ease);
}
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
  transition: all 0.3s;
}
.step.active {
  color: var(--text);
  background: var(--surface);
}
.step.active .step-dot {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(242,153,74,0.18);
  animation: stepPulse 1.4s ease-in-out infinite;
}
@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(242,153,74,0.18); }
  50%      { box-shadow: 0 0 0 7px rgba(242,153,74,0.05); }
}
.step.done { color: var(--text-dim); }
.step.done .step-dot { background: var(--success); box-shadow: none; animation: none; }
.step.done .step-dot::after { content: ""; }

/* ════════════════════════════════════════════════════════════════
   STAGE 3 — RESULT
═══════════════════════════════════════════════════════════════ */
.result-header { text-align: center; padding: 20px 0 28px; }
.result-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.result-badge.sev-minor    { background: rgba(52,211,153,0.12); color: var(--success); border: 1px solid rgba(52,211,153,0.3); }
.result-badge.sev-moderate { background: rgba(251,191,36,0.12); color: var(--warning); border: 1px solid rgba(251,191,36,0.3); }
.result-badge.sev-severe,
.result-badge.sev-total_loss { background: rgba(248,113,113,0.12); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }

.result-title { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.result-sub { font-size: 14px; color: var(--text-dim); }

.total-card {
  background: linear-gradient(160deg, rgba(242,153,74,0.12), rgba(247,185,85,0.06));
  border: 1px solid rgba(242,153,74,0.25);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  margin-bottom: 24px;
}
.total-label { font-size: 13px; color: var(--text-dim); font-weight: 500; margin-bottom: 6px; }
.total-amount {
  font-family: var(--font-head);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(120deg, #fff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.total-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.total-loss-flag {
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 9px;
  padding: 9px 14px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.breakdown-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.breakdown-item .bi-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.breakdown-item .bi-value {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
}
.breakdown-item .bi-note {
  font-size: 10.5px;
  color: var(--warning);
  margin-top: 4px;
}

.parts-section { margin-bottom: 28px; }
.parts-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.parts-section-head h3 { font-family: var(--font-head); font-size: 16px; font-weight: 600; }
.parts-count { font-size: 12px; color: var(--text-faint); }

.parts-list { display: flex; flex-direction: column; gap: 8px; }
.part-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.part-row-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(242,153,74,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.part-row-body { flex: 1; min-width: 0; }
.part-row-name { font-size: 13.5px; font-weight: 600; }
.part-row-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.part-row-action {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 3px 9px;
  border-radius: 100px;
  flex-shrink: 0;
}
.part-row-action.repair  { background: rgba(247,185,85,0.12); color: var(--accent-2); }
.part-row-action.replace { background: rgba(248,113,113,0.12); color: var(--danger); }
.part-row-action.no_work { background: rgba(255,255,255,0.06); color: var(--text-faint); }

.result-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.disclaimer {
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.5;
  padding: 0 10px;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px 0;
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

/* ── Error banner (persistent, not auto-dismiss) ─────────────────── */
.error-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 480px;
  width: calc(100% - 40px);
  background: #1a1018;
  border: 1px solid rgba(248,113,113,0.4);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 20px 50px -10px rgba(0,0,0,0.6);
  z-index: 1000;
  animation: errorIn 0.3s var(--ease);
}
@keyframes errorIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.error-banner-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(248,113,113,0.15);
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.error-banner-body { flex: 1; min-width: 0; }
.error-banner-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.error-banner-msg { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; word-break: break-word; }
.error-banner-close {
  background: none; border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  padding: 2px;
}
.error-banner-close:hover { color: var(--text); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .hero-title { font-size: 32px; }
  .upload-card { padding: 20px; }
  .form-row { flex-direction: column; }
  .total-amount { font-size: 40px; }
  .trust-strip { gap: 24px; }
  .breakdown-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mode toggle ──────────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
}
.mode-btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 9px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  background: transparent;
  color: var(--text-dim);
  transition: all 0.2s var(--ease);
}
.mode-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 14px -4px var(--accent-glow);
}
.mode-btn:not(.active):hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

/* ── OBD section inside upload card ──────────────────────────── */
.obd-section-pub {
  margin-top: 18px;
  margin-bottom: 4px;
}
.obd-label-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.obd-section-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.obd-section-hint {
  font-size: 11px;
  color: var(--text-faint);
}
.obd-required-mode .obd-section-label::after {
  content: " *";
  color: var(--danger);
}

.obd-chip-wrap-pub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 44px;
  cursor: text;
  transition: border-color 0.15s;
}
.obd-chip-wrap-pub:focus-within {
  border-color: var(--accent);
  background: rgba(242,153,74,0.04);
}
.obd-required-mode .obd-chip-wrap-pub {
  border-color: rgba(242,153,74,0.4);
}
.obd-chips-pub {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pub-obd-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 12px;
  font-family: monospace;
  font-weight: 700;
}
.pub-obd-chip button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1;
}
.pub-obd-chip button:hover { color: #fff; }
.obd-chip-input-pub {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  min-width: 160px;
  flex: 1;
  font-family: var(--font-ui);
}
.obd-chip-input-pub::placeholder { color: var(--text-faint); }

/* Suggestions dropdown */
.obd-suggestions {
  background: #16161f;
  border: 1px solid var(--border-hi);
  border-radius: 9px;
  margin-top: 4px;
  overflow: hidden;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.5);
}
.pub-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  transition: background 0.12s;
}
.pub-suggestion:hover { background: rgba(242,153,74,0.1); color: var(--text); }
.pub-suggestion strong {
  font-family: monospace;
  font-size: 13px;
  color: var(--accent-2);
  min-width: 55px;
}
.pub-suggestion span { font-size: 12px; }

/* Quick code pills */
.obd-quick-codes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.quick-label {
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-right: 2px;
}
.quick-chip {
  font-size: 11px;
  font-family: monospace;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.quick-chip:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(242,153,74,0.08);
}

/* ── OBD result section in stage-result ─────────────────────── */
.obd-result-hint {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
  margin-bottom: 12px;
}
.obd-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.obd-result-row {
  display: grid;
  grid-template-columns: 70px 1fr 90px;
  align-items: start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.obd-result-row.confirmed { border-left-color: var(--success); }
.obd-result-row.pending   { border-left-color: var(--warning); }
.obd-status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
  margin-bottom: 4px;
}
.obd-status-badge.confirmed { background: rgba(52,211,153,0.14); color: var(--success); }
.obd-status-badge.pending   { background: rgba(251,191,36,0.14); color: var(--warning); }
.obd-pending-note {
  font-size: 11px;
  font-style: italic;
  color: var(--warning);
  margin-top: 4px;
  line-height: 1.4;
}
.obd-result-badge {
  font-family: monospace;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  align-self: start;
}
.obd-result-body { min-width: 0; }
.obd-result-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}
.obd-result-op {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.4;
}
.obd-result-part {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}
.obd-result-total {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .mode-toggle { flex-direction: column; }
  .obd-result-row { grid-template-columns: 60px 1fr; }
  .obd-result-total { grid-column: 1/-1; text-align: left; }
}
