.timetable-page {
  background: var(--bg-sky);
}

.timetable-page #header {
  position: static;
}

.timetable-tool {
  padding: 28px 0 64px;
}

.timetable-actions {
  width: min(1080px, calc(100vw - 24px));
  margin: 0 auto 20px;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.timetable-actions .retro-btn {
  min-width: 0;
  min-height: 0;
  padding: 0 14px;
  border: none;
  border-top: 7px solid #f8b300;
  background: #fed400;
  color: #231815;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 0.74;
  box-shadow: none;
}

.timetable-actions .timetable-save {
  background: #e8380d;
  border-top-color: #ec6800;
  /* color: #fff; */
}

.timetable-export-shell {
  --poster-scale: 1;
  padding: 0;
  border: 0;
  width: min(1080px, calc(100vw - 24px));
  margin: 0 auto;
  overflow: visible;
}

#poster {
  width: 1080px;
  height: 1350px;
  margin: 0 auto;
  padding: 46px 52px 64px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #13a0e9;
  color: #231815;
  font-family: var(--font-sans);
  image-rendering: auto;
}

.timetable-header {
  position: relative;
  text-align: center;
  margin-bottom: 16px;
}

.timetable-brand-block {
  text-align: center;
  width: 100%;
}

.timetable-kicker {
  display: inline-block;
  margin: 0 0 9px;
  padding: 0 6px;
  background: #fed400;
  border-top: 10px solid #f8b300;
  font-size: 25px;
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: 0;
}

.timetable-logo-title {
  margin: 0;
  display: block;
  width: 100%;
  text-align: center;
  line-height: 0;
}

.timetable-logo-title span {
  display: inline-block;
  padding: 0 8px;
  background: #fed400;
  border-top: 19px solid #fff;
  font-size: 52px;
  font-weight: 400;
  line-height: 0.76;
  letter-spacing: 0;
  white-space: nowrap;
}

.timetable-title-block {
  position: absolute;
  top: 7px;
  right: 0;
  width: auto;
  text-align: right;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: #fed400;
  border-top: 7px solid #f8b300;
  color: #231815;
  font-size: 34px;
  font-weight: 400;
  line-height: 0.74;
  box-shadow: none;
}

.timetable-title-block span {
  display: inline-block;
  font-weight: 400;
  line-height: inherit;
}

#poster.is-exporting {
  padding: 46px 52px 64px !important;
}

.timetable-info-strip,
.timetable-footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.timetable-info-strip {
  margin-bottom: 22px;
}

.timetable-info-strip span,
.timetable-footer span {
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  background: #fed400;
  border-top: 13px solid #f8b300;
  font-size: 28px;
  font-weight: 400;
  line-height: 0.92;
  text-align: center;
}

/* .timetable-info-strip span:nth-child(2),
.timetable-footer span:nth-child(1) {
  background: #e8380d;
  border-top-color: #ec6800;
  color: #fff;
} */

.timeline {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 72px repeat(4, 1fr);
  grid-template-rows: 38px 1fr;
  background: #fff;
}

.stage-heading {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  padding-top: 7px;
  border-left: 2px solid #13a0e9;
  /* border-bottom: 2px solid #13a0e9; */
  background: #fed400;
  font-size: 29px;
  font-weight: 400;
  line-height: 0.74;
  text-align: center;
}

.stage-heading:nth-child(4),
.stage-heading:nth-child(5) {
  background: #f28f00;
}

.stage-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: #f8b300;
}

.stage-heading:nth-child(4)::before,
.stage-heading:nth-child(5)::before {
  background: #ec6800;
}

.timeline-corner {
  position: relative;
  z-index: 5;
  grid-column: 1;
  grid-row: 1;
  border-bottom: 2px solid #13a0e9;
  background: #13a0e9;
}

.time-axis,
.stage-lane {
  position: relative;
  grid-row: 2;
  min-height: 0;
}

.time-axis {
  grid-column: 1;
  background: #13a0e9;
  color: #231815;
}

.time-label {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.time-label-start {
  transform: none;
}

.time-label-end {
  transform: none;
}

.stage-lane {
  border-left: 2px solid #13a0e9;
  background:
    linear-gradient(0deg, rgba(19, 160, 233, 0.18) 1px, transparent 1px),
    linear-gradient(0deg, rgba(19, 160, 233, 0.4) 2px, transparent 2px),
    #fff;
  /* background-size: 100% calc(100% / 40), 100% calc(100% / 10); */
}

.time-rule {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(19, 160, 233, 0.4);
}

.slot {
  position: absolute;
  z-index: 3;
  left: 6px;
  right: 6px;
  border: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  background: #fed400;
  color: #231815;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.slot:focus-visible {
  outline: 3px solid #e8380d;
  outline-offset: 2px;
}

.pair-circle {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border: 9px solid #14a0e9;
  border-radius: 50%;
  background: transparent;
  box-sizing: border-box;
}

.slot-time {
  min-height: 21px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  background: #f8b300;
  font-size: 22px;
  font-weight: 400;
  line-height: 0.8;
  justify-content: center;
}

.slot-title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  padding: 0 0 1px;
  background: #fed400;
  font-size: 28px;
  font-weight: 400;
  line-height: 0.98;
  text-align: center;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: clip;
}

.slot-type-open .slot-title,
.slot-type-close .slot-title,
.slot-type-change .slot-title {
  font-size: 17px;
}

.slot-type-close {
  padding: 1px 6px;
}

.slot-type-close .slot-time {
  font-size: 10px;
  line-height: 1;
}

.slot-type-close .slot-title {
  margin-top: 0;
  font-size: 12px;
  line-height: 1;
}

.slot-type-live {
  background: #fed400;
}

.slot-type-rehearsal {
  background: #7bd0ff;
}

.slot-type-change {
  background: #fff;
}

.slot-type-open {
  background: #e8380d;
  color: #fff;
}

.slot-type-close {
  background: #231815;
  color: #fff;
}

.timetable-footer {
  margin-top: 34px;
}

@media print {
  .timetable-page {
    min-width: 0;
  }

  .timetable-page #header,
  .timetable-actions {
    display: none;
  }

  .timetable-tool {
    padding: 0;
  }
}

@media (max-width: 1120px) {
  .timetable-page {
    min-width: 0;
  }

  .timetable-tool {
    padding: 12px 0 28px;
  }

  .timetable-actions {
    justify-content: center;
    margin-bottom: 10px;
  }

  .timetable-actions .retro-btn {
    font-size: 0.95rem;
  }

  .timetable-export-shell {
    height: calc(1350px * var(--poster-scale));
  }

  #poster {
    margin: 0;
    transform: scale(var(--poster-scale));
    transform-origin: top left;
  }
}

@media (max-width: 768px) {
  .timetable-tool {
    padding: 6px 0 20px;
  }

  .timetable-actions {
    width: calc(100vw - 8px);
    margin-bottom: 6px;
    gap: 8px;
  }

  .timetable-export-shell {
    width: calc(100vw - 8px);
  }

  #poster {
    padding: 46px 52px 64px;
  }
}
