/*
 * Kalender, Raumliste und Raumdetail im Plakat-Stil.
 * Vorlage: design/kalender/project/{Main,A-Mobile,Rooms-*,RoomDetail-*}.dc.html
 * Basis-Komponenten kommen aus raumzeit.css (design/COMPONENTS.md); hier nur
 * Seitenspezifisches mit Präfix cal- (Kalender), rl- (Raumliste), rd- (Raumdetail).
 * button.… wo die Legacy-Regel button:not([class*="btn"]) aus base.html sonst
 * Padding und min-height erzwingt.
 */

/* ------------------------------------------------------------------ */
/* Raumfarben: Klasse per Filter room_color (Raum-ID), Punkte >= 3:1   */
/* ------------------------------------------------------------------ */
.dot.rc-0 { background: var(--rz-room-dorftreff); }
.dot.rc-1 { background: var(--rz-room-aula); }
.dot.rc-2 { background: #1e7a46; }
.dot.rc-3 { background: #9a6a00; }
.dot.rc-4 { background: #6c3483; }
.dot.rc-5 { background: #117a8b; }
.dot.rc-6 { background: #2c3e50; }
.dot.rc-7 { background: #d35400; }

/* Sichtbarkeit: Öffentlich / Intern / Eingeschränkt */
.vis-tag { gap: 6px; font-weight: 600; white-space: nowrap; }
.vis-tag.vis-internal { border-color: var(--rz-line-input); background: var(--rz-surface); }
.vis-tag.vis-restricted { border-color: var(--rz-ink); background: var(--rz-ink); color: #ffffff; }

/* ------------------------------------------------------------------ */
/* Kalender                                                           */
/* ------------------------------------------------------------------ */
.cal-mob { display: none; }
.cal-sep { width: 1px; height: 28px; background: var(--rz-line); margin: 0 8px; }

.cal-filter {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px;
  flex-wrap: wrap; margin: 14px 0 12px;
}
.cal-chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-filter-lbl { font-size: 13px; font-weight: 600; color: var(--rz-muted); margin-right: 2px; }
.cal-holidays { font-size: 13px; color: var(--rz-muted); }
.cal-holidays abbr { text-decoration: none; }

.cal-head {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--rz-ink); color: #ffffff; font-size: 13px; font-weight: 600; text-align: center;
}
.cal-head > div { padding: 9px 0; }

.cal-grid { border-left: 1px solid var(--rz-line); border-top: 1px solid var(--rz-ink); }
.cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(124px, auto); }
.cal-cell {
  min-width: 0; padding: 6px 8px; box-sizing: border-box;
  border-right: 1px solid var(--rz-line); border-bottom: 1px solid var(--rz-line);
  background: #ffffff; display: flex; flex-direction: column; gap: 4px;
}
.cal-cell.we { background: var(--rz-weekend); }
.cal-cell.hol { background: var(--rz-holiday); }
.cal-cell.out { background: var(--rz-surface); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--rz-red-text); }

.cal-dhead { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 24px; }
.cal-num, button.cal-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; min-height: 0; padding: 0 2px; box-sizing: border-box;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font: 700 14px/1 var(--rz-font); color: var(--rz-ink);
}
button.cal-num:hover { background: var(--rz-surface-2); }
.cal-num.we { color: var(--rz-red-text); }
.cal-num.out { color: var(--rz-muted); font-weight: 500; cursor: default; }
.cal-num.today, button.cal-num.today { background: var(--rz-red-text); color: #ffffff; }
.cal-lbl { font-size: 11px; font-weight: 600; color: var(--rz-red-text); text-align: right; line-height: 1.2; }

.cal-ev, button.cal-ev {
  display: flex; gap: 6px; align-items: flex-start; width: 100%; min-height: 0;
  padding: 4px 6px; box-sizing: border-box; text-align: left; cursor: pointer;
  border: 1px solid var(--rz-line-soft); border-radius: 4px; background: #ffffff;
  color: var(--rz-ink); font: 400 12px/1.35 var(--rz-font);
}
button.cal-ev:hover { border-color: var(--rz-line-input); }
.cal-ev .dot { margin-top: 4px; }
.cal-ev-body { min-width: 0; display: flex; flex-direction: column; }
.cal-evt { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.cal-evn { color: var(--rz-ink-2); overflow-wrap: anywhere; }

.cal-more { display: flex; flex-direction: column; gap: 4px; }
.cal-more > summary { list-style: none; }
.cal-more > summary::-webkit-details-marker { display: none; }
.cal-more-btn {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: 24px; padding: 0 6px;
  border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--rz-red-text);
}
.cal-more-btn:hover { background: var(--rz-surface-2); }
.cal-more[open] > .cal-more-btn { color: var(--rz-muted); }
.rz-body .cal-more-btn:focus-visible { outline: 2px solid var(--rz-red-text); outline-offset: 1px; }

.rz-body button:is(.cal-num, .cal-ev):focus-visible,
.rz-body .cal-mc:focus-visible {
  outline: 2px solid var(--rz-red-text); outline-offset: 1px; box-shadow: none;
}
.rz-body button:is(.cal-num, .cal-ev):focus:not(:focus-visible) { box-shadow: none; }

/* Mobil-Raster und Terminliste: nur <= 768px */
.cal-mgrid, .cal-list { display: none; }

.cal-mgrid { border-left: 1px solid var(--rz-line-soft); }
.cal-mgrid .cal-head { font-size: 12px; }
.cal-mgrid .cal-head > div { padding: 6px 0; }
.cal-mdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mc {
  height: 46px; min-width: 0; box-sizing: border-box;
  border-right: 1px solid var(--rz-line-soft); border-bottom: 1px solid var(--rz-line-soft);
  background: #ffffff; color: var(--rz-ink); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.cal-mc.we { background: var(--rz-weekend); }
.cal-mc.hol { background: var(--rz-holiday); }
.cal-mc.out { background: var(--rz-surface); }
.cal-mn {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  width: 28px; height: 28px; border-radius: 50%; font-size: 14px; font-weight: 600; color: var(--rz-ink);
}
.cal-mn.we { color: var(--rz-red-text); }
.cal-mn.out { color: var(--rz-muted); font-weight: 400; }
.cal-mn.today { border: 2px solid var(--rz-red-text); color: var(--rz-red-text); font-weight: 700; }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots .dot { width: 6px; height: 6px; }

.cal-list-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 16px 0 8px; border-bottom: 1px solid var(--rz-line-soft);
}
.cal-list-head .h2 { font-size: 16px; }
.cal-list-count { font-size: 13px; color: var(--rz-muted); }
.cal-row {
  display: flex; gap: 14px; padding: 10px 0; min-height: 44px;
  border-bottom: 1px solid var(--rz-line-soft); scroll-margin-top: 64px;
}
.cal-row.hol { background: var(--rz-weekend); }
.cal-row:target { background: var(--rz-surface); }
.cal-rd { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; padding-top: 1px; }
.cal-rdw { font-size: 11px; font-weight: 600; color: var(--rz-muted); text-transform: uppercase; }
.cal-rdn { font-size: 22px; font-weight: 700; line-height: 1.1; }
.cal-row.today .cal-rdn { color: var(--rz-red-text); }
.cal-row-events { list-style: none; margin: 0; padding: 0; min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.cal-rm { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--rz-ink-2); }
.cal-rtime { font-weight: 700; color: var(--rz-ink); }
.cal-rt { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.cal-empty { margin: 0; padding: 16px 0; font-size: 14px; color: var(--rz-muted); }

.cal-legend {
  margin-top: 14px; padding-top: 10px; border-top: 2px solid var(--rz-title);
  display: flex; align-items: center; justify-content: space-between; gap: 10px 22px; flex-wrap: wrap;
  font-size: 12px; color: var(--rz-ink-2);
}
.cal-legend-items { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cal-swatch { width: 12px; height: 12px; border: 1px solid var(--rz-cal-border); box-sizing: border-box; }
.cal-swatch.we { background: var(--rz-weekend); }
.cal-swatch.hol { background: var(--rz-holiday); }
.cal-stand { color: var(--rz-muted); }

/* Tagesübersicht (<dialog>) */
.cal-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0;
  border: 1px solid var(--rz-line); border-radius: var(--rz-radius);
  color: var(--rz-ink); font-family: var(--rz-font);
}
.cal-dialog::backdrop { background: rgba(44, 62, 80, .45); }
.cal-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 12px 20px; border-bottom: 2px solid var(--rz-title);
}
.cal-dialog-head form { margin: 0; }
.cal-dialog-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.cal-dlg-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.cal-dlg-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rz-line-faint); }
.cal-dlg-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rz-line-faint); font-size: 14px; }
.cal-dlg-by, .cal-dlg-meta { font-size: 13px; color: var(--rz-muted); }
.cal-dlg-room { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rz-line-faint); font-size: 14px; }
.cal-dlg-room-name { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.cal-dlg-room-name .dot { margin-top: 5px; }
.cal-dlg-meta { display: block; overflow-wrap: anywhere; }

@media (max-width: 768px) {
  .cal-desk { display: none; }
  .cal-mob { display: inline-flex; }
  /* Monatsname über, Navigation (zurück, Heute, vor, PDF) unter dem Titel */
  .cal-page .rz-pagehead { flex-wrap: wrap; align-items: flex-end; row-gap: 10px; }
  .cal-page .rz-pagehead-text { flex-direction: column; gap: 4px; }
  .cal-today { min-width: var(--rz-touch); }
  .cal-page .rz-subtitle { font-size: 13px; }
  .cal-actions { flex-wrap: nowrap; }
  .cal-filter { margin: 10px 0; }
  .cal-filter-lbl { display: none; }
  .cal-chips { gap: 8px; }
  .cal-grid { display: none; }
  .cal-mgrid, .cal-list { display: block; }
  .cal-legend { font-size: 13px; }
  .cal-legend-items { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Browser-Druck (Strg+P): nur Monatstitel, Raster und Legende, A4 quer.
   Header, Footer und Meldungen blendet raumzeit.css aus. Die benannte Seite
   gilt nur für den Kalender, raeume.css lädt auch Raumliste und Raumdetail. */
@page cal { size: A4 landscape; margin: 10mm; }

@media print {
  .cal-page { page: cal; }
  /* min-h-screen an <main> erzeugt sonst eine leere Folgeseite */
  body:has(.cal-page), body:has(.cal-page) #main { min-height: 0 !important; background: #ffffff; }
  .cal-page { padding: 0; max-width: none; }
  .cal-page .rz-title, .cal-page .rz-subtitle { color: #000000; }
  .cal-actions, .cal-filter, .cal-dialog, .cal-mgrid, .cal-list { display: none; }
  .cal-page .rz-pagehead { min-height: 0; padding: 0 0 6px; border-bottom: 2px solid #000000; }

  /* Raster auch bei schmalem Fenster; Hintergründe fehlen im Druck oft, daher nur Linien und Text */
  .cal-grid { display: block; border-color: #000000; }
  .cal-head { background: transparent; color: #000000; border-bottom: 1px solid #000000; }
  .cal-head > div { padding: 4px 0; }
  .cal-days { grid-auto-rows: minmax(72px, auto); }
  .cal-cell { padding: 3px 4px; gap: 2px; border-color: #666666; break-inside: avoid; }
  .cal-cell.today { box-shadow: none; }
  .cal-num, button.cal-num, .cal-num.we, .cal-num.today, button.cal-num.today { color: #000000; background: transparent; }
  .cal-num.today, button.cal-num.today { border: 1px solid #000000; }
  .cal-cell.out .cal-num { color: #666666; }
  .cal-lbl, .cal-more-btn { color: #000000; }
  .cal-ev, button.cal-ev { border-color: #666666; color: #000000; font-size: 10px; padding: 2px 4px; break-inside: avoid; }
  .cal-evn { color: #000000; }

  /* Wochenende, Feiertag und Raumfarben bleiben als helle Flächen bzw. Punkte erhalten */
  .cal-cell, .cal-swatch, .dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .cal-legend { margin-top: 8px; border-top-color: #000000; color: #000000; font-size: 12px; break-inside: avoid; }
  .cal-legend-items { flex-direction: row; align-items: center; gap: 6px 22px; }
  .cal-stand { color: #000000; }
}

/* ------------------------------------------------------------------ */
/* Raumliste: Plakat-Tabelle (Desktop), Karten (Mobil), ein Markup     */
/* ------------------------------------------------------------------ */
.rl-page { padding-top: 28px; }
.rl-search {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 16px; align-items: end; padding: 20px 0 24px; border-bottom: 1px solid var(--rz-line);
}
.rl-results-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  margin: 22px 0 10px;
}
.rl-results-meta { font-size: 13px; color: var(--rz-muted); }

.rl-table { border: 1px solid var(--rz-line); border-top: 0; }
.rl-thead, .rl-row {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) 120px 110px 150px 150px;
}
.rl-row { align-items: start; padding: 16px 0; border-top: 1px solid var(--rz-line); }
.rl-thead + .rl-row { border-top: 0; }
.rl-row > *, .rl-main > * { padding: 0 12px; min-width: 0; }
.rl-main > * { padding: 0; }

.rl-img img, .rl-ph { display: block; width: 100%; height: 132px; border-radius: 6px; object-fit: cover; }
.rl-ph {
  background: var(--rz-surface); color: var(--rz-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; font-weight: 600; text-align: center; padding: 0 8px; box-sizing: border-box;
}

.rl-name { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 18px; font-weight: 700; line-height: 1.25; }
.rl-name a { color: var(--rz-ink); text-decoration: none; overflow-wrap: anywhere; }
.rl-name a:hover { color: var(--rz-red-text); text-decoration: underline; text-underline-offset: 2px; }
.rl-name a:focus-visible { outline: 2px solid var(--rz-red-text); outline-offset: 2px; }
.rl-loc { margin: 4px 0 0; font-size: 14px; color: var(--rz-muted); overflow-wrap: anywhere; }
.rl-tags { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rl-tags .tag { max-width: 100%; height: auto; min-height: 26px; padding-top: 3px; padding-bottom: 3px; overflow-wrap: anywhere; }

.rl-week-lbl { font-size: 12px; font-weight: 600; margin: 14px 0 6px; }
.rl-week {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--rz-line); border-right: 0;
}
.rl-av {
  min-width: 0; padding: 8px 2px; border-right: 1px solid var(--rz-line);
  text-align: center; font-size: 12px; background: #ffffff;
  display: flex; flex-direction: column; gap: 2px;
}
.rl-av.we { background: var(--rz-weekend); }
.rl-av.hol { background: var(--rz-holiday); }
.rl-av.busy { background: var(--rz-surface); }
.rl-avd { font-weight: 700; color: var(--rz-ink); }
.rl-avd.we { color: var(--rz-red-text); }
.rl-avs { color: var(--rz-muted); overflow-wrap: anywhere; }
.rl-avs.is-busy { color: var(--rz-ink); font-weight: 600; }
.rl-short { display: none; }
.rl-week-note { margin: 6px 0 0; font-size: 12px; color: var(--rz-muted); }

.rl-cell { font-size: 15px; }
.rl-k { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rl-unit, .rl-sub { color: var(--rz-muted); font-weight: 400; }
.rl-sub { display: block; font-size: 12px; margin-top: 2px; }
.rl-appr { font-size: 14px; }
.rl-actions { display: flex; flex-direction: column; gap: 8px; }

.rl-empty { padding: 24px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border-top: 1px solid var(--rz-line); }
.rl-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding: 12px; border-top: 1px solid var(--rz-line); background: var(--rz-surface);
  font-size: 14px; color: var(--rz-ink-2);
}
.rl-hint-text { display: flex; align-items: center; gap: 8px; }

.rl-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }
.rl-pager-info { font-size: 14px; color: var(--rz-muted); }

.rl-how { margin-top: 36px; padding-top: 14px; border-top: 2px solid var(--rz-title); }
.rl-how .h2 { margin-bottom: 18px; }
.rl-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.rl-step-t { display: block; font-size: 15px; color: var(--rz-ink); }
.rl-step-d { display: block; margin-top: 4px; color: var(--rz-muted); line-height: 1.45; }

@media (max-width: 1024px) {
  .rl-thead, .rl-row { grid-template-columns: 160px minmax(0, 1fr) 100px 100px 130px 140px; }
}

@media (max-width: 860px) {
  .rl-search { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rl-search-q, .rl-search-btn { grid-column: 1 / -1; }

  /* Karten statt Tabelle */
  .rl-table { border: 0; display: flex; flex-direction: column; gap: 12px; }
  .rl-thead { display: none; }
  .rl-row {
    display: flex; flex-direction: column; padding: 0 0 16px;
    border: 1px solid var(--rz-line); border-radius: var(--rz-radius); overflow: hidden;
  }
  .rl-row > * { padding: 0; }
  .rl-main { display: contents; }
  .rl-pad { padding: 0 14px; }
  .rl-img { order: 0; }
  .rl-img img, .rl-ph { height: 150px; border-radius: 0; }
  .rl-name { order: 1; margin-top: 14px; font-size: 19px; }
  .rl-loc { order: 2; line-height: 1.4; }
  .rl-cap { order: 3; margin-top: 10px; }
  .rl-price { order: 4; }
  .rl-appr { order: 5; }
  .rl-tags { order: 6; }
  .rl-week-wrap { order: 7; }
  .rl-actions { order: 8; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 14px; }
  .rl-actions .btn2 { order: -1; }

  .rl-cell {
    display: flex; justify-content: space-between; gap: 12px; font-size: 14px;
  }
  .rl-cell > * { padding: 10px 0; border-bottom: 1px solid var(--rz-line-faint); }
  .rl-cell .rl-k { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; color: var(--rz-muted); flex: none; }
  .rl-cell .rl-v { flex: 1; text-align: right; font-weight: 600; }
  .rl-cell .rl-v b { font-weight: 600; }
  .rl-sub { display: inline; font-size: 14px; color: inherit; font-weight: 600; margin: 0; }
  .rl-sub::before { content: ", "; }

  .rl-av { padding: 6px 0; font-size: 11px; }
  .rl-avw { display: block; }
  .rl-long { display: none; }
  .rl-short { display: inline; }

  .rl-empty { border: 1px solid var(--rz-line); border-radius: var(--rz-radius); }
  .rl-hint { border: 0; border-radius: var(--rz-radius); align-items: flex-start; }
  .rl-hint-text { align-items: flex-start; }
  .rl-hint-text svg { flex: none; margin-top: 2px; }

  .rl-how { margin-top: 24px; padding-top: 12px; }
  .rl-how .h2 { margin-bottom: 12px; }
  .rl-steps { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* ------------------------------------------------------------------ */
/* Raumdetail                                                         */
/* ------------------------------------------------------------------ */
.rd-page { padding-top: 18px; }
.rd-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--rz-touch); margin-bottom: 4px;
  font-size: 14px; color: var(--rz-ink-2); text-decoration: none;
}
.rd-back:hover { color: var(--rz-red-text); }
.rd-back:focus-visible { outline: 2px solid var(--rz-red-text); outline-offset: 2px; }
.rd-head-text { min-width: 0; }
.rd-loc { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 15px; color: var(--rz-muted); }
.rd-loc svg { flex: none; }
.rd-price { font-size: 15px; color: var(--rz-muted); margin-right: 6px; }
.rd-price b { font-size: 20px; color: var(--rz-ink); }

.rd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 40px; margin-top: 24px; }
.rd-main, .rd-aside { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.rd-aside { gap: 24px; }
.rd-section .h2 { font-size: 17px; margin-bottom: 10px; }

.rd-gallery { display: grid; gap: 8px; }
.rd-gallery img { display: block; width: 100%; height: 280px; object-fit: cover; border-radius: var(--rz-radius); }
.rd-gallery.has-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rd-gallery.has-thumbs img:first-child { grid-column: 1 / -1; }
.rd-gallery.has-thumbs img:not(:first-child) { height: 96px; }
.rd-ph {
  height: 280px; border-radius: var(--rz-radius); background: var(--rz-surface); color: var(--rz-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: 12px; text-align: center; padding: 0 16px;
}
.rd-ph-name { font-size: 14px; font-weight: 600; }

.rd-am {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px;
}
.rd-am li {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--rz-line-faint); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere;
}
.rd-am svg { flex: none; margin-top: 2px; color: var(--rz-red-text); }

.rd-box { border: 1px solid var(--rz-line); }
.rd-box.kv.rows dt:nth-last-child(2), .rd-box.kv.rows dd:last-child,
.rd-facts .kv.rows dt:nth-last-child(2), .rd-facts .kv.rows dd:last-child { border-bottom: 0; }
.rd-facts-title { margin: 0; font-size: 13px; }
.rd-facts .kv dd { font-weight: 600; }

.rd-avail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rd-avail-head .h2 { font-size: 17px; }
.rd-avail-range { font-size: 13px; color: var(--rz-muted); }
.rd-grid { border-left: 1px solid var(--rz-line); }
.rd-grid-head { font-size: 11px; }
.rd-grid-head > div { padding: 6px 0; }
.rd-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rd-mc {
  min-width: 0; min-height: 58px; padding: 5px 6px; box-sizing: border-box;
  border-right: 1px solid var(--rz-line); border-bottom: 1px solid var(--rz-line);
  background: #ffffff; font-size: 11px; display: flex; flex-direction: column; gap: 3px;
}
.rd-mc.we { background: var(--rz-weekend); }
.rd-mc.hol { background: var(--rz-holiday); }
.rd-mc.out { background: var(--rz-surface); }
.rd-mc.today { box-shadow: inset 0 0 0 2px var(--rz-red-text); }
.rd-mn { font-size: 13px; font-weight: 700; color: var(--rz-ink); }
.rd-mn.we { color: var(--rz-red-text); }
.rd-mn.out { color: var(--rz-muted); font-weight: 500; }
.rd-ms { color: var(--rz-muted); line-height: 1.25; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.rd-ms.busy { color: var(--rz-ink); font-weight: 600; }
.rd-avail-note { margin: 8px 0 0; font-size: 12px; color: var(--rz-muted); }

.rd-aside-cta { font-size: 15px; }
.rd-login { display: flex; flex-direction: column; gap: 12px; }
.rd-login-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.rd-bar { display: none; }

@media (max-width: 1024px) {
  .rd-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; }
}

@media (max-width: 768px) {
  .rd-page { padding-top: 4px; }
  .rd-head { display: block; min-height: 0; padding: 2px 0 12px; }
  .rd-head .rz-title { line-height: 1.05; }
  .rd-loc { font-size: 14px; line-height: 1.4; align-items: flex-start; }
  .rd-loc svg { display: none; }
  .rd-head-actions { display: none; }

  /* Reihenfolge wie im Mockup: Foto, Eckdaten, 14 Tage, Ausstattung, Regeln */
  .rd-layout { display: flex; flex-direction: column; gap: 24px; margin-top: 16px; }
  .rd-main, .rd-aside { display: contents; }
  .rd-gallery, .rd-ph { order: 0; }
  .rd-desc { order: 1; }
  .rd-facts { order: 2; }
  .rd-avail { order: 3; }
  .rd-features { order: 4; }
  .rd-rules { order: 5; }
  .rd-aside-cta, .rd-login { display: none; }

  .rd-gallery img, .rd-ph { height: 170px; }
  .rd-gallery.has-thumbs img:not(:first-child) { height: 64px; }
  .rd-am { grid-template-columns: minmax(0, 1fr); }
  .rd-am li { font-size: 15px; padding: 9px 0; }
  .rd-facts .kv.rows { --kv-w: 128px; }
  .rd-rules .kv.rows { --kv-w: 104px; }
  .rd-mc { min-height: 52px; padding: 4px 3px; font-size: 10px; text-align: center; }
  .rd-ms { align-items: center; }

  /* Aktionsleiste bleibt am unteren Rand, bis der Inhalt endet */
  .rd-bar {
    position: sticky; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px;
    margin: 24px calc(-1 * var(--rz-gutter)) 0; padding: 12px var(--rz-gutter) calc(12px + env(safe-area-inset-bottom));
    background: #ffffff; border-top: 1px solid var(--rz-line);
  }
  .rd-bar .btn2, .rd-bar .btnp { height: 48px; }
}

@media print {
  .rd-bar, .rd-head-actions, .rd-aside-cta, .rd-login { display: none; }
}

/* Tagesbuttons bleiben ohne <dialog>-Unterstützung deaktiviert, aber lesbar */
button.cal-ev:disabled, button.cal-num:disabled { cursor: default; }
button.cal-num:disabled:hover { background: transparent; }
button.cal-num.today:disabled:hover { background: var(--rz-red-text); }
button.cal-ev:disabled:hover { border-color: var(--rz-line-soft); }
.cal-rtoday { margin-top: 2px; font-size: 11px; font-weight: 700; color: var(--rz-red-text); }
.rd-today { font-size: 10px; font-weight: 700; color: var(--rz-red-text); }
