:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f6f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
}

.page {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #65718a;
}

h1 {
  margin: 4px 0 5px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.035em;
}

.meta {
  color: #6b7588;
  font-size: 14px;
}

.refresh {
  border: 1px solid #ced5df;
  background: #fff;
  color: #172033;
  border-radius: 11px;
  padding: 11px 15px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.refresh:hover { background: #f9fafb; }
.refresh:disabled { opacity: .55; cursor: wait; }

.card {
  background: white;
  border: 1px solid #dde3ea;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(35, 49, 73, .06);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 970px;
  table-layout: fixed;
}

th, td {
  border-right: 1px solid #e6e9ef;
  border-bottom: 1px solid #e6e9ef;
  vertical-align: top;
}

tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { border-right: 0; }

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f8fa;
  padding: 14px 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
}

thead th.today-header {
  background: #eaf2ff;
  color: #245ca8;
}

.time-head {
  width: 105px;
  text-align: center;
}

.time-cell {
  width: 105px;
  background: #fafbfc;
  padding: 13px 10px;
  text-align: center;
  vertical-align: middle;
}

.break-cell {
  padding: 9px 14px;
  background: #f3f5f8;
  color: #69758a;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.break-time {
  margin-left: 8px;
  color: #9aa4b5;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

tr.current-break .break-cell {
  background: #fff4d8;
  color: #946b13;
  box-shadow: inset 0 0 0 2px #e5bb4f;
}

.period-number {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #8a94a6;
  margin-bottom: 3px;
}

.period-time {
  display: block;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.day-cell {
  padding: 8px;
  height: 92px;
  background: white;
}

.day-cell.today-column {
  background: #fbfdff;
}

tr.current-period .time-cell {
  background: #dfeeff;
  color: #245ca8;
}

.day-cell.current-cell {
  background: #f0f7ff;
  box-shadow: inset 0 0 0 2px #4d8eea;
}

.current-cell .lesson {
  border-color: #9cc2f4;
  border-left-color: #367bd1;
  background: #ffffff;
}

.parallel-cell {
  padding-top: 7px;
}

.parallel-label {
  margin: 0 2px 6px;
  color: #8a94a6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.lesson {
  border: 1px solid #dfe5ed;
  border-left: 4px solid #667085;
  border-radius: 9px;
  padding: 10px 10px 9px;
  background: #fbfcfd;
}

.lesson + .lesson { margin-top: 7px; }

.single-lesson {
  min-height: 76px;
  height: 100%;
}

.parallel-lesson {
  padding-top: 8px;
  padding-bottom: 8px;
}

.subject {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.details {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  color: #6f7889;
}

.empty {
  height: 100%;
  min-height: 70px;
}

.status {
  margin: 14px;
  border: 1px solid #f0c2c2;
  background: #fff5f5;
  color: #8a2222;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 14px;
  white-space: pre-wrap;
}

.status.ok {
  border-color: #cbe3d3;
  background: #f4fbf6;
  color: #245b34;
}

.mobile-schedule {
  display: none;
}

.mobile-schedule[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .page {
    width: min(100% - 18px, 1500px);
    padding-top: 22px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .refresh {
    align-self: flex-start;
  }

  .table-wrap {
    display: none;
  }

  .mobile-schedule {
    display: block;
  }

  .mobile-days {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid #e6e9ef;
    background: #f7f8fa;
  }

  .mobile-day {
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 3px 7px;
    background: transparent;
    color: #737e91;
    cursor: pointer;
    font: inherit;
    text-align: center;
  }

  .mobile-day span,
  .mobile-day strong {
    display: block;
  }

  .mobile-day span {
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-day strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-day.today {
    color: #2f6fbd;
  }

  .mobile-day.selected {
    border-color: #8bb7ed;
    background: #eaf2ff;
    color: #245ca8;
  }

  .mobile-body {
    padding: 10px;
  }

  .mobile-period {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    border: 1px solid #e1e6ed;
    border-bottom: 0;
    background: #fff;
  }

  .mobile-period:first-child {
    border-radius: 11px 11px 0 0;
  }

  .mobile-period:nth-last-child(1) {
    border-bottom: 1px solid #e1e6ed;
    border-radius: 0 0 11px 11px;
  }

  .mobile-period-heading {
    display: flex;
    align-items: flex-start;
    padding: 12px 8px;
    background: #fafbfc;
    color: #5f6b80;
  }

  .mobile-period-heading strong,
  .mobile-period-heading span {
    display: block;
  }

  .mobile-period-heading strong {
    font-size: 12px;
  }

  .mobile-period-heading span {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
  }

  .mobile-period-content {
    min-width: 0;
    padding: 8px;
  }

  .mobile-lesson {
    padding: 9px 10px 8px;
  }

  .mobile-lesson + .mobile-lesson {
    margin-top: 6px;
  }

  .mobile-parallel-label {
    margin: 0 2px 5px;
    color: #8a94a6;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .mobile-empty {
    padding: 12px 4px;
    color: #a2aaba;
    font-size: 13px;
  }

  .mobile-break {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 8px 0;
    padding: 9px 8px;
    border: 1px solid #ead9a6;
    border-radius: 10px;
    background: #fff9e9;
    color: #946b13;
    font-size: 11px;
  }

  .mobile-break span {
    color: #b08b3c;
  }

  .mobile-period.current-period {
    border-color: #4d8eea;
    box-shadow: 0 0 0 2px rgba(77, 142, 234, .16);
  }

  .mobile-period.current-period .mobile-period-heading {
    background: #dfeeff;
    color: #245ca8;
  }

  .mobile-period.current-period .mobile-lesson {
    border-color: #9cc2f4;
    border-left-color: #367bd1;
    background: #fff;
  }

  .mobile-break.current-break {
    background: #fff0c7;
    box-shadow: inset 0 0 0 2px #e5bb4f;
  }
}
