:root {
    --bg: #e9ecef;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-solid: #ffffff;
    --panel-deep: #f8fafb;
    --ink: #162126;
    --muted: #59666f;
    --line: #d6dde3;
    --line-soft: #e8edf1;
    --accent: #b91c1c;
    --accent-dark: #8f1414;
    --accent-soft: #fee2e2;
    --warm: #f59e0b;
    --warm-soft: #fff2cc;
    --shadow: 0 26px 70px rgba(18, 28, 34, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(180deg, #f7f8f9 0%, var(--bg) 100%);
}

body:not(.admin-body) {
    padding-top: 0;
}

body.vehicle-detail-page {
    background: #ffffff;
}

a {
    color: inherit;
    text-decoration: none;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes softScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

body:not(.admin-body) .hero-copy,
body:not(.admin-body) .hero-spotlight,
body:not(.admin-body) .featured-slider,
body:not(.admin-body) .page-title-row,
body:not(.admin-body) .filter-form,
body:not(.admin-body) .page-panel,
body:not(.admin-body) .vehicle-detail-layout {
    animation: fadeUp 0.55s ease both;
}

body:not(.admin-body) .hero-spotlight,
body:not(.admin-body) .vehicle-detail-layout {
    animation-name: softScale;
}

body:not(.admin-body) .vehicle-card,
body:not(.admin-body) .slide-card,
body:not(.admin-body) .highlight-card,
body:not(.admin-body) .page-link-card {
    animation: fadeUp 0.5s ease both;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body:not(.admin-body) .vehicle-card:nth-child(2),
body:not(.admin-body) .slide-card:nth-child(2) {
    animation-delay: 0.06s;
}

body:not(.admin-body) .vehicle-card:nth-child(3),
body:not(.admin-body) .slide-card:nth-child(3) {
    animation-delay: 0.12s;
}

body:not(.admin-body) .vehicle-card:hover,
body:not(.admin-body) .slide-card:hover,
body:not(.admin-body) .page-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 80px rgba(18, 28, 34, 0.18);
}

body:not(.admin-body) .vehicle-image,
body:not(.admin-body) .slide-image,
body:not(.admin-body) .detail-thumb {
    transition: transform 0.35s ease, filter 0.35s ease;
}

body:not(.admin-body) .vehicle-card:hover .vehicle-image,
body:not(.admin-body) .slide-card:hover .slide-image,
body:not(.admin-body) .detail-thumb:hover {
    transform: scale(1.025);
    filter: saturate(1.08);
}

.site-shell {
    width: 100%;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

.hero {
    padding: 118px 0 18px;
}

.compact-hero {
    padding-bottom: 0;
}

.page-title-row {
    display: grid;
    gap: 10px;
    padding: 34px 0 18px;
}

.page-title-row h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 1;
}

.page-title-row p {
    margin: 0;
    color: var(--muted);
    max-width: 780px;
    line-height: 1.6;
}

.page-panel {
    margin-bottom: 34px;
}

.page-link-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding: 34px 0 44px;
}

.page-link-card {
    display: grid;
    gap: 10px;
    color: inherit;
    min-height: 190px;
}

.page-link-card h3,
.page-link-card p {
    margin: 0;
}

.page-link-card p {
    color: var(--muted);
    line-height: 1.55;
}

.page-link-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.standalone-highlights {
    margin-top: 0;
    margin-bottom: 24px;
}

.dealership-copy {
    display: grid;
    gap: 12px;
}

.dealership-copy h3,
.dealership-copy p {
    margin: 0;
}

.nav-links a.is-active {
    color: var(--accent-dark);
}

.top-contact-bar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 8px;
    background: #111827;
    color: #f9fafb;
    font-size: 0.92rem;
}

.nav {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    position: fixed;
    top: 16px;
    left: 32px;
    right: 32px;
    z-index: 50;
    margin-bottom: 0;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-tag,
.eyebrow {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.brand h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.1;
    max-width: none;
    letter-spacing: 0;
}

.brand p {
    margin: 0;
    color: var(--muted);
    max-width: 640px;
    font-size: 0.9rem;
}

.nav-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-weight: 700;
}

.hero-grid,
.dealer-highlights,
.lead-layout,
.finance-layout,
.admin-grid {
    display: grid;
    gap: 22px;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
}

.featured-slider {
    margin-top: 22px;
    padding: 20px;
}

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

.slider-head h3 {
    margin: 8px 0 0;
}

.slider-controls {
    display: flex;
    gap: 10px;
}

.slider-btn {
    min-width: 82px;
}

.slider-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(320px, 42%);
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
}

.slider-track::-webkit-scrollbar {
    height: 10px;
}

.slider-track::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}

.slide-card {
    scroll-snap-align: start;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line-soft);
}

.slide-image {
    aspect-ratio: 16 / 9;
    background: #d6e6e4 center/cover no-repeat;
}

.slide-image-link {
    display: block;
}

.slide-copy {
    padding: 18px;
    display: grid;
    gap: 10px;
}

.slide-copy h4 {
    margin: 0;
    font-size: 1.3rem;
}

.slide-copy h4 a {
    color: inherit;
}

.slide-copy h4 a:hover {
    color: var(--accent-dark);
}

.slide-copy p {
    margin: 0;
    color: var(--muted);
}

.slide-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    font-weight: 700;
}

.slide-copy .button {
    width: fit-content;
}

.slide-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.history-link,
.detail-history-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
}

.carfax-logo {
    display: block;
    width: 74px;
    height: 44px;
    object-fit: contain;
    flex: 0 0 74px;
}

.detail-history-link {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.dealer-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 22px;
}

.lead-layout,
.finance-layout {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 34px;
    width: 100%;
}

.admin-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.lower-grid {
    margin-top: 24px;
}

.hero-card,
.panel,
.lead-card {
    background: var(--panel);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
    border-radius: 8px;
}

.hero-copy,
.hero-spotlight,
.panel,
.lead-card {
    padding: 24px;
}

.hero-copy {
    padding: 34px;
}

.hero-copy h2 {
    margin: 18px 0 12px;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
}

.hero-copy p,
.lead-card p,
.panel > p,
.feature-item p,
.highlight-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.hero-actions,
.filter-actions,
.vehicle-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-actions {
    margin-top: 24px;
}

.hero-actions form {
    display: block;
}

.button,
button {
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button.primary,
button.primary {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    box-shadow: 0 18px 30px rgba(185, 28, 28, 0.24);
}

.button.secondary,
button.secondary {
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.button:hover,
button:hover {
    transform: translateY(-1px);
}

.hero-spotlight {
    background:
        linear-gradient(160deg, rgba(17, 24, 39, 0.9), rgba(185, 28, 28, 0.82)),
        url("https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&w=1200&q=80") center/cover;
    color: #f7fffd;
    position: relative;
    overflow: hidden;
}

.hero-spotlight::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 27, 31, 0.06), rgba(8, 27, 31, 0.42));
}

.spotlight-content {
    position: relative;
    z-index: 1;
}

.spotlight-content h3 {
    margin: 18px 0 12px;
    font-size: 2rem;
}

.spotlight-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.stat {
    padding: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.stat-link {
    display: block;
    color: inherit;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.stat-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.42);
}

.stat strong {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.highlight-card {
    padding: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,251,0.9));
}

.highlight-card h3 {
    margin: 10px 0 8px;
    font-size: 1.5rem;
}

main {
    padding-bottom: 44px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin: 34px 0 18px;
}

.section-head h3,
.panel h3,
.lead-card h3 {
    margin: 0 0 8px;
    font-size: 1.9rem;
}

.section-head p {
    margin: 0;
    color: var(--muted);
}

.home-inventory {
    padding: 10px 0 44px;
}

.filter-form {
    padding: 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.admin-filter-form {
    margin-top: 18px;
}

.admin-filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.admin-filter-grid .filter-actions {
    align-items: center;
}

.results-bar {
    margin: 14px 0 18px;
    color: var(--muted);
    font-weight: 700;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.vehicle-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,250,251,0.9));
}

.vehicle-image {
    aspect-ratio: 16 / 10;
    background: #d6e6e4 center/cover no-repeat;
    position: relative;
}

.vehicle-image-link {
    display: block;
}

.vehicle-title-link {
    color: inherit;
}

.vehicle-title-link:hover {
    color: var(--accent-dark);
}

.vehicle-image::after {
    content: "AVAILABLE";
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 7px 10px;
    border-radius: 6px;
    background: rgba(17, 24, 39, 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.vehicle-body {
    padding: 18px;
}

.vehicle-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
    margin-bottom: 12px;
}

.vehicle-meta h4 {
    margin: 0;
    font-size: 1.25rem;
}

.vehicle-meta small {
    color: var(--muted);
}

.vehicle-status-row {
    margin: 0 0 12px;
}

.vehicle-price {
    color: var(--accent-dark);
    font-size: 1.4rem;
    font-weight: 800;
    white-space: nowrap;
}

.spec-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.spec-list li {
    padding: 7px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #344050;
    font-size: 0.88rem;
}

.vehicle-body p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.6;
}

.vehicle-photo-groups {
    display: grid;
    gap: 12px;
    margin: 0 0 14px;
}

.vehicle-photo-group {
    display: grid;
    gap: 7px;
}

.vehicle-photo-group strong {
    color: var(--ink);
    font-size: 0.82rem;
}

.vehicle-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.vehicle-thumb {
    width: 76px;
    min-width: 76px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    border: 2px solid var(--line-soft);
    background: #d6e6e4 center/cover no-repeat;
    padding: 0;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.vehicle-thumb:hover {
    transform: none;
    border-color: var(--accent);
}

.vehicle-thumb span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.feature-list {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.feature-item strong {
    display: block;
    margin-bottom: 5px;
}

.inset-panel {
    background: var(--panel-deep);
    border-color: var(--line-soft);
    box-shadow: none;
    margin: 18px 0 20px;
}

.payment-summary {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.payment-line {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    color: var(--muted);
}

.payment-line strong {
    color: var(--ink);
    font-size: 1.1rem;
}

.payment-line.highlight {
    padding: 16px;
    border-radius: 8px;
    background: var(--warm-soft);
}

.payment-line.highlight strong {
    font-size: 1.4rem;
    color: #8c5c00;
}

#dealership-info {
    scroll-margin-top: 24px;
}

#trade-in {
    scroll-margin-top: 24px;
}

form {
    display: grid;
    gap: 14px;
}

.admin-form {
    margin-top: 18px;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 1rem;
}

.checkbox-label input {
    width: auto;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--panel-solid);
    border-radius: 8px;
    padding: 13px 14px;
    color: var(--ink);
    font: inherit;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
}

.status {
    display: none;
    padding: 13px 14px;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 16px;
}

.status.show {
    display: block;
}

.status strong {
    display: block;
    margin-bottom: 4px;
}

.status p {
    margin: 0;
    line-height: 1.45;
}

.status.success {
    background: #e7f7ef;
    color: #1e6a4c;
}

.status.error {
    background: #fdeceb;
    color: #9f2f28;
}

.table-wrap {
    overflow: auto;
    margin-top: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    max-width: 100%;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: #fff;
    table-layout: fixed;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: normal;
}

.admin-table th {
    background: #f7fbfa;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    line-height: 1.25;
}

.admin-table small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.admin-body {
    min-height: 100vh;
}

.admin-shell {
    padding: 32px 0 42px;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 0;
}

.login-panel {
    width: min(100%, 520px);
}

.admin-head {
    margin-top: 0;
}

.admin-dashboard-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 24px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.admin-dashboard-head h3 {
    margin: 8px 0;
    font-size: 1.85rem;
    line-height: 1.15;
}

.admin-dashboard-head p {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
    line-height: 1.55;
}

.admin-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

.admin-nav form {
    display: block;
}

.admin-nav .button,
.admin-nav button {
    min-height: 44px;
    white-space: nowrap;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 18px;
}

.admin-stat-card {
    padding: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.admin-stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.25;
}

.admin-stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    color: var(--ink);
}

.admin-quick-grid,
.inventory-management-layout {
    display: grid;
    gap: 22px;
}

.admin-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 24px;
}

.admin-action-card {
    display: block;
    color: inherit;
    text-decoration: none;
    border-left: 5px solid var(--accent);
}

.admin-action-card h3 {
    margin: 8px 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.admin-action-card p {
    overflow-wrap: anywhere;
}

.admin-action-card:hover {
    transform: translateY(-1px);
}

.inventory-management-layout {
    grid-template-columns: 1fr;
}

.admin-body .lower-grid,
.admin-body .admin-grid {
    grid-template-columns: 1fr;
}

.session-note {
    margin: -4px 0 18px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff3cd;
    color: #7a5800;
    font-weight: 700;
}

.gallery-block {
    margin-top: 24px;
}

.gallery-block h4 {
    margin: 0 0 12px;
}

.photo-upload-block {
    display: grid;
    gap: 10px;
}

.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
}

.photo-upload-card {
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 12px;
    background: #f8fbfa;
}

.admin-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.admin-thumb-card {
    display: grid;
    gap: 8px;
}

.admin-thumb {
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    background: #d6e6e4 center/cover no-repeat;
}

.photo-category-chip {
    display: inline-flex;
    width: max-content;
    padding: 5px 8px;
    border-radius: 6px;
    background: #eef2f7;
    color: #344050;
    font-size: 0.76rem;
    font-weight: 800;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    padding: 7px 11px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-available {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-sold {
    background: #fee2e2;
    color: #991b1b;
}

.inline-field {
    display: flex;
    align-items: end;
}

.small-btn {
    padding: 10px 14px;
}

.admin-users-list {
    display: grid;
    gap: 14px;
}

.admin-user-card {
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 16px;
    background: var(--panel-deep);
}

.admin-record-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.admin-record-card {
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.admin-record-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.admin-record-head strong {
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.admin-record-head span {
    color: var(--muted);
    font-size: 0.86rem;
}

.admin-record-preview {
    margin: -4px 0 12px;
    color: var(--muted);
    line-height: 1.45;
}

.admin-record-details {
    border-top: 1px solid var(--line-soft);
    padding-top: 10px;
}

.admin-record-details summary {
    width: max-content;
    max-width: 100%;
    cursor: pointer;
    padding: 9px 12px;
    border-radius: 8px;
    background: #f3f6f8;
    color: var(--ink);
    font-weight: 800;
    list-style-position: inside;
}

.admin-record-details summary:hover {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.admin-record-details[open] summary {
    margin-bottom: 14px;
}

.admin-record-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.admin-record-card dt {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-record-card dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.admin-response-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

.admin-response-form textarea {
    min-height: 92px;
}

.admin-response-form .small-btn {
    width: max-content;
}

.wide-record-field {
    grid-column: 1 / -1;
}

.muted-empty {
    margin: 0;
    color: var(--muted);
}

.admin-user-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.admin-user-head span {
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.empty-state {
    grid-column: 1 / -1;
}

.detail-topbar {
    padding: 18px 0 8px;
    background: linear-gradient(180deg, #f7f8f9 0%, #eef1f4 100%);
}

.detail-nav {
    margin-bottom: 0;
}

.detail-shell {
    width: min(1480px, calc(100% - 48px));
    padding: 18px 0 54px;
}

.vehicle-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(390px, 0.65fr);
    gap: 34px;
    align-items: start;
}

.vehicle-detail-gallery,
.detail-side-card,
.detail-inquiry {
    border: 0;
    background: #ffffff;
    box-shadow: none;
}

.vehicle-detail-gallery {
    display: grid;
    gap: 22px;
    padding: 0;
    border-radius: 0;
}

.detail-main-image {
    min-height: 560px;
    aspect-ratio: 16 / 9.2;
    border-radius: 8px;
    background: #d6e6e4 center/cover no-repeat;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 -160px 120px rgba(15, 23, 42, 0.22);
}

.detail-main-image .status-pill {
    position: absolute;
    top: 18px;
    left: 18px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.detail-hotspot {
    display: none;
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #ffffff;
    border: 7px solid rgba(37, 150, 236, 0.84);
    box-shadow: 0 0 0 16px rgba(37, 150, 236, 0.26);
}

.detail-hotspot-front {
    left: 24%;
    top: 56%;
}

.detail-hotspot-side {
    left: 58%;
    top: 42%;
}

.detail-hotspot-wheel {
    right: 26%;
    bottom: 28%;
}

.detail-zoom-control {
    display: none;
    position: absolute;
    right: 28px;
    top: 48%;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #113047;
    font-size: 1.8rem;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.detail-zoom-control span {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
}

.detail-zoom-control span + span {
    border-top: 1px solid #d8e2ea;
    color: #8ea1b2;
}

.detail-gallery-controls {
    position: absolute;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    width: min(760px, calc(100% - 40px));
}

.detail-gallery-pill {
    min-width: 132px;
    padding: 13px 20px;
    background: rgba(255, 255, 255, 0.94);
    color: #143047;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.detail-gallery-pill.is-active,
.detail-gallery-pill:hover {
    background: #ffffff;
    color: #0f2537;
}

.detail-thumb-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.detail-thumb {
    min-height: 156px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    border: 2px solid transparent;
    background: #d6e6e4 center/cover no-repeat;
    padding: 0;
    overflow: hidden;
    position: relative;
    box-shadow: none;
}

.detail-thumb:hover {
    transform: none;
    border-color: var(--accent);
}

.detail-thumb span {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(17, 24, 39, 0.78);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
}

.detail-thumb em {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 12px 16px;
    border-radius: 8px 0 0 0;
    background: rgba(15, 23, 42, 0.62);
    color: #ffffff;
    font-style: normal;
    font-weight: 900;
    backdrop-filter: blur(8px);
}

.detail-side-card {
    position: sticky;
    top: 20px;
    padding: 48px 42px;
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.13);
}

.detail-side-card h1 {
    margin: 24px 0 8px;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    font-size: clamp(2.2rem, 4vw, 3.35rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.detail-side-card p {
    color: var(--muted);
    line-height: 1.6;
    font-size: 1.15rem;
}

.deal-badge {
    display: inline-flex;
    width: fit-content;
    padding: 10px 16px;
    border-radius: 6px;
    background: #078d4d;
    color: #ffffff;
    font-weight: 900;
}

.detail-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 34px;
}

.detail-price {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: #071f35;
    line-height: 1;
}

.detail-was-price {
    margin-top: 7px;
    color: #697889;
    font-size: 1rem;
    text-decoration: none;
}

.detail-terms-button {
    background: #e6f3ff;
    color: #2070c9;
    white-space: nowrap;
    box-shadow: none;
}

.detail-includes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 22px 0;
    padding: 12px 16px;
    border-radius: 8px;
    background: #e7f3fc;
    color: #173047;
    font-weight: 800;
}

.detail-includes span {
    font-size: 1.8rem;
    line-height: 1;
}

.detail-payment {
    margin-top: 18px;
    color: var(--muted);
    font-size: 1.25rem;
    font-weight: 700;
}

.detail-delivery {
    margin-top: 22px;
    color: #078d4d;
    font-size: 1.15rem;
    font-weight: 900;
}

.detail-specs {
    display: grid;
    gap: 10px;
    margin: 22px 0;
    padding: 0;
    list-style: none;
}

.detail-specs li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}

.detail-specs strong {
    color: var(--muted);
}

.detail-specs span {
    font-weight: 800;
    text-align: right;
}

.detail-cta {
    display: flex;
    justify-content: center;
    margin-top: 28px;
    padding: 20px 24px;
    background: #078d4d;
    box-shadow: 0 18px 34px rgba(7, 141, 77, 0.24);
    font-size: 1.3rem;
}

.detail-inquiry {
    width: min(720px, 100%);
    margin-top: 34px;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.footer {
    margin-top: 34px;
    padding: 38px 0 22px;
    background: #101820 !important;
    color: #f9fafb !important;
    clear: both;
    overflow: hidden;
}

.footer-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.7fr) minmax(180px, 0.7fr);
    gap: 24px;
    align-items: start;
}

.footer .brand-tag {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.footer p {
    margin: 14px 0 0;
    color: #cbd5e1 !important;
    line-height: 1.6;
    max-width: 520px;
}

.footer h4 {
    margin: 0 0 12px;
    color: #ffffff !important;
}

.footer-links {
    display: grid !important;
    gap: 9px;
    justify-items: start;
}

.footer-links a {
    color: #cbd5e1 !important;
    font-weight: 700;
}

.footer-links a:hover {
    color: #ffffff;
}

.social-links {
    display: flex !important;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.social-links a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px;
    max-width: 46px;
    min-height: 46px;
    max-height: 46px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
    padding: 0;
    line-height: 0;
}

.social-links a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.social-links svg {
    display: block;
    width: 21px !important;
    height: 21px !important;
    max-width: 21px;
    max-height: 21px;
    flex: 0 0 21px;
    fill: currentColor !important;
}

.social-links svg path {
    fill: currentColor !important;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: #94a3b8;
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .photo-upload-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .slider-track {
        grid-auto-columns: minmax(300px, 70%);
    }
}

@media (max-width: 980px) {
    .hero-grid,
    .dealer-highlights,
    .lead-layout,
    .finance-layout,
    .inventory-grid,
    .page-link-grid,
    .footer-grid,
    .vehicle-detail-layout,
    .admin-grid,
    .admin-quick-grid,
    .inventory-management-layout,
    .admin-stat-grid {
        grid-template-columns: 1fr;
    }

    .photo-upload-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 720px) {
    .site-shell {
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    body:not(.admin-body) {
        padding-top: 0;
    }

    .hero {
        padding-top: 132px;
    }

    .admin-shell {
        padding-top: 18px;
    }

    .top-contact-bar,
    .nav,
    .slider-head,
    .section-head,
    .field-row,
    .filter-grid,
    .photo-upload-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .nav {
        left: 12px;
        right: 12px;
        top: 10px;
        padding: 12px;
    }

    .nav .brand {
        gap: 4px;
    }

    .nav .brand p {
        display: none;
    }

    .hero-copy,
    .hero-spotlight,
    .lead-card,
    .panel,
    .admin-dashboard-head {
        padding: 18px;
        border-radius: 8px;
    }

    .admin-dashboard-head h3 {
        font-size: 1.55rem;
    }

    .admin-stat-card strong {
        font-size: 1.55rem;
    }

    .admin-quick-grid {
        gap: 14px;
    }

    .admin-table {
        min-width: 680px;
    }

    .admin-record-card dl {
        grid-template-columns: 1fr;
    }

    .hero-actions .button,
    .admin-nav .button,
    .admin-nav button,
    .filter-actions .button,
    .filter-actions button,
    .vehicle-actions .button,
    form button {
        width: 100%;
    }

    .nav-links {
        gap: 10px;
    }

    .slider-track {
        grid-auto-columns: 88%;
    }

    .detail-nav {
        display: grid;
        justify-items: start;
        padding: 14px;
    }

    .detail-main-image {
        min-height: 260px;
        border-radius: 8px;
    }

    .detail-thumb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-side-card {
        position: static;
    }

    .footer-bottom {
        display: grid;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* Admin screens use a stricter layout so public-site button/card rules do not collide. */
.admin-body .site-shell {
    width: min(1180px, calc(100% - 40px));
}

.admin-body .admin-dashboard-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
    overflow: hidden;
}

.admin-body .admin-dashboard-head > div:first-child {
    min-width: 0;
}

.admin-body .admin-dashboard-head .eyebrow {
    max-width: 100%;
    white-space: normal;
}

.admin-body .admin-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
    gap: 10px;
    align-items: center;
    justify-content: start;
}

.admin-body .admin-nav form,
.admin-body .hero-actions form {
    display: contents;
}

.admin-body .admin-nav .button,
.admin-body .admin-nav button,
.admin-body .hero-actions .button,
.admin-body .hero-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 150px;
    min-height: 44px;
    padding: 12px 18px;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
}

.admin-body .admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.admin-body .admin-stat-card {
    display: grid;
    gap: 6px;
    min-height: 96px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.admin-body .admin-stat-card strong {
    margin: 0;
    line-height: 1;
}

.admin-body .admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.admin-body .admin-action-card {
    min-height: 150px;
    padding: 22px;
    overflow: hidden;
    border-radius: 8px;
}

.admin-body .admin-action-card .eyebrow {
    white-space: normal;
}

.admin-body .admin-action-card h3 {
    font-size: 1.45rem;
    line-height: 1.2;
}

@media (max-width: 720px) {
    .admin-body .site-shell {
        width: min(100% - 20px, 1180px);
    }

    .admin-body .admin-dashboard-head {
        padding: 16px;
    }

    .admin-body .admin-nav {
        grid-template-columns: 1fr;
    }

    .admin-body .admin-nav .button,
    .admin-body .admin-nav button,
    .admin-body .hero-actions .button,
    .admin-body .hero-actions button {
        width: 100%;
        min-width: 0;
    }

    .admin-body .admin-stat-grid,
    .admin-body .admin-quick-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile menu and upload refinements */
.menu-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.menu-toggle strong {
    font-size: 0.9rem;
}

.photo-upload-actions {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.photo-upload-actions input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
}

.file-choice:hover {
    border-color: rgba(185, 28, 28, 0.35);
    color: var(--accent-dark);
}

.admin-body .admin-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 20px;
}

.admin-body .admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.admin-body .admin-nav form {
    display: block;
}

.admin-body .admin-nav .button,
.admin-body .admin-nav button {
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding: 11px 16px;
}

@media (max-width: 720px) {
    .nav {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .menu-toggle {
        display: inline-grid;
        grid-template-columns: 18px auto;
        justify-items: center;
    }

    .menu-toggle span:nth-child(2),
    .menu-toggle span:nth-child(3) {
        grid-column: 1;
    }

    .menu-toggle strong {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: center;
    }

    .nav-links {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid var(--line-soft);
    }

    .menu-toggle-input:checked ~ .nav-links {
        display: grid;
        gap: 8px;
    }

    .nav-links a {
        display: block;
        padding: 12px;
        border-radius: 8px;
        background: #f8fbfa;
    }

    .admin-body .admin-head {
        position: sticky;
        top: 10px;
        z-index: 40;
        padding: 14px;
        border: 1px solid var(--line-soft);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: var(--shadow);
        backdrop-filter: blur(10px);
    }

    .admin-body .admin-menu-toggle {
        width: 100%;
        justify-content: center;
    }

    .admin-body .admin-nav {
        display: none;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .admin-body .menu-toggle-input:checked ~ .admin-nav {
        display: grid;
        gap: 8px;
    }

    .admin-body .admin-nav .button,
    .admin-body .admin-nav button {
        width: 100%;
        min-width: 0;
    }

    .photo-upload-actions {
        grid-template-columns: 1fr;
    }
}
