:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #111820;
  background: #edf2f6;
  line-height: 1.45;
  font-size: 16px;
  color-scheme: only light;
  --text: #111820;
  --text-soft: #455563;
  --text-muted: #536574;
  --border: #cbd5dd;
  --border-strong: #9aaab7;
  --surface: #ffffff;
  --surface-soft: #f3f6f8;
  --link: #075b96;
  --link-hover: #003f6a;
  --focus: #0b63a5;
  --success: #176b35;
  --success-soft: #eaf7ee;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #edf2f6; color-scheme: only light; }
body { margin: 0; min-height: 100vh; background: #edf2f6; color: var(--text); }
a { color: var(--link); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
button, input, select { color: var(--text); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(11, 99, 165, .28);
  outline-offset: 2px;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #c8d2da;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { font-weight: 750; font-size: 19px; color: #0f1720; }
.subtitle { color: #465968; font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions form, .inline { margin: 0; }
.user-pill { background: #e8eef2; color: #263746; padding: 7px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.page { max-width: 1500px; margin: 0 auto; padding: 22px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.055); }
.controls { padding: 15px 16px; }
.event-select { display: flex; align-items: end; gap: 10px; }
.event-select label { flex: 1; }
.event-select select { width: 100%; min-height: 44px; }
.summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 14px 0; }
.summary { padding: 17px 20px; }
.summary span, .info span { display: block; color: #4b5e6c; font-size: 14px; font-weight: 600; }
.summary strong { font-size: 31px; color: #0c1620; }
.detail-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
.info { padding: 14px 16px; }
.info strong { font-size: 17px; }

.table-card { overflow: hidden; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; background: #fff; }
th, td { padding: 13px 13px; border-bottom: 1px solid #d9e1e7; text-align: left; vertical-align: middle; font-size: 15px; }
th { background: #e9eff3; color: #182633; font-size: 14px; font-weight: 750; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid #bfcbd4; }
tbody tr:nth-child(even):not(.attended) { background: #f8fafb; }
tbody tr:hover { background: #edf5fa; }
tr.attended { background: #eaf7ee; }
tr.attended:hover { background: #dff1e5; }
.num { text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: #435564; padding: 30px; }
.row-link, .order-link { font-weight: 750; color: #075b96; text-decoration: none; }
.row-link:hover, .order-link:hover { color: #003f6a; text-decoration: underline; }
.order-link { text-decoration: underline; }
a[href^="tel:"] { color: #075b96; font-weight: 650; text-decoration: underline; }

.button { border: 1px solid #9faeba; background: #fff; border-radius: 8px; padding: 9px 13px; cursor: pointer; font: inherit; font-weight: 600; text-decoration: none; color: #17202a; display: inline-block; }
.button:hover { background: #edf2f5; border-color: #778a98; }
.button.primary { background: #075f9f; color: white; border-color: #075f9f; }
.button.primary:hover { background: #034b7e; }
.button.ghost { background: transparent; }
.button.small { padding: 6px 9px; font-size: 13px; }

/* Deutlich sichtbare Anwesenheits-Checkboxen. Die Schaltfläche bleibt ein normales
   Formular-Submit und funktioniert daher ohne JavaScript. */
.check-button,
.check-readonly {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #647786;
  border-radius: 7px;
  background: #fff;
  color: #15212b;
  font-size: 24px;
  line-height: 1;
  font-weight: 850;
  vertical-align: middle;
}
.check-button { cursor: pointer; padding: 0; }
.check-button:hover { background: #edf3f6; border-color: #30495b; }
.check-button.attended,
.check-readonly.attended {
  background: #e3f5e8;
  border-color: #21723d;
  color: #176b35;
}
.check-button.attended:hover { background: #d7efdf; }
.check-readonly { cursor: default; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.flash { border-radius: 9px; padding: 11px 14px; margin: 0 0 14px; font-weight: 600; }
.flash.info { background: #eaf3fa; border: 1px solid #99c1df; }
.flash.success { background: #e8f6ec; border: 1px solid #93caa0; }
.flash.error { background: #fff0f0; border: 1px solid #d99898; color: #761818; }
.notice { background: #fff7df; border: 1px solid #d8b760; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; color: #453a19; }
.muted { color: #4a5e6d; }
.small { font-size: 13px; }
.login-card { max-width: 430px; margin: 8vh auto; padding: 28px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; color: #1e2d39; }
input, select { font: inherit; padding: 10px 11px; border: 1px solid #9eacb7; border-radius: 8px; background: white; min-height: 42px; }

/* Chromium/Windows kann native Formularelemente trotz heller Seite mit einer
   dunklen System-Farbgebung rendern. Deshalb setzen wir Text, Textfüllung und
   Hintergrund für den hellen Modus ausdrücklich. Der Versionsparameter am
   Stylesheet verhindert zusätzlich, dass ein älteres CSS aus dem Browsercache
   weiterverwendet wird. */
body:not(.entry-dark) input:not([type="hidden"]),
body:not(.entry-dark) select,
body:not(.entry-dark) textarea {
  color: #111820 !important;
  -webkit-text-fill-color: #111820 !important;
  background-color: #ffffff !important;
  caret-color: #111820 !important;
  color-scheme: only light !important;
  opacity: 1 !important;
}
body:not(.entry-dark) select option {
  color: #111820 !important;
  -webkit-text-fill-color: #111820 !important;
  background-color: #ffffff !important;
  color-scheme: only light !important;
}
body:not(.entry-dark) input::placeholder,
body:not(.entry-dark) textarea::placeholder {
  color: #657684 !important;
  -webkit-text-fill-color: #657684 !important;
  opacity: 1;
}
body:not(.entry-dark) input:-webkit-autofill,
body:not(.entry-dark) input:-webkit-autofill:hover,
body:not(.entry-dark) input:-webkit-autofill:focus,
body:not(.entry-dark) input:-webkit-autofill:active {
  -webkit-text-fill-color: #111820 !important;
  caret-color: #111820 !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
}

.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.detail-head h1 { margin: 0; font-size: 25px; }
.section { padding: 16px; margin: 14px 0; }
.section h2 { margin: 0 0 12px; font-size: 19px; }
.qty { width: 95px; }
.totals { display: flex; gap: 25px; align-items: center; padding-top: 13px; }
.actions { text-align: right; margin-top: 14px; }
.detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; }
.detail-list dt { font-weight: 750; color: #243542; }
.detail-list dd { margin: 0; }
.admin-grid { display: grid; grid-template-columns: minmax(280px,360px) 1fr; gap: 14px; }
.admin-grid .wide { margin: 0; }
.user-actions { display: flex; gap: 8px; align-items: center; }
.user-actions form { display: flex; gap: 6px; }
.user-actions input { padding: 6px 8px; width: 170px; }

/* Gemeinsame Navigation / Branding */
.brand-wrap { display: flex; align-items: center; gap: 11px; min-width: 250px; }
.brand-icon { width: 38px; height: 38px; object-fit: contain; }
.module-nav { display: flex; gap: 4px; background: #e5ebef; padding: 3px; border-radius: 10px; }
.nav-link { padding: 7px 10px; border-radius: 7px; color: #2c4050; text-decoration: none; font-size: 14px; font-weight: 700; }
.nav-link:hover { background: #fff; }
.nav-link.active { background: #fff; color: #075b96; box-shadow: 0 1px 2px rgba(0,0,0,.1); }

/* Einlassmonitor */
.entry-monitor { display: grid; gap: 14px; }
.entry-head { padding: 16px 18px; }
.entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.entry-heading h1 { margin: 0; font-size: 26px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #4d6070; font-weight: 750; }
.entry-event-name { font-size: 21px; font-weight: 750; margin-top: 5px; }
.entry-event-time { color: #4d6170; margin-top: 2px; }
.entry-clock { font-variant-numeric: tabular-nums; font-size: 44px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.entry-toolbar { display: flex; gap: 12px; align-items: end; margin-top: 14px; }
.entry-target-form { display: flex; gap: 10px; align-items: end; flex: 1; }
.entry-target-form label { flex: 1; }
.gear-menu { position: relative; }
.gear-menu summary { list-style: none; cursor: pointer; font-size: 27px; padding: 5px 8px; line-height: 1; border-radius: 8px; user-select: none; }
.gear-menu summary::-webkit-details-marker { display: none; }
.gear-menu summary:hover { background: #e7edf1; }
.gear-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 230px; background: #fff; border: 1px solid #b9c6cf; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.16); padding: 6px; z-index: 20; }
.gear-panel button { display: block; width: 100%; border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 7px; font: inherit; color: #17202a; cursor: pointer; }
.gear-panel button:hover { background: #eaf0f4; }
.entry-banner { padding: 10px 14px; border-radius: 10px; background: #e8f6ec; border: 1px solid #93caa0; font-weight: 700; }
.entry-banner.warning { background: #fff7df; border-color: #d8b760; }
.entry-details { display: grid; grid-template-columns: 1fr 2fr .7fr 1fr; padding: 13px 16px; gap: 16px; }
.entry-detail span { display: block; color: #4d6070; font-size: 12px; margin-bottom: 3px; font-weight: 600; }
.entry-detail strong { font-size: 14px; }
.entry-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.entry-metric { padding: 22px; text-align: center; }
.entry-metric span { display: block; color: #4d6070; font-size: 14px; font-weight: 600; }
.entry-metric strong { display: block; font-size: 44px; line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; }
.entry-metric.highlight { border-width: 2px; }
.entry-progress-card { padding: 20px 22px; }
.entry-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 11px; }
.entry-progress-head span { font-size: 18px; font-weight: 750; }
.entry-progress-head strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.entry-progress { width: 100%; height: 24px; border: 0; border-radius: 999px; overflow: hidden; display: block; appearance: none; -webkit-appearance: none; background: #d9e2e8; }
.entry-progress::-webkit-progress-bar { background: #d9e2e8; border-radius: 999px; }
.entry-progress::-webkit-progress-value { background: #1e6fa8; border-radius: 999px; }
.entry-progress::-moz-progress-bar { background: #1e6fa8; border-radius: 999px; }
.entry-status { display: flex; justify-content: space-between; gap: 15px; padding: 9px 12px; color: #4d6070; font-size: 13px; }


/* Darkmode-Fix V2: Der freie Viewport-Bereich wird vom <html>-Element gezeichnet.
   :has() koppelt dessen Hintergrund direkt an die bereits gesetzte body-Klasse
   und funktioniert damit unabhängig davon, ob das JavaScript die zusätzliche
   html-Klasse aus einem Browser-Cache geladen hat. */
html:has(body.entry-dark) {
  background: #050607 !important;
  color-scheme: dark !important;
}
html:has(body.entry-dark) body {
  background: #050607 !important;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Die Seite füllt den verfügbaren Viewport auch dann, wenn der Einlassmonitor
   weniger Inhalt als die Fensterhöhe hat. */
body {
  display: flex;
  flex-direction: column;
}
.page {
  width: 100%;
  flex: 1 0 auto;
}

/* Dunkelmodus des Einlassmonitors; wird pro Browser gespeichert. */
body.entry-dark { min-height: 100vh; background: #050607 !important; color: #aeb6bc; color-scheme: dark; }
/* Firefox/Chromium malen freien Bereich unterhalb des Body je nach Viewport mit
   dem Hintergrund des HTML-Elements. Der JS-Dunkelmodus setzt deshalb auch
   auf <html> eine Klasse; so bleibt wirklich der gesamte Viewport dunkel. */
html.entry-dark-root,
html.entry-dark-root body,
html.entry-dark-root .page {
  background: #050607 !important;
}
html.entry-dark-root {
  min-height: 100%;
  color-scheme: dark;
}
html.entry-dark-root body { min-height: 100vh; }
body.entry-dark .topbar, body.entry-dark .card { background: #080a0b; border-color: #2a3034; box-shadow: none; }
body.entry-dark .brand, body.entry-dark .entry-heading h1, body.entry-dark .entry-event-name, body.entry-dark .entry-clock, body.entry-dark .entry-metric strong, body.entry-dark .entry-progress-head strong { color: #d0d6da; }
body.entry-dark .subtitle, body.entry-dark .eyebrow, body.entry-dark .entry-event-time, body.entry-dark .entry-detail span, body.entry-dark .entry-metric span, body.entry-dark .entry-status { color: #9aa4aa; }
body.entry-dark .entry-detail strong, body.entry-dark .entry-progress-head span { color: #c0c8cd; }
body.entry-dark .module-nav, body.entry-dark .user-pill { background: #15191c; color: #c1c8cd; }
body.entry-dark .nav-link { color: #aab3b9; }
body.entry-dark .nav-link.active, body.entry-dark .nav-link:hover { background: #242a2e; color: #e1e5e8; }
body.entry-dark input:not([type="hidden"]), body.entry-dark select, body.entry-dark textarea, body.entry-dark .button { background: #101417 !important; border-color: #4b565d; color: #d3d9dd !important; -webkit-text-fill-color: #d3d9dd !important; caret-color: #d3d9dd !important; color-scheme: dark !important; }
body.entry-dark select option { background: #101417 !important; color: #d3d9dd !important; -webkit-text-fill-color: #d3d9dd !important; }
body.entry-dark .button:hover { background: #1b2024; }
body.entry-dark .gear-menu summary:hover { background: #171c1f; }
body.entry-dark .gear-panel { background: #0f1315; border-color: #3b444a; box-shadow: 0 12px 30px rgba(0,0,0,.6); }
body.entry-dark .gear-panel button { color: #d0d6da; }
body.entry-dark .gear-panel button:hover { background: #1b2024; }
body.entry-dark .entry-banner { background: #0b1810; border-color: #315e3d; color: #b4c7ba; }
body.entry-dark .entry-banner.warning { background: #181407; border-color: #665422; color: #d1c495; }
body.entry-dark .entry-progress, body.entry-dark .entry-progress::-webkit-progress-bar { background: #1a2227; }
body.entry-dark .entry-progress::-webkit-progress-value { background: #426a81; }
body.entry-dark .entry-progress::-moz-progress-bar { background: #426a81; }
body.entry-dark label { color: #d2d8dc; }

@media (max-width: 1050px) {
  .module-nav { order: 3; width: 100%; justify-content: flex-end; }
  .top-actions { flex-wrap: wrap; }
  .entry-details { grid-template-columns: 1fr 1fr; }
  .entry-metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .topbar { position: static; align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .page { padding: 12px; }
  .summary-grid, .detail-summary, .admin-grid { grid-template-columns: 1fr; }
  .event-select { align-items: stretch; flex-direction: column; }
  .summary strong { font-size: 26px; }
  .table-card { border-radius: 8px; }
  .detail-head { align-items: flex-start; flex-direction: column; }
  .user-pill { display: none; }
}
@media (max-width: 700px) {
  .brand-icon { width: 32px; height: 32px; }
  .entry-heading { align-items: flex-start; }
  .entry-clock { font-size: 30px; }
  .entry-toolbar, .entry-target-form { align-items: stretch; flex-direction: column; }
  .gear-menu { align-self: flex-end; position: absolute; right: 18px; margin-top: -2px; }
  .entry-details, .entry-metrics { grid-template-columns: 1fr; }
  .entry-metric { padding: 16px; }
  .entry-metric strong { font-size: 36px; }
  .entry-status { flex-direction: column; }
  .module-nav { justify-content: flex-start; overflow: auto; }
  .nav-link { white-space: nowrap; }
  th, td { padding: 12px 11px; }
}

/* Darkmode-Fix V3: feste Vollbild-Hintergrundebene.
   Damit hängt der dunkle Hintergrund nicht mehr von der berechneten Höhe
   von html/body/main ab. Das ::before-Element deckt den gesamten Viewport ab,
   während Kopfzeile und Seiteninhalt darüber gerendert werden. */
body.entry-dark::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #050607;
  z-index: 0;
  pointer-events: none;
}
body.entry-dark > .topbar,
body.entry-dark > .page {
  position: relative;
  z-index: 1;
}


/* V5: Dunkelmodus ab dem ersten Paint und über den gesamten Viewport.
   Die Klasse wird im <head> gesetzt, bevor das Stylesheet gerendert wird. */
html, body { min-height: 100%; }
html.entry-dark-root {
  background: #050607 !important;
  background-color: #050607 !important;
  color-scheme: dark !important;
}
html.entry-dark-root body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #050607 !important;
  background-color: #050607 !important;
  color: #aeb6bc;
}
/* Die Einlassansicht wird bereits über die Root-Klasse dunkel gerendert,
   noch bevor einlass.js die body-Klasse ergänzt. */
html.entry-dark-root .topbar, html.entry-dark-root .card { background: #080a0b; border-color: #2a3034; box-shadow: none; }
html.entry-dark-root .brand, html.entry-dark-root .entry-heading h1, html.entry-dark-root .entry-event-name, html.entry-dark-root .entry-clock, html.entry-dark-root .entry-metric strong, html.entry-dark-root .entry-progress-head strong { color: #d0d6da; }
html.entry-dark-root .subtitle, html.entry-dark-root .eyebrow, html.entry-dark-root .entry-event-time, html.entry-dark-root .entry-detail span, html.entry-dark-root .entry-metric span, html.entry-dark-root .entry-status { color: #9aa4aa; }
html.entry-dark-root .entry-detail strong, html.entry-dark-root .entry-progress-head span { color: #c0c8cd; }
html.entry-dark-root .module-nav, html.entry-dark-root .user-pill { background: #15191c; color: #c1c8cd; }
html.entry-dark-root .nav-link { color: #aab3b9; }
html.entry-dark-root .nav-link.active, html.entry-dark-root .nav-link:hover { background: #242a2e; color: #e1e5e8; }
html.entry-dark-root input:not([type="hidden"]), html.entry-dark-root select, html.entry-dark-root textarea, html.entry-dark-root .button { background: #101417 !important; border-color: #4b565d; color: #d3d9dd !important; -webkit-text-fill-color: #d3d9dd !important; caret-color: #d3d9dd !important; color-scheme: dark !important; }
html.entry-dark-root select option { background: #101417 !important; color: #d3d9dd !important; -webkit-text-fill-color: #d3d9dd !important; }
html.entry-dark-root .button:hover { background: #1b2024; }
html.entry-dark-root .gear-menu summary:hover { background: #171c1f; }
html.entry-dark-root .gear-panel { background: #0f1315; border-color: #3b444a; box-shadow: 0 12px 30px rgba(0,0,0,.6); }
html.entry-dark-root .gear-panel button { color: #d0d6da; }
html.entry-dark-root .gear-panel button:hover { background: #1b2024; }
html.entry-dark-root .entry-banner { background: #0b1810; border-color: #315e3d; color: #b4c7ba; }
html.entry-dark-root .entry-banner.warning { background: #181407; border-color: #665422; color: #d1c495; }
html.entry-dark-root .entry-progress, html.entry-dark-root .entry-progress::-webkit-progress-bar { background: #1a2227; }
html.entry-dark-root .entry-progress::-webkit-progress-value { background: #426a81; }
html.entry-dark-root .entry-progress::-moz-progress-bar { background: #426a81; }
html.entry-dark-root label { color: #d2d8dc; }


/* Admin-Einstellung im Zahnradmenü des Einlassmonitors */
.gear-divider { height: 1px; background: #d7e0e6; margin: 6px 4px; }
.gear-setting-form { padding: 6px 8px 8px; }
.gear-setting-form label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.gear-setting-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.gear-setting-row input { width: 100%; min-width: 0; padding: 8px; border: 1px solid #9faeba; border-radius: 7px; background: #fff; color: #111820; font: inherit; }
.gear-panel .gear-setting-row button { width: auto; border: 1px solid #9faeba; background: #f3f6f8; text-align: center; padding: 8px 9px; }
.gear-setting-form small { display: block; margin-top: 5px; color: #536574; font-size: 11px; }
body.entry-dark .gear-divider, html.entry-dark-root .gear-divider { background: #323a3f; }
body.entry-dark .gear-setting-form small, html.entry-dark-root .gear-setting-form small { color: #929da4; }
body.entry-dark .gear-panel .gear-setting-row button, html.entry-dark-root .gear-panel .gear-setting-row button { background: #171c1f; border-color: #4b565d; color: #d3d9dd; }

/* Einlassmonitor V5.2 ------------------------------------------------------
   1) Detail-/Statusleiste zuverlässig ausblenden.
   2) Auf Geräten mit geringer Viewport-Höhe (Tablets/Laptops im Querformat)
      die komplette Einlassübersicht in eine Bildschirmseite einpassen. */
#entry-root [hidden],
#entry-root .entry-section-hidden {
  display: none !important;
}

/* Kompakte Ein-Seiten-Ansicht für typische Tablet-/Laptop-Höhen. */
@media (max-height: 900px) and (min-width: 760px) {
  body.entry-page .topbar {
    padding: 8px 14px;
    gap: 10px;
    min-height: 0;
  }
  body.entry-page .brand-wrap { gap: 9px; }
  body.entry-page .brand-icon { width: 28px; height: 28px; }
  body.entry-page .brand { font-size: 15px; }
  body.entry-page .subtitle { font-size: 10px; }
  body.entry-page .top-actions { gap: 6px; flex-wrap: nowrap; }
  body.entry-page .module-nav {
    order: initial;
    width: auto;
    padding: 3px;
    gap: 2px;
  }
  body.entry-page .nav-link { padding: 5px 8px; font-size: 12px; }
  body.entry-page .user-pill { display: none; }
  body.entry-page .button { padding: 7px 10px; font-size: 12px; }
  body.entry-page .page {
    max-width: 1500px;
    padding: 8px 12px;
  }

  body.entry-page .entry-monitor { gap: 7px; }
  body.entry-page .entry-head { padding: 9px 12px; }
  body.entry-page .entry-heading { gap: 12px; }
  body.entry-page .eyebrow { font-size: 10px; }
  body.entry-page .entry-heading h1 { font-size: 21px; line-height: 1.05; }
  body.entry-page .entry-event-name { font-size: 17px; margin-top: 2px; line-height: 1.15; }
  body.entry-page .entry-event-time { font-size: 12px; margin-top: 1px; }
  body.entry-page .entry-clock { font-size: 34px; }
  body.entry-page .entry-toolbar { gap: 7px; margin-top: 7px; }
  body.entry-page .entry-target-form { gap: 7px; }
  body.entry-page .entry-target-form label { font-size: 11px; }
  body.entry-page .entry-target-form select { padding: 7px 9px; }
  body.entry-page .gear-menu summary { font-size: 23px; padding: 4px 6px; }

  body.entry-page .entry-banner { padding: 7px 11px; font-size: 13px; }
  body.entry-page .entry-details {
    grid-template-columns: 1fr 2fr .7fr 1fr;
    padding: 8px 11px;
    gap: 10px;
  }
  body.entry-page .entry-detail span { font-size: 10px; margin-bottom: 1px; }
  body.entry-page .entry-detail strong { font-size: 12px; line-height: 1.2; }

  body.entry-page .entry-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
  body.entry-page .entry-metric { padding: 11px 8px; }
  body.entry-page .entry-metric span { font-size: 12px; }
  body.entry-page .entry-metric strong { font-size: 34px; margin-top: 4px; }

  body.entry-page .entry-progress-card { padding: 10px 12px; }
  body.entry-page .entry-progress-head { margin-bottom: 6px; }
  body.entry-page .entry-progress-head span { font-size: 15px; }
  body.entry-page .entry-progress-head strong { font-size: 23px; }
  body.entry-page .entry-progress { height: 18px; }
  body.entry-page .entry-status { padding: 6px 9px; font-size: 11px; }

  body.entry-page .gear-panel {
    max-height: min(70vh, 430px);
    overflow-y: auto;
  }
}

/* Noch flacherer Browser-Viewport, z. B. Android-Tablet mit sichtbarer
   Browser-/Systemleiste. Die Informationshierarchie bleibt vollständig. */
@media (max-height: 700px) and (min-width: 760px) {
  body.entry-page .topbar { padding: 5px 10px; }
  body.entry-page .brand-icon { width: 24px; height: 24px; }
  body.entry-page .brand { font-size: 14px; }
  body.entry-page .subtitle { display: none; }
  body.entry-page .nav-link { padding: 4px 7px; }
  body.entry-page .button { padding: 6px 9px; }
  body.entry-page .page { padding: 6px 10px; }

  body.entry-page .entry-monitor { gap: 5px; }
  body.entry-page .entry-head { padding: 7px 10px; }
  body.entry-page .eyebrow { display: none; }
  body.entry-page .entry-heading h1 { font-size: 18px; }
  body.entry-page .entry-event-name { font-size: 15px; }
  body.entry-page .entry-event-time { font-size: 11px; }
  body.entry-page .entry-clock { font-size: 29px; }
  body.entry-page .entry-toolbar { margin-top: 5px; }
  body.entry-page .entry-banner { padding: 5px 9px; font-size: 12px; }
  body.entry-page .entry-details { padding: 6px 9px; gap: 8px; }
  body.entry-page .entry-detail span { font-size: 9px; }
  body.entry-page .entry-detail strong { font-size: 11px; }
  body.entry-page .entry-metric { padding: 8px 6px; }
  body.entry-page .entry-metric strong { font-size: 30px; }
  body.entry-page .entry-progress-card { padding: 8px 10px; }
  body.entry-page .entry-progress-head { margin-bottom: 4px; }
  body.entry-page .entry-progress-head strong { font-size: 20px; }
  body.entry-page .entry-progress { height: 15px; }
  body.entry-page .entry-status { padding: 4px 7px; font-size: 10px; }
}

/* Tablets im Hochformat: Kennzahlen bleiben als 2x2-Raster kompakt statt
   vier große Blöcke untereinander zu bilden. */
@media (min-width: 520px) and (max-width: 900px) {
  body.entry-page .entry-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Betriebsstatus 5.3.0 ----------------------------------------------------
   In der Entwicklungsphase nur für Admin sichtbar. Die Seite ist bewusst
   touchfreundlich und zeigt Foyer/Kuppel auf Tablets nebeneinander. */
.ops-status-page { display: grid; gap: 14px; }
.ops-status-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 2px 0;
}
.ops-status-intro h1 { margin: 2px 0 0; font-size: 29px; }
.ops-status-intro p { margin: 4px 0 0; color: var(--text-muted); }
.ops-beta-badge {
  background: #fff4cf;
  border: 1px solid #d7b74d;
  color: #5a4610;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}
.ops-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ops-panel { padding: 16px; min-width: 0; }
.ops-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.ops-panel-head h2 { margin: 0; font-size: 24px; }
.ops-sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #25a351;
  box-shadow: 0 0 0 4px rgba(37,163,81,.13);
}
.ops-current {
  min-height: 150px;
  border-radius: 14px;
  border: 2px solid transparent;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.ops-current-label {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.ops-current-meta { margin-top: 9px; font-size: 14px; font-weight: 700; opacity: .82; }
.ops-current-note {
  margin-top: 10px;
  max-width: 100%;
  padding: 7px 10px;
  background: rgba(255,255,255,.64);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.ops-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 9px;
  margin-top: 12px;
}
.ops-status-button {
  border: 2px solid transparent;
  border-radius: 11px;
  min-height: 66px;
  padding: 10px;
  font: inherit;
  font-size: 17px;
  line-height: 1.12;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}
.ops-status-button:hover { filter: brightness(.97); }
.ops-status-button:active { transform: translateY(1px); }
.ops-status-button.is-active { border-color: #111820; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7), 0 0 0 2px rgba(17,24,32,.12); }
.ops-status-button:disabled { opacity: .58; cursor: wait; }
.ops-note-label { margin-top: 12px; font-size: 13px; }
.ops-note-label input { width: 100%; }
.ops-readonly-note { color: var(--text-muted); margin-top: 12px; font-size: 13px; }
.ops-status-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 0 3px;
}

/* Statusfarben: Rot bleibt bewusst Störung vorbehalten. */
.ops-current.tone-gray, .ops-status-button.tone-gray { background: #e4e8eb; color: #24323c; border-color: #aab5bd; }
.ops-current.tone-green, .ops-status-button.tone-green { background: #c9f0d4; color: #0e5227; border-color: #55a96d; }
.ops-current.tone-cyan, .ops-status-button.tone-cyan { background: #caedf4; color: #0d5361; border-color: #55a9b9; }
.ops-current.tone-blue, .ops-status-button.tone-blue { background: #cfe2ff; color: #123e78; border-color: #6f9bd5; }
.ops-current.tone-yellow, .ops-status-button.tone-yellow { background: #fff0b8; color: #654d00; border-color: #d2ac2e; }
.ops-current.tone-orange, .ops-status-button.tone-orange { background: #ffd9b7; color: #6b3100; border-color: #dc8947; }
.ops-current.tone-red, .ops-status-button.tone-red { background: #ffd0d0; color: #711515; border-color: #d76161; }

@media (max-width: 850px) {
  .ops-status-grid { grid-template-columns: 1fr; }
  .ops-current { min-height: 120px; }
  .ops-status-intro { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* Querformat-Tablets: beide Bereiche ohne unnötige Höhe auf einer Seite. */
@media (max-height: 850px) and (min-width: 851px) {
  body .ops-status-page { gap: 8px; }
  body .ops-status-intro h1 { font-size: 24px; }
  body .ops-status-intro p { margin-top: 1px; font-size: 13px; }
  body .ops-panel { padding: 11px; }
  body .ops-panel-head { margin-bottom: 6px; }
  body .ops-panel-head h2 { font-size: 20px; }
  body .ops-current { min-height: 108px; padding: 11px; }
  body .ops-current-label { font-size: clamp(27px, 3.4vw, 42px); }
  body .ops-current-meta { margin-top: 5px; font-size: 12px; }
  body .ops-current-note { margin-top: 5px; padding: 5px 8px; font-size: 13px; }
  body .ops-buttons { gap: 6px; margin-top: 7px; }
  body .ops-status-button { min-height: 49px; font-size: 14px; padding: 6px; }
  body .ops-note-label { margin-top: 7px; font-size: 11px; gap: 3px; }
  body .ops-note-label input { min-height: 34px; padding: 6px 8px; }
}
