:root {
  color-scheme: light;
  --ou-crimson: #841617;
  --ink: #171717;
  --muted: #66615b;
  --line: #ded7cb;
  --panel: #fffaf2;
  --surface: #ffffff;
  --class: #841617;
  --conference: #0f766e;
  --deadline: #7c3aed;
  --exam: #b45309;
  --personal: #2563eb;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: white;
}

button {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 1200px;
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  padding: 24px;
}

.semester-hero {
  min-height: auto;
  display: flex;
  align-items: center;
  padding: 8px 0 18px;
  overflow: hidden;
  color: var(--ink);
}

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

h1 {
  margin-bottom: 0;
  font-size: 18pt;
  line-height: 1;
  letter-spacing: 0;
}

.primary-button,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  font-weight: 800;
}

.primary-button {
  padding: 0 18px;
  color: white;
  background: var(--ou-crimson);
}

.calendar-layout {
  min-width: 0;
}

.calendar-panel {
  min-width: 0;
  overflow-x: auto;
}

.calendar-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.calendar-heading h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.calendar-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.weekday-row,
.week-row {
  display: grid;
  grid-template-columns: 84px repeat(7, minmax(92px, 1fr));
}

.weekday-row {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.weekday-row span {
  padding: 0 8px 8px;
}

.semester-grid {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.week-row {
  border-bottom: 1px solid var(--line);
}

.week-label {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  color: var(--ou-crimson);
  border-right: 1px solid var(--line);
  background: #f7e8e8;
}

.week-label strong {
  font-size: 0.86rem;
}

.week-note {
  color: #6f3939;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.day-cell {
  min-height: 116px;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: #fffdf9;
}

.day-cell.is-muted {
  background: #f4efe6;
}

.day-cell.is-semester-start {
  box-shadow: inset 0 0 0 2px var(--ou-crimson);
}

.day-cell.is-holiday {
  background:
    repeating-linear-gradient(135deg, rgba(132, 22, 23, 0.09) 0 8px, rgba(255, 255, 255, 0) 8px 16px),
    #fffdf9;
}

.day-cell.is-finals {
  background: #fff6e7;
}

.day-cell.is-weekend {
  background: #f4efe6;
}

.date-number {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
  font-size: 0.78rem;
  font-weight: 900;
}

.date-number small {
  color: var(--muted);
  font-weight: 800;
}

.event-stack {
  display: grid;
  gap: 5px;
}

.day-note {
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 3px 0;
  color: var(--ou-crimson);
  font-size: 0.74rem;
  font-weight: 900;
}

.event-pill {
  width: 100%;
  min-height: 28px;
  padding: 5px 7px;
  overflow: hidden;
  color: white;
  border: 0;
  border-radius: 5px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--class);
}

.event-pill[data-type="conference"] {
  background: var(--conference);
}

.event-pill[data-type="deadline"] {
  background: var(--deadline);
}

.event-pill[data-type="exam"] {
  background: var(--exam);
}

.event-pill[data-type="personal"] {
  background: var(--personal);
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .semester-hero {
    padding: 24px;
  }

  .weekday-row,
  .week-row {
    min-width: 728px;
  }
}

@media print {
  body {
    background: white;
  }

  .app-shell {
    padding: 0;
  }

  .calendar-panel {
    overflow: visible;
  }
}
