/* ==========================================================================
   Raumbuchung – modernes, minimalistisches Design
   ========================================================================== */

:root {
    --bg: #f4f5fa;
    --bg-glow-1: rgb(99 102 241 / .10);
    --bg-glow-2: rgb(168 85 247 / .07);
    --surface: #ffffff;
    --surface-2: #f6f7fb;
    --surface-glass: rgb(255 255 255 / .78);
    --border: rgb(15 23 42 / .07);
    --border-strong: rgb(15 23 42 / .13);
    --text: #0b1020;
    --text-2: #4b5468;
    --muted: #8a93a6;

    --accent: #5b5bf0;
    --accent-2: #9b5cf6;
    --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-soft: #eef0ff;
    --accent-text: #3b36b8;
    --ring: 0 0 0 4px rgb(99 102 241 / .18);

    --free: #12a150;
    --free-soft: #e9f9ef;
    --busy: #e5484d;
    --busy-soft: #fff0f0;
    --now: #f43f5e;

    --radius-lg: 22px;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgb(16 24 40 / .05);
    --shadow: 0 1px 2px rgb(16 24 40 / .04), 0 8px 24px -6px rgb(16 24 40 / .08);
    --shadow-lg: 0 2px 4px rgb(16 24 40 / .04), 0 24px 48px -12px rgb(16 24 40 / .16);
    --ease: cubic-bezier(.2, .8, .2, 1);

    color-scheme: light;
    font-family: "Inter", "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-feature-settings: "tnum" 1, "cv11" 1;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #07090f;
        --bg-glow-1: rgb(99 102 241 / .16);
        --bg-glow-2: rgb(168 85 247 / .10);
        --surface: #10131c;
        --surface-2: #161a26;
        --surface-glass: rgb(16 19 28 / .78);
        --border: rgb(255 255 255 / .07);
        --border-strong: rgb(255 255 255 / .13);
        --text: #eef0f6;
        --text-2: #aab1c3;
        --muted: #6c7489;
        --accent: #8b8cfb;
        --accent-soft: rgb(99 102 241 / .16);
        --accent-text: #c9cbff;
        --free: #3dd68c;
        --free-soft: rgb(61 214 140 / .10);
        --busy: #ff6369;
        --busy-soft: rgb(255 99 105 / .10);
        --shadow-sm: none;
        --shadow: 0 0 0 1px rgb(255 255 255 / .02);
        --shadow-lg: 0 24px 48px -12px rgb(0 0 0 / .6);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

body {
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    line-height: 1.45;
    background:
        radial-gradient(1200px 600px at -10% -10%, var(--bg-glow-1), transparent 60%),
        radial-gradient(900px 500px at 110% -5%, var(--bg-glow-2), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.02em; }
a { color: var(--accent); text-decoration: none; }
p { margin: 0; }
.muted { color: var(--muted); }

.icon {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible { outline: none; box-shadow: var(--ring); }

.section-title, .card .section-title {
    font-size: .72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Buttons, Formularelemente, Hinweise
   -------------------------------------------------------------------------- */

.btn {
    --btn-h: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: var(--btn-h);
    padding: 0 1.25rem;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: -.005em;
    color: #fff;
    background: var(--accent-grad);
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 1px 0 rgb(255 255 255 / .2) inset, 0 6px 16px -4px rgb(99 102 241 / .45);
    transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    text-decoration: none;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 1px 0 rgb(255 255 255 / .2) inset, 0 10px 22px -6px rgb(99 102 241 / .55); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: grayscale(.4); transform: none; }
.btn--block { width: 100%; }
.btn--ghost {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { background: var(--surface-2); box-shadow: var(--shadow-sm); filter: none; }
.btn--danger {
    color: var(--busy);
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--busy) 30%, transparent);
    box-shadow: none;
}
.btn--danger:hover { background: var(--busy-soft); box-shadow: none; filter: none; }
.btn--sm { --btn-h: 36px; padding: 0 .85rem; font-size: .84rem; border-radius: 10px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 20px; height: 20px; }

.field { display: grid; gap: .4rem; }
label, .label { font-size: .84rem; font-weight: 600; color: var(--text-2); }

input[type=text], input[type=password], input[type=date], input[type=number],
input[type=email], input[type=url], select, textarea {
    width: 100%;
    min-height: 50px;
    font: inherit;
    font-size: 16px; /* verhindert Auto-Zoom auf iOS */
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .75rem .95rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    -webkit-appearance: none;
    appearance: none;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: var(--ring);
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a93a6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
textarea { min-height: 6rem; resize: vertical; line-height: 1.45; }
::placeholder { color: var(--muted); }

.pw-field { position: relative; }
.pw-field input { padding-right: 3.2rem; }
.pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    translate: 0 -50%;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 10px;
    cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }

.notice {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    border-radius: 14px;
    padding: .85rem 1rem;
    font-size: .92rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    animation: pop .35s var(--ease);
}
.notice .icon { margin-top: .1rem; }
.notice--error { background: var(--busy-soft); color: var(--busy); border-color: color-mix(in srgb, var(--busy) 20%, transparent); }
.notice--success { background: var(--free-soft); color: var(--free); border-color: color-mix(in srgb, var(--free) 22%, transparent); }

.hint { font-size: .8rem; color: var(--muted); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem .8rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 550;
    color: var(--text-2);
    background: var(--surface-glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}
.pill-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 50% { box-shadow: 0 0 0 .4em transparent; } }

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

/* --------------------------------------------------------------------------
   Kiosk (Startseite)
   -------------------------------------------------------------------------- */

.kiosk-body { overflow: hidden; }
.kiosk-body.cursor-idle, .kiosk-body.cursor-idle * { cursor: none !important; }

.kiosk {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(270px, 19vw, 350px);
    gap: 1.4vw;
    height: 100vh;
    height: 100dvh;
    padding: 1.4vw;
}

.kiosk-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.kiosk-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1vw;
    flex-wrap: wrap;
}
.kiosk-title { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.kiosk-head h1 { font-size: clamp(1.35rem, 1.7vw, 2.2rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand-mark {
    display: grid;
    place-items: center;
    width: clamp(36px, 2.4vw, 46px);
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--accent-grad);
    box-shadow: 0 6px 16px -4px rgb(99 102 241 / .5);
    flex: none;
}
.brand-mark svg { width: 55%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }

.cal-scroll { flex: 1; min-height: 0; display: flex; }

.cal {
    flex: 1;
    display: grid;
    grid-template-columns: 3.8rem repeat(var(--cols), minmax(0, 1fr));
    grid-template-rows: auto repeat(var(--rows), minmax(0, 1fr));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: clip; /* clip statt hidden: erlaubt position:sticky in der Stundenspalte */
}

.cal-corner { grid-column: 1; grid-row: 1; border-bottom: 1px solid var(--border); }

.cal-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .7rem .25rem .6rem;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
}
.cal-dow { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.cal-dom { font-size: clamp(.85rem, .95vw, 1.15rem); font-weight: 650; padding: .1rem .55rem; border-radius: 999px; }
.cal-day.is-today .cal-dow { color: var(--accent); }
.cal-day.is-today .cal-dom { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 12px -3px rgb(99 102 241 / .55); }
.cal-day.is-past { opacity: .4; }

.cal-hour {
    grid-column: 1;
    font-size: .7rem;
    font-weight: 550;
    color: var(--muted);
    text-align: right;
    padding: .3rem .6rem 0 0;
    border-top: 1px solid var(--border);
}

.cal-cell { border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.cal-cell.is-today { background: color-mix(in srgb, var(--accent) 4.5%, transparent); }
.cal-cell.is-past {
    background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--border-strong) 45%, transparent) 7px 8px);
}
.cal-cell.is-free {
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
}
.cal-cell.is-free::after {
    content: "+ Buchen";
    font-size: .74rem;
    font-weight: 650;
    padding: .2rem .55rem;
    border-radius: 999px;
}
.cal-cell.is-free:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); }
.cal-cell.is-free:hover::after { background: var(--surface); box-shadow: var(--shadow-sm); }

.week-start { border-left: 2px solid var(--border-strong) !important; }

.cal-block {
    position: relative;
    z-index: 1;
    margin: 3px 4px;
    padding: .35rem .55rem;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-text);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-height: 0;
    box-shadow: inset 3px 0 0 var(--accent);
}
.cal-block-time { font-size: .68rem; font-weight: 650; opacity: .8; white-space: nowrap; }
.cal-block-remark {
    font-size: clamp(.72rem, .78vw, .95rem);
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}
.cal-block.is-short { justify-content: center; }
.cal-block.is-short .cal-block-remark { display: block; white-space: nowrap; text-overflow: ellipsis; }
.cal-block.is-past { filter: grayscale(1); opacity: .45; }
.cal-block.is-now {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 8px 20px -6px rgb(99 102 241 / .6);
}

.cal-now { position: relative; z-index: 2; pointer-events: none; }
.cal-now-line { position: absolute; left: -1px; right: 0; height: 2px; background: var(--now); border-radius: 2px; }
.cal-now-line::before {
    content: "";
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--now);
    color: var(--now);
    animation: pulse 2s infinite;
}

/* Seitenleiste */

.kiosk-side { display: flex; flex-direction: column; gap: 1vw; min-height: 0; }

.clock { padding: .25rem .25rem 0; }
.clock-time { font-size: clamp(2.8rem, 4.6vw, 5.8rem); font-weight: 250; letter-spacing: -.045em; line-height: 1; }
.clock-date { color: var(--text-2); margin-top: .45rem; font-size: clamp(.9rem, 1vw, 1.2rem); font-weight: 500; }

.status {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.status::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 100% at 0% 0%, var(--status-glow), transparent 70%);
    pointer-events: none;
}
.status--free { --status-color: var(--free); --status-glow: var(--free-soft); }
.status--busy { --status-color: var(--busy); --status-glow: var(--busy-soft); }
.status > * { position: relative; }
.status-label {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: clamp(1.35rem, 1.65vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--status-color);
}
.dot { width: .55em; height: .55em; border-radius: 50%; background: currentColor; animation: pulse 2.4s infinite; }
.status-detail { color: var(--text-2); margin-top: .2rem; font-weight: 500; }
.status-remark { margin-top: .6rem; font-weight: 600; }

.upcoming { flex: 1; min-height: 0; overflow: hidden; padding: 0 .25rem; }
.upcoming .section-title { margin-bottom: .75rem; }
.upcoming ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.upcoming li { position: relative; display: grid; gap: .1rem; padding-left: 1.1rem; }
.upcoming li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .45rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.upcoming-when { font-size: .8rem; color: var(--muted); font-weight: 550; }
.upcoming-what { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .9rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.qr-code {
    padding: 6px;
    border-radius: 18px;
    background: var(--accent-grad);
    box-shadow: 0 10px 24px -8px rgb(99 102 241 / .5);
}
.qr-code img {
    display: block;
    width: min(13vw, 220px);
    height: auto;
    aspect-ratio: 1;
    border-radius: 13px;
    background: #fff;
}
.qr-title { font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; }
.qr-hint { color: var(--text-2); font-size: .85rem; }

/* Kiosk auf Tablet/Handy: gestapelt, Kalender horizontal scrollbar */
@media (max-width: 960px) {
    .kiosk-body { overflow: auto; }
    .kiosk { display: flex; flex-direction: column; height: auto; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); gap: 1rem; }
    .kiosk-main { display: contents; }
    .kiosk-head { order: 0; margin: 0; }
    .kiosk-side { order: 1; gap: 1rem; }
    .cal-scroll, .kiosk-main > .notice { order: 2; }
    .kiosk-head .pill { font-size: .75rem; }

    .clock { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
    .clock-time { font-size: 2.4rem; font-weight: 300; }
    .clock-date { margin: 0; font-size: .9rem; }
    .status { padding: 1rem 1.1rem; }
    .status-label { font-size: 1.4rem; }
    .upcoming { display: none; }

    .qr { padding: 0; background: none; border: 0; box-shadow: none; }
    .qr-code, .qr-text { display: none; }

    .cal-scroll {
        overflow-x: auto;
        scroll-snap-type: x proximity;
        margin: 0 -1rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .cal-scroll::-webkit-scrollbar { display: none; }
    .cal {
        grid-template-columns: 3.2rem repeat(var(--cols), 6.6rem);
        grid-template-rows: auto repeat(var(--rows), 3.4rem);
        min-width: max-content;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
    .cal-corner, .cal-hour { position: sticky; left: 0; z-index: 3; background: var(--surface); }
    .cal-day { scroll-snap-align: start; scroll-margin-left: 3.2rem; }
    .cal-block-remark { font-size: .78rem; }
    .cal-cell.is-free::after { content: "+"; font-size: 1.1rem; }
    .cal-cell.is-free:active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
}

/* --------------------------------------------------------------------------
   App-Seiten (Buchung, Admin)
   -------------------------------------------------------------------------- */

.app-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: calc(.7rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .7rem max(1rem, env(safe-area-inset-left));
    background: var(--surface-glass);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-bottom: 1px solid var(--border);
}
.app-bar-title { display: flex; align-items: center; gap: .65rem; min-width: 0; font-weight: 650; letter-spacing: -.01em; }
.app-bar-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar .brand-mark { width: 32px; border-radius: 10px; }
.app-bar-actions { display: flex; gap: .5rem; flex: none; }

.page {
    max-width: 560px;
    margin: 0 auto;
    padding: 1.5rem max(1rem, env(safe-area-inset-left)) calc(2rem + env(safe-area-inset-bottom));
    animation: rise .4s var(--ease);
}
.page--wide { max-width: 1040px; }
.page--center { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }

.hero { margin: .25rem 0 1.4rem; }
.hero h1 { font-size: clamp(1.7rem, 6vw, 2.1rem); letter-spacing: -.035em; line-height: 1.1; }
.hero p { color: var(--text-2); margin-top: .45rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.5rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; letter-spacing: -.03em; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650; margin-bottom: .25rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card h2 { font-size: 1.05rem; }
.card-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: .3rem;
}
.card-icon .icon { width: 24px; height: 24px; }

.stack { display: grid; gap: 1.1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

.step { display: grid; gap: .7rem; }
.step + .step { padding-top: 1.2rem; border-top: 1px solid var(--border); }
.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.step-head .hint { white-space: nowrap; }

/* Tagesauswahl (horizontal scrollbar) */

.day-strip {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -1.4rem;
    padding: .15rem 1.4rem .35rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.day-strip::-webkit-scrollbar { display: none; }

.day-chip {
    flex: none;
    scroll-snap-align: start;
    scroll-margin-left: 1.4rem;
    display: grid;
    justify-items: center;
    gap: .1rem;
    min-width: 4.1rem;
    padding: .6rem .5rem;
    font: inherit;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 15px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s var(--ease), color .15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.day-chip:hover { border-color: var(--border-strong); }
.day-chip:active { transform: scale(.96); }
.day-chip-dow { font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.day-chip-dom { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.day-chip-mon { font-size: .7rem; color: var(--muted); font-weight: 550; }
.day-chip.is-today .day-chip-dow { color: var(--accent); }
.day-chip.is-selected {
    background: var(--accent-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px -6px rgb(99 102 241 / .55);
}
.day-chip.is-selected .day-chip-dow, .day-chip.is-selected .day-chip-mon { color: rgb(255 255 255 / .8); }
.day-chip--more { min-width: 4.6rem; align-content: center; color: var(--text-2); }
.day-chip--more .icon { width: 22px; height: 22px; }

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Slot-Auswahl */

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.slot {
    position: relative;
    min-height: 48px;
    font: inherit;
    font-size: .92rem;
    font-weight: 600;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s, transform .12s var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.slot:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.slot:active:not(:disabled) { transform: scale(.95); }
.slot:disabled { cursor: not-allowed; }
.slot.is-busy { background: var(--busy-soft); border-color: transparent; color: color-mix(in srgb, var(--busy) 75%, var(--text-2)); }
.slot.is-busy::after {
    content: "";
    position: absolute;
    left: 22%;
    right: 22%;
    top: 50%;
    height: 1.5px;
    background: currentColor;
    opacity: .6;
    rotate: -12deg;
}
.slot.is-past { opacity: .35; }
.slot.is-selected { background: var(--accent-grad); border-color: transparent; color: #fff !important; box-shadow: 0 6px 14px -5px rgb(99 102 241 / .55); }
.slot.is-range { background: var(--accent-soft); border-color: transparent; color: var(--accent-text) !important; }
.slots.is-loading { opacity: .5; pointer-events: none; }
.slots-empty { grid-column: 1 / -1; text-align: center; padding: 1rem; color: var(--muted); font-size: .9rem; }

.legend { display: flex; gap: 1rem; font-size: .76rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend span::before { content: ""; width: .7rem; height: .7rem; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.legend .l-busy::before { background: var(--busy-soft); border-color: color-mix(in srgb, var(--busy) 30%, transparent); }
.legend .l-sel::before { background: var(--accent-grad); border: 0; }

/* Fixierte Aktionsleiste unten (Handy) */

.action-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 1rem -1.4rem -1.4rem;
    padding: 1rem 1.4rem;
    background: var(--surface-glass);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: grid;
    gap: .7rem;
}
.action-summary { display: flex; align-items: center; gap: .6rem; font-size: .92rem; color: var(--text-2); min-height: 1.4em; }
.action-summary .icon { color: var(--accent); }
.action-summary strong { color: var(--text); font-weight: 650; }

.success-card { text-align: center; padding: 2rem 1.4rem; animation: pop .45s var(--ease); }
.success-check {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--free-soft);
    color: var(--free);
}
.success-check .icon { width: 32px; height: 32px; stroke-width: 2.5; }
.success-card h2 { font-size: 1.3rem; margin-bottom: .35rem; }
.success-card p { color: var(--text-2); }
.success-card .btn { margin-top: 1.4rem; }

.footer-hint { text-align: center; margin-top: 1.5rem; }

/* Admin */

.table-wrap { overflow-x: auto; margin: 0 -1.4rem; padding: 0 1.4rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
    text-align: left;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 650;
    padding: .6rem .7rem;
    border-bottom: 1px solid var(--border);
}
td { padding: .8rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.nowrap { white-space: nowrap; }
td.actions { text-align: right; }
tr.is-past td { color: var(--muted); }
.date-badge { font-weight: 650; }

/* Admin: Tabs */

.tabs {
    display: flex;
    gap: .35rem;
    padding: .3rem;
    margin-bottom: 1.25rem;
    background: var(--surface-glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    backdrop-filter: blur(10px);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    padding: 0 1rem;
    border-radius: 12px;
    color: var(--text-2);
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    transition: background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

/* Admin: Schalter, Badges, Listen */

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
}
.switch-row > span { display: grid; gap: .1rem; }
.switch-title { font-weight: 600; color: var(--text); font-size: .92rem; }

.switch {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    position: relative;
    width: 48px;
    height: 28px;
    margin: 0;
    border-radius: 999px;
    background: var(--border-strong);
    cursor: pointer;
    transition: background .2s var(--ease);
}
.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / .25);
    transition: transform .2s var(--ease);
}
.switch:checked { background: var(--accent-grad); }
.switch:checked::after { transform: translateX(20px); }

.check-row { display: flex; align-items: center; gap: .55rem; font-size: .88rem; color: var(--text-2); font-weight: 500; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }

.row--host { grid-template-columns: 1fr 7rem; }

.status-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .8rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
}
.badge .dot { width: .5rem; height: .5rem; animation: none; }
.badge--ok { color: var(--free); background: var(--free-soft); border-color: transparent; }
.badge--off { color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .8rem .7rem 1rem;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.list-item.is-inactive .list-title { color: var(--muted); text-decoration: line-through; }
.list-main { display: grid; min-width: 0; }
.list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-actions { display: flex; gap: .35rem; flex: none; }
.icon-btn--sm { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn--sm .icon { width: 17px; height: 17px; }
.icon-btn--danger { color: var(--busy); }
.icon-btn--danger:hover { color: var(--busy); background: var(--busy-soft); }

.qr-preview { display: flex; align-items: center; gap: 1rem; }
.qr-preview img { flex: none; border-radius: 10px; background: #fff; border: 1px solid var(--border); }

.toolbar { display: flex; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; margin-top: 1rem; }
.grid-2 .card + .card { margin-top: 0; }

@media (max-width: 640px) {
    .page { padding-top: 1.1rem; }
    .card { padding: 1.15rem; border-radius: 20px; }
    .day-strip { margin: 0 -1.15rem; padding-left: 1.15rem; padding-right: 1.15rem; }
    .day-chip { scroll-margin-left: 1.15rem; }
    .action-bar { margin: 1rem -1.15rem -1.15rem; padding: .9rem 1.15rem calc(.9rem + env(safe-area-inset-bottom)); border-radius: 0 0 20px 20px; }
    .table-wrap { margin: 0; padding: 0; }

    /* Tabelle als Karten */
    table, tbody, tr, td { display: block; }
    thead { display: none; }
    tbody { display: grid; gap: .6rem; }
    tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: .15rem .75rem;
        padding: .85rem .95rem;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: var(--surface-2);
    }
    td { padding: 0; border: 0; }
    td.col-date { grid-column: 1; }
    td.col-time { grid-column: 1; color: var(--text-2); }
    td.col-remark { grid-column: 1 / -1; margin-top: .35rem; font-weight: 550; }
    td.col-created { grid-column: 1 / -1; font-size: .78rem; }
    td.actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

    /* Admin-Tabs: alle vier nebeneinander, Symbol über Text */
    .tab { flex: 1 1 0; flex-direction: column; gap: .15rem; min-height: 54px; padding: 0 .25rem; font-size: .72rem; }
    .tab .icon { width: 20px; height: 20px; }

    /* Formularzeilen untereinander (außer Server/Port) */
    .card .row:not(.row--host) { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
    .slots { grid-template-columns: repeat(3, 1fr); }
    .row { grid-template-columns: 1fr; }
}

/* Großer Bildschirm / Tablet quer: Buchungsseite etwas luftiger */
@media (min-width: 641px) {
    .action-bar { position: static; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
