* {
  box-sizing: border-box;
}

:root {
  --blue: #003887;
  --blue-dark: #00275f;
  --teal: #0f6071;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --text: #17212b;
  --muted: #66727f;
  --border: #dfe6ea;
  --soft-blue: #edf4ff;
  --shadow: 0 12px 30px rgba(26, 47, 58, .08);
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 96, 113, .14), transparent 30rem),
    linear-gradient(180deg, #f8fafb 0%, var(--bg) 100%);
}

button,
select {
  font: inherit;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 26px;
}

.hero > div {
  min-width: 0;
}

.logo {
  width: 142px;
  height: auto;
}

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

h1 {
  margin-bottom: 7px;
  color: var(--blue);
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.hero p {
  margin-bottom: 0;
  color: var(--muted);
}

.panel,
.schedule {
  padding: 24px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.selector {
  max-width: 820px;
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 3px;
  font-size: 21px;
}

.section-heading p,
.schedule-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.step {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.field-group + .field-group {
  margin-top: 20px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #344252;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border-radius: 14px;
  background: #edf1f4;
}

.tab,
.choice,
.day-tab,
.change-button {
  appearance: none;
  cursor: pointer;
}

.tab {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  color: #53606d;
  background: transparent;
  font-weight: 800;
  text-decoration: none;
}

.tab[aria-selected="true"] {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 3px 10px rgba(23, 33, 43, .1);
}

.tab-link:hover {
  color: var(--blue);
  background: rgba(255, 255, 255, .65);
}

.external-mark {
  margin-left: 3px;
  font-size: 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.choice {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 13px;
  text-align: left;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.choice > span:last-child {
  min-width: 0;
}

.choice:hover,
.choice[aria-pressed="true"] {
  border-color: rgba(0, 56, 135, .55);
  background: var(--soft-blue);
}

.choice-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #fff;
  border-radius: 11px;
  font-weight: 850;
}

.choice strong,
.choice small {
  display: block;
}

.choice small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.3;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "⌄";
  position: absolute;
  right: 16px;
  top: 50%;
  color: var(--blue);
  pointer-events: none;
  transform: translateY(-58%);
}

select {
  width: 100%;
  min-height: 50px;
  padding: 0 44px 0 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cdd7de;
  border-radius: 12px;
  appearance: none;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 56, 135, .28);
  outline-offset: 2px;
}

.status {
  max-width: 820px;
  margin: 15px auto 0;
}

.status:not(:empty) {
  padding: 13px 15px;
  color: #694f05;
  background: #fff9e8;
  border: 1px solid #f0dfaa;
  border-radius: 13px;
  font-size: 14px;
}

.schedule {
  margin-top: 22px;
}

.schedule-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.schedule-heading h2 {
  margin: 2px 0 5px;
  font-size: 25px;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.change-button {
  padding: 10px 13px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #b8c9dc;
  border-radius: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.desktop-schedule {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
}

.week-grid {
  min-width: 880px;
  display: grid;
  grid-template-columns: 108px repeat(5, minmax(150px, 1fr));
}

.week-cell {
  min-height: 88px;
  padding: 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.week-cell:nth-child(6n) {
  border-right: 0;
}

.week-grid > :nth-last-child(-n + 6) {
  border-bottom: 0;
}

.week-head {
  min-height: auto;
  padding: 12px 10px;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.time-cell {
  display: grid;
  place-items: center;
  color: #415064;
  background: #f7f9fa;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.class-card {
  height: 100%;
  padding: 9px;
  background: #eef5ff;
  border-radius: 9px;
}

.class-card strong,
.class-details {
  display: block;
}

.subject-code {
  display: inline-block;
  margin-bottom: 5px;
  padding: 2px 6px;
  color: #075a78;
  background: #d8eafa;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.class-card strong {
  font-size: 13px;
  line-height: 1.3;
}

.class-details {
  margin-top: 5px;
  color: #5a6877;
  font-size: 12px;
}

.free {
  color: #a0a9b1;
  font-size: 12px;
  text-align: center;
}

.mobile-days,
.mobile-schedule {
  display: none;
}

.updated {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 27px;
  color: #7a8792;
  font-size: 13px;
}

footer a {
  color: inherit;
  text-decoration: none;
}

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

  .hero {
    justify-content: flex-start;
    gap: 13px;
    margin-bottom: 16px;
  }

  .logo {
    width: 88px;
  }

  h1 {
    font-size: 27px;
  }

  .hero p {
    font-size: 13px;
  }

  .panel,
  .schedule {
    padding: 16px;
    border-radius: 17px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .schedule-heading {
    display: block;
  }

  .change-button {
    margin-top: 13px;
  }

  .desktop-schedule {
    display: none;
  }

  .mobile-days {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-bottom: 14px;
  }

  .day-tab {
    min-width: 0;
    padding: 10px 3px;
    color: #5b6875;
    background: #f0f3f5;
    border: 0;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 850;
  }

  .day-tab[aria-selected="true"] {
    color: #fff;
    background: var(--blue);
  }

  .mobile-schedule {
    display: grid;
    gap: 9px;
  }

  .mobile-class {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 11px;
    align-items: stretch;
  }

  .mobile-time {
    padding-top: 11px;
    color: #566474;
    font-size: 11px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
  }

  .mobile-class .class-card {
    min-height: 68px;
  }

  .updated {
    text-align: left;
  }
}

@media (max-width: 390px) {
  .logo {
    width: 76px;
  }

  .hero p {
    display: none;
  }

  .panel,
  .schedule {
    padding: 14px;
  }
}
