.timetable-page #timetable {
  margin: 0 auto;
  max-width: 1120px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.timetable-page #timetable .hgroup {
  margin-bottom: 36px;
  text-align: center;
}

.timetable-page #timetable .hgroup h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 0.95;
  margin-bottom: 12px;
}

.timetable-page #timetable .hgroup p {
  font-size: 1rem;
  line-height: 1.8;
}

.timetable-board {
  background: #ede7d3;
  border: 1px solid #000;
  border-radius: 32px;
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.08);
  padding: 32px clamp(16px, 3.5vw, 40px) 36px;
}

.timetable-day-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 26px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.timetable-day-tab {
  appearance: none;
  background: #f7f3e7;
  border: 1px solid #000;
  border-radius: 999px;
  color: #7f7b71;
  cursor: pointer;
  font: inherit;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.timetable-day-tab:hover {
  transform: translateY(-2px);
}

.timetable-day-tab.is-active {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  color: #000;
}

.timetable-day-tab {
  display: grid;
  flex: 1 1 0;
  gap: 2px;
  min-width: 0;
  padding: 18px 24px;
  text-align: center;
}

.timetable-day-tab.is-active {
  background: #fff8ea;
}

.timetable-day-tab__label {
  font-size: 0.95rem;
  font-weight: 700;
}

.timetable-day-tab__date {
  font-size: 16px;
  line-height: 1;
}

.timetable-day-tab__weekday {
  font-size: 0.95rem;
  font-weight: 700;
}

.timetable-stage-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.timetable-stage-head__note {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.timetable-grid {
  --minute-height: 1.7px;
  display: grid;
  gap: 18px;
  grid-template-columns: 68px minmax(0, 1fr);
}

.timetable-times,
.timetable-track {
  height: calc(var(--timeline-duration) * var(--minute-height));
  position: relative;
}

.timetable-time {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 800;
  left: 0;
  line-height: 1;
  position: absolute;
  top: calc(var(--offset) * var(--minute-height));
  transform: translateY(-50%);
}

.timetable-times .timetable-time:first-child {
  transform: translateY(0);
}

.timetable-times .timetable-time:last-child {
  transform: translateY(-100%);
}

.timetable-track {
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.timetable-hour-line {
  border-top: 1px solid rgba(0, 0, 0, 0.22);
  left: 0;
  position: absolute;
  right: 0;
  top: calc(var(--offset) * var(--minute-height));
}

.timetable-card {
  background: #e98796;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: calc(var(--duration) * var(--minute-height));
  justify-content: center;
  left: 0;
  min-height: 32px;
  padding: 10px 18px;
  position: absolute;
  right: 8px;
  top: calc(var(--start) * var(--minute-height));
}

.timetable-card.is-open {
  background: #df2428;
  color: #fff;
}

.timetable-card.is-accent {
  background: #efad62;
}

.timetable-card.is-closing {
  background: #d86e80;
  color: #fff;
}

.timetable-card__time {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 8px;
  max-width: fit-content;
  padding: 7px 14px;
}

.timetable-card.is-open .timetable-card__time,
.timetable-card.is-closing .timetable-card__time {
  color: #000;
}

.timetable-card__label {
  align-self: flex-start;
  background: #ff7b30;
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 8px;
  padding: 5px 10px;
}

.timetable-card__title {
  font-size: clamp(1rem, 2.3vw, 1.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}

.timetable-card__note {
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 6px 0 0;
}

.timetable-empty {
  font-size: 1rem;
  left: 0;
  line-height: 1.8;
  position: absolute;
  right: 0;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
}

.timetable-caption {
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 28px 0 0;
  text-align: center;
}

.timetable-page #timetable .normal-button {
  margin: 40px auto 0;
}

@media screen and (min-width: 1182px) {
  .timetable-page #timetable {
    max-width: 760px;
    padding: 0 16px;
  }
}

@media screen and (max-width: 767px) {
  .timetable-page #timetable {
    margin-bottom: 80px;
    padding: 0 12px;
  }

  .timetable-board {
    border-radius: 24px;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.06);
    padding: 20px 14px 24px;
  }

  .timetable-day-tab {
    flex: 0 0 160px;
    padding: 14px 16px;
  }

  .timetable-stage-head {
    justify-content: flex-start;
    margin-bottom: 22px;
  }

  .timetable-grid {
    --minute-height: 1.4px;
    gap: 12px;
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .timetable-time {
    font-size: 0.95rem;
  }

  .timetable-card {
    border-radius: 14px;
    padding: 9px 12px 9px 14px;
    right: 0;
  }

  .timetable-card__time {
    font-size: 0.78rem;
    margin-bottom: 6px;
    padding: 6px 10px;
  }

  .timetable-card__label {
    font-size: 0.68rem;
  }

  .timetable-card__title {
    font-size: 0.95rem;
  }
}
