:root {
  color-scheme: light dark;
  --bg: #0b1220;
  --panel: #111827;
  --text: #f9fafb;
  --muted: #d1d5db;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --outline: #f59e0b;
  --card: #1f2937;
  --ok: #16a34a;
  --hall-count: 6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  line-height: 1.5;
  background: linear-gradient(180deg, var(--bg), #020617);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -100%;
  background: #ffffff;
  color: #000000;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  z-index: 50;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header,
main,
.site-footer {
  width: min(1760px, 98%);
  margin-inline: auto;
}

.site-header {
  padding: 1rem 0 0.5rem;
}

.site-header h1 {
  font-size: clamp(1.4rem, 2vw + 1rem, 2.1rem);
  margin: 0;
}

.source-note a {
  color: var(--accent);
}

.panel {
  background: color-mix(in srgb, var(--panel) 92%, black);
  border: 1px solid #334155;
  border-radius: 0.8rem;
  padding: 1.05rem;
  margin-block: 1rem;
}

.hint {
  color: var(--muted);
  margin-top: 0;
}

.filters {
  display: grid;
  gap: 0.75rem;
}

fieldset {
  margin: 0;
  border: 1px solid #475569;
  border-radius: 0.7rem;
  padding: 0.75rem;
}

legend {
  padding-inline: 0.25rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-button {
  border: 1px solid #64748b;
  background: #1e293b;
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.filter-button:hover {
  background: #334155;
}

.filter-button.is-active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #041014;
  font-weight: 700;
}

input[type="search"] {
  width: min(28rem, 100%);
  background: #0f172a;
  color: var(--text);
  border: 1px solid #64748b;
  border-radius: 0.55rem;
  padding: 0.6rem 0.7rem;
}

.status,
.offline-status {
  margin-bottom: 0;
}

.offline-status {
  color: #bfdbfe;
}

.calendar-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.fahrplan {
  border: 1px solid #334155;
  border-radius: 0.7rem;
  background: #0a1222;
  overflow: hidden;
}

.fahrplan-scroll {
  overflow-x: auto;
}

.fahrplan-room-picker {
  display: none;
}

.room-picker-button {
  border: 1px solid #415274;
  background: #1a2741;
  color: #dbe7ff;
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.room-picker-button.is-active {
  background: #c7cfe6;
  color: #1f2937;
  border-color: #c7cfe6;
  font-weight: 700;
}

.fahrplan-canvas {
  --time-col-width: 4.2rem;
  --room-min-width: 14rem;
  --grid-height: 40rem;
  min-width: calc(var(--time-col-width) + (6 * var(--room-min-width)));
}

.fahrplan-head {
  display: grid;
  grid-template-columns: var(--time-col-width) repeat(6, minmax(var(--room-min-width), 1fr));
  background: #111b2f;
  border-bottom: 1px solid #334155;
}

.fahrplan-corner,
.hall-header {
  padding: 0.45rem 0.35rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #cfd8f0;
  border-right: 1px solid #334155;
}

.hall-header:last-child {
  border-right: 0;
}

.fahrplan-body {
  display: grid;
  grid-template-columns: var(--time-col-width) 1fr;
}

.time-scale {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  height: var(--grid-height);
  border-right: 1px solid #334155;
  background: #0f192d;
}

.time-scale li {
  position: absolute;
  right: 0.35rem;
  transform: translateY(-50%);
  color: #b8c5e4;
  font-size: 0.76rem;
  white-space: nowrap;
}

.room-columns {
  display: grid;
  grid-template-columns: repeat(6, minmax(var(--room-min-width), 1fr));
}

.room-track {
  position: relative;
  height: var(--grid-height);
  border-right: 1px solid #334155;
  background: #0c1426;
  overflow: hidden;
}

.room-track:last-child {
  border-right: 0;
}

.room-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #23314a;
}

.fahrplan-event {
  position: absolute;
  background: #c7cfe6;
  border: 1px solid #9da8cc;
  border-radius: 0.45rem;
  padding: 0.34rem 0.48rem;
  overflow: hidden;
}

.fahrplan-event .event-title-link {
  color: #1f2937;
  font-size: 0.92rem;
  line-height: 1.18;
  font-weight: 700;
}


.day-column {
  background: var(--card);
  border: 1px solid #475569;
  border-radius: 0.75rem;
  padding: 0.7rem;
}

.day-column h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.event-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.65rem;
  padding: 0.85rem;
}

.event-item--timed {
  border-color: #0ea5e9;
  box-shadow: inset 0 0 0 1px #0ea5e9;
}

.event-item h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.time-chip {
  display: inline-block;
  border: 1px solid #0284c7;
  color: #dbeafe;
  background: #082f49;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
}

.time-tba {
  border-color: #f59e0b;
  background: #3f2b05;
  color: #fde68a;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.untimed-heading {
  margin-bottom: 0.45rem;
}

.event-item a {
  color: #7dd3fc;
}

.event-title-link {
  color: #bae6fd;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.38;
  font-size: clamp(1rem, 0.92rem + 0.5vw, 1.25rem);
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

.event-title-link:hover,
.event-title-link:focus-visible {
  text-decoration: underline;
}

.hall-chip {
  margin: 0.35rem 0 0;
  display: inline-block;
  padding: 0.12rem 0.52rem;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
}

.site-footer {
  padding: 1rem 0 1.5rem;
}

.export-row {
  margin-top: 0.85rem;
}

:focus-visible {
  outline: 3px solid var(--outline);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  .fahrplan-room-picker {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.5rem 0.55rem;
    border-bottom: 1px solid #334155;
    background: #0f192e;
  }

  .room-picker-button {
    padding: 0.42rem 0.76rem;
    font-size: 0.84rem;
  }

  .fahrplan-canvas {
    --time-col-width: 3.4rem;
    --room-min-width: 11rem;
    min-width: calc(var(--time-col-width) + (6 * var(--room-min-width)));
  }

  .hall-hidden-mobile {
    display: none;
  }

  .event-title-link {
    font-size: 1rem;
  }
}
