/* CarBluff Garage (car-buying CRM) — reuses the site design tokens from style.css.
   Gated prototype; not linked from the site nav until accounts + cloud sync ship. */

/* Make the HTML `hidden` attribute authoritative — several of our containers set an explicit
   display (flex/etc.) which would otherwise beat the UA `[hidden]{display:none}` rule and keep
   sign-in/app/account regions visible when they should be toggled off. */
[hidden] { display: none !important; }

.dash-topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 14px 20px; }
.dash-logo { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.04em; color: var(--ink); text-decoration: none; font-size: 18px; }
.dash-logo b { color: var(--accent); }
.dash-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--ink-3); }
.dash-scan-link { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink-2); text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.dash-scan-link:hover, .dash-scan-link:focus-visible { color: var(--accent); }
.dash-preview-pill {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--accent-ink);
  background: var(--accent); padding: 3px 7px; border-radius: var(--radius);
}
.dash-scan-link { margin-left: auto; font-family: var(--font-mono); font-size: 13px; color: var(--accent); text-decoration: none; }
.dash-scan-link:hover { text-decoration: underline; }

.dash-main { padding: 26px 20px 80px; }

/* ---- account chip + sign out (topbar) ---- */
.dash-account { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.plan-chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-2); }
.plan-chip a { color: var(--accent); text-decoration: none; }
.plan-chip a:hover { text-decoration: underline; }
.plan-chip.unlimited { color: var(--accent-ink); background: var(--accent); padding: 3px 8px; border-radius: var(--radius); letter-spacing: 0.1em; }

/* ---- Friends & Family admin panel ---- */
.ff-panel { border: var(--bw) solid var(--accent); background: var(--panel); border-radius: var(--radius); padding: 18px 18px 16px; margin-bottom: 24px; }
.ff-title { font-family: var(--font-head); font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.ff-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--accent-ink); background: var(--accent); padding: 2px 7px; border-radius: var(--radius); }
.ff-sub { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 14px; }
.ff-form { display: flex; gap: 10px; flex-wrap: wrap; }
.ff-form input { flex: 1; min-width: 160px; font-family: var(--font-mono); font-size: 14px; color: var(--ink); background: var(--panel-2); border: var(--bw) solid var(--border); border-radius: var(--radius); padding: 11px 12px; min-height: 46px; }
.ff-form .btn { min-height: 46px; }
.ff-msg { color: var(--accent); font-size: 13px; min-height: 1em; margin: 10px 0 0; }
.ff-list { margin-top: 12px; }
.ff-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--border); padding: 10px 0; }
.ff-row:first-child { border-top: none; }
.ff-em { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink); }
.ff-note { flex: 1; color: var(--ink-3); font-size: 12.5px; }
.ff-remove { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); background: none; border: none; cursor: pointer; }
.ff-remove:hover { color: var(--critical); }
.ff-empty { color: var(--ink-3); font-size: 13px; font-family: var(--font-mono); }

/* ---- sign-in screen ---- */
.dash-login { padding: 48px 20px 80px; display: flex; justify-content: center; }
.login-card {
  width: 100%; max-width: 440px; border: var(--bw) solid var(--border); background: var(--panel);
  border-radius: var(--radius); padding: 30px 26px;
}
.login-card h1 { font-family: var(--font-head); font-size: 28px; font-weight: 700; }
.login-sub { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; margin: 10px 0 22px; }
#login-form { display: flex; flex-direction: column; gap: 10px; }
#login-form label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
#login-form input {
  font-family: var(--font-mono); font-size: 15px; color: var(--ink); background: var(--panel-2);
  border: var(--bw) solid var(--border); border-radius: var(--radius); padding: 12px 13px; min-height: 48px;
}
#login-form .btn { margin-top: 6px; }
.login-msg { color: var(--accent); font-size: 13.5px; min-height: 1.2em; margin-top: 14px; line-height: 1.5; }
.login-fine { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; margin-top: 16px; }

/* Soft, non-blocking "Did you mean gmail.com?" nudge under the email field (step 1). */
.login-typo { color: var(--ink-2); font-size: 13px; line-height: 1.4; margin: 2px 0 0; }
.login-typo .typo-fix { display: inline; min-height: 0; padding: 0 3px; font-size: 13px; text-transform: none; letter-spacing: 0; }

/* ---- step 2: verify code ---- */
#code-form { display: flex; flex-direction: column; gap: 10px; }
#code-form label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
#code-form input {
  font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.32em; text-align: center;
  color: var(--ink); background: var(--panel-2);
  border: var(--bw) solid var(--border); border-radius: var(--radius); padding: 12px 13px; min-height: 48px;
}
#code-form .btn { margin-top: 6px; }
/* One subtle secondary resend, centered under the primary Verify button. */
.code-resend { align-self: center; margin-top: 2px; }
.code-sent { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; margin: 0 0 4px; }
.code-sent b { color: var(--ink); word-break: break-all; }
.code-change { display: inline; min-height: 0; padding: 0 4px; font-size: 12.5px; text-transform: none; letter-spacing: 0; }

.dash-banner {
  background: var(--panel); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; margin-bottom: 26px;
}
.dash-banner b { color: var(--ink); }

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { font-family: var(--font-head); font-size: 30px; font-weight: 700; letter-spacing: 0.01em; }
.dash-sub { color: var(--ink-2); font-size: 14px; margin-top: 4px; }

/* stat strip */
.dash-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
@media (min-width: 640px) { .dash-stats { grid-template-columns: repeat(4, 1fr); } }
.stat { border: var(--bw) solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1; }
.stat .lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 8px; }

/* filter tabs */
.dash-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-filters button {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); background: transparent; border: var(--bw) solid var(--border);
  border-radius: var(--radius); padding: 8px 14px; cursor: pointer; min-height: 40px;
}
.dash-filters button.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* card grid */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .dash-grid { grid-template-columns: 1fr 1fr; } }

.car {
  border: var(--bw) solid var(--border); background: var(--panel); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.car.is-closed { opacity: 0.72; }

/* The whole card is a tap target that opens the detail view (dashboard.js click/keydown handlers).
   Interactive controls inside set their own cursor, so only the empty areas read as clickable. */
.car { cursor: pointer; }
.car:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.car-notes { cursor: text; }

/* Card colour aura (2026-08-13): a subtle tinted hairline + soft glow in the colour of the more
   meaningful score. --aura is set by the au-* class; the shared rule keeps it on-system and it
   retunes across all 11 palettes because it is built from the risk-scale tokens via color-mix. */
.car.has-aura {
  border-color: color-mix(in srgb, var(--aura) 48%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--aura) 15%, transparent),
              0 14px 32px -20px color-mix(in srgb, var(--aura) 42%, transparent);
}
.car.au-good { --aura: var(--good); }
.car.au-good-lt { --aura: var(--good-lt); }
.car.au-warn { --aura: var(--warn); }
.car.au-serious { --aura: var(--serious); }
.car.au-critical { --aura: var(--critical); }
.car.au-neutral { --aura: var(--ink-3); }

/* listing photo (auto-pulled or swapped from device) */
.car-photo {
  display: block; width: 100%; aspect-ratio: 16 / 10; position: relative; padding: 0;
  border: var(--bw) solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--panel-2); cursor: pointer;
}
.car-photo.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.car-photo.empty:hover { border-color: var(--ink-3); }
.photo-cta { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.06em; color: var(--ink-2); }
.photo-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2); }
.car-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-edit {
  position: absolute; right: 8px; bottom: 8px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.06em; color: var(--ink); background: rgba(11, 14, 19, 0.8);
  padding: 4px 8px; border-radius: var(--radius);
}
.car-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.car-title { font-family: var(--font-head); font-size: 17px; font-weight: 700; line-height: 1.25; }
.car-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--ink-2); }
.car-meta .car-price { color: var(--ink); font-weight: 700; }
.pill {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 7px; white-space: nowrap;
}

/* trust chip, colored by scam band (reuses the site's risk vocabulary) */
.trust { display: inline-flex; align-items: center; gap: 8px; }
.trust .score { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.trust .band { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.b-low .score, .b-low .band { color: var(--good); }
.b-caution .score, .b-caution .band { color: var(--warn); }
.b-high .score, .b-high .band { color: var(--serious); }
.b-scam .score, .b-scam .band { color: var(--critical); }
.trust.unscored .score { color: var(--ink-3); }
.trust.unscored .band { color: var(--ink-3); }

/* Risk + deal numbers read together at the top of the card. The deal number is coloured by its
   deal band (dc-*), mirroring the risk number's b-* colouring. */
.car-scores { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.deal-num { display: inline-flex; align-items: baseline; gap: 6px; }
.dn-score { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--ink-2); }
.dn-lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.deal-num.dc-pos .dn-score { color: var(--good); }
.deal-num.dc-neutral .dn-score { color: var(--ink-2); }
.deal-num.dc-warn .dn-score { color: var(--serious); }
.deal-num.dc-bad .dn-score { color: var(--critical); }

/* Overall + 3 value-colored sub-scores on the garage card (matches the app garage card). Overrides
   the older inline .car-scores rule above (later in the cascade wins). */
.car-scores { display: flex; align-items: center; gap: 16px; margin-top: 4px; justify-content: flex-start; flex-wrap: nowrap; }
.cs-overall { display: flex; flex-direction: column; align-items: center; min-width: 46px; }
.cs-ov-num { font-family: var(--font-mono); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.cs-ov-cap { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.cs-subs { display: flex; gap: 14px; flex: 1; border-left: 1px solid var(--border); padding-left: 16px; }
.cs-sub { display: flex; flex-direction: column; align-items: center; }
.cs-sub-num { font-family: var(--font-mono); font-size: 17px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.cs-sub-cap { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

/* Detail-view delete (relocated off the card). Left-aligned danger ghost button. */
.ed-actions-gap { flex: 1; }
.ed-actions .dt-delete { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); }

.car-flags { display: flex; flex-direction: column; gap: 4px; }
.car-flag { font-size: 12.5px; color: var(--ink-2); }
.car-flag .dot { color: var(--critical); }

/* status select */
.car-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.status-select {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink); background: var(--panel-2); border: var(--bw) solid var(--border);
  border-radius: var(--radius); padding: 8px 10px; min-height: 40px; cursor: pointer;
}
/* Progress dots deliberately stay OFF the risk ramp (warn/serious/critical) so amber/orange
   never reads as a scam warning: idle = grey, active stages = lime accent, won = green. */
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.sd-watching { background: var(--ink-3); }
.sd-contacted { background: var(--accent); }
.sd-inspecting { background: var(--accent); }
.sd-offer { background: var(--accent); }
.sd-negotiating { background: var(--accent); }
.sd-viewing { background: var(--accent); }
.sd-bought { background: var(--good); }
.sd-passed { background: var(--ink-3); }

.car-notes {
  width: 100%; min-height: 44px; resize: vertical; font-family: var(--font-mono); font-size: 13px;
  line-height: 1.5; color: var(--ink); background: var(--panel-2); border: var(--bw) solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.car-notes::placeholder { color: var(--ink-3); }

.car-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.car-actions a, .car-actions button {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-2);
  background: none; border: none; padding: 0; cursor: pointer; text-decoration: none;
}
.car-actions a:hover { color: var(--accent); text-decoration: underline; }
.car-remove:hover { color: var(--critical); }
.car-added { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

/* empty state */
.dash-empty { text-align: center; padding: 40px 20px; border: var(--bw) dashed var(--border); border-radius: var(--radius); }
.dash-empty h2 { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.dash-empty p { color: var(--ink-2); font-size: 14.5px; max-width: 52ch; margin: 10px auto 20px; }
.dash-empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* add/edit modal */
.dash-editor-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.dash-editor {
  width: 100%; max-width: 460px; background: var(--panel); border: var(--bw) solid var(--accent);
  border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px;
  max-height: 90vh; overflow-y: auto;
}
.dash-editor h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.dash-editor label { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.dash-editor input, .dash-editor select {
  font-family: var(--font-mono); font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink);
  background: var(--panel-2); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 11px 12px; min-height: 46px;
}
.dash-editor .req { color: var(--accent); }
.ed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 400px) { .ed-row { grid-template-columns: 1fr; } }
.ed-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 4px; }

/* ---- controls row: filters + sort ---- */
.dash-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.dash-controls .dash-filters { margin-bottom: 0; }
.dash-sort { display: flex; align-items: center; gap: 8px; }
.dash-sort label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.dash-sort select {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink); background: var(--panel-2);
  border: var(--bw) solid var(--border); border-radius: var(--radius); padding: 8px 10px; min-height: 40px; cursor: pointer;
}

/* ---- deal score row + user override + good-deal badge ---- */
.deal-badge {
  display: inline-block; margin-left: 8px; vertical-align: middle; font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.08em; padding: 2px 7px; border-radius: var(--radius);
}
.deal-badge.dg-great { color: var(--accent-ink); background: var(--good); }
.deal-badge.dg-good { color: var(--accent-ink); background: var(--accent); }
/* Neutral "fair" tag + red "overpriced" tag, so every userDeal rating shows (Matt), not just good ones. */
.deal-badge.dg-fair { color: var(--ink); background: color-mix(in srgb, var(--ink-3) 22%, transparent); }
.deal-badge.dg-overpriced { color: var(--accent-ink); background: var(--critical); }
.car-deal { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.deal-lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--ink-3); }
.deal-auto { font-family: var(--font-mono); font-size: 12px; }
.deal-auto.soon { color: var(--ink-3); }
.deal-auto.has { color: var(--ink); }
.deal-select {
  margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink);
  background: var(--panel-2); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 7px 9px; min-height: 38px; cursor: pointer;
}

/* ---- delete-car button: clearly labeled + visually distinct from the plain action links ---- */
.car-delete {
  border: var(--bw) solid var(--border) !important; border-radius: var(--radius);
  padding: 4px 10px !important; color: var(--ink-3) !important;
}
.car-delete:hover { color: var(--critical) !important; border-color: var(--critical) !important; }

/* ---- undo toast ---- */
.dash-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 120;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  background: var(--panel); border: var(--bw) solid var(--accent); border-radius: var(--radius);
  padding: 12px 16px; font-size: 13.5px; color: var(--ink);
}
.dash-toast[hidden] { display: none; }
.toast-undo {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: none; border: none; cursor: pointer; padding: 0;
}

/* ============================================================================
   Retention features (2026-08-12): Watch/monitoring, Import a listing, Compare.
   Reuses the existing design tokens + .b-* risk vocabulary above.
   ============================================================================ */

/* dash-head action buttons (Import + Add) */
.dash-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- per-card Watch toggle ---- */
.watch-toggle {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 7px 10px; min-height: 40px;
}
.watch-toggle input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.watch-toggle:hover { color: var(--ink); }
.watch-toggle.is-off { opacity: 0.7; cursor: not-allowed; }
.watch-toggle.is-off input { cursor: not-allowed; }
/* Reliable tap target on mobile: no double-tap-zoom delay, no text selection on tap. */
.watch-toggle { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
/* Toggle + its short unavailable reason, stacked so the caption sits under the control. */
.watch-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.watch-reason {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.03em;
  color: var(--ink-3); line-height: 1.3; max-width: 16ch; text-transform: none;
}

/* ---- per-card monitoring alert badge ---- */
.car.has-alert { border-color: var(--accent); }
.car-alert {
  display: flex; align-items: center; gap: 10px; margin: 0 0 2px;
  background: var(--accent-glow); border: var(--bw) solid var(--accent); border-radius: var(--radius);
  padding: 9px 12px; font-size: 13px; color: var(--ink);
}
.car-alert .alert-ico {
  flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-head); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.car-alert .alert-text { flex: 1; line-height: 1.4; }
.car-alert .alert-dismiss {
  flex: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); background: none; border: none; cursor: pointer; padding: 2px 4px;
}
.car-alert .alert-dismiss:hover { color: var(--accent); }

/* ---- compare checkbox on each card ---- */
.cmp-check-wrap {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 7px 10px; min-height: 40px;
}
.cmp-check-wrap input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.cmp-check-wrap:hover { color: var(--ink); }

/* ---- floating compare bar ---- */
.cmp-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 115;
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: var(--bw) solid var(--accent); border-radius: var(--radius);
  padding: 10px 16px;
}
.cmp-bar[hidden] { display: none; }
.cmp-bar .cmp-count { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.cmp-bar .cmp-clear { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); background: none; border: none; cursor: pointer; }
.cmp-bar .cmp-clear:hover { color: var(--critical); }

/* ---- compare modal ---- */
.cmp-backdrop { align-items: flex-start; }
.cmp-modal {
  width: 100%; max-width: 900px; margin: 40px auto; background: var(--panel);
  border: var(--bw) solid var(--accent); border-radius: var(--radius);
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.cmp-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: var(--bw) solid var(--border);
}
.cmp-modal-head h3 { font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.cmp-modal-close { font-family: var(--font-mono); font-size: 15px; color: var(--ink-3); background: none; border: none; cursor: pointer; }
.cmp-modal-close:hover { color: var(--accent); }
.cmp-table-wrap { overflow: auto; }
.cmp-table { border-collapse: collapse; width: 100%; min-width: 520px; }
.cmp-table th, .cmp-table td {
  border: 1px solid var(--border); padding: 12px 14px; text-align: left; vertical-align: top;
  font-size: 13.5px; color: var(--ink); min-width: 150px;
}
.cmp-table .cmp-rowhead {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); background: var(--panel-2); white-space: nowrap; min-width: 96px; position: sticky; left: 0;
}
.cmp-thumb { width: 100%; max-width: 160px; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); display: block; margin-bottom: 8px; }
.cmp-name { font-family: var(--font-head); font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.cmp-score { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.cmp-score.b-low { color: var(--good); }
.cmp-score.b-caution { color: var(--warn); }
.cmp-score.b-high { color: var(--serious); }
.cmp-score.b-scam { color: var(--critical); }
.cmp-band { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.cmp-flags { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.cmp-flags li { font-size: 12.5px; color: var(--ink-2); }
.cmp-none { font-size: 12.5px; color: var(--ink-3); }
.cmp-table a { color: var(--accent); text-decoration: none; }
.cmp-table a:hover { text-decoration: underline; }

/* ---- import modal extras ---- */
.import-sub { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; text-transform: none; letter-spacing: 0; }
.import-fb { color: var(--warn); font-size: 12.5px; line-height: 1.5; text-transform: none; letter-spacing: 0; }
.import-msg { color: var(--accent); font-size: 13px; min-height: 1em; text-transform: none; letter-spacing: 0; }
/* Import modal input-mode tabs (mirrors the homepage scanner's 3 modes) */
.import-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.import-mode {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-2);
  background: var(--panel-2); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 8px 14px; min-height: 44px; cursor: pointer;
}
.import-mode.on { color: var(--accent); border-color: var(--accent); }
.import-panel { display: flex; flex-direction: column; gap: 6px; }
.import-panel input[type="file"] {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-2);
  background: var(--panel-2); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 12px; text-transform: none; letter-spacing: 0; min-height: 46px;
}
.import-shots-status { color: var(--ink-2); font-size: 12.5px; line-height: 1.5; min-height: 1em; text-transform: none; letter-spacing: 0; }
.dash-editor textarea {
  font-family: var(--font-mono); font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink);
  background: var(--panel-2); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 11px 12px; resize: vertical; line-height: 1.5;
}

/* ============================================================================
   Garage CRM (2026-08-13): full detail/edit view + server-synced photo gallery.
   ============================================================================ */
.photo-count {
  position: absolute; left: 8px; bottom: 8px; font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink); background: rgba(11, 14, 19, 0.8); padding: 4px 8px; border-radius: var(--radius);
}
/* "Details & edit" card action, styled like the delete pill so it reads as a distinct control */
.car-details {
  border: var(--bw) solid var(--border) !important; border-radius: var(--radius);
  padding: 4px 10px !important; color: var(--ink-2) !important;
}
.car-details:hover { color: var(--accent) !important; border-color: var(--accent) !important; }

.dash-detail { max-width: 560px; }

/* Detail view on mobile (2026-08-17): the overlay itself owns the vertical scroll, so every field
   and the bottom action buttons are always reachable, with comfortable safe-area padding under the
   last button. Horizontal scrolling is never possible: the overlay clips overflow-x and children
   are held to the width, and long unbreakable strings wrap instead of pushing the page sideways. */
.detail-backdrop {
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.detail-backdrop .dash-detail {
  max-height: none;
  overflow-y: visible;
  overflow-x: hidden;
  margin: 0 auto;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.dash-detail input, .dash-detail select, .dash-detail textarea { max-width: 100%; box-sizing: border-box; }
.dash-detail .dt-none, .dash-detail .dt-deal, .dash-detail .dt-recall-line,
.dash-detail .dt-recall-summary, .dash-detail .dt-flags li, .dash-detail .dt-recall-meta {
  overflow-wrap: anywhere;
}
.dt-head { display: flex; align-items: center; justify-content: space-between; }
.dt-head h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.dt-close {
  font-family: var(--font-mono); font-size: 16px; color: var(--ink-3); background: none; border: none; cursor: pointer;
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; margin: -8px -8px -8px 0;
}
.dt-close:hover { color: var(--accent); }
.dt-summary {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border: var(--bw) solid var(--border); border-radius: var(--radius); background: var(--panel-2); padding: 12px 14px;
}
.dt-deal { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink-2); }
.dt-group-title {
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--ink); margin-top: 6px;
}
.dt-flags { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.dt-flags li { font-size: 13px; color: var(--ink-2); }
.dt-none { color: var(--ink-3); font-size: 13px; font-family: var(--font-mono); }

.dt-photos { display: flex; flex-direction: column; gap: 8px; }
.dt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 460px) { .dt-grid { grid-template-columns: repeat(4, 1fr); } }
.dt-thumb {
  position: relative; aspect-ratio: 1 / 1; border: var(--bw) solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--panel-2);
}
.dt-thumb.is-cover { border-color: var(--accent); }
.dt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dt-cover-tag {
  position: absolute; left: 4px; top: 4px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em;
  color: var(--accent-ink); background: var(--accent); padding: 2px 5px; border-radius: var(--radius);
}
/* A11y (contract §C): cover/delete controls are >=44px touch targets on mobile. */
.dt-cover-btn {
  position: absolute; left: 4px; bottom: 4px; font-family: var(--font-mono); font-size: 9.5px;
  color: var(--ink); background: rgba(11, 14, 19, 0.82); border: none; border-radius: var(--radius);
  padding: 4px 8px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center;
}
.dt-cover-btn:hover { color: var(--accent); }
.dt-del-btn {
  position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; font-size: 15px; line-height: 1;
  color: var(--ink); background: rgba(11, 14, 19, 0.82); border: none; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.dt-del-btn:hover { color: var(--critical); }
.dt-add {
  aspect-ratio: 1 / 1; border: var(--bw) dashed var(--border); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; cursor: pointer;
}
.dt-add:hover { border-color: var(--accent); color: var(--accent); }
.dt-photo-hint { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.dash-detail textarea {
  font-family: var(--font-mono); font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink);
  background: var(--panel-2); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 11px 12px; resize: vertical; line-height: 1.5;
}

/* ---- detail recall resolver (contract §A) ---- */
.dt-recalls { display: flex; flex-direction: column; gap: 8px; }
.dt-recall-check { align-self: flex-start; }
.dt-recall-vehicle { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--ink); }
.dt-recall-summary { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; }
.dt-recall-summary.is-open { color: var(--serious); }
.dt-recall-summary.is-clear { color: var(--good); }
.dt-recall-views { display: flex; gap: 8px; }
.dt-recall-view {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--ink-2);
  background: var(--panel-2); border: var(--bw) solid var(--border); border-radius: 999px;
  padding: 6px 14px; min-height: 44px; cursor: pointer;
}
.dt-recall-view.on { color: var(--accent); border-color: var(--accent); }
.dt-recall {
  border: var(--bw) solid var(--border); border-radius: var(--radius); background: var(--panel-2); padding: 12px 14px;
}
.dt-recall.is-resolved { opacity: 0.72; }
.dt-recall-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dt-recall-comp { font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.dt-recall.is-resolved .dt-recall-comp { text-decoration: line-through; color: var(--ink-3); }
.dt-recall-fixed { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--good); }
.dt-recall-line { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-top: 6px; }
.dt-recall-line b { color: var(--ink); }
.dt-recall-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.dt-recall-mark {
  margin-top: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.03em; color: var(--ink-2);
  background: var(--panel); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 8px 14px; min-height: 44px; cursor: pointer;
}
.dt-recall-mark.on { color: var(--good); border-color: var(--good); }
.dt-recall-nhtsa { font-family: var(--font-mono); font-size: 12px; color: var(--accent); text-decoration: none; margin-top: 4px; }
.dt-recall-nhtsa:hover { text-decoration: underline; }

/* ---- View-gate: paid buy-decision intelligence, locked for a non-entitled account ----
   The real numbers are withheld server-side (garage.php); the blur sits over inert placeholders,
   with an upgrade CTA on top. Free CRM fields stay fully visible + editable. */
.locked-panel { position: relative; }
.locked-blur { filter: blur(6px); opacity: 0.5; pointer-events: none; user-select: none; }
.locked-box { border: var(--bw) dashed var(--border); border-radius: var(--radius); padding: 14px; overflow: hidden; }
.lock-overlay {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 12px;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}
.lock-badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); border-radius: var(--radius); padding: 2px 8px;
}
.lock-copy { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); max-width: 30ch; margin: 0; }
.lock-cta { padding: 7px 16px; min-height: 0; font-size: 13px; text-decoration: none; }
.stat.is-locked .num { position: relative; }
.cmp-locked {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); text-decoration: none; border-bottom: 1px dashed var(--border);
}
.cmp-locked:hover { color: var(--accent); border-color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Credit model: Full Report wallet + per-car unlock (2026-08-19) ----
   Safety (scam score/flags/recalls) is always visible; only the buy-decision layer (Deal/Cond/
   Overall) is gated per car, with an inline unlock CTA. No em/en dashes in copy. */
.credits-chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-2); }
.credits-chip a { color: var(--accent); text-decoration: none; }
.credits-chip a:hover { text-decoration: underline; }
.car-scores.has-lock .cs-sub.is-locked .cs-sub-num,
.car-scores.has-lock .cs-overall.is-locked .cs-ov-num { filter: blur(5px); opacity: 0.5; user-select: none; }
.cs-unlock { margin-left: auto; }
.unlock-btn { min-height: 0; padding: 6px 14px; font-size: 12.5px; }
.unlock-getcredits { min-height: 0; padding: 6px 14px; font-size: 12.5px; text-decoration: none; }
.dt-deal.is-locked a {
  color: var(--ink-3); text-decoration: none; border-bottom: 1px dashed var(--border);
}
.dt-deal.is-locked a:hover { color: var(--accent); border-color: var(--accent); }
.dt-unlock { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 4px; }
.dt-unlock-note { font-size: 12px; line-height: 1.4; color: var(--ink-3); flex: 1 1 200px; }

/* ---- Account create / sign-in modal (lead-capture gate for signed-out visitors) ----
   The signed-out Garage presents the sign-in card as a modal overlay, re-shown every time a
   signed-out visitor opens the Garage. Signed-in users never see it. */
.dash-login {
  position: fixed; inset: 0; z-index: 90; padding: 24px 20px; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}
.consent-row {
  flex-direction: row !important; align-items: flex-start; gap: 9px;
  font-family: var(--font-body, inherit) !important; font-size: 13px !important; line-height: 1.45;
  letter-spacing: 0 !important; text-transform: none !important; color: var(--ink-2) !important;
  margin-top: 4px; cursor: pointer;
  /* The whole <label> is the tap target; guarantee it meets the 44px touch minimum on mobile
     even when the copy is a single line (the Terms row). */
  min-height: 44px; padding: 5px 0; box-sizing: border-box;
}
/* Scoped with #login-form to outrank the id-level `#login-form input` sizing above. */
#login-form .consent-row input[type="checkbox"] {
  width: 17px; height: 17px; min-height: 0; padding: 0; margin-top: 1px; flex: 0 0 auto; accent-color: var(--accent);
}
.consent-row a { color: var(--accent); text-decoration: underline; }
