:root {
    --bg: #f6f4ef;
    --card: #ffffff;
    --ink: #24302c;
    --muted: #66726d;
    --line: #e2ded5;
    --accent: #3f6f5e;
    --accent-ink: #ffffff;
    --accent-soft: #e6efea;
    --warn: #a6542f;
    --warn-soft: #fbeee6;
    --pending: #b8860b;
    --pending-soft: #fbf3dc;
    --radius: 14px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 1.9rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
[hidden] { display: none !important; }

.wrap { max-width: 860px; margin: 0 auto; padding: 32px 16px 48px; }
.wrap.narrow { max-width: 440px; }
.page-head { margin-bottom: 24px; }
.page-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; }
.head-actions form { margin: 0; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.page-foot { margin-top: 32px; color: var(--muted); font-size: .85rem; text-align: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { color: var(--muted); }
.big { font-size: 1.2rem; font-weight: 600; }

.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.step-head h2 { margin: 0; }
.step { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
        display: inline-grid; place-items: center; font-weight: 600; font-size: .95rem; flex: none; }

/* Wochen-Navigation */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px;
            padding: 6px; background: var(--bg); border-radius: 10px; }
.week-label { font-weight: 600; text-align: center; }
.week-nav .btn { min-width: 44px; font-size: 1.2rem; line-height: 1; }

.day { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0; }
.week .day:first-child { border-top: 0; }
.day legend { font-weight: 600; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.times { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.time { position: relative; }
.time input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.time span { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 8px 14px;
             border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer;
             transition: border-color .15s, background .15s; }
.time small { font-weight: 400; font-size: .75rem; color: var(--muted); }
.time:hover span { border-color: var(--accent); }
.time input:focus-visible + span { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
.time input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.time input:checked + span small { color: var(--accent-ink); opacity: .85; }

.chosen { background: var(--accent-soft); padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; }

/* Formulare */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 4px; border: 0; padding: 0; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span, .field legend { font-size: .9rem; font-weight: 600; padding: 0; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date],
input[type=time], input[type=number], select, textarea {
    width: 100%; font: inherit; color: inherit; background: #fff; padding: 10px 12px;
    border: 1.5px solid var(--line); border-radius: 10px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
.radios label { display: flex; align-items: center; gap: 8px; font-weight: 400; padding: 4px 0; cursor: pointer; }
.radios input, .check input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 12px; font-size: .92rem; cursor: pointer; }
.check input { margin-top: 3px; }
.note { font-size: .9rem; background: var(--bg); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
       padding: 11px 20px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
       min-height: 44px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger-ghost { background: transparent; border-color: var(--line); color: var(--warn); }
.btn.danger-ghost:hover { border-color: var(--warn); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .88rem; }
.btn:disabled { opacity: .35; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; }
.alert.error { background: var(--warn-soft); color: var(--warn); border: 1px solid #efcdb9; }
.alert.ok { background: var(--accent-soft); color: var(--accent); border: 1px solid #c9ddd2; }
.success { border-top: 4px solid var(--accent); }

/* Admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap;
          border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-color: var(--accent); }
.badge { display: inline-block; background: var(--pending); color: #fff; border-radius: 999px; font-size: .75rem;
         padding: 1px 8px; margin-left: 4px; }

.booking { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
           border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; display: grid; gap: 12px; }
.booking.pending { border-left-color: var(--pending); }
.booking.declined { border-left-color: var(--line); opacity: .75; }
.booking-when { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.booking-who .name { font-weight: 600; font-size: 1.05rem; }
.msg { background: var(--bg); padding: 10px 12px; border-radius: 8px; margin: 8px 0; white-space: normal; }
.booking-actions { border-top: 1px solid var(--line); padding-top: 12px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
       background: var(--bg); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.tag.new { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

.segmented { display: inline-flex; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 7px 16px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.preview { font-size: .9rem; min-height: 1.4em; }

.legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; margin: 0 0 12px; }
.av-day { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.av-day h3 { margin-bottom: 8px; }
.av-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: center; padding: 6px 0; }
.av-row form { margin: 0; }
.av-meta { display: flex; flex-direction: column; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; }
.chip.free { background: var(--accent-soft); color: var(--accent); }
.chip.pending { background: var(--pending-soft); color: var(--pending); }
.chip.confirmed { background: var(--accent); color: #fff; }
.chip.blocked { background: #eee; color: #888; text-decoration: line-through; }
.chip.past { background: transparent; color: #999; border-color: var(--line); }

@media (max-width: 640px) {
    h1 { font-size: 1.55rem; }
    .card { padding: 18px 16px; }
    .grid { grid-template-columns: 1fr; }
    .av-row { grid-template-columns: 1fr auto; }
    .av-row .chips { grid-column: 1 / -1; grid-row: 2; }
    .time span { min-width: 74px; }
}
.lead { color: var(--muted); max-width: 60ch; margin: 8px 0 0; }
