/* ============================================================
   TOKENS
   ============================================================ */
:root {
    --font-display: "Oswald", "Arial Narrow", Impact, sans-serif;
    --font-body:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    --font-mono:
        "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono",
        monospace;

    /* dark / garage default */
    --ink-900: #12151a;
    --ink-800: #1b1f27;
    --ink-700: #232833;
    --ink-650: #262b35;
    --line-600: #333a46;
    --line-500: #3e4757;
    --chrome-100: #edeff2;
    --chrome-300: #aeb4bf;
    --chrome-500: #7b8494;
    --amber-500: #f2a730;
    --amber-600: #d98f1f;
    --amber-tint: #3a2e17;
    --teal-500: #2fa98c;
    --teal-tint: #173430;
    --red-500: #e5595e;
    --red-tint: #3a1e20;
    --shadow-1:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 10px 24px -12px rgba(0, 0, 0, 0.55);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --ink-900: #edece6;
        --ink-800: #f8f7f3;
        --ink-700: #ffffff;
        --ink-650: #ffffff;
        --line-600: #d9d6cc;
        --line-500: #c7c3b6;
        --chrome-100: #1b1d22;
        --chrome-300: #4b4f58;
        --chrome-500: #6d7178;
        --amber-tint: #fceacb;
        --teal-tint: #dbf0ea;
        --red-tint: #f8dedf;
        --shadow-1:
            0 1px 0 rgba(255, 255, 255, 0.6) inset,
            0 10px 24px -14px rgba(30, 25, 10, 0.25);
    }
}
:root[data-theme="light"] {
    --ink-900: #edece6;
    --ink-800: #f8f7f3;
    --ink-700: #ffffff;
    --ink-650: #ffffff;
    --line-600: #d9d6cc;
    --line-500: #c7c3b6;
    --chrome-100: #1b1d22;
    --chrome-300: #4b4f58;
    --chrome-500: #6d7178;
    --amber-tint: #fceacb;
    --teal-tint: #dbf0ea;
    --red-tint: #f8dedf;
    --shadow-1:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 10px 24px -14px rgba(30, 25, 10, 0.25);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
    width: 100%;
    overflow-x: hidden;
}
body {
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    background: var(--ink-900);
    background-image: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.015) 0px,
        rgba(255, 255, 255, 0.015) 1px,
        transparent 1px,
        transparent 42px
    );
    color: var(--chrome-100);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}
img {
    max-width: 100%;
    display: block;
}
button {
    font: inherit;
}
a {
    color: inherit;
}
::selection {
    background: var(--amber-500);
    color: #1a1305;
}
:focus-visible {
    outline: 2px solid var(--amber-500);
    outline-offset: 2px;
    border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--ink-800) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-600);
}
.topbar-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px clamp(14px, 4vw, 20px);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--chrome-100);
    min-width: 0;
    flex-shrink: 0;
}
.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(155deg, var(--amber-500), var(--amber-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1305;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow-1);
    flex-shrink: 0;
}
.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.brand-name small {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 10px;
    color: var(--chrome-500);
    letter-spacing: 0.3px;
}

.brand-logo {
    height: auto;
    width: 150px;
    display: block;
}

#topbarRight {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: nowrap;
}
.plate-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    border: 1px solid var(--line-600);
    border-radius: 999px;
    padding: 5px 10px 5px 6px;
    background: var(--ink-700);
}
.plate-chip .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal-500);
    flex-shrink: 0;
}
.plate-chip .dot.due {
    background: var(--amber-500);
}
.plate-chip .dot.over {
    background: var(--red-500);
}
.plate-chip span {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--chrome-300);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 34vw;
}
.link-reset {
    background: none;
    border: 0;
    color: var(--chrome-500);
    font-size: 12.5px;
    cursor: pointer;
    padding: 8px 2px;
    text-decoration: underline;
    text-underline-offset: 2px;
    flex-shrink: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
}
.link-reset:hover {
    color: var(--chrome-100);
}
@media (max-width: 400px) {
    .brand-name small {
        display: none;
    }
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
    display: none;
}
.screen.active {
    display: block;
}

/* ---------- SEARCH SCREEN ---------- */
.hero-search {
    min-height: calc(100vh - 63px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 64px;
}
.search-card {
    width: 100%;
    max-width: 460px;
    background: linear-gradient(180deg, var(--ink-700), var(--ink-650));
    border: 1px solid var(--line-600);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 5vw, 38px);
    box-shadow: var(--shadow-1);
    position: relative;
    overflow: hidden;
}
.search-card::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--amber-500) 0%, transparent 70%);
    opacity: 0.12;
    pointer-events: none;
}
.search-eyebrow-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(155deg, var(--amber-500), var(--amber-600));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: var(--shadow-1);
}
.search-eyebrow-mark svg {
    width: 24px;
    height: 24px;
}
.search-card h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(24px, 5vw, 30px);
    margin: 0 0 8px;
    line-height: 1.15;
    letter-spacing: 0.2px;
}
.search-card p.lede {
    margin: 0 0 26px;
    color: var(--chrome-300);
    font-size: 14.5px;
    max-width: 38ch;
}

.seg {
    display: flex;
    background: var(--ink-800);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 16px;
    gap: 4px;
}
.seg button {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--chrome-300);
    padding: 9px 10px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.seg button.active {
    background: var(--amber-500);
    color: #1a1305;
}

.field {
    margin-bottom: 8px;
}
.field label {
    display: block;
    font-size: 12.5px;
    color: var(--chrome-500);
    margin-bottom: 7px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.field-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ink-800);
    border: 1px solid var(--line-500);
    border-radius: var(--radius-md);
    padding: 0 4px 0 14px;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.field-input:focus-within {
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber-500) 22%, transparent);
}
.field-input .prefix {
    color: var(--chrome-500);
    font-family: var(--font-mono);
    font-size: 14px;
    flex-shrink: 0;
}
.field-input input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    color: var(--chrome-100);
    padding: 14px 10px 14px 0;
    font-family: var(--font-mono);
    font-size: 16px;
    letter-spacing: 0.5px;
}
.field-input input::placeholder {
    color: var(--chrome-500);
    letter-spacing: normal;
    font-family: var(--font-body);
}
.field-input input:focus {
    outline: none;
}

.hint {
    font-size: 12px;
    color: var(--chrome-500);
    margin: 10px 0 22px;
}
.hint button {
    background: none;
    border: 0;
    color: var(--amber-500);
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
    padding: 0;
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    border: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--amber-500), var(--amber-600));
    color: #1a1305;
    font-weight: 700;
    font-size: 15px;
    padding: 15px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition:
        transform 0.12s ease,
        filter 0.15s ease;
    min-height: 48px;
}
.btn-primary:hover {
    filter: brightness(1.06);
}
.btn-primary:active {
    transform: scale(0.985);
}
.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--red-tint);
    border: 1px solid color-mix(in srgb, var(--red-500) 45%, transparent);
    color: var(--red-500);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-top: 16px;
}
.form-error svg {
    flex-shrink: 0;
    margin-top: 1px;
}
.form-error strong {
    color: var(--chrome-100);
}

/* ============================================================
   DASHBOARD SCREEN
   ============================================================ */
.veh-header {
    padding: 28px 0 6px;
}
.veh-header .kicker {
    font-size: 12.5px;
    color: var(--chrome-500);
    font-weight: 600;
    letter-spacing: 0.3px;
    margin: 0 0 6px;
}
.veh-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 14px;
}
.veh-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(22px, 5vw, 30px);
    margin: 0;
}
.veh-sub {
    color: var(--chrome-300);
    font-size: 14px;
}

.hero-card {
    margin-top: 20px;
    background: linear-gradient(165deg, var(--ink-700), var(--ink-650));
    border: 1px solid var(--line-600);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 4vw, 30px);
    box-shadow: var(--shadow-1);
    display: grid;
    gap: 26px;
}
@media (min-width: 680px) {
    .hero-card {
        grid-template-columns: 1.1fr 1fr;
        align-items: center;
    }
}
.odo-block .label {
    font-size: 12px;
    color: var(--chrome-500);
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}
.odo-reel {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: baseline;
    row-gap: 6px;
}
.odo-digit {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(22px, 6.5vw, 42px);
    background: var(--ink-900);
    border: 1px solid var(--line-500);
    border-radius: 5px;
    min-width: 0.85em;
    text-align: center;
    padding: 2px 2px;
    color: var(--chrome-100);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.odo-unit {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 14px;
    color: var(--chrome-300);
    margin-left: 4px;
    align-self: center;
}
.odo-meta {
    margin-top: 12px;
    font-size: 13.5px;
    color: var(--chrome-300);
}
.odo-meta b {
    color: var(--chrome-100);
    font-weight: 600;
}

.due-block {
    border-left: 0;
}
@media (min-width: 680px) {
    .due-block {
        border-left: 1px solid var(--line-600);
        padding-left: 26px;
    }
}
.due-block .label {
    font-size: 12px;
    color: var(--chrome-500);
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
}
.due-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    margin-bottom: 14px;
}
.due-status .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--teal-500);
}
.due-status.due .dot {
    background: var(--amber-500);
}
.due-status.over .dot {
    background: var(--red-500);
}
.due-status.ok {
    color: var(--teal-500);
}
.due-status.due {
    color: var(--amber-500);
}
.due-status.over {
    color: var(--red-500);
}

.gauge {
    height: 10px;
    border-radius: 999px;
    background: var(--ink-900);
    border: 1px solid var(--line-500);
    overflow: hidden;
    margin-bottom: 10px;
}
.gauge-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal-500), var(--teal-500));
    transition: width 0.5s ease;
}
.gauge-fill.due {
    background: linear-gradient(90deg, var(--amber-600), var(--amber-500));
}
.gauge-fill.over {
    background: linear-gradient(90deg, #9c2f33, var(--red-500));
}
.due-figures {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--chrome-500);
    font-family: var(--font-mono);
}
.due-date-line {
    margin-top: 14px;
    font-size: 13.5px;
    color: var(--chrome-300);
}
.due-date-line b {
    color: var(--chrome-100);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ---- ongoing service banner ---- */
.ongoing-banner {
    margin-top: 20px;
    background: var(--amber-tint);
    border: 1px solid color-mix(in srgb, var(--amber-500) 45%, transparent);
    border-radius: var(--radius-lg);
    padding: clamp(18px, 3.5vw, 24px);
}
.ongoing-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
}
.ongoing-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
}
.pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--amber-500);
    position: relative;
    flex-shrink: 0;
}
.pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid var(--amber-500);
    animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
    0% {
        transform: scale(0.6);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}
.ongoing-meta {
    font-size: 12.5px;
    color: var(--chrome-300);
}
.ongoing-body {
    margin-top: 14px;
}
.issue-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ink-800);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
}
.issue-row span.txt {
    flex: 1;
    font-size: 14px;
}
.issue-row input.edit-input {
    flex: 1;
    background: var(--ink-900);
    border: 1px solid var(--line-500);
    border-radius: 6px;
    color: var(--chrome-100);
    padding: 7px 10px;
    font-size: 14px;
    font-family: var(--font-body);
}
.icon-btn {
    background: none;
    border: 0;
    color: var(--chrome-500);
    cursor: pointer;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    display: flex;
    border-radius: 6px;
    flex-shrink: 0;
}
.icon-btn:hover {
    color: var(--chrome-100);
    background: var(--ink-700);
}
.icon-btn.danger:hover {
    color: var(--red-500);
}
.add-issue-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.add-issue-row input {
    flex: 1;
    min-width: 0;
    background: var(--ink-800);
    border: 1px solid var(--line-500);
    border-radius: var(--radius-sm);
    color: var(--chrome-100);
    padding: 11px 13px;
    font-size: 14px;
    font-family: var(--font-body);
    min-width: 160px;
}
.add-issue-row input:focus {
    outline: none;
    border-color: var(--amber-500);
}
.btn-small {
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--amber-500);
    color: #1a1305;
    font-weight: 700;
    font-size: 13.5px;
    padding: 0 16px;
    cursor: pointer;
    white-space: nowrap;
    min-height: 42px;
    flex-shrink: 0;
}
.btn-small:hover {
    filter: brightness(1.06);
}
@media (max-width: 360px) {
    .add-issue-row input {
        flex: 1 1 100%;
    }
    .btn-small {
        flex: 1 1 100%;
        min-height: 44px;
    }
}
.empty-note {
    font-size: 13px;
    color: var(--chrome-500);
    font-style: italic;
    margin: 2px 0 10px;
}

/* ---- timeline / service list ---- */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 38px 0 14px;
    gap: 10px;
}
.section-head h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 19px;
    margin: 0;
}
.section-head .count {
    font-size: 13px;
    color: var(--chrome-500);
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--line-600);
}
.tl-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 10px;
}
.tl-dot {
    position: absolute;
    left: 11px;
    top: 18px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--ink-800);
    border: 2px solid var(--teal-500);
    z-index: 1;
}
.tl-dot.ongoing {
    border-color: var(--amber-500);
}
.tl-card {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 14px;
    text-align: left;
    background: var(--ink-700);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-md);
    padding: 15px 16px;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        transform 0.1s ease;
    min-width: 0;
}
.tl-card:hover {
    border-color: var(--line-500);
}
.tl-card:active {
    transform: scale(0.995);
}
.tl-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--chrome-500);
    min-width: 60px;
    line-height: 1.35;
    flex-shrink: 0;
}
.tl-date b {
    display: block;
    color: var(--chrome-300);
    font-size: 12.5px;
}
.tl-main {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.tl-type {
    display: block;
    width: 100%;
    font-weight: 600;
    font-size: 14.5px;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tl-sub {
    display: block;
    width: 100%;
    font-size: 12.5px;
    color: var(--chrome-500);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tl-tag {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    flex-shrink: 0;
    background: var(--teal-tint);
    color: var(--teal-500);
    white-space: nowrap;
}
.tl-tag.ongoing {
    background: var(--amber-tint);
    color: var(--amber-500);
}
.tl-cost {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--chrome-300);
    flex-shrink: 0;
    min-width: 70px;
    text-align: right;
}
.chev {
    color: var(--chrome-500);
    flex-shrink: 0;
    display: flex;
}

/* Below ~600px there are too many inline elements to fit one row legibly,
   so the card reflows into two compact rows instead of squeezing every item. */
@media (max-width: 600px) {
    .tl-item {
        padding-left: 34px;
    }
    .tl-dot {
        left: 9px;
        width: 14px;
        height: 14px;
        top: 16px;
    }
    .tl-card {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "date main chev"
            "tag  tag  cost";
        align-items: center;
        row-gap: 9px;
        column-gap: 10px;
        padding: 13px 14px;
    }
    .tl-date {
        grid-area: date;
        min-width: 0;
    }
    .tl-main {
        grid-area: main;
        min-width: 0;
        overflow: hidden;
    }
    .tl-tag {
        grid-area: tag;
        justify-self: start;
    }
    .tl-cost {
        grid-area: cost;
        justify-self: end;
        min-width: 0;
    }
    .chev {
        grid-area: chev;
    }
}

/* ============================================================
   DETAIL SCREEN
   ============================================================ */
.back-row {
    padding: 22px 0 0;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    color: var(--chrome-300);
    cursor: pointer;
    font-size: 14px;
    padding: 8px 2px;
    font-weight: 500;
}
.back-link:hover {
    color: var(--chrome-100);
}

.detail-head {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}
.detail-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(21px, 5vw, 27px);
    margin: 0 0 6px;
}
.detail-sub {
    color: var(--chrome-300);
    font-size: 13.5px;
    font-family: var(--font-mono);
}
.status-pill {
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--teal-tint);
    color: var(--teal-500);
    flex-shrink: 0;
}
.status-pill.ongoing {
    background: var(--amber-tint);
    color: var(--amber-500);
}

.card {
    background: var(--ink-700);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-lg);
    padding: clamp(18px, 3.5vw, 24px);
    margin-top: 18px;
}
.card h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15.5px;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: 0.2px;
}
.card h3 svg {
    flex-shrink: 0;
    color: var(--amber-500);
}

.center-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.center-logo {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    flex-shrink: 0;
    background: linear-gradient(155deg, var(--ink-800), var(--ink-900));
    border: 1px solid var(--line-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    color: var(--amber-500);
}
.center-info b {
    display: block;
    font-size: 15.5px;
    margin-bottom: 2px;
}
.center-info span {
    display: block;
    font-size: 12.5px;
    color: var(--chrome-500);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag {
    font-size: 13px;
    background: var(--ink-800);
    border: 1px solid var(--line-600);
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--chrome-100);
}

.parts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.parts-table th {
    text-align: left;
    font-size: 11px;
    text-transform: none;
    color: var(--chrome-500);
    font-weight: 600;
    padding: 0 8px 10px 0;
    border-bottom: 1px solid var(--line-600);
}
.parts-table td {
    padding: 11px 8px 11px 0;
    border-bottom: 1px solid var(--line-600);
    vertical-align: top;
}
.parts-table tr:last-child td {
    border-bottom: 0;
}
.parts-table td.num,
.parts-table th.num {
    text-align: right;
    font-family: var(--font-mono);
}
.parts-table td:first-child {
    color: var(--chrome-100);
    font-weight: 500;
}

.cost-lines {
    font-size: 14px;
}
.cost-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--chrome-300);
}
.cost-line b {
    color: var(--chrome-100);
    font-weight: 500;
}
.cost-line .amt {
    font-family: var(--font-mono);
}
.cost-line.total {
    border-top: 1px dashed var(--line-500);
    margin-top: 6px;
    padding-top: 14px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    color: var(--chrome-100);
}
.cost-line.total .amt {
    font-family: var(--font-mono);
    color: var(--amber-500);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.gallery-item {
    border: 1px solid var(--line-600);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--ink-800);
    cursor: pointer;
    text-align: left;
    padding: 0;
}
.gallery-thumb {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(
        45deg,
        var(--ink-900),
        var(--ink-900) 8px,
        var(--ink-800) 8px,
        var(--ink-800) 16px
    );
    color: var(--chrome-500);
}
.gallery-caption {
    padding: 8px 10px;
    font-size: 11.5px;
    color: var(--chrome-500);
    border-top: 1px solid var(--line-600);
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(6, 7, 9, 0.82);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}
.lightbox.active {
    display: flex;
}
.lightbox-inner {
    background: var(--ink-700);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 100%;
    padding: 26px;
    text-align: center;
    position: relative;
}
.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: 0;
    color: var(--chrome-500);
    cursor: pointer;
    padding: 6px;
}
.lightbox-icon {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    margin: 0 auto 16px;
    background: var(--ink-900);
    border: 1px solid var(--line-500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--amber-500);
}
.lightbox-inner p {
    color: var(--chrome-300);
    font-size: 13.5px;
    margin: 4px 0 0;
}
.lightbox-inner b {
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
}

footer.foot {
    max-width: 900px;
    margin: 50px auto 0;
    padding: 22px 20px 40px;
    border-top: 1px solid var(--line-600);
    color: var(--chrome-500);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.foot-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}
.foot-meta {
    justify-content: space-between;
}
.foot-links a {
    color: var(--chrome-300);
    text-decoration: none;
    font-weight: 500;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}
.foot-links a:hover {
    color: var(--chrome-100);
    text-decoration: underline;
}

/* ---- small screens ---- */
@media (max-width: 600px) {
    .hero-search {
        padding: 24px 14px 48px;
    }
    .search-card {
        padding: 22px 18px;
    }
    .seg button {
        padding: 9px 6px;
        font-size: 12.5px;
    }
    .field-input input {
        font-size: 16px;
    } /* prevents iOS auto-zoom on focus */
    .hero-card {
        padding: 18px;
        gap: 20px;
        border-radius: 12px;
    }
    .due-block {
        padding-top: 18px;
        border-top: 1px solid var(--line-600);
    }
    .section-head {
        margin: 28px 0 12px;
        flex-wrap: wrap;
    }
    .center-row {
        gap: 12px;
    }
    .center-logo {
        width: 46px;
        height: 46px;
        font-size: 15px;
    }
    .parts-table {
        font-size: 12.5px;
    }
    .parts-table th,
    .parts-table td {
        padding-right: 4px;
    }
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
        gap: 10px;
    }
    .card {
        padding: 16px;
        border-radius: 12px;
    }
    .lightbox-inner {
        padding: 20px;
    }
}
@media (max-width: 480px) {
    .wrap {
        padding: 0 16px;
    }
    .topbar-inner {
        padding: 12px 16px;
    }
    .brand-name {
        font-size: 16px;
    }
    .search-eyebrow-mark {
        width: 40px;
        height: 40px;
        margin-bottom: 14px;
    }
    .btn-primary {
        font-size: 14.5px;
    }
}
@media (max-width: 360px) {
    .odo-digit {
        font-size: 20px;
    }
    .due-figures span {
        font-size: 11px;
    }
    .plate-chip span {
        max-width: 22vw;
    }
}

/* ============================================================
   LIVEWIRE PORT ADDITIONS
   (anchors instead of buttons, vehicle picker, real photos)
   ============================================================ */
.tl-card {
    text-decoration: none;
    color: inherit;
}
.back-link {
    text-decoration: none;
}
.gallery-item {
    display: block;
    text-decoration: none;
    color: inherit;
}
.gallery-thumb {
    overflow: hidden;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lightbox-inner.wide {
    max-width: min(880px, 100%);
}
.lightbox-img {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 10px;
    background: var(--ink-900);
    margin-bottom: 14px;
}

.choice-list {
    margin-top: 20px;
    border-top: 1px solid var(--line-600);
    padding-top: 16px;
}
.choice-title {
    font-size: 13px;
    color: var(--chrome-300);
    margin: 0 0 12px;
}
.choice {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    background: var(--ink-800);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    min-height: 48px;
}
.choice:hover {
    border-color: var(--amber-500);
}
.choice-plate {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13.5px;
    flex-shrink: 0;
}
.choice-name {
    flex: 1;
    min-width: 0;
    color: var(--chrome-500);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
form .field + .btn-primary {
    margin-top: 22px;
}
.issue-error {
    flex: 1 1 100%;
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--red-500);
}
.issue-row .edit-input {
    min-width: 0;
}

/* ---- 404 page ---- */
.err-card {
    text-align: center;
}
.err-code {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 88px;
    line-height: 1;
    letter-spacing: 0.06em;
    margin: 0 0 6px;
    color: var(--amber-500);
}
a.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    margin-top: 22px;
}
@media (max-width: 480px) {
    .err-code {
        font-size: 68px;
    }
}

/* ============================================================
   HOME PAGE
   ============================================================ */
:root {
    --amber-text: var(--amber-500);
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --amber-text: #b8650b;
    }
}
:root[data-theme="light"] {
    --amber-text: #b8650b;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

.search-card h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(24px, 5vw, 30px);
    margin: 0 0 8px;
    line-height: 1.15;
    letter-spacing: 0.2px;
}
body:has(.home-wrap) footer.foot {
    max-width: 1120px;
    padding-left: clamp(16px, 4vw, 28px);
    padding-right: clamp(16px, 4vw, 28px);
}

.home-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 28px);
}

/* top navigation (home only) */
.topbar-inner.wide {
    max-width: 1120px;
    padding-left: clamp(16px, 4vw, 28px);
    padding-right: clamp(16px, 4vw, 28px);
}
.topnav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.topnav a {
    color: var(--chrome-300);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    min-height: 40px;
    display: flex;
    align-items: center;
}
.topnav a:hover {
    color: var(--chrome-100);
    background: var(--ink-700);
}
.topnav a.topnav-cta {
    background: linear-gradient(180deg, var(--amber-500), var(--amber-600));
    color: #1a1305;
    font-weight: 700;
    margin-left: 6px;
}
.topnav a.topnav-cta:hover {
    filter: brightness(1.06);
    background: linear-gradient(180deg, var(--amber-500), var(--amber-600));
    color: #1a1305;
}
@media (max-width: 760px) {
    .topnav a:not(.topnav-cta) {
        display: none;
    }
}

/* hero */
.home-hero {
    padding: clamp(32px, 7vw, 88px) 0 clamp(40px, 6vw, 72px);
}
.home-hero-grid {
    display: grid;
    gap: clamp(28px, 5vw, 56px);
    align-items: center;
}
@media (min-width: 960px) {
    .home-hero-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--chrome-300);
    background: var(--ink-700);
    border: 1px solid var(--line-600);
    border-radius: 999px;
    padding: 6px 14px 6px 11px;
}
.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber-500);
    flex-shrink: 0;
}
.home-h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(34px, 6.4vw, 58px);
    line-height: 1.08;
    letter-spacing: 0.2px;
    margin: 0 0 16px;
}
.home-h1 em {
    font-style: normal;
    color: var(--amber-text);
}
.home-lede {
    color: var(--chrome-300);
    font-size: clamp(15.5px, 2.2vw, 18px);
    line-height: 1.6;
    max-width: 56ch;
    margin: 0 0 24px;
}
.trust-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 11px;
    color: var(--chrome-300);
    font-size: 14.5px;
}
.trust-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}
.trust-list svg {
    color: var(--teal-500);
    flex-shrink: 0;
}
.home-search {
    scroll-margin-top: 84px;
    min-width: 0;
}
.home-search .search-card {
    max-width: none;
}
@media (min-width: 960px) {
    .home-search .search-card {
        max-width: 480px;
        margin-left: auto;
    }
}

/* sections */
.home-section {
    padding: clamp(44px, 7vw, 84px) 0;
    border-top: 1px solid var(--line-600);
    scroll-margin-top: 60px;
}
.home-section-head {
    max-width: 64ch;
    margin: 0 0 clamp(26px, 4vw, 40px);
}
.home-section-head h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(26px, 4.4vw, 38px);
    line-height: 1.15;
    letter-spacing: 0.2px;
    margin: 0 0 12px;
}
.home-section-head p {
    color: var(--chrome-300);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
}
@media (min-width: 760px) {
    .steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}
.step {
    counter-increment: step;
    background: var(--ink-700);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.step::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: linear-gradient(155deg, var(--amber-500), var(--amber-600));
    color: #1a1305;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
}
.step h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 19px;
    margin: 0 0 8px;
    letter-spacing: 0.2px;
}
.step p {
    margin: 0;
    color: var(--chrome-300);
    font-size: 14.5px;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 960px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.feature {
    background: var(--ink-700);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-lg);
    padding: 22px;
}
.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    margin-bottom: 14px;
    background: var(--amber-tint);
    color: var(--amber-text);
    display: flex;
    align-items: center;
    justify-content: center;
}
.feature h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    margin: 0 0 6px;
    letter-spacing: 0.2px;
}
.feature p {
    margin: 0;
    color: var(--chrome-300);
    font-size: 14.5px;
    line-height: 1.6;
}

/* sample record */
.sample-frame {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
    border: 1px dashed var(--line-500);
    border-radius: 20px;
    padding: clamp(16px, 3vw, 26px);
    padding-top: clamp(22px, 3vw, 30px);
    background: color-mix(in srgb, var(--ink-800) 60%, transparent);
}
.sample-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--ink-900);
    border: 1px solid var(--line-500);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--chrome-300);
}
.sample-frame .veh-title {
    font-size: clamp(20px, 4vw, 26px);
}
.sample-frame .tl-card {
    cursor: default;
}
.sample-frame .tl-card:hover {
    border-color: var(--line-600);
}
.sample-frame .timeline {
    margin-top: 20px;
}

/* faq */
.faq {
    display: grid;
    gap: 12px;
    /* max-width: 820px; */
}
.faq details {
    background: var(--ink-700);
    border: 1px solid var(--line-600);
    border-radius: var(--radius-md);
}
.faq details[open] {
    border-color: var(--line-500);
}
.faq summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 18px;
    min-height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1.4;
}
.faq summary::-webkit-details-marker {
    display: none;
}
.faq summary::after {
    content: "+";
    font-size: 22px;
    line-height: 1;
    color: var(--amber-text);
    flex-shrink: 0;
}
.faq details[open] summary::after {
    content: "\2013";
}
.faq details p {
    margin: 0;
    padding: 0 18px 18px;
    color: var(--chrome-300);
    font-size: 14.5px;
    line-height: 1.65;
}

/* closing call to action */
.cta-band {
    margin-top: clamp(36px, 6vw, 64px);
    text-align: center;
    background: linear-gradient(165deg, var(--ink-700), var(--ink-650));
    border: 1px solid var(--line-600);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: clamp(28px, 6vw, 56px) clamp(18px, 4vw, 40px);
}
.cta-band h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(24px, 4.4vw, 36px);
    margin: 0 0 10px;
    letter-spacing: 0.2px;
}
.cta-band p {
    color: var(--chrome-300);
    margin: 0 auto 24px;
    max-width: 52ch;
    font-size: 15.5px;
}
.cta-band a.btn-primary {
    display: inline-flex;
    width: auto;
    margin-top: 0;
    padding: 15px 30px;
    text-decoration: none;
}

@media (max-width: 480px) {
    .step {
        padding: 20px;
    }
    .feature {
        padding: 18px;
    }
    .sample-badge {
        left: 14px;
    }
}

/* ============================================================
   WORKSHOP APP SECTION
   ============================================================ */
.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 22px;
    min-height: 44px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--chrome-100);
    text-decoration: none;
    border-bottom: 1px solid var(--line-500);
    padding-bottom: 2px;
}
.hero-link:hover {
    border-color: var(--amber-500);
}

.app-section {
    background: color-mix(in srgb, var(--ink-800) 55%, transparent);
}
.app-grid {
    display: grid;
    gap: clamp(28px, 5vw, 56px);
    align-items: center;
    margin-bottom: clamp(30px, 5vw, 48px);
}
@media (min-width: 900px) {
    .app-grid {
        grid-template-columns: 1.15fr 0.85fr;
    }
}
.app-copy h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(28px, 4.8vw, 42px);
    line-height: 1.12;
    letter-spacing: 0.2px;
    margin: 0 0 14px;
}
.app-lede {
    color: var(--chrome-300);
    font-size: clamp(15.5px, 2.2vw, 17.5px);
    line-height: 1.6;
    max-width: 56ch;
    margin: 0 0 26px;
}
.app-meta {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--chrome-500);
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    background: #0b0d10;
    color: #fff;
    border: 1px solid #4a505c;
    border-radius: 12px;
    padding: 9px 22px 9px 16px;
    min-height: 52px;
    transition:
        transform 0.12s ease,
        border-color 0.15s ease;
}
.store-btn:hover {
    border-color: var(--amber-500);
}
.store-btn:active {
    transform: scale(0.985);
}
.store-btn svg {
    flex-shrink: 0;
}
.store-btn span {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}
.store-btn small {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: #c9ced6;
}
.store-btn b {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.phone {
    width: min(268px, 74vw);
    margin: 0 auto;
    padding: 12px;
    border-radius: 36px;
    border: 1px solid var(--line-500);
    box-shadow: var(--shadow-1);
    background: linear-gradient(165deg, var(--ink-700), var(--ink-650));
}
.phone-screen {
    display: grid;
    gap: 10px;
    padding: 14px 14px 18px;
    border-radius: 26px;
    background: var(--ink-800);
    border: 1px solid var(--line-600);
}
.phone-bar {
    display: block;
    width: 64px;
    height: 5px;
    border-radius: 999px;
    background: var(--line-500);
    margin: 0 auto 6px;
}
.ph-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}
.ph-title .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 12px;
    border-radius: 7px;
}
.ph-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--ink-700);
    border: 1px solid var(--line-600);
}
.ph-ico {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    flex-shrink: 0;
    background: var(--amber-tint);
    color: var(--amber-text);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ph-lines {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 7px;
}
.ph-lines b {
    font-size: 13.5px;
    font-weight: 600;
}
.ph-lines i {
    display: block;
    height: 6px;
    width: 60%;
    border-radius: 999px;
    background: var(--line-500);
    opacity: 0.8;
}

.app-features {
    margin-top: 0;
}
.app-note {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: var(--teal-tint);
    border: 1px solid color-mix(in srgb, var(--teal-500) 40%, transparent);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--chrome-300);
}
.app-note strong {
    color: var(--chrome-100);
}

.cta-alt {
    margin: 18px 0 0 !important;
    font-size: 14px;
    color: var(--chrome-500) !important;
}
.cta-alt a {
    color: var(--chrome-100);
    font-weight: 600;
    text-underline-offset: 3px;
}

/* ============================================================
   LEGAL PAGES (Terms, Privacy)
   ============================================================ */
.legal-shell {
    display: grid;
    gap: clamp(24px, 4vw, 48px);
    padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 7vw, 88px);
    align-items: start;
}
@media (min-width: 900px) {
    .legal-shell {
        grid-template-columns: 220px minmax(0, 760px);
    }
}

.legal-toc {
    position: sticky;
    top: 0;
    align-self: start;
    border: 1px solid var(--line-600);
    border-radius: var(--radius-md);
    background: var(--ink-700);
    padding: 16px;
}
@media (min-width: 900px) {
    .legal-toc {
        top: 20px;
    }
}
.legal-toc-label {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--chrome-500);
}
.legal-toc nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.legal-toc nav a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    min-height: 36px;
    line-height: 20px;
    font-size: 13.5px;
    color: var(--chrome-300);
    text-decoration: none;
}
.legal-toc nav a:hover {
    background: var(--ink-800);
    color: var(--chrome-100);
}
@media (max-width: 899px) {
    .legal-toc {
        max-height: 220px;
        overflow-y: auto;
    }
    .legal-toc nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 8px;
    }
}
@media (max-width: 480px) {
    .legal-toc nav {
        grid-template-columns: 1fr;
    }
}

.legal-content {
    min-width: 0;
    max-width: 760px;
}
.legal-kicker {
    margin: 0 0 8px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--amber-text);
}
.legal-content h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.15;
    letter-spacing: 0.2px;
    margin: 0 0 8px;
}
.legal-updated {
    margin: 0 0 30px;
    font-size: 13px;
    color: var(--chrome-500);
}
.legal-content h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(19px, 3vw, 23px);
    letter-spacing: 0.2px;
    margin: 38px 0 12px;
    scroll-margin-top: 20px;
    padding-top: 6px;
}
.legal-content h2:first-of-type {
    margin-top: 0;
}
.legal-content h3 {
    font-weight: 700;
    font-size: 15.5px;
    margin: 22px 0 8px;
    color: var(--chrome-100);
}
.legal-content p {
    color: var(--chrome-300);
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 16px;
}
.legal-content p strong {
    color: var(--chrome-100);
}
.legal-content ul,
.legal-content ol {
    margin: 0 0 16px;
    padding-left: 22px;
    color: var(--chrome-300);
    font-size: 15px;
    line-height: 1.7;
}
.legal-content li {
    margin-bottom: 6px;
}
.legal-content a {
    color: var(--amber-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 22px;
    font-size: 13.5px;
    border: 1px solid var(--line-600);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.legal-table th,
.legal-table td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-600);
    vertical-align: top;
}
.legal-table th {
    background: var(--ink-700);
    font-weight: 700;
    color: var(--chrome-100);
    font-size: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.legal-table td {
    color: var(--chrome-300);
}
.legal-table tr:last-child td {
    border-bottom: none;
}
@media (max-width: 600px) {
    .legal-table,
    .legal-table thead,
    .legal-table tbody,
    .legal-table th,
    .legal-table td,
    .legal-table tr {
        display: block;
    }
    .legal-table thead {
        display: none;
    }
    .legal-table tr {
        border-bottom: 1px solid var(--line-600);
        padding: 10px 14px;
    }
    .legal-table tr:last-child {
        border-bottom: none;
    }
    .legal-table td {
        border: none;
        padding: 4px 0;
    }
    .legal-table td:first-child {
        font-weight: 600;
        color: var(--chrome-100);
    }
}

.legal-contact {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.legal-contact li {
    margin-bottom: 6px;
}
.legal-footnote {
    font-size: 13px;
    color: var(--chrome-500);
    border-top: 1px solid var(--line-600);
    padding-top: 18px;
    margin-top: 32px;
}

/* ============================================================
   MOBILE APP OPEN BANNER
   ============================================================ */
.app-open-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px clamp(14px, 4vw, 20px);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--ink-700);
    border-top: 1px solid var(--line-600);
    box-shadow: 0 -10px 24px -12px rgba(0, 0, 0, 0.45);
    animation: aob-slide-up 0.25s ease;
}
.app-open-banner[hidden] {
    display: none;
}
@keyframes aob-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
body.has-app-open-banner {
    padding-bottom: 72px;
}
.aob-close {
    flex-shrink: 0;
    background: none;
    border: 0;
    color: var(--chrome-500);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.aob-close:hover {
    color: var(--chrome-100);
    background: var(--ink-800);
}
.aob-icon {
    flex-shrink: 0;
}
.aob-icon .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 13px;
}
.aob-copy {
    flex: 1;
    min-width: 0;
}
.aob-copy b {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--chrome-100);
}
.aob-copy span {
    display: block;
    font-size: 12px;
    color: var(--chrome-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aob-open-btn {
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--amber-500), var(--amber-600));
    color: #1a1305;
    font-weight: 700;
    font-size: 13.5px;
    padding: 9px 18px;
    cursor: pointer;
    min-height: 36px;
}
.aob-open-btn:hover {
    filter: brightness(1.06);
}
@media (min-width: 781px) {
    .app-open-banner {
        display: none !important;
    }
}
