:root {
  /* Shared design tokens so the theme can be changed from one place. */
  --bg: #14181f;
  --bg-gradient-top: #181d25;
  --bg-gradient-bottom: #101318;
  --bg-glow: rgba(111, 124, 255, 0.18);
  --panel: rgba(24, 29, 38, 0.92);
  --panel-soft: rgba(32, 38, 49, 0.74);
  --border: rgba(255, 255, 255, 0.08);
  --text: #edf2ff;
  --muted: #9ba6bd;
  --accent: #6f7cff;
  --accent-strong: #5162ff;
  --accent-soft: rgba(111, 124, 255, 0.22);
  --success: #62d39f;
  --surface-tint-1: rgba(255, 255, 255, 0.03);
  --surface-tint-2: rgba(255, 255, 255, 0.04);
  --surface-tint-3: rgba(255, 255, 255, 0.05);
  --surface-tint-4: rgba(255, 255, 255, 0.06);
  --field-border: rgba(255, 255, 255, 0.07);
  --field-bg: #252c39;
  --focus-border: rgba(111, 124, 255, 0.7);
  --status-bg: rgba(98, 211, 159, 0.09);
  --status-border: rgba(98, 211, 159, 0.2);
  --metric-bg: rgba(255, 255, 255, 0.03);
  --timeline-grid-bg: rgba(255, 255, 255, 0.03);
  --timeline-grid-line: rgba(255, 255, 255, 0.06);
  --timeline-available-bg: rgba(98, 211, 159, 0.22);
  --timeline-available-border: rgba(132, 230, 181, 0.18);
  --timeline-occupied-bg: rgba(255, 104, 104, 0.6);
  --timeline-occupied-border: rgba(255, 146, 146, 0.55);
  --timeline-occupied-inner: rgba(255, 255, 255, 0.05);
  --timeline-occupied-label: #ffffff;
  --timeline-search-marker: rgba(255, 255, 255, 0.45);
  --timeline-search-marker-shadow: rgba(111, 124, 255, 0.18);
  --brand-text: #0d1020;
  --button-text-strong: #0d1020;
  --popup-bg: #151a22;
  --calendar-bg: #1b2230;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

/* Light mode overrides only the palette variables.
   The component layout stays the same, which keeps the UI explainable. */
body[data-theme="light"] {
  --bg: #eef3f8;
  --bg-gradient-top: #f7fafc;
  --bg-gradient-bottom: #e7edf5;
  --bg-glow: rgba(111, 124, 255, 0.1);
  --panel: rgba(255, 255, 255, 0.84);
  --panel-soft: rgba(241, 245, 251, 0.92);
  --border: rgba(24, 36, 58, 0.1);
  --text: #172033;
  --muted: #5f6d85;
  --accent: #5268ff;
  --accent-strong: #3e55ef;
  --accent-soft: rgba(82, 104, 255, 0.16);
  --success: #1d8d62;
  --surface-tint-1: rgba(23, 32, 51, 0.04);
  --surface-tint-2: rgba(23, 32, 51, 0.06);
  --surface-tint-3: rgba(23, 32, 51, 0.08);
  --surface-tint-4: rgba(23, 32, 51, 0.1);
  --field-border: rgba(23, 32, 51, 0.12);
  --field-bg: #f4f7fc;
  --focus-border: rgba(82, 104, 255, 0.45);
  --status-bg: rgba(29, 141, 98, 0.1);
  --status-border: rgba(29, 141, 98, 0.22);
  --metric-bg: rgba(23, 32, 51, 0.05);
  --timeline-grid-bg: rgba(23, 32, 51, 0.04);
  --timeline-grid-line: rgba(23, 32, 51, 0.08);
  --timeline-available-bg: rgba(29, 141, 98, 0.18);
  --timeline-available-border: rgba(29, 141, 98, 0.18);
  --timeline-occupied-bg: rgba(218, 87, 87, 0.52);
  --timeline-occupied-border: rgba(208, 78, 78, 0.42);
  --timeline-occupied-inner: rgba(255, 255, 255, 0.22);
  --timeline-occupied-label: #172033;
  --timeline-search-marker: rgba(23, 32, 51, 0.42);
  --timeline-search-marker-shadow: rgba(23, 32, 51, 0.12);
  --brand-text: #ffffff;
  --button-text-strong: #ffffff;
  --popup-bg: #ffffff;
  --calendar-bg: #ffffff;
  --shadow: 0 24px 80px rgba(29, 44, 71, 0.14);
}

* {
  /* Makes padding and borders stay inside declared element widths. */
  box-sizing: border-box;
}

html,
body {
  /* Page-wide background and default typography. */
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, var(--bg-glow), transparent 24%),
    linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--bg-gradient-bottom) 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

body {
  /* Outer breathing room around the whole interface. */
  padding: 14px;
}

button,
input,
select {
  /* Ensures form controls inherit the same font as the page. */
  font: inherit;
}

.app-shell {
  /* Behaves like a full app shell instead of a centered landing-page card. */
  width: 100%;
  min-height: calc(100vh - 28px);
}

.topbar {
  /* Main toolbar layout: brand, nav, and utility action. */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand-group {
  /* Aligns the icon and title block horizontally. */
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  /* Small visual identity tile. */
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8fc0ff);
  color: var(--brand-text);
  font-weight: 800;
  font-size: 1.25rem;
}

.brand-group h1,
.search-heading h2 {
  /* Remove default heading spacing so alignment stays tight. */
  margin: 0;
}

.eyebrow {
  /* Reusable small uppercase label used above titles. */
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.topnav {
  /* Compact nav pill background similar to app dashboards. */
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: 18px;
  background: var(--surface-tint-1);
}

.topnav a,
.ghost-button,
.shortcut-chip,
.search-button {
  /* Shared interaction polish for clickable elements. */
  border: 0;
  border-radius: 16px;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.topnav a {
  /* Neutral nav links become highlighted through the active state below. */
  padding: 12px 18px;
  color: var(--muted);
}

.topnav a.active,
.topnav a:hover,
.ghost-button:hover,
.shortcut-chip:hover,
.search-button:hover {
  transform: translateY(-1px);
}

.topnav a.active {
  /* Indicates the current section focus in the top nav. */
  background: rgba(111, 124, 255, 0.18);
  color: var(--text);
}

.ghost-button {
  /* Secondary low-emphasis button in the header. */
  padding: 12px 18px;
  background: var(--surface-tint-2);
  color: var(--text);
}

.content {
  /* Vertical stack of the search panel and the map section. */
  display: grid;
  gap: 18px;
  margin-top: 0px;
  min-height: calc(100vh - 28px);
}

.search-panel,
.building-panel {
  /* Shared glass-card treatment used throughout the UI. */
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.search-panel {
  /* Outer container for all search-related controls and messaging. */
  padding: 22px;
  border-radius: 28px;
}

.search-heading {
  /* Heading and explanatory text sit side by side on wide screens. */
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.search-heading-meta {
  /* Groups helper text and the theme toggle in the search panel header. */
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 12px;
}

.search-heading-meta .theme-toggle {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
}

.search-copy,
.map-overlay p,
.status-banner {
  /* Shared muted paragraph style for helper text. */
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.search-controls {
  /* Two-column grid so start/end stay together and duration/search form
     a second row in the narrower desktop sidebar layout. */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.search-controls label {
  /* Keeps label text and form field vertically grouped. */
  display: grid;
  gap: 8px;
}

.room-type-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.search-controls .room-type-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--field-border);
  background: var(--panel-soft);
  cursor: pointer;
  margin: 0;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.search-controls .room-type-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.search-controls .room-type-option span {
  position: relative;
  padding-left: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.search-controls .room-type-option input:checked + span {
  color: var(--text);
}

.search-controls .room-type-option:hover {
  transform: translateY(-1px);
  border-color: var(--focus-border);
}

.search-controls .room-type-option:focus-within {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-controls .room-type-option:has(input:checked) {
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--panel-soft) 42%);
  border-color: var(--focus-border);
}

.datetime-picker {
  /* Input and calendar button share one field shell. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 18px;
  border: 1px solid var(--field-border);
  background: var(--panel-soft);
  overflow: hidden;
}

.search-controls span {
  /* Small caption above each control. */
  font-size: 0.92rem;
  color: var(--muted);
}

.search-controls input,
.search-controls select {
  /* Dashboard-like field styling with dark surfaces. */
  width: 100%;
  padding: 16px 18px;
  color: var(--text);
  border-radius: 18px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  outline: none;
}

.search-controls select option {
  background: var(--field-bg);
  color: var(--text);
}

.datetime-picker input {
  border: 0;
  background: transparent;
  border-radius: 0;
}

.datetime-trigger {
  /* Explicit picker button for users who expect a calendar affordance. */
  align-self: stretch;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--field-border);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
}

.search-controls input:focus,
.search-controls select:focus {
  /* Stronger focus treatment helps keyboard navigation and accessibility. */
  border-color: var(--focus-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.datetime-picker:focus-within {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.datetime-picker input:focus {
  box-shadow: none;
}

.datetime-trigger:hover,
.datetime-trigger:focus-visible {
  color: var(--text);
}

.flatpickr-calendar {
  background: var(--calendar-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 1;
}

.flatpickr-months,
.flatpickr-innerContainer,
.flatpickr-rContainer,
.flatpickr-days,
.flatpickr-time,
.flatpickr-weekdays {
  background: var(--calendar-bg);
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year,
.flatpickr-weekdays,
.flatpickr-weekday,
.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
  color: var(--text);
}

.flatpickr-day {
  color: var(--text);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--muted);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.search-button {
  /* Primary call to action. */
  align-self: end;
  grid-column: 1 / -1;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent), #8d84ff);
  color: var(--button-text-strong);
  font-weight: 800;
  cursor: pointer;
}

.shortcut-row {
  /* Preset chips wrap naturally on smaller screens. */
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.shortcut-chip {
  /* Quick action buttons for predefined date ranges. */
  padding: 12px 16px;
  background: var(--surface-tint-2);
  color: var(--text);
  cursor: pointer;
}

.status-banner {
  /* Gives feedback after search or preset interactions. */
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--status-bg);
  border: 1px solid var(--status-border);
}

.map-section {
  /* The map area is now a single full-width frame. */
  display: block;
  min-height: min(78vh, 920px);
}

.map-frame {
  /* Relative positioning allows the info overlay to sit on top of the map. */
  position: relative;
  min-height: min(78vh, 920px);
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

#map {
  /* The Leaflet map fills the entire frame. */
  width: 100%;
  height: 100%;
  min-height: min(78vh, 920px);
}

@media (min-width: 1101px) {
  /* Desktop layout: keep the full search panel on the left and let the map
     occupy the wider right column. */
  .content {
    height: calc(100vh - 28px);
    grid-template-columns: 520px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .search-panel {
    align-self: stretch;
    overflow: auto;
  }

  .map-section,
  .map-frame,
  #map {
    min-height: 0;
    height: 100%;
  }
}

.building-panel {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 500;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: stretch;
  gap: 16px;
  width: clamp(320px, 34vw, 560px);
  max-width: calc(100% - 36px);
  max-height: calc(100% - 36px);
  padding: 18px 20px;
  border-radius: 24px;
  overflow: hidden;
  min-height: 0;
}

.building-panel.is-empty {
  /* The empty state is just an instructional card, so it should size itself
     from the viewport instead of reusing the much wider timeline layout. */
  width: clamp(280px, 24vw, 380px);
  max-width: min(calc(100% - 36px), 380px);
  max-height: fit-content;
}

@media (min-width: 1101px) and (max-width: 1500px) {
  /* On laptop-sized non-mobile screens, slim the floating panel down so the
     initial timeline viewport shows roughly two hours instead of three. */
  .building-panel {
    width: clamp(300px, 28vw, 420px);
  }

  .building-panel.is-empty {
    width: clamp(260px, 20vw, 320px);
    max-width: min(calc(100% - 36px), 320px);
  }
}

@media (min-width: 1501px) {
  /* On large external monitors, widen the floating panel again so the initial
     timeline viewport expands back toward roughly three visible hours. */
  .building-panel {
    width: clamp(420px, 40vw, 760px);
  }

  .building-panel.is-empty {
    width: clamp(320px, 26vw, 460px);
    max-width: min(calc(100% - 36px), 460px);
  }
}

.building-panel.is-empty .timeline-shell {
  display: none;
}

.building-panel.is-empty .panel-close {
  display: none;
}

.building-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.panel-close {
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--surface-tint-4);
  color: var(--text);
  cursor: pointer;
}

.building-panel-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.building-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.building-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-tint-3);
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.timeline-header,
.timeline-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.timeline-header {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  min-height: 0;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: auto;
}

.timeline-section-heading {
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 4px;
}

.timeline-section-empty {
  /* Explicit empty-state label for Available/Unavailable sections. */
  color: var(--muted);
  font-size: 1.5rem;
  font-style: italic;
  padding: 4px 0 8px;
}

.timeline-room-label {
  display: grid;
  gap: 4px;
}

.timeline-room-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.timeline-room-link:hover strong,
.timeline-room-link:focus-visible strong {
  text-decoration: underline;
}

.timeline-room-label strong {
  font-size: 0.96rem;
}

.timeline-room-label span {
  color: var(--muted);
  font-size: 0.84rem;
}

.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: auto;
}

@media (hover: none) and (pointer: coarse) {
  /* Touch devices now use explicit JS gesture routing for the timeline, so the
     browser should not try to infer its own competing pan direction here. */
  .timeline-scroll {
    touch-action: none;
  }
}

.timeline-grid {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 180px;
  width: max-content;
  min-width: max-content;
  min-height: 74px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, var(--timeline-grid-line) 1px, transparent 1px) 0 0 / 180px 100%,
    var(--timeline-grid-bg);
  overflow: hidden;
}

.timeline-grid.timeline-hours {
  min-height: 32px;
  background:
    linear-gradient(90deg, var(--timeline-grid-line) 1px, transparent 1px) 0 0 / 180px 100%;
}

.timeline-hour {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 10px;
  min-width: 180px;
}

.timeline-slot {
  min-width: 180px;
}

.timeline-search-marker {
  /* Highlight the selected search range with two vertical guide lines. */
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--timeline-search-marker);
  box-shadow: 0 0 0 1px var(--timeline-search-marker-shadow);
  pointer-events: none;
  z-index: 2;
}

.timeline-empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.timeline-segment {
  position: absolute;
  top: 10px;
  bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
  pointer-events: none;
}

.timeline-segment-available {
  background: var(--timeline-available-bg);
  border: 1px solid var(--timeline-available-border);
}

.timeline-segment-occupied {
  background: var(--timeline-occupied-bg);
  border: 1px solid var(--timeline-occupied-border);
  box-shadow: inset 0 0 0 1px var(--timeline-occupied-inner);
}

.timeline-segment-label {
  /* Show the event title directly inside occupied segments when space allows. */
  display: block;
  padding: 8px 10px;
  color: var(--timeline-occupied-label);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.timeline-segment-tooltip {
  /* Floating popup for truncated occupied-event titles on hover. */
  position: fixed;
  z-index: 2000;
  max-width: min(320px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--popup-bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  line-height: 1.35;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  /* On desktop we re-enable direct interaction on segments so hover tooltips
     still work, while touch devices keep smooth scrolling priority. */
  .timeline-segment {
    pointer-events: auto;
  }
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  /* Restyles Leaflet popups so they match the dark theme. */
  background: var(--popup-bg);
  color: var(--text);
}

.room-popup h4 {
  /* Tight popup heading spacing. */
  margin: 0 0 6px;
}

.room-popup p {
  /* Popup description styling. */
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1100px) {
  /* Tablet layout: stack major sections vertically and reduce column count. */
  .topbar,
  .search-heading,
  .map-section {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    justify-content: stretch;
  }

  .topnav {
    overflow-x: auto;
  }

  .search-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-heading-meta {
    justify-items: start;
  }

  .map-section {
    min-height: auto;
  }

  .building-panel {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    max-height: min(58vh, 520px);
    margin: 0;
    padding: 16px 18px;
  }

  .building-panel.is-empty {
    width: auto;
    max-width: none;
    max-height: fit-content;
  }
}

@media (max-width: 720px) {
  /* Mobile layout: simplify spacing and keep the map readable. */
  body {
    padding: 12px;
  }

  .topbar,
  .search-panel,
  .building-panel {
    border-radius: 22px;
  }

  .search-controls {
    grid-template-columns: 1fr;
  }

  .brand-group {
    align-items: flex-start;
  }

  .map-frame,
  #map {
    min-height: 280px;
  }

  .building-panel.panel-detached {
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    margin-top: 12px;
    left: auto;
    right: auto;
    bottom: auto;
  }

  .building-panel:not(.panel-detached) {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 14px;
    padding: 14px 16px;
    max-height: min(56vh, 460px);
  }

  .building-panel:not(.panel-detached).is-empty {
    max-height: fit-content;
  }

  .building-panel-header {
    gap: 12px;
  }

  .building-panel-copy {
    font-size: 0.95rem;
  }

  .timeline-shell {
    gap: 8px;
  }

  .timeline-body {
    gap: 10px;
  }

  .timeline-header,
  .timeline-row {
    grid-template-columns: 1fr;
  }

  .timeline-room-label {
    gap: 2px;
  }

  .timeline-grid {
    grid-auto-columns: 140px;
    min-height: 64px;
    background:
      linear-gradient(90deg, var(--timeline-grid-line) 1px, transparent 1px) 0 0 / 140px 100%,
      var(--timeline-grid-bg);
  }

  .timeline-grid.timeline-hours {
    background:
      linear-gradient(90deg, var(--timeline-grid-line) 1px, transparent 1px) 0 0 / 140px 100%;
  }

  .timeline-hour,
  .timeline-slot {
    min-width: 140px;
  }

  .timeline-segment {
    top: 8px;
    bottom: 8px;
  }
}
