:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand: #009688;
  --brand-accent: #fbc02d;
  --brand-dark: #00675B;
  --nav-bg: #eaf6f3;
  --nav-border: rgba(0, 150, 136, 0.22);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
}

.navtoggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.topbar {
  display: none;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 900;
}

.topbar__logo { display: block; }

.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.burger:hover {
  border-color: rgba(0, 150, 136, 0.25);
  background: rgba(0, 150, 136, 0.06);
}

.burger__bars {
  width: 18px;
  height: 2px;
  background: var(--fg);
  position: relative;
  border-radius: 999px;
}

.burger__bars::before,
.burger__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--fg);
  border-radius: 999px;
}

.burger__bars::before { top: -6px; }
.burger__bars::after { top: 6px; }

.navscrim {
  display: none;
}

.nav {
  border-right: 1px solid var(--nav-border);
  padding: 16px;
  background: var(--nav-bg);
  display: flex;
  flex-direction: column;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 900;
  margin-bottom: 14px;
}

.nav__close {
  display: none;
}

.nav__logobox {
  background: var(--brand-dark);
  padding: 10px;
  width: 100%;
}

.nav__logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

@media (min-width: 901px) {
  .nav__brand {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
}

.topbar__logo {
  border-radius: 8px;
  background: var(--brand-dark);
  padding: 3px;
  object-fit: contain;
}

.nav__spacer {
  flex: 1;
}

.nav__admin {
  margin-top: 16px;
  display: flex;
}

.adminbtn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0, 150, 136, 0.22);
  background: rgba(255, 255, 255, 0.7);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.adminbtn:hover {
  border-color: rgba(0, 150, 136, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

.adminbtn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.nav__brandtext {
  letter-spacing: 0.2px;
}

.nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__item + .nav__item { margin-top: 6px; }

.nav__link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
}

.nav__link:hover {
  background: rgba(0, 150, 136, 0.08);
}

.nav__link.is-active {
  background: rgba(0, 150, 136, 0.14);
  border: 1px solid rgba(0, 150, 136, 0.25);
}

.nav__details {
  border-radius: 8px;
}

.nav__summary {
  list-style: none;
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
}

.nav__summary::-webkit-details-marker {
  display: none;
}

.nav__summary:hover {
  background: rgba(0, 150, 136, 0.08);
}

.nav__summary.is-active {
  background: rgba(0, 150, 136, 0.14);
  border: 1px solid rgba(0, 150, 136, 0.25);
}

.nav__sublist {
  padding: 6px 0 0;
}

.nav__sublink {
  display: block;
  margin-left: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav__sublink:hover {
  background: rgba(0, 150, 136, 0.08);
}

.nav__sublink.is-active {
  background: rgba(0, 150, 136, 0.14);
  border-color: rgba(0, 150, 136, 0.25);
}

.adminpage {
  max-width: 980px;
}

.adminbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.adminbar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.adminbar__title {
  margin: 0;
}

.form {
  display: grid;
  gap: 12px;
  max-width: 980px;
}

.field label {
  display: block;
  font-weight: 750;
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field input[type="datetime-local"],
.field input[type="file"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
}

/* Inputs should be as wide as textareas in admin forms. */

.field textarea {
  min-height: 200px;
  resize: vertical;
}

.field__checkbox {
  display: block;
  margin-top: 10px;
}

.field__row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.field__row > input[type="datetime-local"] {
  flex: 1;
  min-width: 260px;
}

.form__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.helptext {
  color: var(--muted);
  margin-top: 6px;
}

.helptext--block {
  margin: 6px 0 12px;
}

.adminblock {
  margin-bottom: 12px;
}

.error {
  border: 1px solid rgba(176, 0, 32, 0.35);
  background: rgba(176, 0, 32, 0.08);
  color: #7a0016;
  padding: 10px 12px;
  border-radius: 12px;
}

.adminlist {
  display: grid;
  gap: 10px;
}

.adminitem {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.adminitem__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.adminitem__title {
  font-weight: 850;
}

.adminitem__meta {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.adminitem__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.flashstack {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.flash {
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 650;
}

.flash--success {
  border-color: rgba(0, 150, 136, 0.25);
  background: rgba(0, 150, 136, 0.08);
  color: #045a52;
}

.flash--info {
  border-color: rgba(2, 6, 23, 0.14);
  background: rgba(2, 6, 23, 0.04);
  color: var(--fg);
}

.flash--error {
  border-color: rgba(176, 0, 32, 0.35);
  background: rgba(176, 0, 32, 0.08);
  color: #7a0016;
}

.content {
  padding: 24px;
}

.map iframe {
  width: 100%;
  height: 420px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.page {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
}

.page > :first-child { margin-top: 0; }
.page > :last-child { margin-bottom: 0; }

.page h1, .page h2, .page h3 {
  line-height: 1.2;
}

.page h1 { margin: 0 0 12px; }
.page h2 { margin: 18px 0 10px; }
.page h3 { margin: 14px 0 8px; }

.page p {
  margin: 0 0 12px;
}

.page a {
  color: var(--brand);
  text-underline-offset: 2px;
}

/* Make the external appointment booking link feel like a primary CTA. */
.page a[href^="https://webtermin.medatixx.de/"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand);
  border: 1px solid rgba(0, 150, 136, 0.35);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  margin: 4px 0 14px;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
}

.page a[href^="https://webtermin.medatixx.de/"]:visited { color: #fff; }

.page a[href^="https://webtermin.medatixx.de/"]:hover {
  filter: brightness(0.96);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.12);
}

.page a[href^="https://webtermin.medatixx.de/"]:focus-visible {
  outline: 3px solid rgba(251, 192, 45, 0.7);
  outline-offset: 3px;
}

.page ul, .page ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.page li + li { margin-top: 4px; }

.page hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.page blockquote {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--brand-accent);
  background: #f8fafc;
  border-radius: 12px;
}

.page blockquote p { margin: 0; }

.page img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.page table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
  display: block;
  overflow-x: auto;
}

.page th,
.page td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.page thead th {
  background: #f8fafc;
  font-weight: 800;
}

.page pre {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b1220;
  color: #e2e8f0;
  overflow: auto;
}

.page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

.page :not(pre) > code {
  background: rgba(2, 6, 23, 0.06);
  border: 1px solid rgba(2, 6, 23, 0.10);
  border-radius: 8px;
  padding: 1px 6px;
}

.muted { color: var(--muted); }

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  text-decoration: none;
  font-weight: 650;
}

.btn--ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid rgba(0, 150, 136, 0.35);
}

.btn--mini {
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 18px;
}

.hero__media img {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.hero__cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.card__top {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
}

.card__title {
  font-weight: 800;
  margin-bottom: 6px;
}

.card__lines {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.smalllink {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.panel--quiet {
  background: #f8fafc;
}

.kv {
  margin: 0;
}

.kv div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.kv div:last-child { border-bottom: none; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.qr {
  width: 220px;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.callout {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0 16px;
}

.callout--accent {
  border-left: 6px solid var(--brand-accent);
}

.callout__title {
  font-weight: 800;
  margin-bottom: 6px;
}

.callout__list {
  margin: 0;
  padding-left: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid var(--border);
  background: #fff;
}

.badge--closed {
  background: rgba(176, 0, 32, 0.08);
  border-color: rgba(176, 0, 32, 0.25);
  color: #7a0017;
}

.badge--vacation {
  background: rgba(251, 192, 45, 0.22);
  border-color: rgba(251, 192, 45, 0.65);
  color: #5a3b00;
}

.badge--info {
  background: rgba(0, 150, 136, 0.10);
  border-color: rgba(0, 150, 136, 0.22);
  color: #045a52;
}

.chip {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #fff;
  align-items: center;
  line-height: 1;
}

.chip--dots {
  font-weight: 900;
  letter-spacing: 2px;
  padding: 0 10px;
  height: 22px;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.news__dots {
  display: flex;
  justify-content: flex-start;
  margin: 6px 0 10px;
}

.chip.is-active {
  background: rgba(0, 150, 136, 0.12);
  border-color: rgba(0, 150, 136, 0.30);
  color: #045a52;
  font-weight: 750;
}

.ticker {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
  background: #fff;
}

.ticker__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.ticker__title {
  font-weight: 900;
}

.ticker__all {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.ticker__list {
  display: grid;
  gap: 8px;
}

.ticker__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #f8fafc;
}

.ticker__row--closed {
  border-left: 6px solid rgba(176, 0, 32, 0.55);
}

.ticker__row--vacation {
  border-left: 6px solid rgba(251, 192, 45, 0.9);
}

.ticker__row--info {
  border-left: 6px solid rgba(0, 150, 136, 0.35);
}

.ticker__row:hover {
  background: rgba(0, 150, 136, 0.06);
  border-color: rgba(0, 150, 136, 0.18);
}

.ticker__date {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 750;
}

.ticker__text {
  font-weight: 750;
  overflow: hidden;
}

.ticker__titleline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ticker__titletext {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker__meta {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ticker__more {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 150, 136, 0.25);
  background: rgba(0, 150, 136, 0.08);
  color: var(--brand);
  font-weight: 850;
  font-size: 12px;
}

.newslist {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.sectiontitle {
  margin: 8px 0 0;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.news {
  display: block;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  text-decoration: none;
  color: var(--fg);
}

.news:hover {
  border-color: rgba(0, 150, 136, 0.25);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
}

.news__top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.news__date {
  color: var(--muted);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.news__title {
  font-weight: 900;
  margin-bottom: 6px;
}

.news__excerpt {
  color: var(--muted);
  margin-bottom: 10px;
}

.news__teaser {
  margin-bottom: 10px;
}

.news__teaser p { margin: 0; }

.news__preview {
  margin-bottom: 10px;
  color: var(--muted);
}

.news__preview p { margin: 0 0 6px; }

.clamp3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp3 { -webkit-line-clamp: 3; }

.ticker__teaser {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 550;
}

.ticker__teaser p { margin: 0; }

.news__meta {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.news__more {
  margin-left: auto;
  color: var(--brand);
  font-weight: 800;
}

.newsmeta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.newsmeta__date {
  color: var(--muted);
  font-weight: 750;
}

.newsdetail__head {
  margin-bottom: 14px;
}

.newsdetail__back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
}

.newsdetail__title {
  margin: 0 0 10px;
  line-height: 1.15;
}

.schedule {
  display: grid;
  gap: 8px;
  margin: 8px 0 16px;
}

.schedule__row {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 10px;
  background: #fff;
}

.schedule__day {
  font-weight: 850;
}

.schedule__label {
  color: var(--muted);
  font-size: 0.9em;
}

.schedule__value {
  margin-top: 2px;
}

.slotlist {
  display: grid;
  gap: 6px;
}

.slotline {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: start;
}

.slotline__time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.slotline__docs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Doctor name chips (Sprechzeiten) */
.chip--doc {
  background: rgba(2, 6, 23, 0.03);
  border-color: rgba(2, 6, 23, 0.12);
  color: #334155;
}

.chip--doc-rolf {
  background: rgba(0, 150, 136, 0.06);
  border-color: rgba(0, 150, 136, 0.16);
  color: #045a52;
}

.chip--doc-eva {
  background: rgba(251, 192, 45, 0.18);
  border-color: rgba(251, 192, 45, 0.45);
  color: #5a3b00;
}

@media (max-width: 900px) {
  /* Avoid mobile grid sizing issues with fixed overlays (nav, scrim). */
  .layout {
    display: block;
    min-height: 100vh;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 64px;
    padding: 0 16px;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
  }

  /* Keep mobile header height consistent (no wrapping). */
  .topbar__brand {
    flex: 1;
    min-width: 0;
  }

  .topbar__brandtext {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .navscrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease-out;
    z-index: 59;
  }

  .nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 88vw;
    border-right: 1px solid var(--nav-border);
    border-bottom: none;
    transform: translateX(-105%);
    transition: transform 180ms ease-out;
    z-index: 60;
    overflow: auto;
    background: var(--nav-bg);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.25);
  }

  .nav__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 8px 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-weight: 750;
  }

  .navtoggle:checked ~ .layout .nav {
    display: block;
    transform: translateX(0);
  }

  .navtoggle:checked ~ .layout .navscrim {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .map iframe { height: 340px; }

  .hero { grid-template-columns: 1fr; }
  .hero__media img { max-height: 220px; }
  .grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .schedule__row { grid-template-columns: 1fr; }
  .kv div { grid-template-columns: 1fr; }
  .slotline { grid-template-columns: 1fr; }

  .ticker__row {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .ticker__meta { justify-content: flex-start; }
}
