:root {
  --accent: #6495ED;
  --accent-100: color-mix(in srgb, var(--accent) 10%, white);
  --accent-200: color-mix(in srgb, var(--accent) 20%, white);
  --accent-700: color-mix(in srgb, var(--accent) 70%, black);
  --text: #1c1c1e;
  --muted: rgba(28, 28, 30, 0.55);
  --divider: rgba(0, 0, 0, 0.12);
  --surface: rgba(255, 255, 255, 0.72);
  --bg: #f2f2f5;
  --radius-l: 14px;
  --radius-m: 10px;
  --radius-s: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.topbar h1 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-on { background: #2f9e44; }
.dot-off { background: #d4a017; }

/* Hinweis am Fensterende, solange eine hier gemachte Planung-Änderung noch
   nicht mit PPEdit synchronisiert wurde — siehe index.php/app.js. */
.sync-footer {
  flex-shrink: 0;
  padding: 8px 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #7a4a00;
  background: #fdf1d8;
  border-top: 1px solid #f0dba8;
}

/* --- Split-Screen: oberes Drittel Aufnahme (record.js), untere zwei
   Drittel Projekte/Folgen/ShowNotes (app.js) — siehe index.php. --- */

.split-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.record-panel {
  flex: 0 0 33%;
  min-height: 220px;
  overflow-y: auto;
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Umschalter oben links im Topbar (siehe index.php #toggleRecordPanelBtn) —
   blendet #recordPanel komplett aus, .panes.split-bottom bekommt dann den
   kompletten verfügbaren Platz. */
.split-screen.record-collapsed .record-panel {
  display: none;
}

.record-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-panel-header .pane-heading {
  margin: 0;
}

.record-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Wanduhr im Aufnahme-Panel (siehe index.php #recordClock, record.js,
   Abschnitt "Wanduhr") — bewusst dieselbe kleine/gedämpfte Optik wie
   .record-status statt einer eigenen, neuen visuellen Sprache. */
.record-clock {
  font-size: 12px;
  color: var(--muted);
}

/* Countdown-Timer (siehe index.php #recordCountdown, record.js, Abschnitt
   "Countdown-Timer") — grüne Pille analog zu .record-session-status.status-open,
   wechselt per .record-countdown.red auf Rot, sobald die Restzeit die
   konfigurierte Schwelle unterschreitet. */
.record-countdown {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
}
.record-countdown[hidden] {
  display: none;
}
.record-countdown-time {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 3px 10px;
  border-radius: 999px;
  color: #2f9e44;
  background: color-mix(in srgb, #2f9e44 15%, white);
}
.record-countdown.red .record-countdown-time {
  color: #c0392b;
  background: color-mix(in srgb, #c0392b 15%, white);
}

.record-countdown-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.record-countdown-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}
.record-countdown-field input {
  width: 72px;
  padding: 6px 8px;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  font: inherit;
  color: var(--text);
}

.panes.split-bottom {
  flex: 1 1 66%;
  display: flex;
  min-height: 0;
}

.pane-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 10px;
}

.project-pane {
  width: 260px;
  min-width: 200px;
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--divider);
  flex-shrink: 0;
}

.episode-pane {
  width: 280px;
  min-width: 220px;
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--divider);
  flex-shrink: 0;
}

.shownotes-pane {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-width: 320px;
}

.project-list, .episode-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-m);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}
.list-row:hover { background: var(--accent-100); }
.list-row.selected {
  background: var(--accent-200);
  border-color: var(--divider);
  font-weight: 600;
}

.list-row .row-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row .row-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.empty-hint {
  font-size: 13px;
  color: var(--muted);
}

.shownotes-header {
  margin-bottom: 16px;
}
.shownotes-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}
.shownotes-header .episode-meta {
  font-size: 12px;
  color: var(--muted);
}

.contributor-section {
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  padding: 12px;
}
.contributor-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

.contributor-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.contributor-section-heading h3 { margin: 0; }

.readonly-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--divider);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Spiegelt ShownoteItem.isNew (siehe PPEdit-App) — rein optischer Hinweis,
   dass dieser Eintrag seit dem letzten Ansehen der Folge (in der App) neu
   hinzugekommen ist. Wird von dort aus wieder gelöscht (kein eigener
   "gesehen"-Mechanismus hier in PPEdit_web). */
.new-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #b5650a;
  background: color-mix(in srgb, #ff9500 18%, white);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.shownote-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 4px;
}

.shownote-item input[type="checkbox"] {
  margin-top: 3px;
}

.shownote-item .item-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.shownote-item.done .item-text {
  text-decoration: line-through;
  color: var(--muted);
}

.item-text-link {
  color: var(--accent);
  text-decoration: underline;
}

.shownote-title-link-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  margin-left: 24px;
  font-size: 12px;
  color: var(--muted);
}

.shownote-title-link-row .item-text-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.shownote-title-loading {
  font-style: italic;
}

.shownote-item .item-edit-fields {
  display: flex;
  flex: 1;
  min-width: 0;
}

.shownote-item .item-text-input {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.shownote-item .item-text-input:focus {
  border-bottom: 1px solid var(--accent);
}

.shownote-item.done .item-text-input {
  text-decoration: line-through;
  color: var(--muted);
}

.add-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.add-row input[type="text"] {
  flex: 1;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--text);
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 3px 7px;
  border-radius: 6px;
  line-height: 1;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--text); }
.icon-btn.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.mic-icon { vertical-align: -2px; margin-right: 4px; }

/* --- Per-item "Zusatzinfos" (note + image thumbnails), app.js --- */
/* Holds the note field/text and any images PPEdit attached to the item
   (view-only here, see shownote-image.php). */

.zusatzinfos {
  margin: 0 0 8px 26px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zusatzinfos .item-note-input {
  width: 100%;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  padding: 6px 8px;
  border: none;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  resize: vertical;
}

.zusatzinfos .item-note-input:focus {
  border-bottom-color: var(--accent);
}

.zusatzinfos-note-readonly {
  color: var(--muted);
  font-style: italic;
}

.zusatzinfos-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zusatzinfos-thumb {
  position: relative;
}

.zusatzinfos-thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--divider);
  display: block;
}

.zusatzinfos-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.zusatzinfos-thumb-remove:hover {
  color: var(--text);
  border-color: var(--accent);
}

.zusatzinfos-add-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  border: 1px dashed var(--divider);
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.zusatzinfos-add-thumb:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.zusatzinfos-thumb {
  cursor: pointer;
}

/* --- Image lightbox overlay (app.js: openImageLightbox()) --- */

.image-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-lightbox-overlay[hidden] {
  display: none;
}

.image-lightbox-img {
  object-fit: contain;
  max-width: 90vw;
  max-height: 90vh;
}

.image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.image-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.image-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}
.image-lightbox-nav:disabled {
  opacity: 0.3;
  cursor: default;
}
.image-lightbox-nav:disabled:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-lightbox-prev {
  left: 16px;
}

.image-lightbox-next {
  right: 16px;
}

.image-lightbox-indicator {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

/* --- "Teilnehmer informieren" (E-Mail/WhatsApp/Telegram), app.js --- */

.inform-participants {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.inform-participants-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 6px;
}
.inform-participant-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.inform-participant-name {
  font-size: 13px;
  min-width: 140px;
}

.help-text {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 24px;
}

.btn {
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  cursor: pointer;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
}
.btn-secondary:hover { background: rgba(0, 0, 0, 0.04); }

/* --- Login / Nutzerverwaltung (auth.php, login.php, admin.php) --- */

.account-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 0 8px;
}

.account-name {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.login-body, .admin-body {
  align-items: center;
  justify-content: center;
}

.login-card {
  margin: auto;
  width: 100%;
  max-width: 380px;
  padding: 28px 26px;
  border-radius: var(--radius-l);
  border: 1px solid var(--divider);
  background: var(--surface);
  backdrop-filter: blur(20px);
}

.login-card h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.4;
}

.login-error {
  font-size: 12px;
  color: #c0392b;
  background: color-mix(in srgb, #c0392b 10%, white);
  border: 1px solid color-mix(in srgb, #c0392b 30%, white);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  margin: 0 0 14px;
}

.login-message {
  font-size: 12px;
  color: #2f9e44;
  background: color-mix(in srgb, #2f9e44 10%, white);
  border: 1px solid color-mix(in srgb, #2f9e44 30%, white);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  margin: 0 0 14px;
}

/* Frisch erzeugter Gast-Zugriffslink (admin.php) — auffällig, komplett
   selektierbar zum Kopieren, bricht auch bei langen URLs sauber um. */
.guest-link-code {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-s);
  -webkit-user-select: all;
  user-select: all;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
}

.login-form label:first-of-type { margin-top: 0; }

.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="number"],
.login-form textarea {
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--text);
}

.login-form textarea {
  resize: vertical;
}

.login-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  margin-top: 10px;
}

.login-submit {
  margin-top: 16px;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-700);
}
.login-submit:hover { background: var(--accent-700); }

.login-help {
  margin-top: 18px;
}

.admin-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
  width: 100%;
  overflow-y: auto;
}

.admin-section {
  margin-bottom: 32px;
  padding: 18px 20px;
  border-radius: var(--radius-l);
  border: 1px solid var(--divider);
  background: var(--surface);
}

.admin-section h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
}

.admin-section .login-form {
  max-width: 320px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--divider);
}

.admin-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}

.admin-table form { margin: 0; }

.admin-table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Horizontales Scrollen statt kaputtem Umbruch, wenn eine Tabelle auf
   schmalen Fenstern nicht mehr komplett hineinpasst (Tabellen reflowen von
   sich aus nicht responsiv) — siehe recordings.php. */
.table-scroll {
  overflow-x: auto;
}

.recordings-table td {
  vertical-align: top;
}
.recordings-table td:nth-child(2) {
  white-space: nowrap;
}

/* Löschen-Spalte bewusst rechtsbündig, getrennt von der ZIP-Spalte davor. */
.recordings-table .col-actions-right {
  text-align: right;
}
.recordings-table .col-actions-right form {
  display: inline-block;
}

/* --- Berechtigungen je Nutzer (permissions.php) --- */

.admin-section .login-form.permissions-form {
  max-width: none;
}

.permission-tree {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.permission-tree.disabled-tree {
  opacity: 0.45;
  pointer-events: none;
}

.permission-project {
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-s);
  background: #fff;
}

.permission-episodes {
  margin: 8px 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.episode-checkbox {
  margin-top: 2px !important;
}

/* --- Projekte/Folgen anlegen (app.js createProject/createEpisode) --- */

.episode-row-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.episode-row-wrapper .list-row {
  flex: 1;
}

/* --- Rollenauswahl inline in der Nutzertabelle (admin.php) --- */

.inline-role-form select {
  font-size: 12px;
  padding: 4px 6px;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--text);
}

/* --- "Passwort setzen" je Zugang, per <details> eingeblendet (admin.php) --- */

.password-reset-details > summary {
  list-style: none;
  cursor: pointer;
}
.password-reset-details > summary::-webkit-details-marker,
.password-reset-details > summary::marker {
  display: none;
  content: "";
}
.password-reset-details[open] > summary {
  margin-bottom: 6px;
}
.password-reset-form {
  display: flex;
  align-items: center;
  gap: 6px;
}
.password-reset-form input[type="password"],
.password-reset-form input[type="text"] {
  font-size: 12px;
  padding: 4px 6px;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--text);
  width: 140px;
}

/* --- "Passwort anzeigen"-Umschalter (login.php, admin.php), siehe
   password-toggle.js --- */

.password-field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.password-field input[type="password"],
.password-field input[type="text"] {
  flex: 1;
}
.password-toggle-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.password-toggle-btn:hover { background: rgba(0, 0, 0, 0.04); }

/* --- Aufnahme-Modul (record.js, eingebettet im oberen Drittel von
   index.php — siehe .record-panel weiter oben) --- */

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

.roster-list:empty { display: none; }

/* "Weitere Nutzer hinzufügen" — eingeklappte, nicht (mehr) freigeschaltete
   Konten, sobald ein Aufnahmeraum offen ist (siehe record.js
   renderAdminPresence()). Direktes Kind von .roster-list (#rosterList,
   selbst flex-wrap) — flex-basis:100% erzwingt einen eigenen Zeilenumbruch
   statt als weiterer Chip neben den aktiven Teilnehmern zu stehen. Dieselbe
   <details>/<summary>-Umsetzung wie beim "Passwort setzen"-Aufklapper in
   admin.php, siehe .password-reset-details oben. */
.roster-more {
  flex-basis: 100%;
  border-top: 1px dashed var(--divider);
  padding-top: 8px;
  margin-top: 2px;
}
.roster-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.roster-more > summary::-webkit-details-marker,
.roster-more > summary::marker {
  display: none;
  content: "";
}
.roster-more[open] > summary {
  margin-bottom: 8px;
}
.roster-more-list {
  opacity: 0.85;
}

.roster-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-m);
  border: 1px solid var(--divider);
  background: #fff;
  font-size: 13px;
  opacity: 0.6;
}

/* Anwesend (grüner Punkt) — volle Deckkraft statt der gedämpften Optik
   abwesender Zeilen, damit auf einen Blick klar ist, wer online/im
   Aufnahmeraum ist. */
.roster-row.online {
  opacity: 1;
  background: var(--accent-100);
  border-color: var(--accent-200);
}

/* Angehakt/freigeschaltet (siehe record.js renderAdminPresence()) — dezente
   Hervorhebung der ganzen Zeile, das Häkchen selbst zeigt den Zustand schon
   eindeutig, hier nur ein zusätzlicher visueller Hinweis. */
.roster-row.activated {
  background: var(--accent-100);
  border-color: var(--accent-200);
}

/* Grauer Punkt für "nicht online" (siehe record.js dotClassFor()). */
.roster-row .dot.dot-off {
  background: #b0b0b5;
}

/* Rot: Aufnahme läuft UND diese Person ist im Aufnahmeraum (Vorgabe Punkt 7).
   Zusätzlich .dot-muted (blinkend, siehe @keyframes unten): Person hat sich
   stummgeschaltet (Vorgabe Punkt 8) — der Stumm-Zustand kommt vom Server
   (siehe record-api.php Aktion "set_mute") und gilt für ALLE Teilnehmer, nicht
   nur lokal. */
.roster-row .dot.dot-recording {
  background: #c0392b;
}
.roster-row .dot.dot-muted {
  animation: dot-blink 1s step-start infinite;
}
@keyframes dot-blink {
  50% { opacity: 0.15; }
}

/* Häkchen zur Teilnehmer-Auswahl (nur Administrator-Ansicht, siehe
   record.js renderAdminPresence()/onAdminCheckboxChange()) — fester
   Platzhalter für nicht ankreuzbare Zeilen (andere Administratoren), damit
   alle Namen unabhängig davon bündig untereinanderstehen. */
.roster-check,
.roster-check-spacer {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.roster-name {
  white-space: nowrap;
}

/* Hebt eine Zeile hervor, solange laut Pegelanzeige (record.js, Abschnitt
   "Sprechpegel-/Wellenform-Anzeige") gerade gesprochen wird — deutlich
   sichtbarer Rahmen/Schatten statt einer nur farblich leicht anderen
   Fläche, damit "wer spricht gerade" auch aus den Augenwinkeln erkennbar
   ist. */
.roster-row.speaking {
  border-color: #2f9e44;
  box-shadow: 0 0 0 2px color-mix(in srgb, #2f9e44 35%, transparent);
}

.roster-waveform {
  width: 160px;
  height: 32px;
  border-radius: var(--radius-s);
  background: var(--bg);
  flex-shrink: 0;
}

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

/* Einladungs-Banner (siehe index.php #recordInvite, record.js renderInviteState())
   — bewusst auffälliger als ein normaler Button, damit die Freischaltung
   durch den Administrator nicht wie bisher leicht übersehen wird. */
.record-invite {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--accent-100);
  border: 1px solid var(--accent-200);
  border-radius: var(--radius-m);
}

/* WICHTIG: ".record-invite[hidden]" hat höhere Spezifität als ".record-invite"
   allein und muss deshalb NACH der display:flex-Regel oben stehen — sonst
   gewinnt die Klassen-Regel gegen das hidden-Attribut (beide Selektoren
   haben ohne dies dieselbe Spezifität, es zählt dann nur die Reihenfolge im
   Stylesheet) und record.js' recordInviteEl.hidden = true zeigt keine
   Wirkung mehr: das Banner bliebe für JEDEN sichtbar, auch Administratoren
   und nicht freigeschaltete Nutzer, egal was renderInviteState() setzt. */
.record-invite[hidden] {
  display: none;
}

.record-invite-text {
  margin: 0;
  flex: 1 1 auto;
  font-weight: 600;
}

/* Administrator-eigene Projekt-/Folgenauswahl fürs Aufnahme-Panel (siehe
   index.php #recordEpisodePicker, record.js refreshAdminEpisodePicker()). */
.record-episode-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.record-episode-select {
  flex: 1 1 auto;
  padding: 8px 10px;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  background: #fff;
  font: inherit;
  color: var(--text);
}

.record-episode-select:disabled {
  opacity: 0.5;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-700);
}
.btn-primary:hover { background: var(--accent-700); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-danger {
  background: #c0392b;
  color: #fff;
  border-color: #a5311f;
}
.btn-danger:hover { background: #a5311f; }

.record-session-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
}
.record-session-status.status-open {
  color: #2f9e44;
  background: color-mix(in srgb, #2f9e44 15%, white);
}
.record-session-status.status-closed {
  color: var(--muted);
  background: var(--divider);
}

.record-session-tracks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* --- Einstellungen-Bereich (admin.php/sync-settings.php/recordings.php) ---
   Übernimmt bewusst die Struktur von Planung (siehe index.php/.split-screen
   weiter oben): Topbar oben (flex-shrink:0, aus der generischen body-Regel),
   darunter EIN full-height Flex-Bereich, der den restlichen Platz komplett
   ausfüllt — links eine schmale, feste Sidebar (wie .project-pane), rechts
   der Inhalt (wie .shownotes-pane, flex:1). Beide scrollen bei Bedarf nur
   INNERHALB ihres eigenen Bereichs, die Topbar bleibt fix stehen. */

.settings-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.settings-sidebar {
  width: 240px;
  min-width: 180px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 20px 14px;
  border-right: 1px solid var(--divider);
  background: var(--surface);
}

.settings-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 12px 10px;
}

.settings-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-sidebar-nav a {
  padding: 9px 10px;
  border-radius: var(--radius-s);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.settings-sidebar-nav a:hover { background: var(--bg); }
.settings-sidebar-nav a.active {
  background: var(--accent);
  color: #fff;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  min-width: 320px;
}

/* Schmaler als der volle Inhaltsbereich, für Abschnitte mit reinen
   Formularen (Nutzerverwaltung, Sync) — der Speicherplatz-/Aufnahmen-
   Abschnitt in recordings.php nutzt stattdessen .admin-section-wide, weil
   eine Tabelle die zusätzliche Breite sinnvoll ausfüllt. */
.admin-section {
  max-width: 760px;
}
.admin-section.admin-section-wide {
  max-width: none;
}

/* Schmalere Fenster (z. B. Tablet/Smartphone): Sidebar wird zur
   horizontalen, umbrechenden Leiste oberhalb des Inhalts statt einer
   schmalen linken Spalte, die sonst zu viel Breite kosten würde. */
@media (max-width: 760px) {
  .settings-layout {
    flex-direction: column;
    overflow-y: auto;
  }
  .settings-sidebar {
    width: auto;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--divider);
    overflow-y: visible;
  }
  .settings-sidebar-title {
    margin-left: 0;
  }
  .settings-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .settings-content {
    overflow-y: visible;
    min-width: 0;
  }
}

/* Schmalere Fenster/Smartphones: das Planung-Split-Screen-Layout
   (index.php, siehe .split-screen/.record-panel/.panes weiter oben) wird
   von "drei feste Spalten nebeneinander, je intern scrollend" zu
   "gestapelte Bereiche, ganze Seite scrollt" umgebaut — die festen
   Spaltenbreiten oben (260px + 280px + 320px = 860px) passen ab hier nicht
   mehr nebeneinander. 900px statt der 760px oben, weil dieser Wert zum
   Inhalt DIESER Seite passt, nicht zwingend zu dem der
   Einstellungen-Seiten. Keine JS-Änderung nötig: app.js/record.js rendern
   weiterhin dieselben Elemente, nur ihre CSS-Anordnung ändert sich. */
@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .account-name {
    display: none;
  }

  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
  .split-screen {
    overflow: visible;
  }

  .record-panel {
    flex: 0 0 auto;
    max-height: 45vh;
  }

  .panes.split-bottom {
    flex-direction: column;
    overflow: visible;
  }
  .project-pane,
  .episode-pane {
    width: auto;
    min-width: 0;
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .shownotes-pane {
    min-width: 0;
  }
}

/* --- Speicherplatz-Anzeige (recordings.php) --- */

.storage-usage {
  margin-bottom: 14px;
}

.storage-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--divider);
  overflow: hidden;
  margin-bottom: 6px;
}

.storage-bar-fill {
  height: 100%;
  background: #2f9e44;
  transition: width 0.2s ease;
}
.storage-bar-fill.storage-bar-info { background: #e08e0b; }
.storage-bar-fill.storage-bar-warn { background: #c0392b; }

.storage-banner {
  padding: 10px 14px;
  border-radius: var(--radius-m);
  font-weight: 600;
  margin-bottom: 14px;
}
.storage-banner-info {
  color: #8a5a00;
  background: color-mix(in srgb, #e08e0b 15%, white);
  border: 1px solid color-mix(in srgb, #e08e0b 40%, transparent);
}
.storage-banner-warn {
  color: #a5311f;
  background: color-mix(in srgb, #c0392b 15%, white);
  border: 1px solid color-mix(in srgb, #c0392b 40%, transparent);
}
