:root {
  color-scheme: light;
  --ink: #102b2a;
  --muted: #68738a;
  --line: #d9e5e2;
  --surface: #ffffff;
  --page: #f3f7f6;
  --teal: #0f8b7d;
  --teal-dark: #0b3834;
  --mint: #e5f4f1;
  --amber: #f6b949;
  --danger: #c9352b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 16px 14px 28px;
}

.hero {
  background: var(--teal-dark);
  color: #fff;
  border-radius: 8px;
  padding: 22px 20px;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 4px 0 8px;
  font-size: 28px;
  line-height: 1.18;
}

.hero p {
  margin: 0;
  color: #bed9d5;
  line-height: 1.5;
}

.eyebrow {
  color: #ffffff;
  font-weight: 700;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}

.line-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.line-picker button,
.calendar-head button,
#changeDateButton {
  border: 0;
  border-radius: 7px;
  background: #f0f3f5;
  color: #344057;
  font-weight: 800;
  min-height: 44px;
}

.line-picker button.active {
  background: var(--teal);
  color: #fff;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.search-row input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfdfc;
}

.search-row button {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.date-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fbfdfc;
}

.date-summary strong {
  display: block;
  font-size: 20px;
}

.date-summary span {
  color: var(--muted);
  line-height: 1.5;
}

.error {
  border: 1px solid #f0b6b2;
  background: #fff0ef;
  color: var(--danger);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.calendar-head {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.calendar-head strong {
  text-align: center;
  font-size: 20px;
}

.week-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.week-row {
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
}

.day-cell {
  min-height: 54px;
  border: 0;
  border-radius: 7px;
  background: #f1f4f6;
  color: var(--ink);
  padding: 6px 2px;
  text-align: center;
}

.day-cell.blank {
  background: transparent;
}

.day-cell.selected {
  background: var(--teal);
  color: #fff;
}

.day-cell.holiday:not(.selected) {
  background: #fff4d8;
}

.day-cell.adjusted_workday:not(.selected) {
  background: var(--mint);
}

.day-number {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.day-label {
  font-size: 12px;
  margin-top: 3px;
}

.result-stack {
  display: grid;
  gap: 12px;
}

.result-card {
  border: 1px solid #a9d9d2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.result-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.result-code {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
}

.result-meta {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}

.warning {
  color: #8a5b00;
  background: #fff6df;
  padding: 10px 14px;
  line-height: 1.5;
}

.train-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.15fr;
  align-items: center;
  min-height: 48px;
  border-top: 1px solid var(--line);
  padding: 0 14px;
  gap: 8px;
}

.train-row.header {
  background: var(--mint);
  border-top: 0;
  font-weight: 900;
}

.train-row.missing {
  color: var(--danger);
}

@media (min-width: 560px) {
  .search-row {
    grid-template-columns: minmax(0, 1fr) 144px;
  }
}
