/* ==========================================================================
   Auto Style — premium car care service UI
   Royal blue on white, minimal SaaS proportions, no framework.
   ========================================================================== */

:root {
    --blue: #0755c9;
    --blue-deep: #0b4dbb;
    --blue-dark: #08419e;
    --blue-100: #eaf1fd;
    --blue-50: #f4f8ff;
    --blue-ring: rgba(7, 85, 201, 0.13);

    --ink: #0e1729;
    --ink-2: #1c2942;
    --muted: #64748b;
    --faint: #94a3b8;

    --page: #f5f8fd;
    --surface: #ffffff;
    --surface-2: #fafbfd;
    --line: #e6eaf2;
    --line-2: #dbe2ee;

    --danger: #dc2626;
    --danger-soft: #fef3f2;
    --success: #0f9d58;
    --success-soft: #eefaf3;

    --r-lg: 16px;
    --r: 12px;
    --r-sm: 10px;

    --shadow-xs: 0 1px 2px rgba(16, 30, 54, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 30, 54, 0.06);
    --shadow: 0 2px 6px rgba(16, 30, 54, 0.05), 0 18px 40px -28px rgba(16, 30, 54, 0.28);

    --field-h: 52px;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    --font: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
            Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
    background:
        radial-gradient(1200px 620px at 50% -220px, #e9f1ff 0%, rgba(233, 241, 255, 0) 70%),
        var(--page);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==========================================================================
   Shells
   ========================================================================== */

.app-shell {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: calc(24px + var(--safe-top)) 16px calc(30px + var(--safe-bottom));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-shell.wide { max-width: 1200px; }

/* the framed desktop application window */
.app-shell.frame {
    max-width: 1240px;
    padding: 20px 20px calc(20px + var(--safe-bottom));
    justify-content: center;
}

.app-frame {
    display: grid;
    grid-template-columns: 164px 1fr;
    min-height: 660px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    /* no overflow:hidden — it would stop the sidebar nav from sticking */
}

/* ==========================================================================
   Sidebar (desktop)
   ========================================================================== */

.sidebar {
    position: relative;
    padding: 26px 14px 20px;
    background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 55%, var(--blue-dark) 100%);
    border-radius: 21px 0 0 21px;
}

/* the nav stays in view while the form scrolls past it */
.sidebar-inner {
    position: sticky;
    top: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    margin-bottom: 20px;
}

.sidebar-logo svg { width: 25px; height: 25px; stroke: #fff; }

.step {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px 13px;
    border-radius: var(--r-lg);
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.step:hover:not(.is-active) { background: rgba(255, 255, 255, 0.1); }

.step-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.step-icon svg { width: 18px; height: 18px; stroke: currentColor; }

.step-num {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    opacity: 0.55;
}

.step.is-active {
    background: #fff;
    color: var(--blue);
    box-shadow: 0 6px 18px -8px rgba(4, 30, 76, 0.5);
}

.step.is-active .step-icon {
    background: var(--blue-100);
    border-color: var(--blue-100);
    color: var(--blue);
}

.step.is-active .step-num { opacity: 1; color: var(--blue); }

.step.is-done .step-icon { background: rgba(255, 255, 255, 0.22); border-color: transparent; }

/* decorative droplet pattern at the foot of the sidebar */
.sidebar-deco {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 10px;
    opacity: 0.16;
    pointer-events: none;
}

.sidebar-deco svg { width: 100%; height: auto; display: block; }

/* ==========================================================================
   Frame main column
   ========================================================================== */

.frame-main {
    display: flex;
    flex-direction: column;
    padding: 24px 30px 26px;
    background: var(--surface-2);
    border-radius: 0 21px 21px 0;
    min-width: 0;
}

.frame-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.wordmark { display: flex; align-items: center; gap: 11px; }

.wordmark-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: var(--r);
    background: linear-gradient(160deg, var(--blue), var(--blue-deep));
    box-shadow: 0 6px 16px -8px rgba(7, 85, 201, 0.85);
}

.wordmark-logo svg { width: 23px; height: 23px; stroke: #fff; }
.wordmark-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

.wordmark-sub {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}


/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 26px 28px;
    box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 14px; }

.form-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 28px 30px 24px;
}

.headline {
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 6px;
}

.subhead { margin: 0 0 6px; color: var(--muted); font-size: 14px; }

.required-note { margin: 0 0 18px; font-size: 12.5px; color: var(--faint); }
.required-note b { color: var(--danger); }

.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--blue);
}

.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-label:first-child { margin-top: 0; }

/* ==========================================================================
   Fields
   ========================================================================== */

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 7px;
}

.field label .req { color: var(--danger); font-weight: 700; }

.control { position: relative; display: flex; align-items: center; }

.control .icon {
    position: absolute;
    left: 15px;
    width: 18px;
    height: 18px;
    color: var(--faint);
    pointer-events: none;
    transition: color 0.16s ease;
}

.control:focus-within .icon { color: var(--blue); }

.input {
    width: 100%;
    height: var(--field-h);
    padding: 0 16px 0 44px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input::placeholder { color: var(--faint); }
.input:hover:not(:focus) { border-color: #c6d0e2; }

.input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-ring);
}

.input.is-filled:not(:focus) { background: var(--surface-2); }

.input.is-invalid { border-color: var(--danger); background: var(--danger-soft); }
.input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12); }

.input.plate { text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; }

/* minmax(0, 1fr) — otherwise the 1fr tracks can be pushed wider than the screen */
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.hint { margin-top: 7px; font-size: 12px; color: var(--muted); }

.error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--danger);
}

.error::before {
    content: "!";
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

/* ==========================================================================
   Upload
   ========================================================================== */

.dropzone {
    border: 1.5px dashed var(--line-2);
    border-radius: var(--r-lg);
    padding: 30px 20px;
    text-align: center;
    background: var(--blue-50);
    transition: border-color 0.16s ease, background 0.16s ease;
    cursor: pointer;
}

.dropzone:hover { border-color: #b9cdf1; }
.dropzone:active,
.dropzone.is-dragging { border-color: var(--blue); background: var(--blue-100); }

.dropzone-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: var(--r);
    background: var(--blue-100);
    color: var(--blue);
}

.dropzone-icon svg { width: 22px; height: 22px; }
.dropzone-title { font-size: 15px; font-weight: 600; }
.dropzone-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }

.previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.previews:empty { display: none; }

.preview {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-2);
    display: grid;
    place-items: center;
    animation: pop 0.16s ease;
}

.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.preview .file-chip {
    padding: 8px;
    text-align: center;
    font-size: 10px;
    color: var(--muted);
    word-break: break-word;
    line-height: 1.3;
}

.preview .file-chip svg { width: 20px; height: 20px; color: var(--blue); margin-bottom: 4px; }

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 23px;
    height: 23px;
    border: 0;
    border-radius: 50%;
    background: rgba(14, 23, 41, 0.72);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
}

@keyframes pop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 50px;
    padding: 0 26px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--blue);
    border: 0;
    border-radius: var(--r);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 20px -12px rgba(7, 85, 201, 0.9);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
    background: var(--blue-deep);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -12px rgba(7, 85, 201, 0.95);
}

.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }

.btn-full { width: 100%; }

.btn-secondary {
    color: var(--ink-2);
    background: var(--surface);
    border: 1px solid var(--line-2);
    box-shadow: none;
}

.btn-secondary:hover { background: var(--surface-2); color: var(--ink); transform: none; box-shadow: none; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--ink-2);
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-ghost:hover { background: var(--blue-50); border-color: #c3d6f6; color: var(--blue); }
.btn-ghost svg { width: 16px; height: 16px; color: var(--blue); }
.btn-row { display: grid; gap: 10px; }

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Wizard
   ========================================================================== */

/* every section on one page; the last one runs into the submit bar */
.form-section + .form-section { margin-top: 6px; }

.form-foot {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   Animated road hero
   ========================================================================== */

.road-hero {
    position: relative;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    overflow: hidden;
    background: var(--blue-50);
    margin-bottom: 16px;
}

.road-svg { display: block; width: 100%; height: 176px; }

/* caption sits in its own band, so the car can never collide with it */
.road-caption {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 18px 13px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.road-caption strong {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ink);
    white-space: nowrap;
}

.road-caption span { font-size: 12.5px; color: var(--muted); }

/* the motion: scenery slides left, wheels spin, the car breathes */
.road-layer { will-change: transform; }
.road-scenery { animation: road-pan 9s linear infinite; }
.road-dashes { animation: road-pan 2.2s linear infinite; }
.road-clouds { animation: road-pan 34s linear infinite; }

@keyframes road-pan {
    from { transform: translateX(0); }
    to { transform: translateX(-1000px); }   /* one tile width */
}

.road-wheel {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: road-spin 0.5s linear infinite;
}

@keyframes road-spin {
    to { transform: rotate(360deg); }
}

.road-car { animation: road-bob 1.4s ease-in-out infinite; }

@keyframes road-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.road-speed { animation: road-whoosh 0.9s ease-in-out infinite; }

@keyframes road-whoosh {
    0%, 100% { opacity: 0.12; transform: translateX(0); }
    50% { opacity: 0.4; transform: translateX(-6px); }
}

/* brand badge floating in the sky — drops in, then breathes with a slow shine */
.road-logo {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

.road-logo-plate {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    overflow: hidden;
    border: 1px solid rgba(7, 85, 201, 0.10);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 18px -10px rgba(16, 30, 54, 0.45);
    animation:
        road-logo-in 0.9s cubic-bezier(0.2, 0.75, 0.3, 1) both,
        road-logo-float 6s ease-in-out 1s infinite;
}

/* the sheen that sweeps across the plate */
.road-logo-plate::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.85) 50%, transparent 62%);
    transform: translateX(-130%);
    animation: road-logo-shine 6s ease-in-out 1.6s infinite;
}

.road-logo-img { display: block; height: 60px; width: auto; }
svg.road-logo-img { width: 127px; }   /* the stand-in's 220x104 box, in pixels */

/* a real logo file carries its own whitespace, so the plate hugs it tighter */
.road-logo-plate.is-image { padding: 4px 9px; }
img.road-logo-img { height: 66px; object-fit: contain; }

/* the drawn stand-in used until public/images/logo.png exists */
.road-logo-word {
    font-family: var(--font);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 4px;
    fill: #14213a;
}

.road-logo-tag {
    font-family: var(--font);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.6px;
    fill: #6b7a90;
}

@keyframes road-logo-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.94); }
    to { opacity: 1; transform: none; }
}

@keyframes road-logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes road-logo-shine {
    0% { transform: translateX(-130%); }
    38%, 100% { transform: translateX(130%); }
}

.mobile-bar { display: none; }

/* ==========================================================================
   QR screen
   ========================================================================== */

.qr-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.qr-card { padding: 28px 24px 24px; text-align: center; }

.scan-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--blue-100);
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.qr-frame {
    position: relative;
    width: min(268px, 74vw);
    margin: 22px auto;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.qr-frame svg { display: block; width: 100%; height: auto; }

.qr-corner { position: absolute; width: 22px; height: 22px; border: 2.5px solid var(--blue); }
.qr-corner.tl { top: -7px; left: -7px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.qr-corner.tr { top: -7px; right: -7px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.qr-corner.bl { bottom: -7px; left: -7px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.qr-corner.br { bottom: -7px; right: -7px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }

.qr-url {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--blue-50);
    border: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--muted);
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.steps-row { display: flex; gap: 8px; margin-top: 14px; }

.steps-row .step-card {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 13px 8px;
    text-align: center;
}

.step-card-num {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 6px;
}

.step-card-label { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

/* ==========================================================================
   Success
   ========================================================================== */

.success-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.tick {
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--success-soft);
    color: var(--success);
    animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.35);
}

.tick svg { width: 32px; height: 32px; }

.ref-badge {
    display: block;
    margin: 16px auto 18px;
    padding: 14px;
    border-radius: var(--r);
    background: var(--blue-50);
    border: 1px dashed #b9cdf1;
    text-align: center;
}

.ref-badge span {
    display: block;
    font-size: 10.5px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.ref-badge strong {
    font-size: 21px;
    letter-spacing: 0.05em;
    color: var(--blue);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.summary { border-top: 1px solid var(--line); margin: 0; }

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.summary-row dt { color: var(--muted); margin: 0; flex: 0 0 auto; }
.summary-row dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.thumbs a {
    width: 60px;
    height: 60px;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    padding: 4px;
}

.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   Entries table
   ========================================================================== */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tabs {
    display: inline-flex;
    gap: 3px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.tabs a {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

.tabs a.is-active { background: var(--blue); color: #fff; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; }
.toolbar form.search { flex: 1 1 240px; }
.toolbar .input { height: 44px; padding-left: 16px; }

.table-wrap {
    overflow-x: auto;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }

thead th {
    text-align: left;
    padding: 13px 16px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    font-weight: 700;
}

tbody td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: var(--blue-50); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--muted); }

.tag {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 7px;
    background: var(--blue-100);
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.count-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    vertical-align: middle;
}

.link { color: var(--blue); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.icon-btn.is-restore:hover { color: var(--success); border-color: var(--success); background: var(--success-soft); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* ==========================================================================
   Misc
   ========================================================================== */

.alert {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 13px 15px;
    border-radius: var(--r);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-error { background: var(--danger-soft); border-color: #fbc9c5; color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: #b7e6cd; color: var(--success); }

.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: var(--r);
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, var(--blue), var(--blue-deep));
    box-shadow: 0 6px 16px -8px rgba(7, 85, 201, 0.85);
}

.brand-mark svg { width: 23px; height: 23px; display: block; stroke: #fff; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }

.brand-sub {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
}

.footer-note { margin-top: 20px; text-align: center; font-size: 12px; color: var(--faint); }
.footer-note a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-note a:hover { color: var(--blue); }

/* ==========================================================================
   Responsive — the same product, one column
   ========================================================================== */

@media (max-width: 900px) {
    .app-shell.frame { max-width: 560px; padding: 0 0 calc(20px + var(--safe-bottom)); }

    .app-frame {
        grid-template-columns: 1fr;
        min-height: 0;              /* no forced full-height frame, no dead space */
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: var(--surface);
    }

    .sidebar { display: none; }

    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: calc(14px + var(--safe-top)) 18px 14px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .hamburger {
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: var(--r-sm);
        background: var(--surface);
        color: var(--ink-2);
        cursor: pointer;
    }

    .hamburger svg { width: 19px; height: 19px; }

    .mobile-menu {
        position: absolute;
        top: calc(100% + 6px);
        left: 18px;
        min-width: 190px;
        padding: 6px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--r);
        box-shadow: 0 16px 36px -18px rgba(16, 30, 54, 0.5);
    }

    .mobile-menu a {
        display: block;
        padding: 11px 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        color: var(--ink-2);
        text-decoration: none;
    }

    .mobile-menu a:hover { background: var(--blue-50); color: var(--blue); }

    .frame-main { padding: 14px 14px 20px; background: var(--page); border-radius: 0; gap: 12px; }
    .frame-head { display: none; }

    /* hero shrinks and the caption stacks on a phone */
    .road-hero { margin-bottom: 12px; }
    .road-svg { height: 140px; }

    .road-logo { top: 8px; }
    .road-logo-plate { padding: 6px 11px; border-radius: 10px; }
    .road-logo-img { height: 46px; }
    svg.road-logo-img { width: 97px; }
    img.road-logo-img { height: 50px; }

    .road-caption {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 11px 16px 13px;
        text-align: center;
    }

    .road-caption strong { font-size: 16px; white-space: normal; }

    /* a real card on the phone, not a flat page */
    .form-card {
        flex: none;
        padding: 20px 18px;
        border-radius: var(--r-lg);
        border: 1px solid var(--line);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .form-foot { margin-top: 20px; padding-top: 18px; }
    .form-foot .btn { width: 100%; }

    .headline { font-size: 23px; }

    /* one field per row on a phone — except Make / Model, which stay paired */
    .row-2 { grid-template-columns: 1fr; gap: 0; }
    .row-2.split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

}

@media (max-width: 360px) {
    .row-2.split { grid-template-columns: 1fr; gap: 0; }
}

@media (min-width: 901px) {
    .mobile-menu { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
