:root {
  --bg: #f3f8fa;
  --card: #ffffff;
  --text: #13262e;
  --muted: #5d7079;
  --line: #dde8ec;
  --primary: #0e7490;
  --primary-2: #14b8a6;
  --primary-soft: #e3f4f7;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --ok: #059669;
  --ok-soft: #e7f8f1;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --booked: #edf1f3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 38, 46, .06), 0 6px 20px rgba(19, 38, 46, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1a1f; --card: #13252c; --text: #e9f4f7; --muted: #94aab3; --line: #223a43;
    --primary: #38bdf8; --primary-2: #2dd4bf; --primary-soft: #133542; --warn: #fbbf24; --warn-soft: #3a2c12;
    --ok: #34d399; --ok-soft: #10302a; --danger: #f87171; --danger-soft: #3a1a1f; --booked: #1a2f37;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.container { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.between { justify-content: space-between; }
.hidden { display: none !important; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand-mini { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; font-weight: 700; }
.brand-mini img { border-radius: 8px; }
.admin-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--muted);
}
.admin-btn.active { color: var(--primary); border-color: var(--primary); }

/* Hero */
.hero { text-align: center; padding: 32px 4px 8px; }
.hero .logo { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 12px 30px rgba(14, 116, 144, .3); }
.hero h1 { font-size: 2rem; margin: 18px 0 2px; letter-spacing: -.02em; }
.hero .tagline { color: var(--primary); font-weight: 600; margin: 0 0 14px; }
.hero p.desc { color: var(--muted); margin: 0 auto 24px; max-width: 460px; }
.info-list { display: grid; gap: 8px; margin-top: 28px; text-align: left; }
.info-list .card { padding: 14px 16px; }
.hours-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hours-table td { padding: 3px 0; }
.hours-table td:last-child { text-align: right; }
.hours-table tr.today td { color: var(--primary); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 20px; font-weight: 700; font-size: 1rem;
  transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn.lg { padding: 16px 24px; font-size: 1.08rem; }
.btn.sm { padding: 7px 12px; font-size: .85rem; border-radius: 9px; }

/* Cards & steps */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { padding: 16px; margin-bottom: 14px; }
.section h3 { margin: 0 0 10px; font-size: 1rem; }
.stepper { display: flex; gap: 6px; margin: 4px 0 18px; }
.stepper span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.stepper span.on { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.step-title { font-size: 1.4rem; margin: 0 0 4px; letter-spacing: -.01em; }
.step-sub { color: var(--muted); margin: 0 0 16px; }
.back { background: none; border: 0; color: var(--muted); padding: 4px 0; margin-bottom: 8px; font-weight: 600; }

/* Arbeitszeiten-Banner */
.hours-banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--primary-soft); margin-bottom: 14px; font-size: .9rem;
}
.hours-banner strong { display: block; }
.hours-chips { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); }

/* Tage */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 64px; scroll-snap-align: start; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); text-align: center; line-height: 1.2;
}
.day .wd { font-size: .75rem; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.day .dn { font-size: 1.3rem; font-weight: 800; margin: 2px 0; }
.day .fr { font-size: .7rem; color: var(--ok); font-weight: 600; }
.day.closed { opacity: .45; }
.day.closed .fr, .day.full .fr { color: var(--muted); }
.day.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary) inset; }
.month-label { font-weight: 700; margin: 6px 0 8px; }

/* Slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot {
  padding: 11px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  font-weight: 700; text-align: center; position: relative;
}
.slot.free:hover { border-color: var(--primary); }
.slot.sel { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.slot.booked, .slot.past, .slot.blocked {
  background: var(--booked); color: var(--muted); cursor: not-allowed; text-decoration: line-through; font-weight: 500;
}
.slot .tag { display: block; font-size: .65rem; text-decoration: none; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line); }
.legend .lf { background: var(--card); }
.legend .lb { background: var(--booked); }
.legend .ls { background: var(--primary); border-color: var(--primary); }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }

/* Services */
.services { display: grid; gap: 10px; }
.service {
  display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); text-align: left; width: 100%;
}
.service .check {
  flex: 0 0 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center;
}
.service.sel { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.service.sel .check { background: var(--primary); border-color: var(--primary); }
.service.sel .check::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.service .body { flex: 1; min-width: 0; }
.service .name { font-weight: 700; }
.service .meta { font-size: .85rem; color: var(--muted); }
.service .price { font-weight: 800; white-space: nowrap; }

/* Sticky bottom bar */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.06);
}
.bottombar .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.bottombar .sum { flex: 1; line-height: 1.25; }
.bottombar .sum strong { font-size: 1.1rem; }
.bottombar .sum span { display: block; font-size: .82rem; color: var(--muted); }
.warn { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: .9rem; margin-top: 12px; }

/* Summary */
.summary .when { display: flex; gap: 12px; align-items: center; }
.summary .icon {
  flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 1.3rem;
}
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.lines td:last-child { text-align: right; white-space: nowrap; }
.lines tr.total td { border-bottom: 0; border-top: 2px solid var(--text); font-weight: 800; font-size: 1.1rem; padding-top: 12px; }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
label .req { color: var(--danger); }
input, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg); font-size: 1rem;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.error { color: var(--danger); font-size: .9rem; margin: 0 0 12px; }

/* Success */
.success { text-align: center; padding: 28px 8px 8px; }
.success .big-check {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok); font-size: 2.2rem; font-weight: 800;
}
.notice {
  display: flex; gap: 10px; text-align: left; padding: 14px; border-radius: 12px;
  background: #fff7e6; color: #8a5a00; border: 1px solid #f6dfb0; font-size: .92rem; margin: 16px 0;
}
@media (prefers-color-scheme: dark) { .notice { background: #2e2410; color: #f3cf86; border-color: #4d3c18; } }

/* Dialog */
.dialog { border: 0; border-radius: 18px; padding: 22px; width: min(92vw, 380px); background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog::backdrop { background: rgba(8, 24, 30, .5); backdrop-filter: blur(2px); }
.dialog h2 { margin: 0 0 4px; }
.dialog .row { justify-content: flex-end; margin-top: 6px; }

/* Admin */
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tabs { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--primary-soft); color: var(--primary); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stats .card { padding: 12px; text-align: center; }
.stats b { display: block; font-size: 1.35rem; }
.stats span { font-size: .75rem; color: var(--muted); }
.bk { padding: 14px; margin-bottom: 10px; }
.bk .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.bk .time { font-weight: 800; }
.bk .who { font-weight: 600; }
.bk .contact { font-size: .85rem; color: var(--muted); word-break: break-all; }
.bk .contact a { color: inherit; }
.bk .svc { font-size: .88rem; margin-top: 6px; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--booked); color: var(--muted); vertical-align: 2px; margin-left: 4px; }
.date-head { font-weight: 800; margin: 18px 0 8px; font-size: .95rem; color: var(--muted); text-transform: capitalize; }
.admin-slot { cursor: pointer; }
.admin-slot.booked { cursor: default; text-decoration: none; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.admin-slot.blocked { cursor: pointer; background: var(--danger-soft); color: var(--danger); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #13262e; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .92rem; transition: .2s; z-index: 50;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 700px) {
  .container { padding-top: 28px; }
  .hero h1 { font-size: 2.4rem; }
}

/* Zahnarzt-Demo: Testphase, Ablauf, Status */
.testphase {
  display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--warn-soft); color: var(--warn); border: 1px dashed currentColor;
}
.how { text-align: left; padding: 14px 16px; margin-top: 18px; }
.how h3 { margin: 0 0 8px; font-size: 1rem; }
.how ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.how li b { display: block; }
.how li span { color: var(--muted); font-size: .88rem; }
.service .price.kasse { font-size: .78rem; font-weight: 700; color: var(--ok); }
.status { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: 2px; margin-left: 4px; }
.s-pending { background: var(--warn-soft); color: var(--warn); }
.s-confirmed { background: var(--ok-soft); color: var(--ok); }
.s-declined { background: var(--danger-soft); color: var(--danger); }
.bk.is-pending { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.bk .note { font-size: .85rem; color: var(--muted); margin-top: 6px; font-style: italic; }
.bk .note.sent { font-style: normal; border-left: 3px solid var(--primary); padding-left: 8px; }
.bk .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn.ok { background: var(--ok); color: #fff; }
.info-box { background: var(--primary-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.tabs button { position: relative; font-size: .88rem; padding: 9px 4px; }
.tabs .count:not(:empty) { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: .7rem; line-height: 18px; }
.link-tabs a { flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--muted); text-decoration: none; }
.link-tabs a.on { background: var(--primary-soft); color: var(--primary); }
.success .big-check.wait { background: var(--warn-soft); font-size: 2rem; }
.success .big-check.err { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.ok-text { color: var(--ok); }
.admin-slot.booked.pend { background: var(--warn-soft); color: var(--warn); }
a.brand-mini { color: inherit; text-decoration: none; }
.tabs button { flex: 1 1 auto; white-space: nowrap; }
.card a { color: var(--primary); }
