:root {
    --blue: #163661;
    --blue-strong: #102b4e;
    --blue-soft: #eef3f9;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --surface: #ffffff;
    --background: #f8fafc;
    --success: #059669;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --radius: 16px;
    --shadow: 0 18px 50px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 280px;
    color: var(--text);
    background: linear-gradient(180deg, #fff 0%, var(--background) 100%);
    font-family: Inter, system-ui, sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.lab-header {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .94);
}
.lab-header__inner {
    width: min(100% - 40px, 1080px);
    min-height: 72px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--blue); }
.brand img { display: block; width: 72px; height: 42px; object-fit: contain; }
.lab-badge {
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: .78rem;
    font-weight: 700;
}
.lab-shell { width: min(100% - 40px, 920px); margin: 0 auto; padding: 32px 0 72px; }
.intro-card { text-align: center; padding: 12px 20px 26px; }
.eyebrow {
    margin: 0 0 7px;
    color: var(--blue);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
h1, h2 { margin: 0; font-family: "DM Sans", Inter, sans-serif; }
h1 { font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1.04; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.specialty { margin: 8px 0 0; color: var(--blue); font-weight: 700; }
.intro-copy { max-width: 580px; margin: 16px auto 0; color: var(--muted); line-height: 1.55; }

.steps { margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; list-style: none; }
.step {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
}
.step span { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--background); }
.step.is-active { color: var(--blue); border-color: #bfccdb; background: var(--blue-soft); }
.step.is-active span { color: #fff; background: var(--blue); }

.booking-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel { padding: clamp(20px, 4vw, 34px); }
.panel-heading { margin-bottom: 24px; }
.panel-heading--row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.visit-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 420px; }
.visit-choice__option { min-height: 52px; border: 1px solid #b9c7d6; border-radius: 12px; background: #fff; color: var(--blue); cursor: pointer; font-size: 1rem; font-weight: 700; }
.visit-choice__option:hover, .visit-choice__option:focus-visible { border-color: var(--blue); background: var(--blue-soft); outline: none; }
.visit-choice__option.is-selected { border-color: var(--blue); background: var(--blue); color: #fff; }
.fixed-service { display: grid; gap: 4px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--blue-soft); }
.fixed-service small { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.fixed-service--unavailable { color: var(--muted); background: var(--background); }
.normal-service-section { margin-top: 18px; }
.normal-service-section h3 { margin: 0 0 10px; font-size: 1rem; }
.service-option {
    width: 100%;
    min-height: 112px;
    padding: 17px;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}
.service-option:hover, .service-option:focus-visible { border-color: #9db0c6; outline: none; }
.service-option.is-selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px rgba(22, 54, 97, .08); }
.service-option strong { display: block; margin-bottom: 5px; font-family: "DM Sans", sans-serif; font-size: 1.05rem; }
.service-option small { display: block; color: var(--muted); line-height: 1.4; }
.service-price { margin-top: 9px; color: var(--blue) !important; font-weight: 700; }

.week-nav { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; margin-bottom: 14px; text-align: center; }
.icon-button { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--blue); cursor: pointer; font-size: 1.7rem; }
.icon-button:disabled { opacity: .35; cursor: default; }
.date-jump { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin: -2px 0 4px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.date-jump input { width: auto; max-width: 170px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); font: inherit; color-scheme: light; }
.date-jump input:focus { outline: 2px solid var(--blue); outline-offset: 2px; border-color: var(--blue); }
.date-jump__help { display: block; margin: 0 0 12px; color: var(--muted); font-size: .72rem; text-align: right; }
.day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; margin-bottom: 20px; }
.day-tab { min-height: 68px; padding: 8px 4px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); cursor: pointer; }
.day-tab span, .day-tab strong { display: block; }
.day-tab span { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.day-tab strong { margin-top: 4px; font-size: 1rem; }
.day-tab.is-selected { border-color: var(--blue); background: var(--blue); color: #fff; }
.day-tab.is-selected span { color: #dce7f3; }
.day-tab:disabled { opacity: .45; cursor: default; }
.slots-region { min-height: 170px; }
.slot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.slot-button { min-height: 48px; border: 1px solid #b9c7d6; border-radius: 11px; background: #fff; color: var(--blue); cursor: pointer; font-weight: 700; }
.slot-button:hover, .slot-button:focus-visible { border-color: var(--blue); background: var(--blue-soft); outline: none; }
.slot-button.is-selected { color: #fff; border-color: var(--blue); background: var(--blue); }
.loading-state, .empty-state { display: grid; min-height: 150px; place-items: center; padding: 24px; border-radius: 12px; background: var(--background); color: var(--muted); text-align: center; line-height: 1.5; }
.next-availability { display: grid; gap: 9px; margin-top: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; }
.next-availability__title { font-size: .88rem; }
.next-availability__status { color: var(--muted); line-height: 1.4; }
.next-availability__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.next-availability__option { display: grid; gap: 2px; min-height: 48px; padding: 8px 10px; border: 1px solid #b9c7d6; border-radius: 10px; background: #fff; color: var(--blue); cursor: pointer; text-align: left; }
.next-availability__option span { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: capitalize; }
.next-availability__option strong { font-size: .84rem; }
.next-availability__option:hover, .next-availability__option:focus-visible { border-color: var(--blue); background: var(--blue-soft); outline: none; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 22px; padding: 16px; border: 1px solid #cfdae7; border-radius: 14px; background: var(--blue-soft); }
.summary-item span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.summary-item strong { line-height: 1.35; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field--wide { grid-column: 1 / -1; }
.field span { font-size: .88rem; font-weight: 700; }
.field input { width: 100%; min-height: 50px; padding: 12px 13px; border: 1px solid #cbd5e1; border-radius: 11px; color: var(--text); background: #fff; }
.field input:focus { border-color: var(--blue); outline: 3px solid rgba(22, 54, 97, .12); }
.notice { margin: 0 0 14px; padding: 13px 15px; border-radius: 12px; line-height: 1.45; }
.notice--error { border: 1px solid #fecdca; color: var(--danger); background: var(--danger-soft); }

.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.actions--end { justify-content: flex-end; }
.button { min-height: 48px; padding: 11px 18px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 800; }
.button:disabled { opacity: .48; cursor: default; }
.button--primary { color: #fff; background: var(--blue); }
.button--primary:not(:disabled):hover { background: var(--blue-strong); }
.button--secondary { color: var(--blue); border-color: #bdcad8; background: #fff; }
.button--ghost { min-height: 40px; color: var(--blue); background: var(--blue-soft); }
.button--small { padding: 8px 12px; font-size: .82rem; }
.confirmation { padding-block: 48px; text-align: center; }
.confirmation__icon { display: grid; width: 64px; height: 64px; margin: 0 auto 18px; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 2rem; font-weight: 800; }
.confirmation .summary { margin: 24px auto 0; text-align: left; }
.confirmation__note { color: var(--muted); }
noscript { display: block; padding: 24px; color: var(--danger); text-align: center; }

@media (max-width: 700px) {
    .lab-header__inner, .lab-shell { width: min(100% - 24px, 920px); }
    .lab-header__inner { min-height: 62px; }
    .brand img { width: 62px; }
    .brand span { display: none; }
    .lab-shell { padding: 18px 0 max(42px, env(safe-area-inset-bottom)); }
    .intro-card { padding: 8px 8px 20px; }
    .steps { gap: 5px; }
    .step { justify-content: center; padding: 8px 4px; font-size: .69rem; }
    .step span { width: 21px; height: 21px; flex-basis: 21px; }
    .panel { padding: 20px 16px; }
    .service-grid, .form-grid { grid-template-columns: 1fr; }
    .field--wide { grid-column: auto; }
    .panel-heading--row { display: block; }
    .panel-heading--row .button { margin-top: 12px; }
    .date-jump { justify-content: space-between; }
    .date-jump__help { text-align: left; }
    .day-tabs { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
    .day-tab { min-height: 62px; border-radius: 10px; }
    .slot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .next-availability__list { grid-template-columns: 1fr; }
    .next-availability__option { grid-template-columns: 1fr auto; align-items: center; }
    .summary { grid-template-columns: 1fr; }
    .actions { position: sticky; bottom: 0; margin: 24px -16px -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(255,255,255,.97); z-index: 4; }
    .actions .button { flex: 1; }
}

@media (max-width: 390px) {
    .lab-badge { font-size: .68rem; }
    .step { gap: 4px; }
    .day-tab span { font-size: .62rem; }
    .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
