/* Uitvaartplanner (PC Uitvaart): design tokens, light/dark mode, responsive layout. */
:root {
    --brand: #2f6363;
    --brand-strong: #224a4a;
    --brand-soft: #e6f0ef;
    --accent: #cfd21c;
    --accent-ink: #2b3300;
    --bg: #f4f6f5;
    --surface: #ffffff;
    --surface-2: #f8faf9;
    --text: #182222;
    --text-2: #536262;
    --border: #dde4e2;
    --busy: #2f6363;
    --busy-ink: #eef3c0;
    --closed: repeating-linear-gradient(135deg, #eef1f0 0 6px, #e4e8e7 6px 12px);
    --danger: #b3261e;
    --danger-soft: #fdecea;
    --warn-soft: #fff5d6;
    --ok: #2e7d32;
    --ok-soft: #e7f4e8;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 40, 40, .06), 0 6px 20px rgba(16, 40, 40, .06);
    --focus: 0 0 0 3px rgba(207, 210, 28, .55);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand: #7fc4c0;
        --brand-strong: #a7dcd8;
        --brand-soft: #1d3332;
        --accent: #d9dc3a;
        --accent-ink: #1d2200;
        --bg: #0f1716;
        --surface: #172221;
        --surface-2: #1b2726;
        --text: #e6eeec;
        --text-2: #9fb1ae;
        --border: #2b3a38;
        --busy: #3d7a76;
        --busy-ink: #e9f3b0;
        --closed: repeating-linear-gradient(135deg, #1c2827 0 6px, #213030 6px 12px);
        --danger: #ff8a80;
        --danger-soft: #3a1d1b;
        --warn-soft: #3a3415;
        --ok: #81c784;
        --ok-soft: #1c3320;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--brand); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }

/* ---------- App bar ---------- */
.appbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    padding: 10px 24px; background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 19px; color: var(--brand); text-decoration: none; font-weight: 600; }
.brand-mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -.5px;
}
.appbar .spacer { flex: 1; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand-strong); font-size: 13px; font-weight: 600;
}
.chip.accent { background: var(--accent); color: var(--accent-ink); }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand); color: var(--surface); font-size: 12px; font-weight: 700;
}

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 8px; max-width: 1180px; margin: 20px auto 0; padding: 0 24px; list-style: none; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.stepper li::after { content: ""; flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
.stepper li:last-child::after { display: none; }
.stepper .num {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
    background: var(--surface); border: 2px solid var(--border); font-weight: 700; font-size: 13px;
}
.stepper .done .num { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.stepper .done::after { background: var(--brand); }
.stepper .active { color: var(--text); font-weight: 600; }
.stepper .active .num { border-color: var(--brand); color: var(--brand); }
@media (max-width: 640px) { .stepper .label { display: none; } .stepper .active .label { display: inline; } }

/* ---------- Layout ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 20px 24px 120px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin: 8px 0 16px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0; letter-spacing: -.3px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.with-aside > aside { position: sticky; top: 76px; }
@media (max-width: 900px) { .with-aside { grid-template-columns: 1fr; } .with-aside > aside { position: static; order: -1; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; flex: 1; }

/* ---------- Buttons & inputs ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--danger); }
.btn.lg { min-height: 50px; padding: 0 24px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .spinner { display: none; }
.btn.busy .spinner { display: inline-block; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--text-2); cursor: pointer; text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field .hint { font-weight: 400; color: var(--text-2); font-size: 13px; }
.field input, .field select, .search input {
    min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-2); color: var(--text); font: inherit; font-weight: 400;
}
.field input:focus, .field select:focus, .search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.field input:user-invalid { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.req::after { content: " *"; color: var(--danger); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }

.stepperinput { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.stepperinput button { width: 40px; height: 42px; border: 0; background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }
.stepperinput button:hover { background: var(--brand-soft); }
.stepperinput input { width: 56px; height: 42px; border: 0; text-align: center; background: transparent; color: var(--text); font: inherit; font-weight: 600; -moz-appearance: textfield; }
.stepperinput input::-webkit-inner-spin-button { -webkit-appearance: none; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
    min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--surface); font-weight: 600; }

/* ---------- Alerts / toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; font-size: 14px; }
.alert.info { background: var(--brand-soft); }
.alert.warn { background: var(--warn-soft); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert .grow { flex: 1; }
.toasts { position: fixed; right: 20px; bottom: 96px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 14px; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Plan screen ---------- */
.controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 28px; align-items: end; }
@media (max-width: 760px) { .controls { grid-template-columns: minmax(0, 1fr); } }
.controls .row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.dates { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.date-chip {
    flex: none; scroll-snap-align: start; width: 64px; padding: 8px 0; border-radius: 12px; text-align: center;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit;
}
.date-chip .dow { display: block; font-size: 12px; color: var(--text-2); text-transform: capitalize; }
.date-chip .day { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.date-chip .mon { display: block; font-size: 11px; color: var(--text-2); }
.date-chip.weekend .dow { color: var(--brand); }
.date-chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.date-chip[aria-pressed="true"] span, .date-chip.weekend[aria-pressed="true"] .dow { color: inherit; }
.date-other { display: flex; align-items: center; position: relative; }
.date-other input { min-height: 44px; border: 1px solid var(--border); border-radius: 12px; padding: 0 10px; background: var(--surface-2); color: var(--text); font: inherit; }

.timeline { margin-top: 4px; }
.tl-scroll { overflow-x: auto; padding-bottom: 6px; }
.tl-inner { min-width: 860px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; }
.tl-axis .ticks { position: relative; height: 24px; }
.tl-axis .tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl-row { min-height: 64px; border-top: 1px solid var(--border); }
.tl-room { padding: 10px 12px 10px 0; }
.tl-room strong { display: block; }
.tl-room span { font-size: 12px; color: var(--text-2); }
.tl-track {
    position: relative; height: 48px; border-radius: 10px; background: var(--surface-2); cursor: crosshair; touch-action: pan-x;
    background-image: linear-gradient(to right, var(--border) 1px, transparent 1px);
    background-size: calc(100% / var(--hours)) 100%;
}
.tl-closed { position: absolute; top: 0; bottom: 0; background: var(--closed); pointer-events: none; }
.tl-closed:first-child { border-radius: 10px 0 0 10px; }
.tl-closed.end { border-radius: 0 10px 10px 0; }
.tl-booking {
    position: absolute; top: 6px; bottom: 6px; border-radius: 8px; background: var(--busy); color: var(--busy-ink);
    font-size: 12px; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; pointer-events: auto; cursor: help;
}
.tl-booking.conflict { background: var(--danger); color: #fff; animation: pulse 1s ease-in-out 3; }
@keyframes pulse { 50% { opacity: .55; } }
.tl-ghost, .tl-selected {
    position: absolute; top: 4px; bottom: 4px; border-radius: 8px; pointer-events: none;
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden;
}
.tl-ghost { border: 2px dashed var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.tl-ghost.invalid { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.tl-selected { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px var(--brand); }
.tl-selected.invalid { background: var(--danger); color: #fff; box-shadow: none; }
.tl-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--danger); pointer-events: none; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.tl-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--border); }
.tl-legend .free { background: var(--surface-2); } .tl-legend .busy { background: var(--busy); } .tl-legend .closed { background: var(--closed); } .tl-legend .sel { background: var(--accent); }

.suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.suggestions button {
    min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--brand); background: transparent; color: var(--brand);
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums;
}
.suggestions button:hover { background: var(--brand-soft); }

.skeleton { height: 64px; border-radius: 10px; margin: 8px 0; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 32px 16px; color: var(--text-2); }

.actionbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(0,0,0,.06);
}
.actionbar .inner { max-width: 1180px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.actionbar .summary { flex: 1; min-width: 220px; }
.actionbar .summary strong { display: block; font-size: 16px; }
.actionbar .summary span { font-size: 13px; color: var(--text-2); }

/* ---------- Summary aside ---------- */
.summary-card dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.summary-card dt { color: var(--text-2); }
.summary-card dd { margin: 0; font-weight: 600; }
.countdown { margin-top: 16px; padding: 12px; border-radius: var(--radius-sm); background: var(--brand-soft); font-size: 14px; }
.countdown .time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-strong); }
.countdown .bar { height: 6px; border-radius: 3px; background: var(--border); margin-top: 8px; overflow: hidden; }
.countdown .bar > i { display: block; height: 100%; background: var(--brand); transition: width 1s linear; }
.countdown.low { background: var(--warn-soft); }
.countdown.expired { background: var(--danger-soft); color: var(--danger); }
.aside-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

/* ---------- Dossier ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search { position: relative; margin-bottom: 12px; }
.search input { width: 100%; padding-left: 40px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.dossier-list { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.dossier-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.dossier-item:hover { border-color: var(--brand); }
.dossier-item input { accent-color: var(--brand); width: 18px; height: 18px; }
.dossier-item .nr { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; min-width: 104px; }
.dossier-item:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.list-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 12px; flex-wrap: wrap; }

/* ---------- Confirm / done ---------- */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } }
.choice {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; width: 100%;
    padding: 20px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; cursor: pointer; transition: border-color .15s, transform .05s;
}
.choice:hover { border-color: var(--brand); }
.choice:active { transform: translateY(1px); }
.choice strong { font-size: 18px; }
.choice span { color: var(--text-2); font-size: 14px; }
.choice.primary { border-color: var(--brand); background: var(--brand-soft); }
.choice:disabled { opacity: .5; cursor: progress; }
.progress { display: none; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; color: var(--text-2); }
.progress.show { display: flex; }

.success { text-align: center; padding: 32px 20px; }
.success .check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: var(--ok-soft); color: var(--ok); }
.success h1 { margin-bottom: 4px; }
.success .actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
details.tech { margin-top: 16px; font-size: 13px; color: var(--text-2); }
details.tech summary { cursor: pointer; }
details.tech code { font-size: 12px; }

.spinner { display: inline-block; flex: none; box-sizing: border-box; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.signin { max-width: 440px; margin: 64px auto; text-align: center; }
.signin .brand-mark { width: 56px; height: 56px; font-size: 20px; margin: 0 auto 16px; }
.footer { text-align: center; font-size: 12px; color: var(--text-2); padding: 24px; }

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

/* Elements with the hidden attribute stay hidden, also when a class sets display. */
[hidden] { display: none !important; }

/* ---------- v2: toolbar, multi-room timeline, blockades, selection panel, dialogs ---------- */
:root { --block: #e8871e; --block-ink: #2b1600; --block-soft: #fdf0e1; }
@media (prefers-color-scheme: dark) { :root { --block: #f0a04b; --block-ink: #241200; --block-soft: #3a2a17; } }

.lead { color: var(--text-2); margin: 0; flex-basis: 100%; }
.toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.date-text { min-height: 44px; width: 130px; border: 1px solid var(--border); border-radius: 12px; padding: 0 10px; background: var(--surface-2); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; }
.field input.date-text { width: 100%; }
.date-chip.month-start { margin-left: 10px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }

.tl-axis, .tl-row { grid-template-columns: 180px 1fr; }
.tl-axis { position: sticky; top: 0; z-index: 3; background: var(--surface); }
.tl-group {
    display: flex; align-items: center; gap: 10px; padding: 14px 0 6px; margin-top: 4px;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-2);
    border-top: 2px solid var(--border);
}
/* Room type label in a fixed column, so every "Aantal gasten" starts at the same position. */
.tl-group > span:first-child { flex: 0 0 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-guests { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.stepperinput.small button { width: 32px; height: 32px; font-size: 16px; }
.stepperinput.small input { width: 44px; height: 32px; }
.tl-row.unfit { opacity: .45; }
.tl-row.unfit .tl-track { cursor: not-allowed; }
.tag { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tl-row { min-height: 58px; padding: 5px 0; }
.tl-row:has(.tl-badge) { padding-top: 26px; }
.tl-row.readonly .tl-track { cursor: default; opacity: .9; }
.tl-row.readonly .tl-room strong { font-weight: 600; color: var(--text-2); }
.tl-row.active .tl-room { box-shadow: inset 3px 0 0 var(--brand); padding-left: 10px; }
.tl-row.active .tl-track { box-shadow: 0 0 0 2px var(--brand-soft); }
.tl-track:focus-visible { outline: none; box-shadow: var(--focus); }
.tl-closed.past { background: color-mix(in srgb, var(--text-2) 14%, transparent); }

/* Existing bookings: busy = brand colour, blockade = orange */
.tl-booking > span { font-variant-numeric: tabular-nums; }
.tl-booking.block { background: var(--block); color: var(--block-ink); background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,.18) 6px 12px); }
.tl-booking, .tl-selected { padding: 0 4px; justify-content: center; }
.tl-booking > span, .tl-selected > span { display: block; white-space: nowrap; overflow: hidden; }
.tl-booking .short, .tl-selected .short { display: none; }
.tl-booking.short .full, .tl-selected.short .full { display: none; }
.tl-booking.short .short, .tl-selected.short .short { display: block; }
.tl-booking.narrow > span, .tl-selected.narrow > span { display: none; }
/* Internal users work on large screens: give the planner room. */
@media (min-width: 1400px) { .page { max-width: 1520px; } .actionbar .inner { max-width: 1520px; } }

/* Contra bookings the selection would create */
.tl-buffer {
    position: absolute; top: 4px; bottom: 4px; border-radius: 8px; pointer-events: auto; cursor: help;
    border: 2px dashed var(--block); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--block) 22%, transparent) 0 5px, transparent 5px 10px);
}

/* Selection + always-readable badge above it */
.tl-selected.ok { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px var(--brand); }
.tl-selected.block { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--block); }
.tl-selected.hard { background: var(--danger); color: #fff; box-shadow: none; }
.tl-badge {
    position: absolute; top: -24px; z-index: 2; transform: translateX(-2px); pointer-events: none;
    padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
    background: var(--brand); color: var(--surface);
}
.tl-badge.block { background: var(--block); color: var(--block-ink); }
.tl-badge.hard { background: var(--danger); color: #fff; }
.tl-ghost.ok { border-color: var(--brand); color: var(--brand); }
.tl-ghost.block { border-color: var(--block); color: var(--block); background: color-mix(in srgb, var(--block) 14%, transparent); }
.tl-ghost.hard { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); cursor: not-allowed; }

.tl-legend .block { background: var(--block); }
.tl-legend .buffer { border: 2px dashed var(--block); background: color-mix(in srgb, var(--block) 18%, transparent); }

.tl-tip {
    position: fixed; z-index: 60; max-width: 280px; padding: 8px 10px; border-radius: 8px; pointer-events: none;
    background: var(--text); color: var(--bg); font-size: 13px; line-height: 1.4; white-space: pre-line; box-shadow: var(--shadow);
}

/* Selection panel */
.selection-panel { margin-top: 16px; }
.sel-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.sel-item.active { border-color: var(--brand); }
.sel-item.block { border-left: 4px solid var(--block); }
.sel-item.hard { border-left: 4px solid var(--danger); }
.sel-head { display: flex; align-items: center; gap: 12px; }
.sel-head > div:first-child { flex: 1; min-width: 0; }
.sel-time { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 15px; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.durations button { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; }
.durations button small { font-size: 11px; font-weight: 400; opacity: .8; }
.note { font-size: 14px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); }
.note.warn { background: var(--block-soft); color: var(--text); border-left: 3px solid var(--block); }
.note.error { background: var(--danger-soft); color: var(--danger); }
.hint-line { margin: 8px 0 0; }
.suggestions button[aria-pressed="true"] { background: var(--brand); color: var(--surface); }
.inline-error { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 14px; }

.btn.warn { background: var(--block); border-color: var(--block); color: var(--block-ink); }

/* Dialog */
dialog.modal { border: 0; border-radius: var(--radius); padding: 24px; max-width: 480px; width: calc(100vw - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.modal::backdrop { background: rgba(10, 20, 20, .45); }
dialog.modal h2 { margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* Wait overlay */
.wait { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(3px); }
.wait-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; text-align: center; min-width: 280px; max-width: calc(100vw - 32px); }
.spinner.big { display: block; width: 36px; height: 36px; border-width: 3px; margin: 0 auto 14px; color: var(--brand); }

/* Dossier step */
.dossier-head, .dossier-item { display: grid; grid-template-columns: 18px 110px minmax(0, 1.4fr) 100px minmax(0, 1fr); gap: 12px; align-items: center; }
.dossier-head { padding: 0 14px 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.dossier-item .who { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.linklike { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.req::after { content: " *"; color: var(--danger); }
.segmented .seg input { position: absolute; opacity: 0; pointer-events: none; }
.segmented .seg span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; cursor: pointer; }
.segmented .seg input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--surface); font-weight: 600; }
.segmented .seg input:focus-visible + span { box-shadow: var(--focus); }
.combo { position: relative; }
.combo input { min-height: 44px; border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; background: var(--surface-2); color: var(--text); font: inherit; }
.combo [role=listbox] { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); font-weight: 400; }
.combo [role=option] { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.combo [role=option] small { color: var(--text-2); }
.combo [role=option].active, .combo [role=option]:hover { background: var(--brand-soft); }

/* Summary */
.summary-date { color: var(--text-2); margin: -6px 0 12px; }
.summary-items { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.summary-items li { display: flex; gap: 12px; align-items: baseline; }
.summary-items .time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 96px; }
.summary-items.center { align-items: center; margin: 16px 0; }
.small { font-size: 13px; }
.break { word-break: break-all; }
.aside-actions { margin-top: 12px; }
.aside-actions .btn { width: 100%; }

@media (max-width: 900px) { .with-aside > aside { order: 0; } }
@media (max-width: 640px) {
    .tl-axis, .tl-row { grid-template-columns: 110px 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .dossier-head { display: none; }
    .dossier-item { grid-template-columns: 18px 1fr; }
    .dossier-item > span:nth-child(n+4) { grid-column: 2; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
    .appbar { padding: 8px 16px; gap: 8px; }
    .appbar .chip.accent, .user .muted { display: none; }
    .brand { font-size: 17px; }
    .page { padding: 16px 16px 150px; }
    .stepper { padding: 0 16px; }
    .card { padding: 16px; border-radius: 12px; }
    h1 { font-size: 23px; }
    .tl-axis, .tl-row { grid-template-columns: 96px 1fr; }
    .tl-inner { min-width: 720px; }
    .tl-room span { display: none; }
    .actionbar .inner { padding: 10px 16px; }
    .actionbar .btn { width: 100%; }
    .toasts { left: 16px; right: 16px; bottom: 150px; }
}
.tl-axis .tick:last-child { transform: translateX(-100%); }
.tl-axis .tick:first-child { transform: none; }
@media (min-width: 1400px) { .stepper { max-width: 1520px; } }

/* ---------- Location / activity ---------- */
.toolbar-row.what { align-items: flex-end; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.toolbar-row.what .field { min-width: 240px; }
.field select {
    min-height: 44px; border: 1px solid var(--border); border-radius: 12px; padding: 0 36px 0 12px; background: var(--surface-2); color: var(--text); font: inherit;
    appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
    background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.field select option:disabled { color: var(--text-2); }
.questions { display: flex; flex-wrap: wrap; gap: 12px 24px; min-height: 44px; align-items: center; }
.timeline-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 4px 0 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.cal-info { margin: 2px 0 0; }
.tl-closed { pointer-events: auto; cursor: default; }
@media (max-width: 640px) { .toolbar-row.what .field { min-width: 0; width: 100%; } }

/* ---------- Date field with calendar button, "Andere datum" ---------- */
.datefield { position: relative; display: flex; align-items: stretch; width: 100%; }
.field.inline .datefield { width: auto; }
.datefield > input.date-text { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; min-width: 0; }
.datefield-btn {
    flex: none; width: 44px; min-height: 44px; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--border); border-left: 0; border-radius: 0 12px 12px 0; background: var(--surface); color: var(--brand);
}
.datefield-btn:hover { background: var(--brand-soft); }
.datefield-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.datefield-picker { position: absolute; right: 0; bottom: 0; width: 44px; height: 44px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.date-chip.other { border-style: dashed; color: var(--brand); }
.date-chip.other .day { display: grid; place-items: center; height: 24px; }
.date-chip.other.chosen { border-style: solid; }
.other-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 4px 2px 0; }
.other-row .date-text { width: 140px; }
.empty.start { padding: 40px 16px; line-height: 1.7; }
.field select:disabled { opacity: .6; cursor: not-allowed; }
.date-chip.other[aria-pressed="true"] { color: var(--surface); }

/* ---------- v5: wide "Andere datum", inline field errors, custom popup, error page ---------- */
.date-chip.other {
    width: auto; min-width: 150px; padding: 8px 14px; border-style: solid; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px;
}
.date-chip.other .day { height: auto; font-size: 15px; font-weight: 600; }
.date-chip.other .dow, .date-chip.other .mon { font-size: 15px; font-weight: 600; color: inherit; text-transform: none; }
.date-chip.other #otherDay svg { display: block; }
@media (max-width: 640px) {
    .dates { flex-wrap: wrap; }
    .date-chip.other { flex-basis: 100%; }
}
.field-error { display: block; font-size: 13px; font-weight: 600; color: var(--danger); }
.field input[aria-invalid="true"], .date-text[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.field-error:not([hidden])::before { content: "⚠ "; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.modal-text { margin: 0 0 4px; line-height: 1.5; }
.modal-note:empty { display: none; }
.error-page { max-width: 640px; margin: 40px auto; }
.error-page .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.date-chip.other #otherLabel { font-size: 15px; font-weight: 600; white-space: nowrap; }

/* ---------- Environment: ACC / PRODUCTIE ---------- */
.chip.env.prod { background: var(--danger); color: #fff; font-weight: 700; letter-spacing: .3px; }
.env-banner { padding: 8px 24px; text-align: center; font-size: 14px; background: var(--danger); color: #fff; }
.env-banner.config { background: var(--warn-soft); color: var(--text); border-bottom: 1px solid var(--border); }
.env-line { margin-top: 16px; font-size: 13px; color: var(--text-2); }
.env-line.prod { color: var(--danger); font-weight: 600; }
.actionbar #resetBtn { margin-left: auto; }
.actionbar #resetBtn + #bookBtn { margin-left: 0; }

/* ---------- Confirm: one overview, one button ---------- */
.confirm-card { max-width: 880px; }
.confirm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.confirm-head h2 { font-size: 22px; margin: 0; }
.confirm-when { margin: 4px 0 0; font-size: 16px; color: var(--text-2); }
.countdown.compact { margin: 0; min-width: 180px; padding: 8px 12px; }
.countdown.compact .time { font-size: 18px; }
.confirm-section { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); margin: 22px 0 8px; }
.confirm-section .small { text-transform: none; letter-spacing: 0; }
table.overview { width: 100%; border-collapse: collapse; font-size: 15px; }
table.overview th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0 12px 6px 0; border-bottom: 1px solid var(--border); }
table.overview td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
table.overview td.time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag.warn { margin-left: 8px; background: var(--block-soft); border-color: var(--block); color: var(--text); }
.block-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.block-list li { padding: 6px 10px; border-left: 3px solid var(--block); background: var(--block-soft); border-radius: 6px; }
.block-list .time { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 8px; }
.overview-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; font-size: 15px; }
.overview-dl dt { color: var(--text-2); }
.overview-dl dd { margin: 0; font-weight: 600; }
.confirm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.confirm-actions #confirmBtn { min-width: 220px; }
.confirm-actions .progress { margin: 0; }
.confirm-actions form { margin: 0; }
.btn.outline { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn.outline:hover { background: var(--brand-soft, rgba(0,0,0,.04)); }
/* Confirm page: each part in a rounded box with a round pencil button to change it */
.confirm-box { border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px 12px; margin-top: 18px; }
.confirm-box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.confirm-box-head form { margin: 0; }
.confirm-box .confirm-section { margin: 12px 0 8px; }
.confirm-box table.overview tr:last-child td { border-bottom: 0; }
.edit-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--brand); }
.edit-btn:hover, .edit-btn:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 640px) {
    table.overview thead { display: none; }
    table.overview td { display: block; padding: 2px 0; border: 0; }
    table.overview tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .confirm-actions #confirmBtn { width: 100%; }
}

/* ---------- Inline bar under the selected room ---------- */
.tl-inline {
    margin: 2px 0 10px 180px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2);
    border: 1px solid var(--border); border-left: 4px solid var(--brand); display: flex; flex-direction: column; gap: 8px;
}
.tl-inline.block { border-left-color: var(--block); }
.tl-inline.hard { border-left-color: var(--danger); }
.tl-inline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.tl-inline-head .sel-time { font-size: 17px; }
.tl-inline-head .durations { flex: 1; min-width: 0; }
.tl-inline-head .icon-btn { width: 32px; height: 32px; }
.tl-inline .note { display: block; }
.tl-inline .suggestions { margin-top: 0; }
.tl-inline .suggestions button { min-height: 30px; padding: 0 10px; font-size: 13px; }
@media (max-width: 640px) { .tl-inline { margin-left: 0; } }

/* ---------- Configuration check ---------- */
.config-check h2 { margin-bottom: 4px; }
.cc-activity { font-size: 16px; margin: 24px 0 8px; display: flex; align-items: center; gap: 10px; }
.cc-table td { font-size: 14px; }
.cc-table tr.cc-warn td { background: var(--block-soft); }
.cc-table tr.cc-off td { color: var(--text-2); }

/* ---------- Logo, environment badge, current link ---------- */
.appbar { padding-top: 6px; padding-bottom: 6px; }
.brand { color: var(--text); line-height: 0; }
.brand .logo { height: 44px; width: auto; display: block; }
.signin-logo { height: 72px; width: auto; display: block; margin: 0 auto 16px; }
.chip.env:not(.accent) { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.linklike.current { font-weight: 700; text-decoration: none; color: var(--text); }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Own choice can be picked up and moved in steps of 15 minutes */
.tl-selected { pointer-events: auto; cursor: grab; touch-action: none; }
.tl-track.dragging, .tl-track.dragging .tl-selected { cursor: grabbing; }
.tl-track.dragging .tl-selected { opacity: .9; box-shadow: 0 0 0 2px var(--brand), 0 4px 12px rgba(0,0,0,.18); }
.tl-track.dragging .tl-badge { z-index: 3; }

/* No access page */
.noaccess { text-align: left; }
.noaccess h1 { text-align: center; font-size: 24px; }
.noaccess-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px;
    background: var(--brand-soft); color: var(--brand); }
.noaccess .btn { margin-top: 8px; }
.error-page .support { margin-top: 4px; }
.error-page .code { font-size: 12px; color: var(--text-2); }

/* ---------- Cancelling an option: progress popup ---------- */
dialog.progress-modal { text-align: center; max-width: 420px; }
dialog.progress-modal .modal-actions { justify-content: center; }
.progress-icon { display: grid; place-items: center; height: 56px; margin-bottom: 8px; }
.progress-time { min-height: 1.2em; margin: 4px 0 0; }
.done-mark, .error-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-weight: 800; font-size: 26px; }
.done-mark { background: var(--brand-soft); color: var(--brand); }
.error-mark { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* ---------- Sign-in button (a link that looks like a button) ---------- */
.signin-btn { width: 100%; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 10px; }
.signin-btn.busy { pointer-events: none; opacity: .8; }
.signin .alert { text-align: left; margin: 12px 0; }
