:root {
    --ink: #17211c;
    --muted: #526158;
    --bg: #f3f6f3;
    --paper: #ffffff;
    --line: #d5ded8;
    --green-950: #10261e;
    --green-900: #16352a;
    --green-700: #1f6b4a;
    --amber: #e3a008;
    --free: #d4f5df;
    --busy: #d92d2d;
    --closed: #e6ebe8;
    --radius: 18px;
    --shadow: 0 14px 40px rgba(16, 38, 30, 0.08);
    --focus: 0 0 0 3px rgba(227, 160, 8, 0.45);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-size: 1.0625rem; }
img, svg { display: block; max-width: 100%; }
a { color: var(--green-700); }
a:hover { color: var(--green-900); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.8rem); margin: 0 0 0.75rem; }
p { margin: 0 0 0.8rem; }

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: #fff;
    color: var(--ink);
    padding: 0.6rem 0.8rem;
    z-index: 20;
}
.skip:focus { top: 0.6rem; }

.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.site-header {
    background: var(--green-950);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 1px 0 rgba(227, 160, 8, 0.85);
}
.header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 4.4rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
    text-decoration: none;
    margin-right: auto;
}
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; color: #c9ddd2; font-size: 0.82rem; }
.brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    display: block;
    flex: 0 0 auto;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.nav-drop { position: relative; }
.nav-drop summary {
    color: #fff;
    cursor: pointer;
    list-style: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
}
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary::after { content: " ▾"; font-size: 0.75em; }
.nav-drop[open] summary { background: rgba(255, 255, 255, 0.1); }
.main-nav { display: flex; align-items: center; gap: 0.35rem; }
.main-nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.main-nav a[aria-current="page"],
.main-nav a:hover { background: rgba(255, 255, 255, 0.1); }
.nav-call { background: var(--green-700); }
.key-login, .logout-form button.key-login {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--green-950);
    background: var(--amber);
    text-decoration: none;
    border: 0;
    cursor: pointer;
    flex: 0 0 auto;
}
.key-login:focus-visible, .logout-form button:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}
.logout-form { margin: 0; }

.hero { padding: 2.2rem 0 1rem; }
.lead { font-size: 1.15rem; max-width: 42rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.1rem 0 0; }
.btn, button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 48px;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    border: 0;
    background: var(--green-700);
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.btn:hover { background: var(--green-900); color: #fff; }
.btn-amber { background: var(--amber); color: var(--green-950); }
.btn-amber:hover { background: #f0b429; color: var(--green-950); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f7faf8; color: var(--ink); }
.btn-danger { background: var(--busy); }
.btn-small { min-height: 40px; padding: 0.35rem 0.8rem; font-size: 0.95rem; }

.panel {
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin: 1rem 0 1.5rem;
}
.section { padding-bottom: 1.5rem; }
#kalendar { scroll-margin-top: 5.4rem; }
.cal-hint { color: var(--muted); margin-bottom: 0.8rem; }
.cal-tools { margin-bottom: 0.15rem; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin: 0 0 0.55rem; }
.cal-arrow {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green-900);
    color: #fff;
    text-decoration: none;
    flex: 0 0 auto;
}
.cal-arrow svg { width: 1.35rem; height: 1.35rem; display: block; }
.cal-arrow.is-empty { visibility: hidden; background: transparent; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem 1.4rem; list-style: none; padding: 0; margin: 0 0 0.8rem; }
.legend li { display: flex; align-items: center; gap: 0.45rem; font-weight: 650; }
.swatch { width: 1.15rem; height: 1.15rem; border-radius: 0.35rem; display: inline-block; border: 1px solid rgba(23, 33, 28, 0.08); }
.cal-scroll {
    container: calendar / inline-size;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: min(72vh, 760px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.cal {
    --days: 7;
    display: grid;
    grid-template-columns: 4.4rem repeat(var(--days), minmax(0, 1fr));
    width: 100%;
    min-width: 0;
}
@container calendar (max-width: 37.9rem) {
    .cal { --days: 6; }
    .cal [data-day="6"] { display: none; }
}
@container calendar (max-width: 33.1rem) {
    .cal { --days: 5; }
    .cal [data-day="5"] { display: none; }
}
@container calendar (max-width: 28.3rem) {
    .cal { --days: 4; }
    .cal [data-day="4"] { display: none; }
}
@container calendar (max-width: 23.5rem) {
    .cal { --days: 3; }
    .cal [data-day="3"] { display: none; }
}
@container calendar (max-width: 18.7rem) {
    .cal { --days: 2; }
    .cal [data-day="2"] { display: none; }
}
@container calendar (max-width: 13.9rem) {
    .cal { --days: 1; }
    .cal [data-day="1"] { display: none; }
}
.time, .dayhead, .slot {
    border-bottom: 1px solid rgba(23, 33, 28, 0.06);
    border-right: 1px solid rgba(23, 33, 28, 0.05);
}
.time {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f7faf8;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.45rem;
    min-height: 1.7rem;
}
.time.head, .dayhead { position: sticky; top: 0; z-index: 3; background: #fff; min-height: 4.2rem; }
.time.head { z-index: 4; background: #f7faf8; }
.dayhead { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0.35rem; }
.dayhead .dow { font-weight: 800; }
.dayhead .dom { font-variant-numeric: tabular-nums; }
.dayhead .dstate { color: var(--muted); font-size: 0.75rem; }
.dayhead.is-today { box-shadow: inset 0 3px 0 var(--amber); }
.dayhead.is-closed-head { background: var(--closed); }
.slot { min-height: 1.7rem; width: 100%; padding: 0; }
button.slot {
    font: inherit;
    color: inherit;
    cursor: pointer;
    appearance: none;
    border: 0;
    border-bottom: 1px solid rgba(23, 33, 28, 0.06);
    border-right: 1px solid rgba(23, 33, 28, 0.05);
}
.is-free { background: var(--free); }
.is-busy {
    background-color: var(--busy);
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(255, 255, 255, 0.18) 4px, rgba(255, 255, 255, 0.18) 7px);
}
.is-closed, .is-past { background: var(--closed); }
button.slot.is-selected { box-shadow: inset 0 0 0 2px var(--green-950); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.cards { display: grid; gap: 0.8rem; }
.card { background: #fff; border-radius: 16px; padding: 1rem 1.05rem; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); }

.site-footer { background: var(--green-950); color: #d5e4dc; margin-top: 1rem; padding: 1.6rem 0 1rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1rem; }
.legal-nav { display: flex; flex-direction: column; gap: 0.35rem; }
.legal-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.copy { width: min(1120px, calc(100% - 2rem)); margin: 0.8rem auto 0; color: #9eb2a8; font-size: 0.92rem; }

.contact-grid, .split, .admin-grid { display: grid; gap: 1rem; }
.hours { list-style: none; padding: 0; margin: 0; }
.hours li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.map-box {
    min-height: 280px;
    border-radius: 16px;
    background: #e7efe9;
    overflow: hidden;
    border: 1px solid var(--line);
}
.map-box iframe { width: 100%; height: 320px; border: 0; border-radius: 12px; }
.prose { max-width: 46rem; }
.prose h1 { margin-bottom: 0.4rem; }
.prose h2 { margin-top: 1.5rem; font-size: 1.25rem; }
.page { padding: 1.6rem 0 2rem; }

.flash { border-radius: 12px; padding: 0.75rem 0.9rem; margin: 0 0 0.8rem; }
.flash-ok { background: var(--free); color: #145c38; }
.flash-err { background: #fde8e8; color: #8d1d1d; }

label { display: block; font-weight: 700; margin: 0.75rem 0 0.3rem; }
input, select, textarea {
    width: 100%;
    min-height: 48px;
    font: inherit;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.login-card { max-width: 28rem; margin: 8vh auto; background: #fff; padding: 1.3rem; border-radius: 20px; box-shadow: var(--shadow); }
.admin-main { padding-top: 1.2rem; padding-bottom: 2rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.92rem; color: var(--muted); }
.car-card { border: 1px solid var(--line); border-radius: 16px; padding: 0.9rem; margin: 0.8rem 0; }
.tire-row, .inline-fields { display: grid; gap: 0.5rem; }
.muted { color: var(--muted); }
.booking-detail { background: #fde8e8; border-radius: 12px; padding: 0.8rem; margin-bottom: 0.8rem; }
.search-row { display: flex; gap: 0.5rem; align-items: end; }
.hours-form .hour-row {
    display: grid;
    grid-template-columns: 8.5rem auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.6rem 0.8rem;
    align-items: end;
    margin-bottom: 0.85rem;
}
.hours-form .hour-row > span { font-weight: 700; padding-bottom: 0.75rem; }
.hours-form .check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.75rem;
    font-weight: 650;
}
.hours-form .check input { width: 1.2rem; height: 1.2rem; min-height: 0; padding: 0; }
.search-row input { margin: 0; }

@media (min-width: 720px) {
    .cards { grid-template-columns: repeat(3, 1fr); }
    .contact-grid, .footer-grid, .admin-grid { grid-template-columns: 1.1fr 0.9fr; }
    .footer-grid { grid-template-columns: 1.2fr 1.2fr 0.8fr; align-items: start; }
    .tire-row, .inline-fields { grid-template-columns: 1.4fr 0.8fr 0.8fr auto; align-items: end; }
    .admin-grid.calendar-layout { grid-template-columns: 20rem 1fr; align-items: start; }
}

@media (min-width: 720px) {
    .nav-drop a {
        position: absolute;
        top: calc(100% + 0.3rem);
        left: 0;
        background: #17362c;
        white-space: nowrap;
        z-index: 5;
        box-shadow: var(--shadow);
    }
}

@media (max-width: 719px) {
    .hours-form .hour-row { grid-template-columns: 1fr 1fr; }
    .hours-form .hour-row > span,
    .hours-form .check { grid-column: 1 / -1; }
    .header-bar { flex-wrap: wrap; padding: 0.45rem 0; }
    #kalendar { scroll-margin-top: 8.6rem; }
    .main-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 0.35rem; }
    .key-login { order: 2; }
    .brand small { display: none; }
}
