:root {
  color-scheme: light;
  --ink: #101d42;
  --ink-soft: #46516f;
  --paper: #f5f3ee;
  --surface: #ffffff;
  --line: #dcded8;
  --brand: #154a8a;
  --brand-dark: #0d3264;
  --official: #154a8a;
  --official-soft: #e7eff9;
  --free: #006c5b;
  --free-soft: #e2f4ed;
  --warning: #8a5200;
  --warning-soft: #fff2d6;
  --danger: #a22b32;
  --shadow: 0 18px 50px rgb(16 29 66 / 9%);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select { font: inherit; }

button,
select { cursor: pointer; }

a { color: inherit; }

[hidden] { display: none !important; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.skip-link:focus { transform: translateY(0); }

.language-button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-weight: 800;
}

.language-button:hover,
.language-button:focus-visible { background: rgb(255 255 255 / 12%); }

.hero {
  overflow: hidden;
  padding: 18px 0 76px;
  background:
    radial-gradient(circle at 85% 10%, rgb(89 159 210 / 25%), transparent 28%),
    linear-gradient(135deg, #101d42 0%, #153d70 100%);
  color: white;
}

.language-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 38px;
}

.hero-grid { display: grid; }

.eyebrow,
.step-label {
  margin: 0 0 8px;
  color: #b9d7f2;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 9vw, 5rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: #dce9f5;
  font-size: clamp(1rem, 2.5vw, 1.22rem);
}

.app-layout {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 28px;
  margin-top: -38px;
  padding-bottom: 70px;
}

.search-panel,
.results-panel {
  border: 1px solid rgb(16 29 66 / 8%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-panel { padding: 22px; }

.results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.results-heading h2 {
  margin-bottom: 0;
  font-family: Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.025em;
}

.search-panel .step-label,
.results-panel .step-label { color: var(--brand); }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 24px 0 20px;
  padding: 4px;
  border-radius: 12px;
  background: #edf0f3;
}

.segment {
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 750;
}

.segment.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgb(16 29 66 / 10%);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(21 74 138 / 25%);
  outline-offset: 2px;
  border-color: var(--brand);
}

.range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.range-fields .field,
.range-fields input[type="time"] { min-width: 0; }

.range-fields input[type="time"] { padding-inline: 8px; }

.search-panel hr {
  height: 1px;
  margin: 22px 0;
  border: 0;
  background: var(--line);
}

.legend {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: .8rem;
}

.legend > span { display: flex; gap: 8px; align-items: center; }

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.official { background: var(--official); }
.legend-dot.free { background: var(--free); }

.results-panel {
  min-width: 0;
  padding: 22px;
  box-shadow: none;
}

.schedule-date {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: .86rem;
  text-align: right;
}

.notice {
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid #eac57d;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: .9rem;
}

.room-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.room-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.room-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--free);
}

.room-card.is-official::before { background: var(--official); }

.room-card:hover {
  transform: translateY(-2px);
  border-color: #bcc5ce;
  box-shadow: 0 12px 30px rgb(16 29 66 / 8%);
}

.room-main { padding: 18px 18px 15px 21px; }

.room-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.room-card h3 {
  margin-bottom: 3px;
  font-family: Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.2;
}

.room-location {
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: .84rem;
}

.badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--free-soft);
  color: var(--free);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.is-official .badge { background: var(--official-soft); color: var(--official); }

.availability-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: baseline;
  margin-bottom: 2px;
}

.availability-line strong { font-size: 1.03rem; }

.availability-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: .84rem;
}

.room-details { border-top: 1px solid var(--line); }

.room-details summary {
  padding: 12px 18px 12px 21px;
  color: var(--brand);
  font-size: .82rem;
  font-weight: 750;
  list-style-position: inside;
  cursor: pointer;
}

.timeline {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 2px 18px 16px 40px;
  list-style: none;
}

.timeline li { position: relative; font-size: .82rem; }

.timeline li::before {
  content: "";
  position: absolute;
  top: .48em;
  left: -17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ba3b2;
}

.timeline li.official::before { background: var(--official); }
.timeline-time { font-weight: 800; }
.timeline-label { display: block; color: var(--ink-soft); }

.state-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 50px 22px;
  border: 1px dashed #c9ced3;
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  text-align: center;
}

.state-card p { max-width: 430px; margin-bottom: 0; }
.error-state strong { color: var(--danger); }

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #d9e1e8;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.primary-button {
  min-height: 42px;
  padding: 9px 17px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 750;
}

.site-footer {
  padding: 30px 0;
  background: var(--ink);
  color: #dce4ee;
}

.footer-grid { display: grid; gap: 18px; }

.site-footer p {
  max-width: 760px;
  margin-bottom: 0;
  color: #bfc9d8;
  font-size: .82rem;
}

.site-footer a { font-size: .84rem; font-weight: 750; }

@media (max-width: 430px) {
  .range-fields { grid-template-columns: 1fr; }
}

@media (min-width: 720px) {
  .shell { width: min(1180px, calc(100% - 56px)); }
  .app-layout { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .search-panel { position: sticky; top: 18px; }
  .results-panel { padding: 28px; }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr auto; align-items: center; }
}

@media (min-width: 1050px) {
  .app-layout { grid-template-columns: 330px minmax(0, 1fr); gap: 34px; }
  .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
