/*
 * V5.7.7 public theory plan: premium hero with the three facts, month navigation, compact lesson
 * cards (next lesson gold, today green, past muted, "Kein Unterricht" soft red), QR card, four
 * information cards, the call to action on the theory page, the display mode for a permanent screen
 * and the A4 print layout. Colours come from the theme tokens (--c-terra-* = accent, --v5-glow) and
 * the surface tokens (--bg-raised, --fg, --line ...), so every theme and the dark mode follow.
 */

:root {
  --v577-red: #b42318;
  --v577-red-bg: #e5484d;
  --v577-green: #1f7a4a;
  --v577-green-strong: #2f8a57;
}
.tone-dark, .tone-dark-2, .tone-deep, .v577-display,
html[data-mode="dark"] .tone-cream, html[data-mode="dark"] .tone-warm {
  --v577-red: #ff9c90;
  --v577-green: #6fd59a;
}

/* ---------------------------------------------------------------- hero */
.v577-hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  /* the floating site header lies over the hero, like on every .page-hero */
  padding-block: calc(var(--header-total, 0px) + clamp(1.5rem, 1rem + 2vw, 3rem)) clamp(2.5rem, 1.5rem + 3.2vw, 4.5rem);
  background: var(--c-graphite-950);
}
.v577-hero__media { position: absolute; inset: 0; z-index: -1; }
.v577-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; filter: saturate(0.85) brightness(0.62); }
.v577-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgb(var(--pv-dark-rgb, 10 15 24) / 0.95) 0%, rgb(var(--pv-dark-rgb, 10 15 24) / 0.8) 46%, rgb(var(--pv-dark-rgb, 10 15 24) / 0.42) 100%),
    linear-gradient(0deg, rgb(var(--pv-dark-rgb, 10 15 24) / 0.9), transparent 55%);
}
[dir="rtl"] .v577-hero__media::after {
  background:
    linear-gradient(260deg, rgb(var(--pv-dark-rgb, 10 15 24) / 0.95) 0%, rgb(var(--pv-dark-rgb, 10 15 24) / 0.8) 46%, rgb(var(--pv-dark-rgb, 10 15 24) / 0.42) 100%),
    linear-gradient(0deg, rgb(var(--pv-dark-rgb, 10 15 24) / 0.9), transparent 55%);
}
.v577-hero__title {
  margin: 0.75rem 0 0.5rem;
  max-width: 22ch;
  font-size: clamp(1.85rem, 1.2rem + 2.8vw, 3.5rem);
  line-height: 1.04;
  color: #fff;
  overflow-wrap: anywhere;
}
.v577-hero__lead { max-width: 40rem; margin: 0; color: var(--fg-2); font-size: var(--fs-lead); }
.v577-facts {
  list-style: none;
  margin: clamp(1.4rem, 1rem + 1.5vw, 2.1rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  max-width: 64rem;
}
.v577-fact {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgb(255 255 255 / 0.13);
  border-radius: 16px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.09), rgb(255 255 255 / 0.04));
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 14px 34px -22px rgb(0 0 0 / 0.8);
}
.v577-fact__icon {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  border-radius: 12px;
  color: var(--c-terra-400);
  background: color-mix(in srgb, var(--c-terra-500) 17%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-terra-400) 32%, transparent);
  stroke-width: 1.7;
}
.v577-fact__body { display: grid; min-width: 0; }
.v577-fact__label { font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.09em; color: var(--fg-2); }
.v577-fact__value { font-size: 1.04rem; line-height: 1.25; color: #fff; }
.v577-fact__sub { font-size: 0.8rem; color: var(--c-terra-300); }
@media (max-width: 799px) {
  .v577-facts { grid-template-columns: 1fr; gap: 0.6rem; }
  .v577-fact { padding: 0.75rem 0.95rem; }
}

/* ---------------------------------------------------------------- month navigation and actions */
.v577-section { padding-block: clamp(2rem, 1.3rem + 2.6vw, 3.75rem) clamp(3rem, 2rem + 3vw, 5rem); }
.v577-monthbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.v577-monthbar__step {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  justify-self: start;
  min-height: 3.1rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-raised);
  color: var(--fg);
  text-decoration: none;
  transition: border-color var(--dur-2, 0.2s) ease, transform var(--dur-2, 0.2s) ease;
}
a.v577-monthbar__step:hover { border-color: var(--accent-ink); transform: translateY(-1px); }
a.v577-monthbar__step:focus-visible { outline: 3px solid var(--focus, currentColor); outline-offset: 2px; }
.v577-monthbar__step--next { justify-self: end; text-align: end; }
.v577-monthbar__step.is-disabled { opacity: 0.38; }
.v577-monthbar__text { display: grid; }
.v577-monthbar__text small { font-size: 0.68rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-2); line-height: 1.2; }
.v577-monthbar__text strong { font-size: 0.95rem; line-height: 1.25; }
.v577-monthbar__chev { width: 1.15rem; height: 1.15rem; color: var(--accent-ink); }
[dir="rtl"] .v577-monthbar__chev { transform: scaleX(-1); }
.v577-monthbar__current {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  justify-self: center;
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
  line-height: 1.1;
  text-align: center;
}
.v577-monthbar__cal { width: 1.55rem; height: 1.55rem; color: var(--accent-ink); }
@media (max-width: 639px) {
  .v577-monthbar { grid-template-columns: 1fr 1fr; }
  .v577-monthbar__current { grid-column: 1 / -1; grid-row: 1; }
  .v577-monthbar__step { width: 100%; padding: 0.45rem 0.7rem; }
  .v577-monthbar__step--next { justify-content: flex-end; }
}

.v577-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.v577-toolbar__buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.v577-toolbar .btn .icon { width: 1.1rem; height: 1.1rem; }

/* ---------------------------------------------------------------- QR card (compact) */
.v577-qr {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 27rem;
  padding: 0.65rem 0.95rem 0.65rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-raised);
}
[dir="rtl"] .v577-qr { padding: 0.65rem 0.65rem 0.65rem 0.95rem; }
.v577-qr__code { flex: none; width: 92px; height: 92px; padding: 2px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.v577-qr__svg { width: 100%; height: 100%; }
.v577-qr__text { min-width: 0; }
.v577-qr__title { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.95rem; font-weight: 700; line-height: 1.25; }
.v577-qr__title .icon { width: 1.05rem; height: 1.05rem; color: var(--accent-ink); }
.v577-qr__caption { margin: 0.2rem 0 0; font-size: 0.82rem; line-height: 1.35; color: var(--fg-2); }
.v577-qr__url { margin: 0.3rem 0 0; font-size: 0.74rem; font-weight: 650; color: var(--accent-ink); overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .v577-toolbar { flex-direction: column; align-items: stretch; }
  .v577-qr { max-width: none; }
}

/* ---------------------------------------------------------------- lesson cards */
.v577-grid {
  list-style: none;
  margin: 0;
  padding: 0.7rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem 1rem;
}
@media (max-width: 1099px) { .v577-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .v577-grid { grid-template-columns: 1fr; gap: 1rem; } }
.v577-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 1rem;
  min-height: 6.6rem;
  padding: 1rem 1rem 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-raised);
  box-shadow: 0 1px 2px rgb(20 18 16 / 0.06), 0 12px 26px -20px rgb(20 18 16 / 0.45);
  transition: transform var(--dur-2, 0.2s) ease, box-shadow var(--dur-2, 0.2s) ease;
}
[dir="rtl"] .v577-card { padding: 1rem 1.1rem 1rem 1rem; }
.v577-card__date {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 4.3rem;
  padding-inline-end: 1rem;
  border-inline-end: 1px solid var(--line);
}
.v577-card__daynum { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.v577-card__month { margin-top: 0.35rem; font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; color: var(--fg-2); }
.v577-card__body { display: grid; gap: 0.12rem; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.v577-card__meta { display: flex; flex-wrap: wrap; gap: 0.05rem 0.65rem; margin: 0; font-size: 0.86rem; color: var(--fg-2); }
.v577-card__weekday { font-weight: 650; color: var(--fg); }
.v577-card__time { font-variant-numeric: tabular-nums; }
.v577-card__topic { display: flex; align-items: center; gap: 0.4rem; margin: 0.3rem 0 0; font-size: 0.78rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent-ink); }
.v577-card__topic .icon { width: 1.05rem; height: 1.05rem; }
/* the full title, never cut: "(Teil 1)" and "(Teil 2)" must stay readable; long German compounds break */
.v577-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--fg);
  overflow-wrap: break-word;
  hyphens: auto;
}
.v577-card__note, .v577-card__reason { margin: 0.1rem 0 0; font-size: 0.82rem; line-height: 1.35; color: var(--fg-2); }
.v577-card__arrow { width: 1.1rem; height: 1.1rem; color: var(--fg-2); opacity: 0.5; }
[dir="rtl"] .v577-card__arrow { transform: scaleX(-1); }
.v577-card__badge {
  position: absolute;
  top: -0.7rem;
  inset-inline-end: 0.9rem;
  padding: 0.16rem 0.62rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
/* the next lesson: premium accent border and glow */
.v577-card--next {
  border-color: color-mix(in srgb, var(--c-terra-500) 75%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c-terra-500) 45%, transparent), 0 0 0 5px rgb(var(--v5-glow, 255 196 20) / 0.1),
    0 20px 42px -22px rgb(var(--v5-glow, 255 196 20) / 0.6);
}
.v577-card__badge--next { color: var(--accent-on, #0b0f17); background: linear-gradient(180deg, var(--c-terra-400), var(--c-terra-500)); box-shadow: 0 6px 16px -8px rgb(var(--v5-glow, 255 196 20) / 0.9); }
/* today: green accent */
.v577-card--today { border-color: color-mix(in srgb, var(--v577-green-strong) 60%, transparent); border-inline-start: 4px solid var(--v577-green-strong); }
.v577-card--today .v577-card__daynum { color: var(--v577-green); }
.v577-card__badge--today { color: #fff; background: var(--v577-green-strong); }
/* past: muted */
.v577-card--past { opacity: 0.62; filter: grayscale(0.45); box-shadow: none; }
.v577-card--past .v577-card__daynum { color: var(--fg-2); }
.v577-card__badge--past { color: var(--fg-2); background: var(--bg-raised); border-color: var(--line-strong); }
.v577-card__badge--extra { color: var(--accent-ink); background: var(--bg-raised); border-color: color-mix(in srgb, var(--accent-ink) 45%, transparent); }
/* no lesson (holiday, company holidays, cancellation): soft red, never alarming */
.v577-card--off {
  background: color-mix(in srgb, var(--v577-red-bg) 7%, var(--bg-raised));
  border-color: color-mix(in srgb, var(--v577-red-bg) 28%, var(--line));
  box-shadow: none;
}
.v577-card--off .v577-card__daynum { color: var(--v577-red); }
.v577-card__topic--off { font-size: 0.98rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--v577-red); }
.v577-card--off .v577-card__arrow { color: var(--v577-red); opacity: 0.6; }
.v577-card--off.v577-card--past { opacity: 0.55; }
@media (hover: hover) {
  .v577-card:not(.v577-card--past):hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgb(20 18 16 / 0.06), 0 18px 34px -20px rgb(20 18 16 / 0.55); }
  .v577-card--next:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c-terra-500) 55%, transparent), 0 0 0 6px rgb(var(--v5-glow, 255 196 20) / 0.12), 0 24px 46px -22px rgb(var(--v5-glow, 255 196 20) / 0.7); }
}
.v577-empty { padding: 1.5rem; border: 1px dashed var(--line-strong); border-radius: 14px; text-align: center; color: var(--fg-2); }

/* ---------------------------------------------------------------- information cards */
.v577-info {
  list-style: none;
  margin: clamp(2rem, 1.5rem + 2vw, 3rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 1099px) { .v577-info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .v577-info { grid-template-columns: 1fr; } }
.v577-info__card { padding: 1.15rem 1.2rem 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-raised); }
.v577-info__icon { width: 2.35rem; height: 2.35rem; padding: 0.5rem; border-radius: 10px; color: var(--accent-ink); background: color-mix(in srgb, var(--accent-ink) 11%, transparent); }
.v577-info__title { margin: 0.8rem 0 0.3rem; font-size: 1rem; line-height: 1.3; }
.v577-info__text { margin: 0; font-size: 0.88rem; line-height: 1.55; color: var(--fg-2); }
.v577-stamp { margin: 1.6rem 0 0; font-size: 0.78rem; color: var(--fg-2); }

/* ---------------------------------------------------------------- call to action on the theory page */
.v577-cta {
  grid-column: 1 / -1;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.95rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--c-terra-400) 60%, transparent);
  border-radius: 16px;
  color: var(--fg);
  text-decoration: none;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c-terra-500) 20%, transparent), color-mix(in srgb, var(--c-terra-500) 6%, transparent) 60%, color-mix(in srgb, var(--c-terra-500) 12%, transparent));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), 0 18px 40px -26px rgb(var(--v5-glow, 255 196 20) / 0.75), 0 0 30px -16px rgb(var(--v5-glow, 255 196 20) / 0.6);
  transition: transform var(--dur-2, 0.2s) ease, box-shadow var(--dur-2, 0.2s) ease, border-color var(--dur-2, 0.2s) ease;
}
.v577-cta::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  animation: v577-cta-glow 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes v577-cta-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgb(var(--v5-glow, 255 196 20) / 0.32), 0 0 14px 0 rgb(var(--v5-glow, 255 196 20) / 0.18); }
  55% { box-shadow: 0 0 0 8px rgb(var(--v5-glow, 255 196 20) / 0), 0 0 26px 3px rgb(var(--v5-glow, 255 196 20) / 0.3); }
}
.v577-cta:hover { transform: translateY(-1px); border-color: var(--c-terra-400); color: var(--fg); }
/* directly under the two hero columns (the hero grid gap is meant for the columns themselves) */
@media (min-width: 900px) { .page-hero__grid > .v577-cta { margin-top: calc(var(--space-5, 1.5rem) - var(--space-8, 4rem)); } }
.v577-cta:focus-visible { outline: 3px solid var(--focus, #fff); outline-offset: 3px; }
.v577-cta__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 12px;
  color: var(--accent-on, #0b0f17);
  background: linear-gradient(180deg, var(--c-terra-400), var(--c-terra-500) 60%, var(--c-terra-600));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 8px 20px -10px rgb(var(--v5-glow, 255 196 20) / 0.9);
}
.v577-cta__icon .icon { width: 1.35rem; height: 1.35rem; stroke-width: 2; }
.v577-cta__text { display: grid; min-width: 0; }
.v577-cta__text strong { font-size: 1.05rem; line-height: 1.3; }
.v577-cta__text small { font-size: 0.86rem; color: var(--fg-2); line-height: 1.35; }
.v577-cta__arrow { margin-inline-start: auto; width: 1.25rem; height: 1.25rem; color: var(--c-terra-400); }
[dir="rtl"] .v577-cta__arrow { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) {
  .v577-cta::before { animation: none; }
  .v577-card, .v577-cta, .v577-monthbar__step { transition: none; }
}

/* ---------------------------------------------------------------- display mode (tablet / TV) */
.v577-display-page { min-height: 100vh; margin: 0; padding: 0; background: var(--c-graphite-950); color: var(--v5-text-on-dark, #f7f3ed); }
.v577-display {
  --fg: var(--v5-text-on-dark, #f7f3ed);
  --fg-2: var(--v5-muted-on-dark, #cdc5bb);
  --line: rgb(247 243 237 / 0.13);
  --line-strong: rgb(247 243 237 / 0.28);
  --bg-raised: var(--c-graphite-800);
  --accent-ink: var(--c-terra-400);
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.9rem, 2.2vh, 2rem);
  padding: clamp(1rem, 2.4vw, 2.75rem);
  background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--c-terra-500) 10%, transparent), transparent 55%), var(--c-graphite-950);
}
.v577-display__head { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.5rem); padding-bottom: clamp(0.6rem, 1.5vh, 1.2rem); border-bottom: 1px solid var(--line); }
.v577-display__logo { width: auto; height: clamp(38px, 6.5vh, 76px); }
.v577-display__heading { flex: 1; min-width: 0; }
.v577-display__eyebrow { margin: 0; font-size: clamp(0.8rem, 1.1vw, 1.15rem); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-terra-400); }
.v577-display__month { margin: 0; font-size: clamp(1.7rem, 3.4vw, 3.6rem); line-height: 1.05; color: #fff; }
.v577-display__clock { display: grid; justify-items: end; text-align: end; }
.v577-display__time { font-size: clamp(2rem, 4.3vw, 4.6rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.v577-display__date { margin-top: 0.3rem; font-size: clamp(0.85rem, 1.25vw, 1.35rem); color: var(--fg-2); }
.v577-display__layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(15rem, 23vw, 26rem); gap: clamp(1rem, 2.2vw, 2.6rem); min-height: 0; }
.v577-display__board { min-width: 0; }
.v577-grid--display { gap: clamp(1rem, 2vw, 1.8rem) clamp(0.8rem, 1.5vw, 1.5rem); padding-top: 0.9rem; }
.v577-grid--display .v577-card { font-size: clamp(1rem, 1.18vw, 1.45rem); min-height: clamp(7rem, 16vh, 12rem); padding: 1em 1em 1em 1.1em; border-radius: 1.1em; }
.v577-grid--display .v577-card__date { min-width: 4.4em; padding-inline-end: 1em; }
.v577-grid--display .v577-card__daynum { font-size: 2.6em; }
.v577-grid--display .v577-card__month { font-size: 0.72em; }
.v577-grid--display .v577-card__meta { font-size: 0.86em; }
.v577-grid--display .v577-card__topic { font-size: 0.78em; }
.v577-grid--display .v577-card__topic--off { font-size: 1em; }
.v577-grid--display .v577-card__title { font-size: 1.05em; }
.v577-grid--display .v577-card__reason, .v577-grid--display .v577-card__note { font-size: 0.82em; }
.v577-grid--display .v577-card__badge { font-size: 0.66em; }
.v577-grid--display .v577-card__arrow { width: 1.1em; height: 1.1em; }
.v577-display__side { display: flex; flex-direction: column; gap: clamp(0.8rem, 1.6vh, 1.4rem); min-width: 0; }
.v577-qr--display { flex-direction: column; align-items: center; max-width: none; padding: clamp(0.9rem, 1.6vw, 1.5rem); text-align: center; }
.v577-qr--display .v577-qr__code { width: min(100%, clamp(9rem, 16vw, 17rem)); height: auto; aspect-ratio: 1; padding: 0; }
.v577-qr--display .v577-qr__title { justify-content: center; font-size: clamp(1rem, 1.3vw, 1.35rem); }
.v577-qr--display .v577-qr__caption { font-size: clamp(0.85rem, 1vw, 1.1rem); }
.v577-qr--display .v577-qr__url { font-size: clamp(0.78rem, 0.9vw, 1rem); }
.v577-display__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(0.6rem, 1.2vh, 1rem); }
.v577-display__facts li { display: flex; align-items: center; gap: 0.8rem; padding: 0.75em 0.95em; border: 1px solid var(--line); border-radius: 14px; background: var(--c-graphite-800); font-size: clamp(0.9rem, 1vw, 1.2rem); }
.v577-display__facts span { display: grid; min-width: 0; }
.v577-display__facts small { font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-2); }
.v577-display__facts strong { line-height: 1.25; }
.v577-display__facticon { width: 1.6em; height: 1.6em; color: var(--c-terra-400); }
.v577-display__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; font-size: clamp(0.78rem, 0.95vw, 1.05rem); color: var(--fg-2); }
.v577-display__live { display: inline-flex; align-items: center; gap: 0.5em; }
.v577-display__live::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50%; background: #3fd07a; box-shadow: 0 0 10px #3fd07a; }
.v577-display__live.is-offline::before { background: #e5a84d; box-shadow: none; }
/* tablet portrait and narrow screens: one column, QR and facts side by side under the board */
@media (max-width: 1000px), (orientation: portrait) {
  .v577-display__layout { grid-template-columns: 1fr; }
  .v577-display__side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .v577-grid--display { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v577-grid--display .v577-card { font-size: clamp(0.95rem, 2vw, 1.3rem); }
}
@media (max-width: 639px) {
  .v577-display__head { flex-wrap: wrap; gap: 0.6rem 1rem; }
  .v577-display__heading { flex: 1 1 100%; order: 2; }
  .v577-display__eyebrow { letter-spacing: 0.08em; overflow-wrap: anywhere; }
  .v577-display__clock { order: 1; margin-inline-start: auto; }
  .v577-display__side { grid-template-columns: 1fr; }
  .v577-grid--display { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- A4 print (Drucken / ?print=1) */
@media print {
  .v577-hero, .v577-monthbar, .v577-toolbar, .v577-info, .v577-qr, .v577-card__badge, .v577-card__arrow, .v577-cta { display: none !important; }
  .v577-section { padding: 0 !important; }
  .v577-plan { display: grid; gap: 5mm; }
  .v577-grid { display: block !important; padding: 0 !important; border-top: 1px solid #8f877b; }
  .v577-card {
    display: grid !important;
    grid-template-columns: 30mm minmax(0, 1fr) !important;
    min-height: 0 !important;
    padding: 2mm 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #c9c2b6 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    opacity: 1 !important;
    filter: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
    color: #111 !important;
  }
  .v577-card--off { background: #fbeceb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .v577-card__date { display: flex !important; gap: 2mm; align-items: baseline; justify-content: flex-start; border: 0 !important; padding: 0 !important; min-width: 0 !important; }
  .v577-card__daynum { font-size: 15pt !important; color: #111 !important; }
  .v577-card__month { font-size: 8pt !important; margin: 0 !important; color: #4b4741 !important; }
  .v577-card__meta, .v577-card__note, .v577-card__reason { color: #4b4741 !important; font-size: 9pt !important; }
  .v577-card__weekday { color: #111 !important; }
  .v577-card__topic { color: #8a5a00 !important; font-size: 8.5pt !important; }
  .v577-card__topic--off { color: #8a2a17 !important; font-size: 10pt !important; }
  .v577-card__title { color: #111 !important; font-size: 10.5pt !important; -webkit-line-clamp: unset; display: block; }
  .v577-stamp { font-size: 9pt; color: #4b4741 !important; }
}
