:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --border: #dbe4f0;
  --text: #102033;
  --muted: #5c7086;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --success: #0f9d58;
  --danger: #dc2626;
  --shadow: 0 20px 45px rgba(16, 32, 51, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(14, 165, 233, 0.08), transparent 26%),
    var(--bg);
}

.bg-glow { position: fixed; inset: auto; border-radius: 999px; filter: blur(80px); opacity: 0.55; pointer-events: none; }
.bg-glow-a { width: 260px; height: 260px; top: -60px; left: -60px; background: rgba(37, 99, 235, 0.12); }
.bg-glow-b { width: 220px; height: 220px; right: 8%; top: 26%; background: rgba(14, 165, 233, 0.12); }

.site-header {
  width: min(1400px, calc(100% - 32px));
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header-links, .site-footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.site-brand-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.site-brand-text-large {
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: 0.01em;
}

.app-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.panel, .hero-card, .toolbar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

p, li, th, td, strong, span, a, button, label {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(1.7rem, 3.2vw, 3rem); line-height: 1.04; max-width: 14ch; }
h1, h2, h3 { overflow-wrap: anywhere; }
.hero-title { margin: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.08; max-width: 16ch; }
.lede, .panel-head p, .hint, .search-group label, .admin-lock small, .card-notes, .login-hint { color: var(--muted); }
.login-hint { margin-top: 14px; line-height: 1.6; }

.mode-switch { display: inline-flex; gap: 10px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.tab-btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.tab-btn.active { background: var(--accent); color: white; }

.view-stack.hidden { display: none; }

.public-hero {
  text-align: center;
  padding: 8px 0 10px;
  margin-bottom: 12px;
}
.public-hero h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 22px;
  max-width: none;
  color: #111;
}
.hero-divider {
  width: 100%;
  height: 1px;
  background: #111;
  opacity: 0.75;
  margin: 0 0 34px;
}
.public-hero p {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.75rem);
  color: #222;
}
.public-search {
  grid-template-columns: 1fr;
  margin-bottom: 32px;
}
.public-search input {
  height: 96px;
  padding: 0 28px;
  border-width: 3px;
  border-color: #3d74b7;
  border-radius: 22px;
  font-size: 1.15rem;
}
.public-results {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.hero-card {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}
.hero-card > * { min-width: 0; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 12px; min-width: 320px; }
.hero-stats article, .admin-lock, .location-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.hero-stats article {
  padding: 16px;
  border-radius: 18px;
}
.hero-stats span { display: block; font-size: 1.8rem; font-weight: 800; }

.toolbar-card {
  padding: 18px;
  display: grid;
  grid-template-columns: 1.3fr .8fr .8fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}
.search-group { display: flex; flex-direction: column; gap: 8px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10); }

button, .file-btn, .secondary-btn, .primary-btn, .ghost-btn {
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
}
.primary-btn { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.secondary-btn { background: #fff; color: var(--text); border: 1px solid var(--border); }
.ghost-btn, .file-btn { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.file-btn { display: inline-flex; align-items: center; gap: 10px; }
.file-btn input { display: none; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.location-card {
  border-radius: 20px;
  padding: 18px;
  cursor: pointer;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.location-card h3 {
  margin: 0;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  font-weight: 400;
  color: #2b313b;
}
.detail-header { display: flex; justify-content: space-between; gap: 18px; align-items: end; padding: 28px; }
.detail-hero { padding: 28px; display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.detail-hero > * { min-width: 0; }
.detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}
.detail-top > * { min-width: 0; }
.detail-hero-copy { flex: 1; }
.detail-hero-box {
  min-width: min(100%, 360px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.detail-hero-box div { min-width: 0; }
.detail-hero-box, .detail-hero-copy, .info-card, .highlight-card { max-width: 100%; }
.detail-hero-copy { display: flex; flex-direction: column; gap: 10px; }
.detail-hero-copy .lede { max-width: 100%; }
.status-note {
  margin: 0;
  font-weight: 700;
  color: #000;
}
.status-note.open,
.status-note.closed {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.status-note.open {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.status-note.closed {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.detail-meta { padding: 28px; }
.detail-meta .detail-hero-box { width: 100%; min-height: 100%; }
.detail-hero-box span, .section-label {
  color: #000;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.detail-hero-box strong { display: block; margin-top: 4px; font-size: 1rem; }
.detail-content { display: grid; gap: 18px; }
.detail-content > * { min-width: 0; }
.info-card, .highlight-card { padding: 26px; }
.highlight-card { background: linear-gradient(180deg, #fff, #f8fbff); border: 1px solid #cfe0ff; }
.legal-panel h1 {
  max-width: none;
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  line-height: 1.02;
  word-break: keep-all;
}
.check-list, .step-list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.7;
}
.check-list li, .step-list li {
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  word-break: normal;
}
.compact li { margin-bottom: 8px; }
.note-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid #bfdbfe;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.accent-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  max-width: 100%;
}
.inline-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.inline-link:hover, .accent-link:hover { text-decoration: underline; }
.action-row { margin-top: 16px; }
.action-row { display: flex; justify-content: center; }
.reserve-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 260px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #d9f7c6;
  color: #000;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid #b8e8a1;
}
.reserve-btn:hover { background: #cdecaf; color: #000; }
.abmeldung-btn {
  background: #fbe1e1;
  border-color: #f1b3b3;
}
.abmeldung-btn:hover { background: #f7cdcd; color: #000; }
.wish-btn {
  background: #dbeafe;
  border-color: #bfdbfe;
}
.wish-btn:hover { background: #bfdbfe; color: #000; }
.hours-table-wrap { overflow-x: visible; margin-top: 16px; }
.hours-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.hours-table th, .hours-table td {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.hours-table th { width: 32%; color: var(--text); font-weight: 700; }
.hours-table td { color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-list span { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.detail-notes { margin: 0; line-height: 1.7; }
.link-btn { text-decoration: none; display: inline-flex; align-items: center; }
.site-legal-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.site-legal-link:hover { color: var(--text); text-decoration: underline; }
.site-footer {
  margin: 36px 0 0;
  padding: 18px 0 8px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.site-footer-note {
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}
.site-footer-note a {
  color: inherit;
  text-decoration: none;
}
.site-footer-note a:hover {
  text-decoration: underline;
}
.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(16, 32, 51, 0.18);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(16, 32, 51, 0.08);
  border-radius: 14px;
  font-size: 0.95rem;
}
.cookie-banner-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #111827;
  color: #fff;
  font-weight: 700;
}
.cookie-banner-btn:hover { background: #0f172a; }

.admin-lock {
  min-width: min(100%, 420px);
  padding: 16px;
  border-radius: 20px;
}
.admin-lock > * { min-width: 0; }
.lock-row { display: flex; gap: 10px; margin-top: 8px; }
.lock-row input { flex: 1; }

.content-grid { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.panel { padding: 22px; }
.panel-head { margin-bottom: 18px; }
.panel-head h2 { margin: 0 0 6px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.admin-controls {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
  align-items: start;
}
.admin-control-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: var(--surface-soft);
}
.admin-control-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.table-wrap { overflow: auto; border-radius: 18px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .85rem; font-weight: 700; }
td strong, td span { display: block; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.links-cell { min-width: 260px; }
.links-list { display: flex; flex-direction: column; gap: 6px; }
.links-list a { color: var(--accent); text-decoration: none; font-size: .9rem; }
.links-list a:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-btn { padding: 9px 11px; border-radius: 12px; background: #fff; color: var(--text); border: 1px solid var(--border); }
.danger-btn { background: #fef2f2; color: var(--danger); }
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.entry-list-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(16, 32, 51, 0.04);
}
.entry-list-item:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
}
.entry-list-item.active {
  border-color: var(--accent);
  background: #eff6ff;
  color: #0f172a;
}

.detail-actions { display: flex; gap: 10px; }
.cards-panel, .form-panel, .list-panel, .detail-header, .admin-hero, .admin-toolbar { overflow: hidden; }

@media (max-width: 980px) {
  .detail-top { grid-template-columns: 1fr; }
  .detail-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .detail-hero-box {
    width: 100%;
    min-width: 0;
  }
  .hero-stats { grid-template-columns: 1fr; }
  .toolbar-card { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .content-grid, .toolbar-card, .hero-card { grid-template-columns: 1fr; display: grid; }
  .topbar { display: grid; }
  .topbar-actions { justify-content: flex-start; }
  .admin-controls { grid-template-columns: 1fr; }
  .hero-stats { min-width: 0; }
  .lock-row { flex-direction: column; }
  .detail-header, .detail-hero { display: grid; }
}
@media (max-width: 720px) {
  .site-header { width: calc(100% - 24px); margin-top: 14px; }
  .site-brand-text-large { font-size: 1.2rem; }
  .app-shell { width: 100%; padding: 12px 12px 28px; }
  .public-hero { padding-top: 4px; }
  .public-hero h1 { margin-bottom: 18px; font-size: 2.1rem; }
  .hero-divider { margin-bottom: 22px; }
  .public-hero p { font-size: 1rem; line-height: 1.4; }
  .public-search input { height: 68px; padding: 0 18px; font-size: 1rem; border-radius: 16px; }
  .hero-card, .panel, .toolbar-card, .detail-header, .detail-hero, .detail-meta { padding: 14px; border-radius: 18px; }
  body { font-size: 16px; line-height: 1.55; }
  .detail-top {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .detail-hero {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .detail-content, .detail-content > * { min-width: 0; width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .card-body { grid-template-columns: 1fr; }
  .detail-grid, .detail-list { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .admin-controls { grid-template-columns: 1fr; }
  .hours-table th { width: auto; }
  .hours-table th, .hours-table td { padding: 12px 0; }
  .detail-hero-box { padding: 14px; }
  .info-card, .highlight-card { padding: 18px; }
  h1 { max-width: 100%; }
  .hero-title { max-width: 100%; }
  .mode-switch { width: 100%; justify-content: stretch; }
  .tab-btn { flex: 1; }
  .detail-hero { gap: 14px; }
  .detail-content { gap: 14px; }
  .check-list, .step-list { padding-left: 18px; }
  .check-list, .step-list { padding-right: 4px; }
  .detail-hero-box { gap: 12px; }
  .detail-hero-copy h1, .detail-hero-copy .lede { max-width: 100%; }
  .info-card h2, .highlight-card h2, .detail-hero-copy h1 {
    overflow-wrap: anywhere;
    hyphens: auto;
  }
  .detail-hero-copy .lede { font-size: 1.02rem; line-height: 1.7; }
  .detail-hero-box, .info-card, .highlight-card { width: 100%; }
  .detail-hero-box { grid-template-columns: 1fr; }
  .detail-hero-box a { justify-content: center; width: 100%; }
  .detail-hero-box div { min-width: 0; }
  .info-card h2, .highlight-card h2 { font-size: 1.15rem; line-height: 1.35; }
  .note-box, .check-list, .step-list, .hours-table th, .hours-table td { font-size: 1rem; }
  .hours-table th { width: 34%; }
  .hours-table td { word-break: break-word; }
  .location-card { min-height: 120px; }
  .location-card h3 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .eyebrow { font-size: 0.7rem; }
  h1 { font-size: 1.9rem; }
  .hero-title { font-size: 1.5rem; }
  .detail-hero-copy .lede { font-size: 1.05rem; }
  .detail-hero-copy { gap: 8px; }
  .hours-table th, .hours-table td { font-size: 0.95rem; }
  .note-box { padding: 14px; }
  .detail-hero-box { padding: 12px; }
}
