/* ─────────────────────────────────────────────────────────────────────────
 * Mercedes-Benz USA brand system
 *   Core palette  : Black #000000, Silver #A4AAAE (Pantone 429 C)
 *   Typography    : Corporate A (proprietary). Public fallback: Inter —
 *                   kept for licensing safety, matches the humanist-sans feel.
 *   Visual tone   : "Luxury through restraint" — high contrast, generous
 *                   whitespace, sharp-ish corners (≤4px), thin separators.
 *
 * Names of the CSS vars (--primary-blue, --teal-action, etc.) are kept so
 * the 25+ existing usages across this file don't need to change; we just
 * retune the values so the whole app picks up MB brand automatically.
 * ───────────────────────────────────────────────────────────────────────── */
:root {
    /* ----- MB core ----- */
    --mb-black:      #000000;                  /* MB signature */
    --mb-silver:     #A4AAAE;                  /* MB Silver / Pantone 429 C */
    --mb-silver-dk:  #7d8589;                  /* for hover on silver surfaces */
    --mb-silver-lt:  #e6e7e8;                  /* subtle borders/dividers */

    /* ----- MB digital action blue -----
     * MB's print system is black+silver only, but their digital products
     * (MB configurator, financing, scheduler) use a confident cobalt blue
     * for interactive CTAs so they stand apart from black brand chrome.
     * This is the same approach — black reserved for brand/typography/
     * borders; blue reserved for "click me" affordances. */
    --mb-blue:       #0078D6;                  /* MB Pure Blue (digital, light bg) */
    --mb-blue-dk:    #005A9E;                  /* hover/pressed */

    /* ----- Legacy variable names, remapped ----- */
    --primary-blue:  var(--mb-blue);           /* CTA colour */
    --hover-blue:    var(--mb-blue-dk);
    --navy-blue:     var(--mb-black);          /* brand chrome stays black */
    --teal-action:   var(--mb-blue);           /* cart/checkout CTA — same blue */
    --teal-hover:    var(--mb-blue-dk);

    /* ----- Neutrals ----- */
    --black:         #000000;
    --dark-grey:     #1f1f1f;                  /* near-black for text */
    --mid-grey:      #6b6b6b;                  /* MB-sophisticated grey */
    --border-grey:   #e4e4e4;
    --light-bg:      #f6f6f6;                  /* very soft off-white */
    --white:         #ffffff;

    /* ----- Functional state colors (kept, but toned toward MB) ----- */
    --success-green: #0e8a3a;

    /* ----- Geometry & motion (tighter radii for sharp MB feel) ----- */
    --radius-sm: 2px;
    --radius-md: 4px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);

    /* ----- V4 "Elevated Cards" dashboard tokens (from Claude Design handoff) -----
     * Scoped-in palette/elevation the dealer Dashboard uses for its softer,
     * rounded, elevated look. One accent only: MB Pure Blue. */
    --blue:        #0078D6;   /* same as --mb-blue */
    --blue-700:    #0063b1;
    --blue-800:    #0a4f8a;
    --blue-100:    #d3e8fa;
    --blue-50:     #eaf4fd;
    --blue-25:     #f4f9fe;

    --ink-900: #0c0d0f;
    --ink-800: #1c1d21;
    --ink-700: #34353b;
    --ink-600: #54565d;
    --ink-500: #71737a;
    --ink-400: #9a9ca3;
    --ink-300: #c4c6cc;
    --line-strong: #d6d7db;
    --line:        #e7e8ea;
    --line-soft:   #f0f1f2;

    --surface:        #ffffff;
    --surface-muted:  #fafafa;
    --surface-sunken: #f5f6f7;
    --page:           #f4f5f6;

    --font-serif:  "Playfair Display", Georgia, serif;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --r-full: 999px;

    --sh-xs: 0 1px 2px rgba(12,13,15,0.05);
    --sh-sm: 0 1px 3px rgba(12,13,15,0.07), 0 1px 2px rgba(12,13,15,0.04);
    --sh-md: 0 6px 18px -6px rgba(12,13,15,0.14), 0 2px 6px -2px rgba(12,13,15,0.07);
    --sh-lg: 0 20px 48px -12px rgba(12,13,15,0.22);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* Corporate A is proprietary MB; Inter is the closest public substitute
     * with the same humanist-sans geometry. `-apple-system` ahead for clean
     * macOS rendering while fonts load. */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-grey);
    line-height: 1.55;
    font-feature-settings: "ss01", "cv11";  /* Inter niceties — nicer digits/grotesque a */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Utility — MB editorial feel: lighter weights, tracking on
 * headings, wider letter-spacing on small all-caps labels. */
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.01em; color: var(--black); }
h1 { font-weight: 400; letter-spacing: -0.015em; }
.uppercase { text-transform: uppercase; letter-spacing: 0.08em; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--mid-grey); }
.text-success { color: var(--success-green); }
.font-bold { font-weight: 600; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.text-center { text-align: center; }

/* Header */
.app-header {
    /* Cream branding bar matching the hero header (was black). */
    background-color: #fcfbf8;
    border-bottom: 1px solid var(--hero-line, #e6e3dc);
    color: var(--hero-ink, #1a1a1a);
    height: 64px;
}
.header-container {
    max-width: 1640px;
    height: 100%;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}
.app-header-side { display: flex; align-items: center; }
.app-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.app-header .mb-logo { height: 36px; width: auto; max-width: 220px; object-fit: contain; }
.app-header .mb-logo.hidden { display: none; }
.app-header .mb-storefront-name {
    /* --hero-serif is scoped to .view-hero, so out here it fell back to Georgia while the hero
       headline rendered in Playfair — the mismatch. Use the global --font-serif (Playfair) so the
       dealer name in the wizard header matches the hero headline. */
    font-family: var(--font-serif);
    font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
    color: var(--hero-ink, #1a1a1a);
}
/* ── Contact us — header button (left of both headers) + popup ── */
/* This app has no global .hidden rule; scope it for these elements. */
.contact-link {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; cursor: pointer; padding: 6px 4px;
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--hero-ink-2, #3a3a3a);
    letter-spacing: .01em; line-height: 1; white-space: nowrap; transition: color .15s;
}
.contact-link:hover { color: var(--mb-blue); }
.contact-link.hidden { display: none; }
.contact-link svg { flex: 0 0 auto; }

.contact-pop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.contact-pop.hidden { display: none; }
.contact-pop-overlay { position: absolute; inset: 0; background: rgba(20,20,20,.45); }
.contact-pop-card {
    position: relative; z-index: 1; background: #fff; border-radius: 12px;
    width: 340px; max-width: calc(100vw - 40px); padding: 28px 26px 30px; text-align: center;
    box-shadow: 0 18px 50px -12px rgba(0,0,0,.35);
}
.contact-pop-close {
    position: absolute; top: 10px; right: 14px; background: none; border: none;
    font-size: 24px; line-height: 1; color: #9a9a9a; cursor: pointer;
}
.contact-pop-close:hover { color: #333; }
.contact-pop-title { font-size: 18px; font-weight: 700; color: #1f1f1f; }
.contact-pop-sub { font-size: 13.5px; color: #6b6b6b; margin: 6px 0 18px; }
.contact-pop-num {
    display: inline-block; font-size: 22px; font-weight: 700; color: var(--mb-blue);
    text-decoration: none; letter-spacing: .01em;
}
.contact-pop-num:hover { text-decoration: underline; }

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-area h1 {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    font-weight: 400;
}
/* ── 4-step progress stepper (below the dark .app-header) ─────────────
 * Renders four labeled circles connected by a horizontal line. State per
 * step is driven by classes on each <li>:
 *   .is-current — filled blue circle, label in bold
 *   .is-done    — filled blue circle with white checkmark; connector to
 *                 the next step is also blue
 *   .is-todo    — light grey circle with muted number; grey connector
 * Hidden on hero + dealer-admin views via body.on-hero / body.on-account.
 * ─────────────────────────────────────────────────────────────────── */
.progress-stepper {
    background: #fff;
    border-bottom: 1px solid var(--border-grey);
}
.progress-stepper.hidden { display: none; }

.progress-stepper-list {
    list-style: none;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 1rem;
    max-width: 1000px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: start;
}
.progress-stepper-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    min-width: 0;
}
/* Connector line — drawn on every step except the last. Sits behind the
 * marker via z-index. The line spans from the right edge of this step's
 * label area to the left edge of the next step's marker. */
.progress-stepper-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;                 /* vertically centered on a 28px marker */
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: var(--border-grey);
    z-index: 0;
    transition: background-color 200ms ease;
}
.progress-stepper-step.is-done:not(:last-child)::after {
    background: var(--primary-blue);
}

.progress-stepper-marker {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f6;
    border: 2px solid var(--border-grey);
    color: var(--mid-grey);
    font-size: 0.78rem;
    font-weight: 700;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.progress-stepper-num   { line-height: 1; }
.progress-stepper-check { display: none; color: #fff; }

.progress-stepper-step.is-current .progress-stepper-marker {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(30,100,200,0.15);
}
.progress-stepper-step.is-done .progress-stepper-marker {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}
.progress-stepper-step.is-done .progress-stepper-num   { display: none; }
.progress-stepper-step.is-done .progress-stepper-check { display: block; }

.progress-stepper-label {
    font-size: 0.78rem;
    color: var(--mid-grey);
    line-height: 1.25;
    max-width: 14ch;
    word-break: normal;
}
.progress-stepper-step.is-current .progress-stepper-label {
    color: var(--navy-blue);
    font-weight: 700;
}
.progress-stepper-step.is-done .progress-stepper-label {
    color: var(--dark-grey);
    font-weight: 600;
}

@media (max-width: 600px) {
    .progress-stepper-list { padding: 1rem 0.75rem 0.85rem; }
    .progress-stepper-label { font-size: 0.68rem; max-width: 11ch; }
    .progress-stepper-marker { width: 24px; height: 24px; font-size: 0.72rem; }
    .progress-stepper-step:not(:last-child)::after {
        top: 12px; left: calc(50% + 16px); right: calc(-50% + 16px);
    }
}

/* Layout Container — wider than the original 1000px so the customer-search
 * view feels more spacious (per reference design). */
.app-container {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Views specific behaviour */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}
.view-section.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark-grey);
}
.view-subtitle {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    margin-top: 2.5rem;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-grey);
    box-shadow: var(--shadow-sm);
}

/* Forms */
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--dark-grey);
    transition: var(--transition);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(29, 112, 184, 0.2);
}
input:disabled, select:disabled {
    background-color: #f9f9f9;
    color: #999;
    cursor: not-allowed;
}

.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; margin-bottom: 0.5rem; color: var(--dark-grey);
}
.form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
/* Phone group (country-code dropdown + tel input). Fixed 30% of the row;
 * email next to it (flex-1) fills the remaining ~70%. min-width keeps the
 * digits area legible on narrow screens. */
.prefix-group { display: flex; flex: 0 0 30%; min-width: 220px; gap: 0; }
.prefix-group select {
    width: 80px; border-top-right-radius: 0; border-bottom-right-radius: 0;
    border-right: none; background-color: #f9f9f9;
}
.prefix-group input { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Search Box Customization */
.search-box {
    padding: 0; border-color: #ccc; position: relative;
}
.search-input-wrapper {
    display: flex; align-items: center; position: relative; padding: 0.5rem 1rem;
}
.search-icon { width: 20px; height: 20px; margin-right: 10px; }
.search-input-wrapper input {
    border: none; padding: 0.5rem 0; box-shadow: none; font-size: 1rem;
}
.clear-search {
    background: #888; color: white; border: none; width: 20px; height: 20px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 10px; cursor: pointer; visibility: hidden;
}
.clear-search.visible { visibility: visible; }
.search-results {
    background: var(--white);
    border-top: 1px solid var(--border-grey);
    max-height: 400px; overflow-y: auto;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.search-results.hidden { display: none; }
.search-result-item {
    padding: 1.5rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border-grey);
}
.search-result-item:hover { background-color: var(--light-bg); }

/* Elastic Search Grid Results */
.elastic-result-grid {
    display: flex; flex-direction: column; gap: 8px; font-size: 0.95rem;
}
.elastic-row {
    display: grid; grid-template-columns: 80px 1fr; gap: 1rem;
}
.elastic-label {
    color: var(--mid-grey); font-weight: 500;
}
.elastic-value {
    color: var(--black);
}
.results-counter-header {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 0.5rem;
}
/* New-customer mode: hide the account-search portion, leaving only the
   manual-entry fields. Toggled by app.js _applyCustomerViewMode('new'). */
#view-customer.is-new-customer .results-counter-header,
#view-customer.is-new-customer .search-box {
    display: none;
}
.results-count {
    font-size: 0.9rem; color: var(--dark-grey);
}

/* Button Styles — MB editorial: sharp corners, letter-spacing, confident black */
.btn {
    padding: 0.85rem 1.75rem; font-size: 0.9rem; font-weight: 500;
    letter-spacing: 0.08em; text-transform: uppercase;
    border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent;
    transition: var(--transition); text-align: center;
}
.btn-primary { background-color: var(--mb-blue); color: var(--white); }
.btn-primary:hover { background-color: var(--mb-blue-dk); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
/* Loading state — subtle spinner + dim so users see their click registered. */
.btn.is-loading { opacity: 0.75; cursor: progress; }
.btn.is-loading::before {
    content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px;
    vertical-align: -2px; border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff; border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────────────────────
 * Plan service-matrix table — rows are services, columns are mileage intervals,
 * dots mark which services apply at each interval. Mirrors the MBUSA dealer-
 * guide style (screenshot 2).
 * ───────────────────────────────────────────────────────────────────────── */
.plan-service-matrix {
    width: 100%; border-collapse: collapse;
    font-size: 0.9rem; margin-top: 0.75rem;
}
.plan-service-matrix th {
    text-align: left; padding: 0.5rem 0.5rem; font-weight: 600;
    background: #f1f3f5; border-bottom: 2px solid #dcdcdc;
    font-size: 0.85rem; color: #333;
}
.plan-service-matrix th.svc-name-head { width: 60%; }
.plan-service-matrix thead th:not(.svc-name-head) {
    text-align: center; min-width: 60px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.02em;
}
.plan-service-matrix td {
    padding: 0.45rem 0.5rem; border-bottom: 1px solid #eee;
    color: #222;
}
.plan-service-matrix td.svc-name { font-weight: 400; }
.plan-service-matrix td.dot-cell { text-align: center; vertical-align: middle; }
.plan-service-matrix td.dot-cell .dot {
    font-size: 1.4rem; line-height: 1; color: #111;
}
.plan-service-matrix tr:last-child td { border-bottom: none; }

/* Expand/collapse wrapper around the service matrix. Closed by default
 * (except on the preferred plan, which starts expanded). */
.plan-services-block { margin-top: 0.5rem; }
.plan-services-toggle {
    display: flex; align-items: center; gap: 0.5rem;
    width: 100%; padding: 0.65rem 0.85rem;
    background: #f7f8fa; border: 1px solid #e3e6ea; border-radius: 6px;
    color: #1f2937; font-size: 0.88rem; font-weight: 500;
    cursor: pointer; transition: background 0.15s, border-color 0.15s;
    text-align: left;
}
.plan-services-toggle:hover { background: #eef1f5; border-color: #c9d0d8; }
.plan-services-toggle .chevron {
    color: #6b7280; transition: transform 0.2s ease;
    flex-shrink: 0;
}
.plan-services-toggle.expanded .chevron { transform: rotate(90deg); }
.plan-services-summary {
    margin-left: auto; color: #6b7280; font-weight: 400;
    font-size: 0.8rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.plan-services-body {
    overflow-x: auto;    /* handle many columns on narrow cards */
    margin-top: 0.5rem;
}
.plan-services-body.hidden { display: none; }

/* V12-only note shown under the matrix for specific flagship models. */
.plan-v12-note {
    display: flex; gap: 0.5rem; align-items: flex-start;
    margin-top: 0.75rem; padding: 0.6rem 0.75rem;
    background: #fff9e6; border: 1px solid #f0d88c; border-radius: 4px;
    font-size: 0.82rem; color: #5c4a15; line-height: 1.4;
}
.plan-v12-note svg { flex-shrink: 0; margin-top: 2px; color: #a37a00; }

/* Inline retry banner shown when auto-VIN-resolve fails on an existing
 * customer's vehicle. No manual input — just a retry affordance. */
.vin-retry-banner {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.7rem; border-radius: 4px;
    background: #fff1f1; border: 1px solid #f4c4c4;
    font-size: 0.83rem; color: #8a2c2c;
}
.vin-retry-banner .vin-retry-btn {
    padding: 2px 10px; border: 1px solid #c94343;
    background: #fff; color: #8a2c2c; border-radius: 3px;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.vin-retry-banner .vin-retry-btn:hover { background: #c94343; color: #fff; }

/* Non-Mercedes empty state — shown instead of plan cards when vehicle is
 * ineligible for MBUSA prepaid maintenance. */
.plan-not-eligible {
    text-align: center; padding: 3rem 1.5rem; max-width: 480px;
    margin: 2rem auto; background: var(--light-bg, #f8f9fa);
    border: 1px solid #e5e7eb; border-radius: 8px;
}
.plan-not-eligible-icon { color: #94a3b8; margin-bottom: 0.75rem; }
.plan-not-eligible h3 { margin: 0 0 0.5rem; font-size: 1.15rem; color: #1f2937; }
.plan-not-eligible p { margin: 0; color: #6b7280; font-size: 0.95rem; }

.btn-secondary {
    background-color: transparent; border-color: #ccc; color: var(--dark-grey);
}
.btn-secondary:hover { background-color: var(--light-bg); }
.btn-teal {
    background-color: var(--teal-action); color: var(--white);
    font-size: 1.1rem; padding: 1rem;
}
.btn-teal:hover { background-color: var(--teal-hover); }
.btn-black { background-color: var(--black); color: var(--white); }
.btn-black:hover { background-color: #333; }

.action-bar {
    margin-top: 2rem; display: flex; justify-content: flex-end; gap: 1rem;
    padding-top: 1.5rem; border-top: 1px solid var(--border-grey);
}

/* Vehicle Form Details */
.input-with-suffix { position: relative; max-width: 200px; }
.input-with-suffix input { padding-right: 3rem; }
.input-with-suffix .suffix {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: #888;
}
.radio-option { display:flex; align-items:center; gap:10px; margin-bottom:8px; cursor:pointer; }
.radio-option input[type="radio"] { accent-color: var(--primary-blue); }

/* View 3: Plan Selection */
.plan-header-row {
    display: flex; justify-content: space-between; align-items:flex-end;
    border-bottom: 1px solid #ccc; padding-bottom: 10px;
}
.plan-vehicle-summary { font-size: 1.1rem; color: var(--primary-blue); font-weight: 500; }
.plan-card {
    display: flex; border: 1px solid var(--border-grey); border-radius: var(--radius-md);
    margin-bottom: 1.5rem; background-color: var(--white); overflow: hidden;
    position: relative; box-shadow: 0 2px 8px rgba(0,0,0,0.03); transition: var(--transition);
}
.plan-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.plan-card.preferred { border: 2px solid var(--navy-blue); }
.plan-card-badge {
    position: absolute; top: 0; left: 0; background-color: var(--navy-blue);
    color: white; font-size: 0.7rem; font-weight: bold; padding: 4px 12px;
    border-bottom-right-radius: 8px; z-index: 2;
}
.plan-card-details { flex: 3; padding: 1.5rem 1.5rem 1rem; }
.plan-card-details h3 { margin-bottom: 1rem; font-size: 1.2rem; }
.plan-service-list { list-style: none; }
.plan-appt-row { border-bottom: 1px dotted #eaeaea; }
.plan-appt-row:last-child { border-bottom: none; }

.appt-toggle {
    width: 100%; background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0; font-size: 0.9rem; font-family: inherit;
    color: var(--dark-grey); text-align: left;
}
.appt-toggle:hover { color: hsl(var(--hsl-primary)); }
.appt-chevron { flex-shrink: 0; transition: transform 0.2s ease; color: var(--mid-grey); }

.appt-details { list-style: none; padding: 0 0 0.6rem 1.5rem; margin: 0; }
.appt-details.hidden { display: none; }
.appt-detail-item {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.82rem; color: var(--mid-grey); padding: 0.25rem 0;
}
.appt-detail-item svg { flex-shrink: 0; stroke: #22c55e; }
.plan-card-price {
    flex: 1; border-left: 1px dashed var(--border-grey); padding: 1.5rem;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
    background-color: #fafafa;
}
.price-value {
    font-size: 2.2rem; font-weight: bold; color: var(--black); line-height: 1; margin: 0.5rem 0 1rem;
}
/* Discount treatment on the plan card. Shown only when the dealer's
 * configured discount actually applies (after silent cap enforcement). */
.price-original {
    font-size: 1.1rem;
    color: var(--mid-grey);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    line-height: 1;
    margin-top: 0.5rem;
}
.price-discount-chip {
    display: inline-block;
    background: rgba(14, 138, 58, 0.10);
    color: var(--success-green);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.01em;
    margin: 0.35rem 0 0.25rem;
}
.price-value--discounted {
    color: var(--mb-black);
    margin-top: 0.15rem;
}
.inflation-tag { font-size: 0.75rem; color: var(--mid-grey); display:flex; align-items:center; gap:4px; }

/* Review & Pay — Discount row */
.summary-row--discount { color: var(--success-green); }
.summary-row--discount.hidden { display: none; }

/* Review & Pay — Promo code entry */
.summary-promo-entry { display: flex; gap: 0.5rem; }
.summary-promo-input {
    flex: 1 1 auto; min-width: 0;
    height: 34px; padding: 0 0.6rem;
    border: 1px solid var(--border-grey); border-radius: var(--radius-md);
    font-size: 0.85rem; text-transform: uppercase;
}
.summary-promo-input:focus {
    outline: none; border-color: var(--mb-blue);
    box-shadow: 0 0 0 3px rgba(0, 120, 214, 0.2);
}
.summary-promo-apply {
    flex: 0 0 auto;
    /* Match the code input's box exactly: same height, vertically centered label. */
    height: 34px; padding: 0 0.9rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.summary-promo-applied {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; font-size: 0.85rem;
}
.summary-promo-applied.hidden, .summary-promo-entry.hidden { display: none; }
.summary-promo-tag { color: var(--success-green); }
.summary-promo-remove {
    background: none; border: none; cursor: pointer; padding: 0;
    color: var(--mid-grey); font-size: 0.8rem; text-decoration: underline;
}
.summary-promo-msg { margin: 0.4rem 0 0; font-size: 0.78rem; }
.summary-promo-msg.hidden { display: none; }
.summary-promo-msg--err { color: #8a2c2c; }

/* OTP channel choice (email vs text) */
/* This app has NO global `.hidden { display:none }` (see the note near #section-dashboard) — every
   hidden toggle is scoped. Scope the OTP two-step + its error boxes so the inactive step stays hidden. */
#otp-channel-choice.hidden, #otp-code-step.hidden { display: none; }
#otp-verify-btn.hidden { display: none; }
#view-otp .account-error.hidden { display: none; }
.otp-channel-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.5rem; }
.otp-channel-btn {
    display: flex; align-items: center; gap: 0.75rem; width: 100%;
    padding: 0.85rem 1rem; text-align: left; cursor: pointer;
    background: var(--white); border: 1px solid var(--border-grey); border-radius: var(--radius-md);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.otp-channel-btn:hover:not(:disabled) {
    border-color: var(--mb-blue); box-shadow: 0 0 0 3px rgba(0, 120, 214, 0.12);
}
.otp-channel-btn:disabled, .otp-channel-btn.is-disabled {
    opacity: 0.5; cursor: not-allowed; background: #f6f6f6;
}
.otp-channel-btn.is-sending { opacity: 0.7; cursor: progress; }
.otp-channel-icon { font-size: 1.35rem; line-height: 1; flex: 0 0 auto; }
.otp-channel-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.otp-channel-label { font-weight: 600; font-size: 0.95rem; }
.otp-channel-dest { font-size: 0.82rem; color: var(--mid-grey); }
#otp-change-channel { white-space: nowrap; }

/* Available offers list (ecom-style discoverable coupons) */
.summary-offers { margin-top: 0.6rem; }
.summary-offers.hidden { display: none; }
.summary-offers-title {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--mid-grey); margin-bottom: 0.35rem;
}
.summary-offers-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.summary-offer {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px dashed var(--mb-blue); border-radius: var(--radius-md);
    background: var(--blue-25, #f4f9fe);
}
.summary-offer-info { display: flex; flex-direction: column; min-width: 0; }
.summary-offer-code { font-weight: 700; font-size: 0.83rem; color: var(--mb-black); letter-spacing: 0.02em; }
.summary-offer-desc { font-size: 0.75rem; color: var(--mid-grey); }
.summary-offer-apply {
    flex: 0 0 auto; background: none; border: none; cursor: pointer;
    color: var(--mb-blue); font-weight: 700; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.04em; padding: 0.2rem 0.3rem;
}
.summary-offer-apply:hover { text-decoration: underline; }

/* View 4: Checkout */
.checkout-page-header { margin-bottom: 0.55rem; }
.checkout-page-header .view-title { margin-bottom: 0.1rem; }
.checkout-subtitle { font-size: 0.82rem; color: var(--mid-grey); }

.checkout-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: stretch; }
@media (max-width: 768px) { .checkout-grid { grid-template-columns: 1fr; align-items: start; } }

/* Stack the left cards with their normal gaps (no big spread), but grow the
   last card so its bottom lines up with the Order Summary's bottom — the first
   card's top already aligns. On mobile the column is content-height, so the
   grow is a harmless no-op. */
.checkout-details-column { display: flex; flex-direction: column; }
.checkout-details-column > .checkout-card:last-child { flex: 1 1 auto; }

/* Make the right column match the left column's height. The right column
   has a single card, so we let the column flex and the card grow to fill. */
.checkout-summary-column { display: flex; flex-direction: column; }
#view-checkout .order-summary-card { flex: 1 1 auto; display: flex; flex-direction: column; height: 100%; }
/* Push the billing block (and the divider right above it) to the bottom of
   the column. Totals stay anchored at the top, action sits at the bottom. */
#view-checkout .order-summary-card > .summary-divider:has(+ .summary-billing-block) {
    margin-top: auto;
}

/* Compact card padding inside the checkout/payment views */
#view-checkout .checkout-card,
#view-payment .checkout-card { padding: 0.7rem 1rem; }
#view-checkout .checkout-card.mt-3,
#view-payment .checkout-card.mt-3 { margin-top: 0.5rem !important; }

/* Compact billing-address form in checkout */
#view-checkout .form-group { margin-bottom: 0.4rem; }
#view-checkout .form-row { margin-bottom: 0; gap: 0.6rem; }
#view-checkout .form-group label { margin-bottom: 0.2rem; }
#view-checkout input[type="text"] { padding: 0.5rem 0.6rem; font-size: 0.88rem; }

/* Vertical squeeze: trim the stock utility margins so the page fits the
   viewport without scrolling. */
#view-checkout .order-summary-card .mb-3 { margin-bottom: 0.55rem !important; }
#view-checkout .order-summary-card .mb-2 { margin-bottom: 0.3rem !important; }
#view-checkout .order-summary-card h3.mb-3 { margin-bottom: 0.5rem !important; }
#view-checkout .checkout-card .mt-3 { margin-top: 0.5rem !important; }
#view-checkout .cart-cust-mask-note,
#view-checkout #cart-cust-mask-note { margin-top: 0.4rem !important; padding-top: 0.4rem !important; }

.checkout-card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0; padding-bottom: 0.4rem; border-bottom: 1px solid #f0f0f0; }
.checkout-card-header h3 { font-size: 0.92rem; font-weight: 700; color: var(--navy-blue); margin: 0; }
.checkout-card-header svg { stroke: var(--primary-blue); flex-shrink: 0; }

/* Detail grid inside cards */
.checkout-detail-grid { display: flex; flex-direction: column; gap: 0.3rem; }
#view-checkout .checkout-detail-grid.mt-3,
#view-payment .checkout-detail-grid.mt-3 { margin-top: 0.45rem !important; }
.checkout-detail-row { display: grid; grid-template-columns: 130px 1fr; font-size: 0.88rem; }
.checkout-detail-label { color: var(--mid-grey); font-weight: 500; }
.checkout-detail-value { color: var(--dark-grey); font-weight: 500; }
.checkout-detail-value.mono { font-family: monospace; letter-spacing: 0.04em; }

.edit-link { color: var(--primary-blue); font-size: 0.82rem; text-decoration: none; }
.edit-link:hover { text-decoration: underline; }
.mileage-badge { background-color: #e3effc; color: #1a5691; padding: 2px 8px; border-radius: 4px; font-weight: bold; font-size: 0.88rem; }

/* Plan details in cart */
.cart-plan-name { font-size: 1rem; font-weight: 700; color: var(--dark-grey); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.cart-appt-list { list-style: none; padding: 0; margin: 0; }
.cart-appt-row { border-bottom: 1px dotted #e8e8e8; }
.cart-appt-row:last-child { border-bottom: none; }

/* Order summary right card. No longer sticky now that the billing-address
   form is nested inside it — the column is roughly as tall as the left
   column, so sticking it would just freeze the whole panel above the fold. */
.order-summary-card { background: #fcfcfc; }
.summary-billing-block .form-group { margin-bottom: 0.5rem; }
.summary-billing-block .form-row { gap: 0.5rem; margin-bottom: 0; }
.summary-billing-block .form-group label { margin-bottom: 0.2rem; }
.summary-billing-block input[type="text"] { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
.summary-plan-block { background: var(--light-grey); border-radius: var(--radius-sm); padding: 0.55rem 0.85rem; }
.summary-plan-name { font-size: 0.8rem; font-weight: 700; color: var(--mid-grey); text-transform: uppercase; letter-spacing: 0.5px; }
.summary-divider { height: 1px; background-color: var(--border-grey); }
.border-top { border-top: 1px solid var(--border-grey); padding-top: 1rem; }
.border-bottom { border-bottom: 1px solid var(--border-grey); }
.lock-icon { display: inline-block; vertical-align: middle; margin-right: 4px; margin-top: -2px; }
.payment-card-icons { display: flex; justify-content: center; gap: 0.4rem; }
.card-icon-badge { font-size: 0.7rem; font-weight: 700; border: 1px solid #d1d5db; border-radius: 4px; padding: 2px 6px; color: var(--mid-grey); letter-spacing: 0.5px; }

/* ── Inline payment failure banner (lives inside view-payment) ── */
.payment-error-banner {
    display: flex; align-items: flex-start; gap: 0.6rem;
    padding: 0.7rem 0.85rem; border-radius: 8px;
    font-size: 0.85rem; line-height: 1.4;
    background: #fdecec; border: 1px solid #f3b8b8; color: #8a1a1a;
}
.payment-error-banner.hidden { display: none; }
.payment-error-banner svg { flex-shrink: 0; margin-top: 1px; }
.payment-error-banner strong { font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── view-payment: 2-column layout — order recap on left, embedded
   PayIsland iframe on right. Falls back to "open in new tab" if framing
   is blocked. ── */
.payment-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 1.25rem;
    align-items: stretch;
}
@media (max-width: 900px) {
    .payment-grid { grid-template-columns: 1fr; }
}
.payment-recap-column { display: flex; flex-direction: column; }
.payment-frame-column { display: flex; flex-direction: column; }
.payment-frame-card {
    flex: 1 1 auto;
    display: flex; flex-direction: column;
    padding: 0; overflow: hidden;
    min-height: 620px;
}

/* Plan-name block on the left column's plan card */
.pay-plan-name-block {
    font-size: 1rem; font-weight: 700; color: var(--dark-grey);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.payment-prepare {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.7rem; width: 100%;
    padding: 3rem 1.5rem; text-align: center;
    flex: 1 1 auto; justify-content: center;
}
.payment-prepare.hidden { display: none; }
.payment-prepare p { margin: 0; font-size: 0.9rem; color: var(--mid-grey); }

/* Calm "open in a new tab" escape hatch shown under the payment iframe. */
.payment-frame-help {
    margin: 0.6rem 0 0; text-align: center;
    font-size: 0.85rem; color: var(--mid-grey);
}
.payment-frame-help.hidden { display: none; }
.payment-frame-help a { color: var(--primary-blue); }

/* "Email a secure payment link" CTA — sits just under PROCEED TO PAY in the
   checkout summary column, so the dealer can send the link without opening the
   pay frame. */
.pay-link-cta { padding: 0.5rem 0 0; text-align: center; }
.pay-link-cta .pay-link-btn { width: 100%; justify-content: center; }
.pay-link-btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    border: 1px solid var(--mb-blue); background: var(--white);
    color: var(--primary-blue); font-family: inherit; font-size: 0.85rem; font-weight: 600;
    padding: 0.5rem 0.95rem; border-radius: var(--radius-md);
    cursor: pointer; transition: var(--transition);
}
.pay-link-btn:hover { background: #eef3fb; }
.pay-link-btn:disabled { opacity: 0.55; cursor: default; }
.pay-link-btn svg { flex: none; }
.pay-link-sent {
    margin: 0.55rem auto 0; max-width: 34ch; line-height: 1.4;
    font-size: 0.82rem; color: var(--success-green);
}
.pay-link-sent.is-error { color: #b0203a; }


.payment-spinner {
    width: 26px; height: 26px;
    border: 3px solid #e3effc; border-top-color: var(--primary-blue);
    border-radius: 50%; animation: spin 0.9s linear infinite;
}
.payment-spinner-sm { width: 14px; height: 14px; border-width: 2px; }

/* Embedded PayIsland iframe — fills the right column of the payment grid.
   The payment URL resolves server-side to the payisland host (no
   X-Frame-Options), so it frames directly; a calm #payment-frame-help link
   sits beneath it as an "open in a new tab" escape hatch. */
.payment-iframe {
    width: 100%; flex: 1 1 auto; min-height: 620px;
    border: 0; display: block; background: #fff;
}
.payment-iframe.hidden { display: none; }
@media (max-width: 900px) { .payment-iframe { min-height: 520px; } }

/* "Not your account?" hint — sits just under the "If this is your account..."
   description on view-customer-vehicles. Subtle so it doesn't compete with
   the primary action (selecting a vehicle), but visible enough that someone
   who hit the wrong account can self-correct without going through support. */
.cv-not-yours-hint {
    font-size: 0.85rem;
    color: var(--mid-grey);
    margin: -0.4rem 0 1rem 0;
}
.cv-not-yours-hint a {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
}
.cv-not-yours-hint a:hover { text-decoration: none; }

/* ── view-customer-vehicles: Customer Info Card ── */
.cv-customer-info { display: flex; flex-direction: column; gap: 0.5rem; }
.cv-info-row { display: grid; grid-template-columns: 80px 1fr; gap: 1rem; font-size: 0.95rem; }
.cv-info-label { color: var(--mid-grey); font-weight: 500; }
.cv-info-value { font-family: monospace; letter-spacing: 0.03em; color: var(--black); }


/* ── Existing vehicle selection cards ─────────────────────────────────────
   Same visual language as .plan-card on view-plans:
     • 1px light grey border, white card body, soft elevation shadow
     • A 3-fr / 1-fr split when expanded, with a dashed vertical divider
     • Right column has a soft #fafafa wash (matches .plan-card-price)
     • No dark navy borders or accent rails */
.cv-vehicle-cards-container { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.cv-vehicle-card {
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    user-select: none;
}
.cv-vehicle-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Collapsed view — visible only on cards that aren't currently selected.
   Sits in one row: vehicle name on the left, checkmark slot on the right. */
.cv-vehicle-card .cv-vehicle-card-collapsed {
    padding: 1.1rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
}
.cv-vehicle-card.selected .cv-vehicle-card-collapsed { display: none; }

/* Expanded view — only on the selected card. Single column; sections stack
   vertically: vehicle name → VIN entry → MILEAGE entry → caption. */
.cv-vehicle-card-expanded { display: none; }
.cv-vehicle-card.selected .cv-vehicle-card-expanded { display: block; }

.cv-vehicle-eyebrow {
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--mid-grey);
    margin-bottom: 0.4rem;
}

.cv-vehicle-details {
    padding: 1.5rem 1.5rem 1.25rem;
}
.cv-vehicle-title {
    margin: 0 0 1.1rem;
    font-size: 1.2rem; font-weight: 700;
    color: var(--dark-grey); letter-spacing: 0.1px;
}
/* Mileage "read me first" callout — soft tinted box + blue accent bar so the
   eye lands on it before the mileage input. Used on both the returning-customer
   screen and the new-vehicle form. */
.mileage-note {
    margin: 0.9rem 0 0;
    padding: 0.7rem 0.9rem;
    background: var(--light-bg);
    border-left: 3px solid var(--mb-black);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--dark-grey);
    line-height: 1.5;
}
.mileage-note strong { color: var(--mb-black); font-weight: 700; }

/* Mileage section — sits inline under the VIN input. Same compact label as
   the VIN section so they read as a vertically-stacked pair. */
.cv-mileage-entry-block {
    margin-top: 1rem;
}
.cv-mileage-entry-block .cv-vehicle-eyebrow {
    margin-bottom: 0.45rem;
}

.cv-vehicle-card-check { color: var(--primary-blue); flex-shrink: 0; }
.cv-vehicle-card-check.hidden { display: none; }

/* ── Mileage entry inside vehicle card ── */
/* ── VIN display / entry inside vehicle card ── */
.cv-vin-display { font-size: 0.85rem; color: var(--mid-grey); margin-bottom: 0.75rem; }
.cv-vin-hint { font-size: 0.8rem; color: var(--mid-grey); margin-bottom: 0.5rem; }
.cv-vin-value { font-family: monospace; letter-spacing: 0.05em; color: var(--dark-grey); }
.cv-vin-entry { margin-bottom: 0.75rem; }
.cv-vin-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--mid-grey); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.35rem; }
.cv-vin-input { width: 100%; padding: 0.55rem 0.75rem; border: 1.5px solid #cbd5e1; border-radius: var(--radius-sm); font-size: 0.9rem; font-family: monospace; letter-spacing: 0.05em; text-transform: uppercase; box-sizing: border-box; outline: none; }
.cv-vin-input:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(30,100,200,0.1); }
.cv-vin-status { font-size: 0.78rem; color: var(--mid-grey); margin-top: 0.4rem; min-height: 1em; }
.cv-vin-status:empty { display: none; }
.cv-vin-entry.hidden { display: none; }

.cv-mileage-entry { margin-top: 1rem; }
.cv-mileage-entry.hidden { display: none; }

/* Mileage label — small all-caps cue above the input, like a spec sheet */
.cv-mileage-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--mid-grey);
    margin-bottom: 0.45rem;
}

.cv-mileage-input-row { display: flex; align-items: center; gap: 0.5rem; }
.cv-mileage-input {
    flex: 1; padding: 0.6rem 0.85rem;
    border: 1px solid #cbd5e1; border-radius: var(--radius-sm);
    font-size: 1rem; font-family: inherit;
    font-variant-numeric: tabular-nums;             /* odometer-style */
    letter-spacing: 0.5px;
    outline: none;
}
.cv-mileage-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30,100,200,0.1);
}
.cv-mileage-suffix { font-size: 0.85rem; color: var(--mid-grey); font-weight: 600; letter-spacing: 0.5px; }

/* Helper note — sits BELOW the input now, with a thin left rail and a
   subtle two-tone treatment (label in dark, body in muted). No yellow/red,
   nothing alarming — just a pro-grade tip. */
.cv-mileage-note {
    display: flex; align-items: flex-start; gap: 0.6rem;
    margin-top: 0.55rem;
    padding: 0.4rem 0 0.4rem 0.85rem;
    border-left: 2px solid var(--border-grey);
    font-size: 0.78rem;
    color: var(--mid-grey);
    line-height: 1.55;
}
.cv-mileage-note svg {
    flex-shrink: 0; margin-top: 2px;
    stroke: var(--mid-grey); opacity: 0.85;
}
.cv-mileage-note .cv-mileage-note-title {
    display: block;
    color: var(--navy-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
}

/* ── Model search input ── */
.model-search-wrapper { position: relative; }
.model-search-wrapper .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; }
#model-search-input { width: 100%; padding: 0.6rem 0.75rem 0.6rem 2.25rem; border: 1px solid var(--border-grey); border-radius: var(--radius-sm); font-size: 0.9rem; box-sizing: border-box; }
#model-search-input:focus { outline: none; border-color: var(--primary-blue); }

/* ── Model selection grid ── */
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--border-grey); border-radius: var(--radius-sm); overflow: hidden; margin-top: 0.5rem; }
.model-tile { padding: 0.55rem 0.75rem; font-size: 0.875rem; cursor: pointer; border-right: 1px solid var(--border-grey); border-bottom: 1px solid var(--border-grey); color: var(--dark-grey); transition: var(--transition); }
.model-tile:nth-child(3n) { border-right: none; }
.model-tile:hover { background-color: #f0f6fd; color: var(--primary-blue); }
.model-tile.selected { background-color: var(--primary-blue); color: var(--white); font-weight: 600; }
.model-tile.hidden { display: none; }
/* Collapsed-to-selection: only the chosen model shows, full-width, styled
   like the neutral Make/Year fields above (not the blue selected state). */
.model-grid--collapsed { grid-template-columns: 1fr; }
.model-grid--collapsed .model-tile,
.model-grid--collapsed .model-tile.selected {
    background-color: var(--white);
    color: var(--dark-grey);
    font-weight: 400;
    border-right: none;
    border-bottom: none;
}
.model-grid-head { display: flex; align-items: center; justify-content: space-between; }
.model-change-link { font-size: 0.8rem; color: var(--primary-blue); cursor: pointer; text-decoration: none; }
.model-change-link:hover { text-decoration: underline; }
@media (max-width: 600px) { .model-grid { grid-template-columns: repeat(2, 1fr); } .model-tile:nth-child(3n) { border-right: 1px solid var(--border-grey); } .model-tile:nth-child(2n) { border-right: none; } }

/* ── Make radio tabs (view-vehicle) ── */
.make-radio-tabs { display: flex; border: 1px solid #ccc; border-radius: var(--radius-sm); overflow: hidden; }
.make-tab {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 0.65rem 0.75rem; font-size: 0.875rem; font-weight: 500;
    color: var(--mid-grey); background-color: var(--white);
    cursor: pointer; border-right: 1px solid #ccc; text-align: center;
    transition: var(--transition);
}
.make-tab:last-child { border-right: none; }
.make-tab input[type="radio"] { display: none; }
.make-tab:hover { background-color: var(--light-bg); color: var(--dark-grey); }
.make-tab.active { background-color: var(--black); color: var(--white); font-weight: 600; }


/* ═════════════════════════════════════════════════════════════════════════
 * HERO LANDING PAGE — translated from Claude Design "Hero Page.html"
 *
 * The hero owns its own dark MB header and full-bleed photographic
 * background. While the hero view is active, body.on-hero hides the global
 * .app-header / .progress-stepper and removes the .app-container's max-width
 * + padding so the hero can go edge-to-edge.
 * ═════════════════════════════════════════════════════════════════════════ */

/* When hero is active, suppress global chrome and let the view be full-bleed.
 * The hero is sized to fit a single viewport so the user never has to scroll
 * (header + hero + stats strip = exactly 100vh on a normal desktop window). */
body.on-hero .app-header { display: none; }
body.on-hero .progress-stepper,
body.on-account .progress-stepper { display: none; }
body.on-hero .app-container { max-width: none; margin: 0; padding: 0; }
body.on-hero, body.on-hero html { background: var(--mb-black); height: 100%; overflow: hidden; }
.view-hero { animation: none !important; }   /* skip fade-in for landing */
.view-hero.active {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Hero local design tokens (scoped, don't leak to other views) ─────── */
.view-hero {
    --hero-ink:        #1a1d20;
    --hero-ink-2:      #4a5159;
    --hero-ink-3:      #7a828b;
    --hero-paper:      #fafaf8;
    --hero-line:       #e6e3dd;
    --hero-line-stg:   #c9c4ba;
    --hero-accent:     var(--mb-blue, #0078d6);
    --hero-serif:      "Playfair Display", "Georgia", serif;
    --hero-sans:       "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --hero-mono:       "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--hero-ink);
    background: var(--hero-paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Hero's own dark MB header ────────────────────────────────────────── */
.view-hero .mb-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 30;
    height: 64px;
    /* Light bar matching the bottom stats strip (was black). */
    background: #fcfbf8;
    border-bottom: 1px solid var(--hero-line);
    color: var(--hero-ink);
}
.view-hero .mb-logo {
    height: 36px;
    width: auto;
    max-width: 220px;
    display: block;
    object-fit: contain;
}
.view-hero .mb-storefront-name {
    font-family: var(--hero-serif);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--hero-ink);
}
.view-hero .hero-signin-bar {
    max-width: 1640px;
    margin: 0 auto;
    padding: 10px 32px;
    text-align: right;
}
.view-hero .hero-signin-bar a {
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--hero-ink-3);
    text-decoration: none;
    cursor: pointer;
}
.view-hero .hero-signin-bar a:hover { text-decoration: underline; }
.view-hero .mb-header-inner {
    height: 100%;
    max-width: 1640px;
    margin: 0 auto;
    padding: 0 32px;
    /* 3 columns so the logo + name sit dead-center while the sign-in link stays top-right. */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}
.view-hero .mb-header-side { display: flex; align-items: center; }
.view-hero .mb-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.view-hero .mb-header-left { display: flex; align-items: center; gap: 36px; }
.view-hero .mb-star { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; }
.view-hero .mb-nav { display: flex; gap: 28px; }
.view-hero .mb-nav a, .view-hero .mb-link {
    color: #fff;
    font-size: 13px;
    letter-spacing: 0.02em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.92;
    transition: opacity 120ms ease;
}
.view-hero .mb-nav a:hover, .view-hero .mb-link:hover { opacity: 1; }
.view-hero .mb-header-right { display: flex; gap: 24px; justify-self: end; }
.view-hero .mb-link-ico { font-size: 14px; opacity: 0.75; }
/* Header is now light — links must be dark, not white. */
.view-hero .mb-header .mb-link { color: var(--hero-ink-2, #3a3a3a); }

/* ── Hero section: full-bleed photo + scrim ──────────────────────────── */
.view-hero .hero {
    position: relative;
    flex: 1 1 auto;            /* fill the space between header and strip */
    min-height: 0;             /* allow flex shrink */
    padding-top: 64px;         /* leave room for the absolutely-positioned header */
    overflow: hidden;
    background: #1a1d20;
}
.view-hero .hero-bg { position: absolute; inset: 0; z-index: 0; }
.view-hero .hero-bg--ink {
    background:
        radial-gradient(120% 70% at 50% 60%, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0) 55%),
        linear-gradient(180deg, #1a1d22 0%, #0a0c10 100%);
}
.view-hero .hero-photo {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.view-hero .hero-scrim {
    position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.55) 25%, rgba(0,0,0,0.15) 48%, rgba(0,0,0,0.05) 60%, rgba(0,0,0,0.35) 100%),
        linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.35) 100%);
    pointer-events: none;
}

.view-hero .hero-grid {
    position: relative;
    z-index: 2;
    height: 100%;
    max-width: 1640px;
    margin: 0 auto;
    padding: 36px 48px 28px;            /* tightened so we fit in 100vh */
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(300px, 380px);
    gap: 36px;
    align-items: center;
}
.view-hero .hero-spacer { display: none; }

/* ── Left card: glass benefits tile ───────────────────────────────────── */
.view-hero .benefits-tile {
    position: relative;
    z-index: 2;
    max-width: 580px;
    color: #f6f4ef;
    background: linear-gradient(180deg, rgba(15,17,20,0.62) 0%, rgba(15,17,20,0.52) 100%);
    backdrop-filter: blur(18px) saturate(1.05);
    -webkit-backdrop-filter: blur(18px) saturate(1.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 3px;
    padding: 28px 32px 28px;
    box-shadow:
        0 30px 80px -30px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.08);
}
.view-hero .bt-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--hero-mono);
    font-size: 14.4px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(246,244,239,0.85);
    margin-bottom: 16px;
}
.view-hero .bt-eyebrow-rule {
    width: 28px;
    height: 1px;
    display: inline-block;
    background: var(--hero-accent);
}
.view-hero .bt-headline {
    font-family: var(--hero-serif);
    font-weight: 600;
    font-size: clamp(26px, 2.4vw, 36px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    text-wrap: balance;
    color: #fff;
    max-width: 16ch;
}
.view-hero .bt-sub {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(246,244,239,0.82);
    margin: 0 0 18px;
    max-width: 52ch;
}
.view-hero .bt-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.14);
    padding-top: 16px;
}
.view-hero .bt-point {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 14px;
    align-items: start;
}
.view-hero .bt-marker-col {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 2px;
}
.view-hero .bt-text-col { min-width: 0; }
.view-hero .bt-title {
    font-family: var(--hero-sans);
    font-weight: 600;
    font-size: 14.5px;
    color: #fff;
    letter-spacing: -0.005em;
    margin-bottom: 2px;
}
.view-hero .bt-body {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(246,244,239,0.78);
}
.view-hero .bt-mark--bar {
    display: block;
    width: 3px;
    height: 28px;
    border-radius: 1px;
    margin-top: 1px;
    background: var(--hero-accent);
}

/* ── Right card: Start Exploring Plans tile ───────────────────────────── */
.view-hero .tile { border-radius: 4px; position: relative; }
.view-hero .explore-tile {
    background: #ffffff;
    padding: 32px 40px 36px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
    border-radius: 2px;
}
.view-hero .explore-title {
    text-align: center;
    font-family: var(--hero-sans);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.15;
    color: var(--hero-ink);
    margin-bottom: 22px;
}
.view-hero .explore-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.view-hero .explore-or {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--hero-ink);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
    padding: 16px 0;
}
.view-hero .primary-btn,
.view-hero .secondary-btn {
    appearance: none;
    border: none;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    font-family: var(--hero-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, color 120ms ease, filter 120ms ease;
}
.view-hero .primary-btn {
    color: #fff;
    background: var(--hero-accent);
}
.view-hero .primary-btn:hover { filter: brightness(1.08); }
.view-hero .secondary-btn {
    color: var(--hero-ink);
    background: #e6e5e3;
}
.view-hero .secondary-btn:hover { background: var(--hero-ink); color: #fff; }

/* ── Stats strip below the hero ───────────────────────────────────────── */
.view-hero .strip {
    background: #fcfbf8;
    border-top: 1px solid var(--hero-line);
    border-bottom: 1px solid var(--hero-line);
}
.view-hero .strip-inner {
    max-width: 1640px;
    margin: 0 auto;
    padding: 14px 32px;
    display: grid;
    grid-template-columns: 1fr 1px 1fr 1px 1fr 1px 1fr;
    gap: 24px;
    align-items: center;
}
.view-hero .strip-rule {
    height: 36px;
    background: var(--hero-line);
    width: 1px;
}
.view-hero .strip-item { text-align: center; }
.view-hero .strip-num {
    font-family: var(--hero-serif);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.view-hero .strip-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hero-ink-3);
    margin-top: 3px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 820px) {
    .view-hero .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        align-content: end;
        gap: 32px;
        padding: 80px 32px 40px;
    }
    .view-hero .hero { height: auto; min-height: 0; padding-bottom: 32px; }
}
@media (max-width: 700px) {
    .view-hero .mb-nav { display: none; }
    .view-hero .strip-inner { grid-template-columns: 1fr 1fr; }
    .view-hero .strip-rule { display: none; }
}


/* ═════════════════════════════════════════════════════════════════════════
 * DEALER ACCOUNT VIEW — UI-only mock-auth + dealer pricing settings.
 *
 * Two states inside #view-account, toggled by .hidden on
 *   .account-signedout  →  Sign-in card
 *   .account-signedin   →  Identity strip + config form
 *
 * Reuses the global :root tokens (--mb-blue, --mb-black, --border-grey,
 * --light-bg, etc.). No values from this view feed into pricing logic yet.
 * ═════════════════════════════════════════════════════════════════════════ */
/* Billing-address validation banner shown when "Proceed to Pay" is clicked
 * with required fields empty. Lives at the top of the Billing Address card. */
.billing-error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    margin-top: 0.5rem;
    margin-bottom: 0.6rem;
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: #8a2c2c;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.35;
}
.billing-error.hidden { display: none; }
.billing-error svg { flex-shrink: 0; margin-top: 2px; color: #c94343; }

/* Inputs flagged as missing — soft red ring + tinted background.
 * Cleared automatically when the user starts typing into them. */
input.input-invalid,
select.input-invalid {
    border-color: #c94343 !important;
    background: #fdecea;
    box-shadow: 0 0 0 3px rgba(201, 67, 67, 0.10);
}

/* Always-visible "Back to home" link at the top of #view-account.
 * Subtle by default, picks up the brand blue on hover. Sits above both
 * the signed-out and signed-in blocks. */
#view-account .account-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--mid-grey);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.4rem 0.5rem 0.4rem 0.25rem;
    margin: 0.5rem 0 1rem;
    border-radius: var(--radius-sm);
    transition: color 120ms ease, background 120ms ease, transform 120ms ease;
}
#view-account .account-back-link:hover {
    color: var(--mb-blue);
    background: rgba(0, 120, 212, 0.06);
}
#view-account .account-back-link:hover svg {
    transform: translateX(-2px);
}
#view-account .account-back-link svg {
    transition: transform 120ms ease;
}

#view-account .account-card {
    background: var(--white);
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.4rem;
}
#view-account .account-signin-card {
    max-width: 440px;
    margin: 4rem auto;
    text-align: center;
}
#view-account .account-mb-mark {
    display: grid; place-items: center;
    color: var(--mb-black);
    margin-bottom: 1rem;
}
#view-account .account-title {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--mb-black);
    margin: 0 0 0.25rem;
    letter-spacing: -0.005em;
}
#view-account .account-sub {
    color: var(--mid-grey);
    font-size: 0.82rem;
    margin: 0 0 0.75rem;
    line-height: 1.45;
}
#view-account .account-hint {
    color: var(--mid-grey);
    font-size: 0.78rem;
    margin: 1.25rem 0 0;
    line-height: 1.45;
}

/* Unauthorized banner — shown on the signed-out card when the SAML
 * assertion was valid but the user isn't in saml/acl.json. */
#view-account .account-unauthorized-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    text-align: left;
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: #8a2c2c;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin: 0 0 1.25rem 0;
    font-size: 0.88rem;
    line-height: 1.45;
}
#view-account .account-unauthorized-banner.hidden { display: none; }
#view-account .account-unauthorized-banner svg { flex-shrink: 0; color: #c94343; margin-top: 1px; }
#view-account .account-unauthorized-text strong { display: block; margin-bottom: 0.2rem; font-weight: 700; }
#view-account .account-unauthorized-text em { font-style: normal; font-weight: 600; }
#view-account .account-unauthorized-signout {
    display: inline-block;
    margin-top: 0.6rem;
    background: none;
    border: 1px solid #c94343;
    color: #8a2c2c;
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
#view-account .account-unauthorized-signout:hover { background: #c94343; color: #fff; }

/* Google sign-in button — matches Google's official styling (white,
 * 1px #dadce0 border, 4px radius, ~44px tall, monochrome G logo). */
#view-account .google-signin-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%;
    height: 44px;
    padding: 0 20px;
    background: var(--white);
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
#view-account .google-signin-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.18), 0 1px 3px 1px rgba(60,64,67,0.10);
}
#view-account .google-signin-btn[disabled] { opacity: 0.7; cursor: progress; }
#view-account .google-signin-btn .google-signin-label { white-space: nowrap; }

/* Signed-in state: sidebar nav on the left, content pane on the right.
 * Sidebar is intentionally NOT a card — it sits transparently on the page
 * background so it doesn't visually compete with the cards in the main pane.
 * Sticky positioning keeps the nav in view as the main pane scrolls. */
#view-account .account-signedin { margin: 1.25rem 0; }
#view-account .account-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
}
#view-account .account-side-nav {
    background: transparent;
    border: none;
    padding: 0.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 1rem;
}

/* User mini-card at the top of the sidebar. No border — uses padding + bg
 * to feel grouped but understated. */
#view-account .account-side-nav .account-id-strip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--white);
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.7rem;
    margin: 0;
}

#view-account .account-sidenav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0;
    border: none;
}
#view-account .account-sidenav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--dark-grey);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background .12s ease, color .12s ease;
}
#view-account .account-sidenav-item svg {
    flex-shrink: 0;
    color: var(--mid-grey);
}
#view-account .account-sidenav-item:hover { background: rgba(0, 0, 0, 0.04); }
#view-account .account-sidenav-item.is-active {
    background: var(--mb-black);
    color: var(--white);
}
#view-account .account-sidenav-item.is-active svg { color: var(--white); }
#view-account .account-signout-link--bottom {
    margin-top: 0.4rem;
    padding: 0.6rem 0.7rem 0;
    border-top: 1px solid var(--border-grey);
    font-size: 0.8rem;
    color: var(--mb-blue);
    text-decoration: none;
}
#view-account .account-signout-link--bottom:hover { text-decoration: underline; }

#view-account .account-main {
    min-width: 0;   /* prevent grid blowout from long table content */
}
#view-account .account-section.hidden { display: none; }
#view-account .account-page-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--mb-black);
    margin: 0 0 1rem;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

@media (max-width: 820px) {
    #view-account .account-layout { grid-template-columns: 1fr; }
    #view-account .account-side-nav { position: static; }
}
#view-account .account-grid {
    display: grid;
    grid-template-columns: minmax(320px, 380px) 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 900px) {
    #view-account .account-grid { grid-template-columns: 1fr; }
}
#view-account .account-id-strip {
    display: flex; align-items: center; gap: 0.65rem;
    background: var(--white);
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.9rem;
    margin-bottom: 0.6rem;
}
#view-account .account-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--mb-blue);
    color: var(--white);
    display: grid; place-items: center;
    font-weight: 600; font-size: 0.9rem;
    letter-spacing: 0;
    flex-shrink: 0;
}
#view-account .account-id-text { flex: 1; min-width: 0; }
#view-account .account-id-line {
    color: var(--dark-grey);
    font-size: 0.85rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#view-account .account-id-email {
    color: var(--mid-grey);
    font-size: 0.75rem;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#view-account .account-signout-link {
    color: var(--mb-blue);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}
#view-account .account-signout-link:hover { text-decoration: underline; }

/* ──────── Tab nav ──────── */
#view-account .account-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-grey);
    margin-bottom: 0.75rem;
}
#view-account .account-tab {
    background: transparent;
    border: none;
    padding: 0.5rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mid-grey);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;          /* overlap the parent border-bottom */
    transition: color .15s ease, border-color .15s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
#view-account .account-tab:hover { color: var(--mb-black); }
#view-account .account-tab.is-active {
    color: var(--mb-blue);
    border-bottom-color: var(--mb-blue);
}
#view-account .account-tab-panel.hidden { display: none; }

/* ──────── Pricing tab: stacked cards (replaces 2-col grid) ──────── */
#view-account .account-tab-panel > .account-card { margin-bottom: 0.6rem; }
#view-account .account-tab-panel > .account-card:last-child { margin-bottom: 0; }

/* Two-col grid wrapping the four settings cards in the Pricing tab.
 * Narrow cards (Discount, Sales tax) sit side-by-side; cards with
 * .pricing-grid-full span both columns. Collapses on narrow screens. */
#view-account .pricing-grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
#view-account .pricing-grid > .account-card { margin-bottom: 0; }
#view-account .pricing-grid > .pricing-grid-full { grid-column: 1 / -1; }
@media (max-width: 820px) {
    #view-account .pricing-grid { grid-template-columns: 1fr; }
}

/* ──────── Pricing tab: collapsible accordion (stacked, full-width) ──────── */
#view-account .acc-stack { display: flex; flex-direction: column; gap: 0.6rem; }
/* .account-card supplies border/bg/radius; the accordion owns its own padding
 * via header + body so the clickable header spans the full card width. */
#view-account .acc-item { padding: 0; overflow: hidden; }
#view-account .acc-header {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.4rem; cursor: pointer; user-select: none;
}
#view-account .acc-header:hover { background: var(--blue-25, #f4f9fe); }
#view-account .acc-header:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--mb-blue, #0078D6);
}
#view-account .acc-header-text { flex: 1 1 auto; min-width: 0; }
#view-account .acc-header .account-title { margin: 0; }
#view-account .acc-header .account-sub { margin: 0.15rem 0 0; }
#view-account .acc-chevron {
    flex: 0 0 auto; color: var(--mid-grey);
    transition: transform 150ms ease-in-out;
}
#view-account .acc-item.acc-collapsed .acc-chevron { transform: rotate(-90deg); }
#view-account .acc-body { padding: 0 1.4rem 1.2rem; }
#view-account .acc-item.acc-collapsed .acc-body { display: none; }

/* Per-tile Save button row + inline status message. */
#view-account .account-tile-actions {
    display: flex; align-items: center; gap: 0.9rem;
    margin-top: 1rem;
}
#view-account .tile-msg {
    margin: 0; font-size: 0.8rem; line-height: 1.35;
}
#view-account .tile-msg.hidden { display: none; }
#view-account .tile-msg--ok   { color: #1c6c3a; }
#view-account .tile-msg--err  { color: #8a2c2c; }
#view-account .tile-msg--warn { color: #8a5a00; }

/* Single shared save/reset row at the bottom of the three settings cards */
#view-account .account-actions--primary {
    margin: 0 0 0.9rem;
    padding: 0 0.25rem;
}

/* Guardrails — stacks vertically since the card lives in a half-width
 * grid column. Three fields read fine top-down. */
#view-account .account-guardrail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}
#view-account .account-guardrail-grid .account-field { margin-bottom: 0; }
#view-account .account-field-hint-sub {
    color: var(--mid-grey);
    font-weight: 400;
    font-size: 0.78rem;
    margin-left: 0.25rem;
}

/* ──────── Promo codes ──────── */
#view-account .promo-empty-state {
    margin: 0.5rem 0 1rem;
    color: var(--mid-grey);
    font-style: italic;
}
#view-account .promo-table-wrap.hidden { display: none; }
#view-account .promo-table-wrap {
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
}
#view-account .promo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
#view-account .promo-table thead {
    background: var(--light-bg);
}
#view-account .promo-table th {
    text-align: left;
    padding: 0.6rem 0.85rem;
    font-weight: 500;
    color: var(--dark-grey);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-grey);
}
#view-account .promo-table td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--mb-black);
}
#view-account .promo-table tbody tr:last-child td { border-bottom: none; }
#view-account .promo-table .promo-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-weight: 600;
    letter-spacing: 0.04em;
}
#view-account .promo-table .promo-expired {
    color: #b04040;
    font-size: 0.78rem;
    margin-left: 0.4rem;
    font-weight: 500;
}
#view-account .promo-remove-btn {
    background: none;
    border: none;
    color: var(--mid-grey);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    font-size: 1.05rem;
    line-height: 1;
    border-radius: 4px;
    transition: background .15s, color .15s;
}
#view-account .promo-remove-btn:hover {
    background: #fdecea;
    color: #8a2c2c;
}

/* Add-row inline form: code text, %, date, button */
/* Single-row add form: [code | discount+toggle | expiry | add btn].
 * The header row above uses the same grid template for label alignment. */
#view-account .promo-add-head,
#view-account .promo-add-row {
    display: grid;
    grid-template-columns: minmax(90px, 1.2fr) auto minmax(120px, 1fr) auto;
    gap: 0.4rem;
    align-items: stretch;
}
#view-account .promo-add-head {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mid-grey);
    font-weight: 600;
    margin-bottom: 0.3rem;
}
#view-account .promo-add-head > span { padding: 0 0.15rem; }
/* Discount input + unit toggle live in one cell, side-by-side. */
#view-account .promo-discount-group {
    display: flex;
    gap: 0.3rem;
    align-items: stretch;
}
#view-account .promo-discount-group .account-pct-input { width: 86px; }
#view-account .promo-add-row .promo-input--code {
    /* Reduce the code column's natural minimum so it doesn't dominate. */
    min-width: 0;
}
#view-account .promo-input--date { width: 100%; }
#view-account .promo-add-btn { white-space: nowrap; padding: 0.45rem 0.9rem; }
#view-account .promo-input {
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--white);
    color: var(--mb-black);
    transition: border-color .15s;
}
#view-account .promo-input:focus { outline: none; border-color: var(--mb-blue); }
#view-account .promo-input--code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
/* ──────── Communication tab ──────── */
#view-account .comms-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
#view-account .comms-card-head .account-sub { margin-bottom: 0; }

/* Toggle switch — pill track with sliding knob */
#view-account .comms-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}
#view-account .comms-toggle input { position: absolute; opacity: 0; pointer-events: none; }
#view-account .comms-toggle-track {
    position: relative;
    width: 36px; height: 20px;
    background: var(--border-grey);
    border-radius: 10px;
    transition: background .15s ease;
    flex-shrink: 0;
}
#view-account .comms-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: left .15s ease;
}
#view-account .comms-toggle input:checked ~ .comms-toggle-track { background: var(--mb-blue); }
#view-account .comms-toggle input:checked ~ .comms-toggle-track::after { left: 18px; }
#view-account .comms-toggle input:focus-visible ~ .comms-toggle-track {
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.2);
}
#view-account .comms-toggle-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--dark-grey);
}

/* Subject input — same look as the rest of the page's text inputs */
#view-account .comms-subject-field { margin-bottom: 0.7rem; }
#view-account .comms-subject-input {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--dark-grey);
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
#view-account .comms-subject-input:focus {
    outline: none;
    border-color: var(--mb-blue);
}
#view-account .comms-subject-input:disabled {
    background: var(--light-bg);
    color: var(--mid-grey);
    cursor: not-allowed;
}

#view-account .comms-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.4rem;
}

/* Existing-account match popup (Can't-find-yourself dedup) */
.acct-modal { position: fixed; inset: 0; z-index: 1000; }
.acct-modal.hidden { display: none; }
.acct-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.acct-modal-dialog {
    position: relative;
    width: min(560px, calc(100vw - 2rem));
    max-height: calc(100vh - 3rem);
    margin: 2rem auto;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex; flex-direction: column; overflow: hidden;
}
.acct-modal-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; padding: 1.1rem 1.25rem 0.4rem;
}
.acct-modal-eyebrow {
    font-size: 0.72rem; color: var(--mid-grey);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.acct-modal-title { font-size: 1.15rem; font-weight: 600; color: var(--mb-black); margin: 2px 0 0; }
.acct-modal-close {
    background: transparent; border: none; color: var(--mid-grey);
    font-size: 1.1rem; cursor: pointer; padding: 0 0.3rem; line-height: 1;
}
.acct-modal-close:hover { color: var(--mb-black); }
.acct-modal-sub { padding: 0 1.25rem; margin: 0 0 0.6rem; color: var(--dark-grey); font-size: 0.9rem; }
.acct-modal-list { overflow-y: auto; padding: 0 1.25rem; }
.acct-modal-list .search-result-item {
    border: 1px solid var(--border-grey); border-radius: var(--radius-sm); margin-bottom: 0.6rem;
}
.acct-modal-foot {
    padding: 0.85rem 1.25rem; border-top: 1px solid var(--border-grey);
    display: flex; justify-content: flex-end;
}

/* Email preview modal */
#view-account .comms-preview-modal { position: fixed; inset: 0; z-index: 1000; }
#view-account .comms-preview-modal.hidden { display: none; }
#view-account .comms-preview-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
#view-account .comms-preview-dialog {
    position: relative;
    width: min(720px, calc(100vw - 2rem));
    height: min(720px, calc(100vh - 2rem));
    margin: 1rem auto;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#view-account .comms-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-grey);
}
#view-account .comms-preview-from {
    font-size: 0.74rem;
    color: var(--mid-grey);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#view-account .comms-preview-subject {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--mb-black);
    margin-top: 2px;
}
#view-account .comms-preview-close {
    background: transparent;
    border: none;
    color: var(--mid-grey);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.4rem;
}
#view-account .comms-preview-close:hover { color: var(--mb-black); }
#view-account .comms-preview-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: var(--light-bg);
}

/* ──────── Dashboard · V4 "Elevated Cards" (Claude Design handoff) ──────── */
/* Cards sit on the page's existing light-grey bg (which already matches the
 * V4 "sunken" tone), so no full-bleed background / negative margin is needed —
 * that would overlap the account sidebar in this app's grid layout. */
#section-dashboard .el { padding: 0; }
#section-dashboard .el *, #section-dashboard .el *::before, #section-dashboard .el *::after { box-sizing: border-box; }
#section-dashboard .el .tnum, #section-dashboard .el .v { font-variant-numeric: tabular-nums lining-nums; }

/* header */
:is(#section-dashboard, #section-reports) .el-head { display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px 24px; margin-bottom: 14px; flex-wrap: wrap; }
:is(#section-dashboard, #section-reports) .el-title { font-family: var(--font-serif); font-weight: 600; font-size: 25px;
    line-height: 1; letter-spacing: -.015em; color: var(--ink-900); }
:is(#section-dashboard, #section-reports) .el-sub { font-size: 12.5px; color: var(--ink-500); margin-top: 5px;
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
:is(#section-dashboard, #section-reports) .el-sub b { color: var(--ink-800); font-weight: 600; }
:is(#section-dashboard, #section-reports) .el-tools { display: flex; align-items: center; gap: 10px; }
:is(#section-dashboard, #section-reports) .linkbtn { background: none; border: 0; color: var(--blue);
    font: 600 13px var(--font-ui, inherit); cursor: pointer; padding: 0; text-decoration: none; }
:is(#section-dashboard, #section-reports) .linkbtn:hover { color: var(--blue-700); text-decoration: underline; }
:is(#section-dashboard, #section-reports) .linkbtn.hidden { display: none; }

/* period pill (wraps the range <select>) */
:is(#section-dashboard, #section-reports) .pill { display: inline-flex; align-items: center; gap: 8px; height: 34px;
    padding: 0 6px 0 13px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
    background: #fff; cursor: pointer; font: 500 13.5px inherit; color: var(--ink-800);
    transition: border-color .16s; white-space: nowrap; }
:is(#section-dashboard, #section-reports) .pill:hover { border-color: var(--ink-300); }
:is(#section-dashboard, #section-reports) .pill .lab { color: var(--ink-500); }
:is(#section-dashboard, #section-reports) .pill select { border: 0; background: transparent; font: 600 13.5px inherit;
    color: var(--ink-800); cursor: pointer; padding: 0 4px; outline: none; }

/* checkpoint button */
#section-dashboard .chk { display: inline-flex; align-items: center; gap: 7px; height: 34px;
    padding: 0 12px; border-radius: var(--r-md); border: 1px dashed var(--line-strong);
    background: #fff; color: var(--ink-600); font: 600 12.5px inherit; cursor: pointer;
    transition: all .16s; white-space: nowrap; }
#section-dashboard .chk:hover { border-color: var(--blue); color: var(--blue); }
#section-dashboard .chk.on { border-style: solid; border-color: var(--blue);
    background: var(--blue-50); color: var(--blue-700); }
#section-dashboard .chk svg { flex: none; }

/* empty-state hints toggle (no generic .hidden rule exists in this app) */
:is(#section-dashboard, #section-reports) .account-hint.hidden { display: none; }

/* card primitive */
:is(#section-dashboard, #section-reports) .el-card { background: #fff; border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--sh-sm); }
#section-dashboard .el-section { margin-top: 10px; padding: 14px 18px; }
#section-dashboard .el-col { display: flex; flex-direction: column; }

/* KPI row */
#section-dashboard .el-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
#section-dashboard .el-kpi { padding: 12px 16px; }
#section-dashboard .el-kpi .ov { font-size: 11px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#section-dashboard .el-kpi .top { display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; margin-top: 8px; }
#section-dashboard .el-kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em;
    line-height: 1; color: var(--ink-900); }
#section-dashboard .el-kpi.hero { border-color: var(--blue-100); }
#section-dashboard .el-kpi.hero .v { color: var(--blue); }
#section-dashboard .el-kpi .sub { font-size: 11px; color: var(--ink-500); margin-top: 7px; }
#section-dashboard .el-chip { display: inline-flex; align-items: center; gap: 2px; height: 21px;
    padding: 0 8px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 700; flex: none; }
#section-dashboard .el-chip.pos { background: #e7f6ec; color: #1b8f4d; }
#section-dashboard .el-chip.neg { background: #fdeaee; color: #b0203a; }

/* panel header */
#section-dashboard .el-ph { display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 11px; }
#section-dashboard .el-ph h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--ink-900); }
#section-dashboard .el-ph .desc { font-size: 12px; color: var(--ink-500); margin: 2px 0 0; }

/* segmented toggle */
#section-dashboard .seg { display: inline-flex; background: var(--surface-sunken);
    border-radius: var(--r-full); padding: 3px; gap: 2px; }
#section-dashboard .seg button { border: 0; background: transparent; font: 600 12.5px inherit;
    letter-spacing: .02em; padding: 5px 14px; border-radius: var(--r-full); color: var(--ink-500);
    cursor: pointer; transition: all .16s; }
#section-dashboard .seg button.on { background: #fff; color: var(--ink-900); box-shadow: var(--sh-xs); }

/* chart meta row */
#section-dashboard .el-meta { display: flex; gap: 22px; margin: -2px 0 12px; flex-wrap: wrap; }
#section-dashboard .el-meta .l { font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ink-400); }
#section-dashboard .el-meta .n { font-size: 15px; font-weight: 700; margin-top: 2px;
    font-variant-numeric: tabular-nums; color: var(--ink-900); }
#section-dashboard .el-meta .n.acc { color: var(--blue); }
#section-dashboard .el-meta .mut { font-size: 12px; color: var(--ink-400); font-weight: 600; }

/* chart body */
#section-dashboard .el-chart-body { position: relative; min-height: 164px; }
#section-dashboard .el-chart-tip { position: absolute; background: #0c0d0f; color: #fff;
    border-radius: 8px; padding: 7px 11px; font: 500 12px inherit; pointer-events: none;
    white-space: nowrap; box-shadow: 0 6px 18px -6px rgba(0,0,0,.4); z-index: 3; }
#section-dashboard .el-chart-tip .d { color: rgba(255,255,255,.6); font-size: 11px; margin-bottom: 2px; }
#section-dashboard .el-chart-tip .vv { font-variant-numeric: tabular-nums; font-weight: 600; }
#section-dashboard .el-chart-tip .u { color: rgba(255,255,255,.55); font-weight: 400; }

/* two-tile row */
#section-dashboard .el-row2 { margin-top: 10px; display: grid; grid-template-columns: 1.05fr .95fr;
    gap: 10px; align-items: stretch; }

/* vertical funnel — uniform track so bars share a baseline and fill the card */
#section-dashboard #dash-funnel { display: flex; flex-direction: column; flex: 1; }
#section-dashboard .elf { display: flex; align-items: stretch; gap: 9px; flex: 1; min-height: 120px; margin-top: 2px; }
#section-dashboard .elf-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
#section-dashboard .elf-c { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 4px; color: var(--ink-900); }
#section-dashboard .elf-bartrack { flex: 1; width: 100%; display: flex; align-items: flex-end; }
#section-dashboard .elf-bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--blue);
    transition: height .55s cubic-bezier(.16,1,.3,1); min-height: 3px; }
#section-dashboard .elf-bar.last { background: var(--ink-900); }
#section-dashboard .elf-lab { margin-top: 6px; font-size: 10.5px; font-weight: 600; color: var(--ink-700);
    text-align: center; line-height: 1.2;
    /* Fixed label height (2 lines + pct) so every column's bar track ends on the SAME baseline —
       without this a wrapped label ("Customer identified") shortens its own bar track. */
    min-height: 40px; }
#section-dashboard .elf-pct { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink-400);
    margin-top: 1px; font-variant-numeric: tabular-nums; }
#section-dashboard .elf-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; }
#section-dashboard .elf-foot .l { font-size: 12.5px; color: var(--ink-600); }
#section-dashboard .elf-foot .v { font-size: 18px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }

/* segments 2x2 */
#section-dashboard .els { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; flex: 1; }
#section-dashboard .els-card { border: 1px solid var(--line); border-radius: 8px;
    padding: 12px 14px; display: flex; flex-direction: column; justify-content: space-between;
    background: var(--surface); transition: box-shadow .16s, border-color .16s; }
#section-dashboard .els-card:hover { box-shadow: var(--sh-sm); border-color: var(--line-strong); }
#section-dashboard .els-card.hot { background: var(--blue-25); border-color: var(--blue-100); }
#section-dashboard .els-card .nm { font-size: 12.5px; font-weight: 600; color: var(--ink-900); line-height: 1.25; }
#section-dashboard .els-card .cnt { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; margin-top: 8px; }
#section-dashboard .els-card .mt { font-size: 11px; color: var(--ink-500); margin-top: 3px; font-variant-numeric: tabular-nums; }
#section-dashboard .els-card .cta { margin-top: 9px; }
:is(#section-dashboard, #section-reports) .csv { display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    width: 100%; height: 30px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
    background: #fff; color: var(--ink-700); font: 600 11.5px inherit; letter-spacing: .04em;
    text-transform: uppercase; cursor: pointer; transition: all .16s; white-space: nowrap; }
:is(#section-dashboard, #section-reports) .csv:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-25); }
:is(#section-dashboard, #section-reports) .csv:disabled { border-color: var(--line); color: var(--ink-400); background: #fff; cursor: default; }
#section-dashboard .els-card.hot .csv { border-color: var(--blue); color: #fff; background: var(--blue); }
#section-dashboard .els-card.hot .csv:hover { background: var(--blue-700); }
#section-dashboard .csv svg { flex: none; }

/* recent sales */
#section-dashboard .el-rs-head, #section-dashboard .el-rs-row {
    display: grid; grid-template-columns: 1.6fr 1.2fr 1fr 1fr .9fr; gap: 16px; align-items: center; }
#section-dashboard .el-rs-head { padding: 0 4px 9px; border-bottom: 1px solid var(--line); }
#section-dashboard .el-rs-head span { font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-400); }
#section-dashboard .el-rs-row { padding: 8px 4px; border-bottom: 1px solid var(--line-soft); }
#section-dashboard .el-rs-row:last-child { border-bottom: 0; }
#section-dashboard .rs-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
#section-dashboard .rs-av { width: 30px; height: 30px; border-radius: var(--r-full); background: var(--ink-900);
    color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
#section-dashboard .rs-name { font-size: 13.5px; font-weight: 600; color: var(--ink-900); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
#section-dashboard .rs-name small { display: block; color: var(--ink-400); font-weight: 400; font-size: 11.5px; }
#section-dashboard .rs-cell { font-size: 13px; color: var(--ink-700); font-variant-numeric: tabular-nums; }
#section-dashboard .rs-amt { font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-900); }
#section-dashboard .rs-mk { font-size: 13px; text-align: right; color: var(--ink-700); font-variant-numeric: tabular-nums; }
#section-dashboard .rs-time { font-size: 12px; color: var(--ink-500); text-align: right; font-variant-numeric: tabular-nums; }
#section-dashboard .rs-time a { color: var(--blue); text-decoration: none; }
#section-dashboard .rs-time a:hover { text-decoration: underline; }

/* responsive reflow */
@media (max-width: 1180px) { #section-dashboard .el-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 940px)  {
    #section-dashboard .el-row2 { grid-template-columns: 1fr; }
}
@media (max-width: 680px)  {
    #section-dashboard .el-kpis { grid-template-columns: repeat(2, 1fr); }
    #section-dashboard .els { grid-template-columns: 1fr; }
    #section-dashboard .el-rs-head, #section-dashboard .el-rs-row { grid-template-columns: 1.6fr 1.2fr 1fr .9fr; }
    #section-dashboard .el-rs-head span:nth-child(4), #section-dashboard .el-rs-row > *:nth-child(4) { display: none; }
}

/* ──────── Service advisors (Settings card + checkout dropdown + leaderboard) ──────── */
#view-account .advisors-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
#view-account .advisors-refresh {
    border: 1px solid var(--mb-blue); background: var(--white); color: var(--primary-blue);
    font-size: 0.8rem; font-weight: 600; padding: 0.4rem 0.8rem; border-radius: var(--radius-md);
    cursor: pointer; white-space: nowrap;
}
#view-account .advisors-refresh:hover { background: #eef3fb; }
#view-account .advisors-refresh:disabled { opacity: 0.55; cursor: default; }
#view-account .advisors-list { margin-top: 0.6rem; }
#view-account .advisor-row {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.6rem;
    padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--line-soft, #f0f1f2);
    font-size: 0.88rem;
}
#view-account .advisor-row:last-child { border-bottom: 0; }
#view-account .advisor-name { color: var(--dark-grey); font-weight: 500; }
#view-account .advisor-dept { color: var(--mid-grey); font-size: 0.75rem; }

/* checkout dropdown + free-text "Other" */
.advisor-select-block.hidden { display: none; }
.advisor-select-block select,
.advisor-select-block .advisor-other-input {
    width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm); background: var(--white); font-family: inherit;
    font-size: 0.9rem; color: var(--dark-grey); cursor: pointer;
}
.advisor-select-block .advisor-other-input { margin-top: 0.4rem; cursor: text; }
.advisor-select-block .advisor-other-input.hidden { display: none; }
.advisor-select-block select:focus,
.advisor-select-block .advisor-other-input:focus { outline: none; border-color: var(--mb-blue); }

/* dashboard leaderboard */
#section-dashboard .dash-lb-head, #section-dashboard .dash-lb-row {
    display: grid; grid-template-columns: 34px 1fr 70px 110px; gap: 12px; align-items: center; }
#section-dashboard .dash-lb-head { padding: 0 4px 9px; border-bottom: 1px solid var(--line); }
#section-dashboard .dash-lb-head span { font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-400); }
#section-dashboard .dash-lb-head .num, #section-dashboard .dash-lb-row .num {
    text-align: right; font-variant-numeric: tabular-nums; }
#section-dashboard .dash-lb-row { padding: 8px 4px; border-bottom: 1px solid var(--line-soft);
    font-size: 13.5px; color: var(--ink-700); }
#section-dashboard .dash-lb-row:last-child { border-bottom: 0; }
#section-dashboard .dash-lb-rank { font-weight: 700; color: var(--ink-400); font-variant-numeric: tabular-nums; }
#section-dashboard .dash-lb-name { font-weight: 600; color: var(--ink-900); }
#section-dashboard .dash-lb-row.is-top .dash-lb-rank { color: var(--blue); }
#section-dashboard .dash-lb-row.is-top .dash-lb-name { color: var(--blue); }
#section-dashboard .dash-lb-row.is-unattributed { color: var(--ink-400); }
#section-dashboard .dash-lb-row.is-unattributed .dash-lb-name { color: var(--ink-400); font-weight: 500; }

/* ──────── Dashboard → Reports drill-down affordances ──────── */
#section-dashboard .el-kpi.clickable { cursor: pointer; transition: border-color .16s, box-shadow .16s; }
#section-dashboard .el-kpi.clickable:hover { border-color: var(--blue); }
#section-dashboard .el-ph-tools { display: flex; align-items: center; gap: 14px; flex: none; }
#section-dashboard .dash-lb-row.clickable { cursor: pointer; }
#section-dashboard .dash-lb-row.clickable:hover { background: var(--blue-25); }
#section-dashboard .el-error, #section-reports .rep-error { margin: 0 0 10px; padding: 10px 14px;
    border: 1px solid #f1c2cb; background: #fdeaee; color: #b0203a;
    border-radius: var(--r-md); font-size: 13px; }
#section-dashboard .el-error a, #section-reports .rep-error a { color: inherit; font-weight: 700; }

/* plans-by-package card (mirrors the leaderboard grid) */
#section-dashboard .dash-pk-head, #section-dashboard .dash-pk-row {
    display: grid; grid-template-columns: 1fr 60px 110px; gap: 12px; align-items: center; }
#section-dashboard .dash-pk-head { padding: 0 4px 9px; border-bottom: 1px solid var(--line); }
#section-dashboard .dash-pk-head span { font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-400); }
#section-dashboard .dash-pk-head .num, #section-dashboard .dash-pk-row .num {
    text-align: right; font-variant-numeric: tabular-nums; }
#section-dashboard .dash-pk-row { padding: 8px 4px; border-bottom: 1px solid var(--line-soft);
    font-size: 13.5px; color: var(--ink-700); cursor: pointer; }
#section-dashboard .dash-pk-row:hover { background: var(--blue-25); }
#section-dashboard .dash-pk-row:last-child { border-bottom: 0; }
#section-dashboard .dash-pk-name { font-weight: 600; color: var(--ink-900); min-width: 0; }
#section-dashboard .dash-pk-bar { display: block; height: 4px; background: var(--blue-50);
    border-radius: 2px; margin-top: 5px; overflow: hidden; }
#section-dashboard .dash-pk-bar i { display: block; height: 100%; background: var(--blue); border-radius: 2px; }

/* ──────── Reports v1 (docs/plans/2026-06-11-reports-v1-design.md) ──────── */
#section-reports .rep { padding: 0; }
#section-reports .hidden { display: none; }
#section-reports .rep-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
#section-reports .rep-card { text-align: left; background: #fff; border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--sh-sm); padding: 16px 18px; cursor: pointer;
    font: inherit; transition: border-color .16s; }
#section-reports .rep-card:hover { border-color: var(--blue); }
#section-reports .rep-card .nm { font-size: 15px; font-weight: 700; color: var(--ink-900); }
#section-reports .rep-card .d { font-size: 12.5px; color: var(--ink-500); margin-top: 5px; line-height: 1.45; }
#section-reports .rep-card .go { margin-top: 10px; color: var(--blue); font-weight: 600; font-size: 12.5px; }
#section-reports .rep-back { display: inline-block; font-size: 12.5px; margin-bottom: 7px; }
#section-reports .rep-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#section-reports .rep-dates, #section-dashboard .rep-dates { display: inline-flex; align-items: center; gap: 6px; }
#section-reports .rep-dates input, #section-dashboard .rep-dates input { height: 34px; border: 1px solid var(--line-strong);
    border-radius: var(--r-md); padding: 0 10px; font: 500 13px inherit; color: var(--ink-800); background: #fff; }
#section-reports .rep-dates .sep, #section-dashboard .rep-dates .sep { color: var(--ink-400); }
#section-reports .csv { width: auto; }
#section-reports .rep-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
#section-reports .rep-chip { display: inline-flex; align-items: center; gap: 7px; height: 26px;
    padding: 0 11px; border-radius: var(--r-full); background: var(--blue-50); color: var(--blue-700);
    font-size: 12px; font-weight: 600; }
#section-reports .rep-chip button { border: 0; background: none; color: inherit; cursor: pointer;
    font-size: 14px; padding: 0; line-height: 1; }
#section-reports .rep-note { font-size: 12px; color: var(--ink-500); margin-top: 8px; }
#section-reports .rep-tablecard { margin-top: 10px; overflow: hidden; }
/* Long reports scroll inside the card (sticky header) instead of stretching the page. */
#section-reports .rep-tablewrap { overflow-x: auto; max-height: 62vh; overflow-y: auto; }
#section-reports .rep-table thead th { position: sticky; top: 0; z-index: 1; background: var(--card-bg, #fff); }
#section-reports .rep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#section-reports .rep-table th { font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-400); text-align: left; padding: 10px 12px;
    border-bottom: 1px solid var(--line); white-space: nowrap; }
#section-reports .rep-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft);
    color: var(--ink-700); white-space: nowrap; font-variant-numeric: tabular-nums; }
#section-reports .rep-table th.num, #section-reports .rep-table td.num { text-align: right; }
#section-reports .rep-table tbody tr.click { cursor: pointer; }
#section-reports .rep-table tbody tr.click:hover { background: var(--blue-25); }
#section-reports .rep-table td a { color: var(--blue); text-decoration: none; }
#section-reports .rep-table td a:hover { text-decoration: underline; }
#section-reports .rep-table tfoot td { font-weight: 700; color: var(--ink-900);
    border-top: 2px solid var(--line); border-bottom: 0; background: var(--surface); }
#section-reports .rep-empty { padding: 30px; text-align: center; color: var(--ink-500); font-size: 13px; }
@media (max-width: 940px) { #section-reports .rep-cards { grid-template-columns: 1fr; } }

/* ──────── Communication: coming soon ──────── */
#view-account .account-coming-soon {
    text-align: center;
    padding: 2.5rem 1.5rem;
}
#view-account .account-coming-icon {
    color: var(--mb-blue);
    margin-bottom: 0.75rem;
    display: inline-flex;
}
#view-account .account-coming-soon .account-title { margin-bottom: 0.4rem; }
#view-account .account-coming-soon .account-sub {
    max-width: 460px;
    margin: 0 auto;
    text-align: center;
}

/* Config form */
#view-account .account-config-card .account-title {
    text-align: left;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}
#view-account .account-config-card .account-sub {
    text-align: left;
    margin-bottom: 0.7rem;
}
#view-account .account-field { margin-bottom: 0.55rem; }
#view-account .account-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--dark-grey);
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}
/* Field header — label on the left, "Currently applied" pill on the right.
 * Shown for the Sales tax field; could be added to the others later. */
#view-account .account-field-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
#view-account .account-field-header label { margin-bottom: 0; }
#view-account .account-current {
    font-size: 0.78rem;
    color: var(--mid-grey);
    letter-spacing: 0;
    font-weight: 400;
}
#view-account .account-current strong {
    color: var(--mb-blue);
    font-weight: 600;
    margin-left: 0.25rem;
    font-variant-numeric: tabular-nums;
}
#view-account .account-hint--inline {
    font-size: 0.74rem;
    margin: 0.4rem 0 0;
    color: var(--mid-grey);
}

/* Stepper variant of the percentage input — adds a small column of up/down
 * arrows between the input and the % suffix. Each click steps by 0.05%. */
#view-account .account-pct-input--stepper { padding-right: 0; }
#view-account .account-stepper {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e4e4e4;
    width: 28px;
}
#view-account .stepper-arrow {
    flex: 1;
    border: none;
    background: var(--white);
    color: var(--mid-grey);
    cursor: pointer;
    padding: 0;
    display: grid;
    place-items: center;
    transition: background 100ms ease, color 100ms ease;
    height: 50%;
    min-height: 18px;
}
#view-account .stepper-arrow:hover {
    background: var(--light-bg);
    color: var(--mb-blue);
}
#view-account .stepper-arrow:active {
    background: #eef4fb;
}
#view-account .stepper-arrow + .stepper-arrow {
    border-top: 1px solid #e4e4e4;
}
#view-account .account-pct-input {
    display: flex; align-items: stretch;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    background: var(--white);
    overflow: hidden;
    transition: border-color 0.15s;
}
#view-account .account-pct-input:focus-within { border-color: var(--mb-blue); }
#view-account .account-pct-input input {
    flex: 1;
    padding: 0.4rem 0.7rem;
    font-size: 0.88rem;
    font-family: inherit;
    border: none;
    outline: none;
    background: transparent;
    color: var(--dark-grey);
    -moz-appearance: textfield;
}
#view-account .account-pct-input input::-webkit-outer-spin-button,
#view-account .account-pct-input input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
/* $ prefix on the left of a pct-input (mirror of the % suffix on the right).
 * Used by the Discount card when toggled to $, and by all $-unit cap inputs. */
#view-account .account-pct-prefix {
    display: grid; place-items: center;
    padding: 0 0.7rem;
    background: var(--light-bg);
    color: var(--mid-grey);
    font-weight: 500;
    font-size: 0.9rem;
    border-right: 1px solid #e4e4e4;
    align-self: stretch;
}
#view-account .account-pct-prefix.hidden { display: none; }
#view-account .account-pct-suffix.hidden { display: none; }

/* [%][$] segmented toggle used in Discount and Promo. */
#view-account .unit-toggle {
    display: inline-flex;
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--white);
}
#view-account .unit-toggle-btn {
    background: transparent;
    border: none;
    padding: 0.18rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mid-grey);
    cursor: pointer;
    font-family: inherit;
    min-width: 28px;
    transition: background .12s ease, color .12s ease;
}
#view-account .unit-toggle-btn:hover { background: var(--light-bg); color: var(--mb-black); }
#view-account .unit-toggle-btn.is-active {
    background: var(--mb-black);
    color: var(--white);
}

/* Two side-by-side cap inputs (% and $) inside one .account-field. */
#view-account .cap-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

#view-account .account-pct-suffix {
    display: grid; place-items: center;
    padding: 0 0.7rem;
    background: var(--light-bg);
    color: var(--mid-grey);
    font-weight: 500;
    border-left: 1px solid #e4e4e4;
    font-size: 0.9rem;
}
#view-account .account-actions {
    display: flex; align-items: center; gap: 1.25rem;
    margin-top: 1.5rem;
}
#view-account .account-reset-link {
    color: var(--mid-grey);
    font-size: 0.85rem;
    text-decoration: none;
}
#view-account .account-reset-link:hover {
    color: var(--mb-black);
    text-decoration: underline;
}

/* Inline error + saved-toast */
#view-account .account-error {
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: #8a2c2c;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-top: 0.6rem;
}
#view-account .account-toast {
    background: #e7f6ec;
    border: 1px solid #b6e0c2;
    color: #1c6c3a;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.6rem;
}
#view-account .account-error.hidden,
#view-account .account-toast.hidden { display: none; }
#view-account .account-signedout.hidden,
#view-account .account-signedin.hidden { display: none; }

/* ──────── Branding tab (hero landing customization) ──────── */
#view-account .btn-outline {
    background: var(--white); color: var(--primary-blue);
    border: 1px solid var(--mb-blue);
}
#view-account .btn-outline:hover { background: #eef3fb; }
#view-account .btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }

#view-account .branding-grid {
    display: grid; grid-template-columns: 1fr; gap: 1.5rem;
    align-items: start; margin-top: 1rem; max-width: 620px;
}

/* Branding preview popup */
.bp-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.bp-modal.hidden { display: none; }
.bp-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.bp-dialog {
    position: relative; width: min(1180px, 96vw); max-height: 92vh; background: #fff;
    border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    display: flex; flex-direction: column;
}
.bp-mount { overflow: auto; }
/* The cloned hero is normally height:100vh (flex). In the preview, cap it so header + hero +
   stats strip all fit at a realistic snapshot size. */
.bp-hero-clone.view-hero { display: flex !important; flex-direction: column; height: 620px; overflow: hidden; }
.bp-hero-clone .mb-header { position: absolute; }
.bp-dialog-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; border-bottom: 1px solid var(--border-grey);
    font-weight: 600; font-size: 0.95rem;
}
.bp-close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--mid-grey); }
.bp-stage { background: #fcfbf8; }
.bp-topbar {
    height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: 0 24px; border-bottom: 1px solid rgba(0,0,0,0.08);
}
.bp-topbar .bp-logo { grid-column: 2; justify-self: center; height: 34px; width: auto; max-width: 200px; object-fit: contain; }
.bp-topbar .bp-name { grid-column: 2; justify-self: center; font-family: var(--font-serif, Georgia, serif); font-size: 18px; font-weight: 600; }
.bp-logo.hidden { display: none; }
.bp-hero {
    position: relative; aspect-ratio: 16 / 8; width: 100%;
    background-color: #1a1d20; background-size: cover; background-position: center 55%;
}
.bp-scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.5) 35%, rgba(0,0,0,0.1) 65%); }
.bp-tile {
    position: absolute; left: 6%; top: 50%; transform: translateY(-50%); max-width: 60%; color: #f6f4ef;
    background: linear-gradient(180deg, rgba(15,17,20,0.6), rgba(15,17,20,0.5));
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 3px; padding: 1rem 1.25rem;
}
.bp-eyebrow { font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(246,244,239,0.85); margin-bottom: 0.5rem; }
.bp-headline { font-family: var(--font-serif, Georgia, serif); font-size: 1.7rem; line-height: 1.1; font-weight: 600; margin-bottom: 0.5rem; }
.bp-sub { font-size: 0.9rem; line-height: 1.45; color: rgba(246,244,239,0.92); }
#view-account .branding-editor textarea {
    width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem;
    color: var(--dark-grey); resize: vertical; line-height: 1.4;
}
#view-account .branding-editor textarea:focus,
#view-account .branding-editor input:focus { outline: none; border-color: var(--mb-blue); }
#view-account .branding-bg-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
#view-account .branding-bg-name { font-size: 0.82rem; color: var(--mid-grey); }

/* Live preview — a scaled mini hero with the dealer's bg + glass tile. */
#view-account .hero-preview {
    position: relative; aspect-ratio: 16 / 10; width: 100%;
    border-radius: var(--radius-md); overflow: hidden;
    background-color: #1a1d20; background-size: cover; background-position: center 55%;
    border: 1px solid var(--border-grey);
}
#view-account .hero-preview-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.5) 35%, rgba(0,0,0,0.1) 65%);
}
#view-account .hero-preview-tile {
    position: absolute; left: 6%; top: 50%; transform: translateY(-50%);
    max-width: 70%; color: #f6f4ef;
    background: linear-gradient(180deg, rgba(15,17,20,0.6), rgba(15,17,20,0.5));
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 3px; padding: 0.9rem 1.1rem;
}
#view-account .hero-preview-eyebrow {
    font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: rgba(246,244,239,0.85); margin-bottom: 0.5rem;
}
#view-account .hero-preview-headline {
    font-family: var(--font-serif, Georgia, serif); font-size: 1.4rem; line-height: 1.1;
    font-weight: 600; margin-bottom: 0.5rem;
}
#view-account .hero-preview-sub { font-size: 0.8rem; line-height: 1.45; color: rgba(246,244,239,0.92); }

/* Markup pricing — per-package, per-tier table ─────────────────────── */
#view-account .markup-card { padding-top: 1.1rem; margin-bottom: 0.6rem; }
#view-account .markup-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
#view-account .markup-card-head h2 { margin-bottom: 0.25rem; }
#view-account .markup-card-head .account-sub { margin-bottom: 0; }
#view-account .markup-fetch-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-grey);
    background: var(--white);
    color: var(--mb-black);
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 100ms, border-color 100ms, color 100ms;
    flex-shrink: 0;
    white-space: nowrap;
}
#view-account .markup-fetch-btn:hover:not(:disabled) {
    background: var(--light-bg);
    border-color: var(--mb-blue);
    color: var(--mb-blue);
}
#view-account .markup-fetch-btn:disabled { opacity: 0.6; cursor: progress; }
#view-account .btn-spinlet {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid var(--border-grey);
    border-top-color: var(--mb-blue);
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    vertical-align: -2px;
    margin-right: 4px;
}

#view-account .markup-hint {
    background: var(--light-bg);
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.95rem;
    margin: 0.6rem 0 0;
    line-height: 1.55;
    color: var(--mid-grey);
    font-size: 0.85rem;
}
#view-account .markup-hint strong { color: var(--dark-grey); font-weight: 600; }
#view-account .markup-hint.hidden { display: none; }

/* Primary-blue treatment for the Fetch button. Chained class selectors
 * (`.markup-fetch-btn.markup-fetch-btn--primary`) outrank the base
 * `.markup-fetch-btn:hover:not(:disabled)` rule above. */
#view-account .markup-fetch-btn.markup-fetch-btn--primary {
    background: var(--mb-blue);
    color: var(--white);
    border-color: var(--mb-blue);
    padding: 0.5rem 0.95rem;
    font-weight: 600;
}
#view-account .markup-fetch-btn.markup-fetch-btn--primary:hover:not(:disabled) {
    background: var(--mb-blue-dk);
    border-color: var(--mb-blue-dk);
    color: var(--white);
}
#view-account .markup-fetch-btn.markup-fetch-btn--primary svg { color: var(--white); }

/* Heads-up about MBUSA's cross-package markup application. Info-tone
 * (blue), shown only when markups are loaded. */
#view-account .markup-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 0.85rem;
    padding: 0.75rem 0.9rem;
    background: rgba(0, 120, 212, 0.06);
    border: 1px solid rgba(0, 120, 212, 0.25);
    border-radius: var(--radius-sm);
    color: var(--dark-grey);
    font-size: 0.82rem;
    line-height: 1.55;
}
#view-account .markup-notice.hidden { display: none; }
#view-account .markup-notice svg { flex-shrink: 0; margin-top: 2px; color: var(--mb-blue); }
#view-account .markup-notice strong { color: var(--mb-black); }
#view-account .markup-notice em { font-style: normal; font-weight: 500; color: var(--mb-black); }
#view-account .markup-notice code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    background: rgba(0, 120, 212, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--mb-blue);
}

#view-account .markup-status {
    margin-top: 0.7rem;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    border: 1px solid;
}
#view-account .markup-status.markup-status--ok {
    background: #e7f6ec; color: #1c6c3a; border-color: #b6e0c2;
}
#view-account .markup-status.markup-status--err {
    background: #fdecea; color: #8a2c2c; border-color: #f5c6c0;
}
#view-account .markup-status.hidden { display: none; }

#view-account .markup-tables { margin-top: 1rem; }
#view-account .markup-tables.hidden { display: none; }

#view-account .markup-package {
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-md);
    background: var(--white);
    margin-bottom: 0.6rem;
    overflow: hidden;
    transition: border-color 120ms;
}
#view-account .markup-package:hover { border-color: #cdd3da; }

/* Toggle row — clickable header showing package name + summary badge */
#view-account .markup-package-toggle {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--white);
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 120ms;
    font-family: inherit;
}
#view-account .markup-package-toggle:hover { background: var(--light-bg); }
#view-account .markup-chevron {
    color: var(--mid-grey);
    transition: transform 200ms ease;
    flex-shrink: 0;
}
#view-account .markup-package-toggle.expanded .markup-chevron {
    transform: rotate(90deg);
    color: var(--mb-blue);
}
#view-account .markup-package-meta { flex: 1; min-width: 0; }
#view-account .markup-package-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mb-black);
    letter-spacing: -0.005em;
}
#view-account .markup-package-sub {
    font-size: 0.72rem;
    color: var(--mid-grey);
    margin-top: 1px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.02em;
}

/* Summary badge on the right of the toggle row */
#view-account .markup-badge {
    flex-shrink: 0;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(0, 120, 212, 0.10);
    color: var(--mb-blue);
    font-variant-numeric: tabular-nums;
    transition: background 120ms, color 120ms;
}
#view-account .markup-badge--zero {
    background: var(--light-bg);
    color: var(--mid-grey);
}
#view-account .markup-badge--dirty {
    background: rgba(0, 120, 212, 0.18);
    color: var(--mb-blue);
}

/* Expanded body holds the table */
#view-account .markup-package-body {
    border-top: 1px solid var(--border-grey);
}
#view-account .markup-package-body.hidden { display: none; }

#view-account .markup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
#view-account .markup-table th {
    text-align: left;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--border-grey);
    background: #fafafa;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--mid-grey);
}
#view-account .markup-table td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
#view-account .markup-table tr:last-child td { border-bottom: none; }
#view-account .markup-table .markup-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    width: 110px;
}
#view-account .markup-table .markup-readonly { color: var(--mid-grey); }
#view-account .markup-table .markup-tier-name {
    font-weight: 500;
    color: var(--mb-black);
}
#view-account .markup-table .markup-tier-id {
    font-size: 0.7rem;
    color: var(--mid-grey);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    margin-top: 1px;
}
/* MBUSA model list — inline with the tier name in (parens), mid-grey,
 * smaller. All models always visible (no truncation); the cell grows
 * to fit, table layout pushes the numeric columns to the right. */
#view-account .markup-tier-models-inline {
    color: var(--mid-grey);
    font-weight: 400;
    font-size: 0.82rem;
    margin-left: 0.35rem;
}
#view-account .markup-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
#view-account .markup-input-prefix {
    color: var(--mid-grey);
    font-size: 0.85rem;
}
#view-account .markup-input {
    display: inline-block;
    width: 72px;
    padding: 0.3rem 0.45rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: right;
    color: var(--mb-black);
    -moz-appearance: textfield;
}
#view-account .markup-input:focus {
    outline: none;
    border-color: var(--mb-blue);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.10);
}
#view-account .markup-input::-webkit-outer-spin-button,
#view-account .markup-input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
#view-account .markup-input-suffix {
    color: var(--mid-grey);
    font-size: 0.85rem;
}
#view-account .markup-input--pct:disabled {
    background: var(--light-bg);
    color: var(--mid-grey);
    cursor: not-allowed;
}
#view-account .markup-table tr.markup-row-dirty td {
    background: rgba(0, 120, 212, 0.04);
}
#view-account .markup-table tr.markup-row-dirty .markup-pays {
    color: var(--mb-blue);
    font-weight: 500;
}

#view-account .markup-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1rem;
}
#view-account .markup-actions.hidden { display: none; }

/* Two-button row: View current MBUSA prices / Edit tier markups */
#view-account .markup-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

/* Preview-example popup */
#view-account .markup-preview-modal { position: fixed; inset: 0; z-index: 1000; }
#view-account .markup-preview-modal.hidden { display: none; }
#view-account .markup-preview-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
#view-account .markup-preview-card {
    position: relative;
    width: min(820px, calc(100vw - 2rem));
    max-height: calc(100vh - 3rem);
    margin: 1.5rem auto;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#view-account .markup-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-grey);
}
#view-account .markup-preview-title { font-size: 1.05rem; font-weight: 600; color: var(--mb-black); }
#view-account .markup-preview-sub { font-size: 0.8rem; color: var(--mid-grey); margin-top: 2px; }
#view-account .markup-preview-close {
    background: none; border: none; font-size: 1.5rem; line-height: 1;
    color: var(--mid-grey); cursor: pointer; padding: 0 0.25rem;
}
#view-account .markup-preview-close:hover { color: var(--mb-black); }
#view-account .markup-preview-body { padding: 1rem 1.25rem 1.25rem; overflow-y: auto; }
#view-account .markup-preview-pkg { margin-bottom: 1.5rem; }
#view-account .markup-preview-pkg-title {
    font-size: 0.95rem; font-weight: 700; color: var(--mb-black); margin-bottom: 0.5rem;
}
#view-account .markup-preview-pkg-title span {
    font-weight: 400; font-size: 0.78rem; color: var(--mid-grey); font-family: var(--hero-mono, monospace);
}


/* ═════════════════════════════════════════════════════════════════════════
 * PAYMENT MODAL — 3 states (waiting / success / failed)
 *
 * Full-page receipt shown after a successful payment. Replaces the old
 * post-payment success modal — feels more like a real order confirmation.
 * ═════════════════════════════════════════════════════════════════════════ */
.confirmation-card {
    max-width: 640px;
    margin: 2rem auto;
    background: #fff;
    border: 1px solid var(--border-grey);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}
.confirmation-icon {
    width: 78px; height: 78px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--success-green, #0e8a3a);
    color: #fff;
}
.confirmation-title {
    font-size: 1.6rem; font-weight: 700;
    margin: 0 0 0.4rem; color: var(--mb-black);
}
.confirmation-sub {
    font-size: 0.95rem; color: var(--mid-grey);
    margin: 0 auto 1.6rem; max-width: 440px;
}
.confirmation-receipt {
    background: var(--light-bg);
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    padding: 0.4rem 1rem;
    margin: 0 0 1.5rem;
    text-align: left;
}
.confirmation-receipt-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-grey);
    font-size: 0.92rem;
}
.confirmation-receipt-row:last-child { border-bottom: none; }
.confirmation-receipt-row span { color: var(--mid-grey); }
.confirmation-receipt-row strong {
    color: var(--mb-black); font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: right;
}
.confirmation-receipt-row--total {
    border-top: 1.5px solid var(--mb-black);
    margin-top: 0.3rem; padding-top: 0.85rem;
    font-size: 1.05rem;
}
.confirmation-receipt-row--total strong { font-size: 1.1rem; font-weight: 700; }

.confirmation-next {
    background: #f1f6ff;
    border: 1px solid #cdddf5;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.6rem;
    text-align: left;
}
.confirmation-next h3 {
    font-size: 0.78rem; font-weight: 700;
    color: var(--mb-blue); text-transform: uppercase; letter-spacing: 0.5px;
    margin: 0 0 0.5rem;
}
.confirmation-next ul {
    margin: 0; padding-left: 1.1rem;
    font-size: 0.9rem; color: var(--mb-black); line-height: 1.55;
}
.confirmation-next li { margin-bottom: 0.3rem; }
.confirmation-next li:last-child { margin-bottom: 0; }

.confirmation-actions {
    display: flex; flex-direction: column; gap: 0.6rem; align-items: stretch;
}
.confirmation-actions .btn { padding: 0.85rem 1.6rem; font-weight: 600; }
.confirmation-actions .hidden { display: none; }
/* Prominent post-payment contract status — sits at the top of the
   confirmation card so the customer sees it without scrolling. Morphs from a
   "generating…" spinner line into a bold full-width Download button. */
.conf-contract-status {
    margin: 0.25rem 0 1.25rem; padding: 1rem 1.1rem;
    background: var(--light-bg); border: 1px solid var(--border-grey);
    border-radius: var(--radius-md); text-align: center;
}
.conf-contract-pending {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    font-size: 0.98rem; color: var(--dark-grey); font-weight: 600;
}
.conf-contract-pending.hidden { display: none; }
.conf-download-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; font-size: 1rem; font-weight: 700; letter-spacing: 0.3px;
}
.conf-download-btn.hidden { display: none; }



/* ── Sales-report column picker (Columns ▾ pill + checkbox menu) ── */
#section-reports .rep-cols-wrap { position: relative; display: inline-flex; }
#section-reports .rep-cols-btn { cursor: pointer; }
#section-reports .rep-cols-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
    min-width: 200px; padding: 8px; border-radius: 10px; background: var(--surface, #fff);
    border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    display: flex; flex-direction: column; gap: 2px; }
#section-reports .rep-cols-menu.hidden { display: none; }
#section-reports .rep-cols-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px;
    border-radius: 7px; font-size: 13px; color: var(--ink-700); cursor: pointer; }
#section-reports .rep-cols-item:hover { background: var(--blue-25); }
#section-reports .rep-cols-item.locked { color: var(--ink-400); cursor: default; }
#section-reports .rep-cols-reset { margin-top: 6px; padding: 6px 8px; border: 0; border-top: 1px solid var(--line-soft);
    background: none; color: var(--blue); font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; }
#section-reports .rep-chip-clearall { border: 1px dashed var(--blue-300, #93c5fd); background: none; cursor: pointer; }

/* Dashboard incl/excl-tax toggle pill (sits beside Set checkpoint) */
#section-dashboard .dash-tax-btn, .dash-tax-btn { cursor: pointer; }

/* Manually added service advisors: add form + tags + remove */
.advisors-actions { display: flex; gap: 8px; align-items: center; }
.advisors-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 2px; }
.advisors-add-form.hidden { display: none; }
.advisors-add-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 13px; min-width: 200px; }
.advisor-manual-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: var(--r-full);
    background: var(--blue-50); color: var(--blue-700); font-size: 10.5px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.advisor-remove { border: 0; background: none; color: var(--ink-400); font-size: 16px; cursor: pointer;
    padding: 0 4px; line-height: 1; }
.advisor-remove:hover { color: var(--red, #dc2626); }

/* Mileage-vs-last-repair validation message (existing-vehicle card) */
.cv-mileage-error { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #dc2626; }

/* OTP gate (experiment) */
#view-otp .card { max-width: 460px; }
#otp-input { font-size: 22px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.cv-verified-badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
    padding: 3px 10px; border-radius: 999px; background: #e8f7ee; color: #157347;
    font-size: 12px; font-weight: 700; }
