:root {
  --bg: #f4f0e8;
  --panel: #fffdf9;
  --ink: #14213d;
  --muted: #5c6477;
  --line: rgba(20, 33, 61, 0.12);
  --accent: #ff6b35;
  --shadow: 0 18px 40px rgba(20, 33, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #faf7f1 0%, #efe8db 100%);
}

.page-shell {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  margin-bottom: 24px;
}

.class-panel {
  margin-bottom: 24px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.site-nav-link {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(20, 33, 61, 0.04);
  color: var(--ink);
}

.site-nav-link.active {
  background: var(--ink);
  color: white;
}

.hero h1,
.panel h2,
.item-card h3 {
  margin: 0;
}

.hero-copy,
.meta-line,
.item-card p,
.card-link {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

.panel {
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.card-list {
  display: grid;
  gap: 14px;
}

.class-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.class-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  background: rgba(20, 33, 61, 0.04);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.class-tab:hover {
  transform: translateY(-1px);
}

.class-tab.active {
  background: var(--ink);
  color: white;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  font: inherit;
  background: rgba(20, 33, 61, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-weekdays {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.calendar-cell {
  min-height: 132px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  gap: 10px;
  align-content: start;
}

.calendar-cell.outside-month {
  opacity: 0.45;
}

.calendar-cell.is-today {
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.15);
}

.calendar-day {
  font-weight: 700;
}

.calendar-items {
  display: grid;
  gap: 6px;
}

.calendar-item {
  display: grid;
  gap: 2px;
  border-radius: 10px;
  padding: 7px 9px;
  background: rgba(255, 107, 53, 0.1);
  color: var(--ink);
  font-size: 0.84rem;
  text-decoration: none;
}

.calendar-item-title {
  font-weight: 600;
}

.calendar-item-course {
  color: var(--muted);
  font-size: 0.76rem;
}

.calendar-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.group-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  min-height: 220px;
  place-content: center;
}

.item-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.item-card.is-target {
  border-color: rgba(255, 107, 53, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.14);
}

.grade-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(20, 33, 61, 0.05);
  border: 1px solid var(--line);
}

.grade-panel .meta-line,
.grade-value {
  margin: 0;
}

.collapsible-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.65);
}

.collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  position: relative;
}

.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-summary::after {
  content: "›";
  font-size: 1.2rem;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform 0.22s ease;
}

.collapsible-group[open] .collapsible-summary::after {
  transform: rotate(270deg);
}

.collapsible-count {
  color: var(--muted);
  margin-left: auto;
  padding-right: 8px;
}

.collapsible-body {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 0.28s ease, opacity 0.22s ease;
}

.collapsible-content {
  display: grid;
  gap: 12px;
  padding: 4px 14px 14px;
}

.group-empty {
  margin: 0;
  padding: 4px 4px 0;
  color: var(--muted);
}

.rubric-list {
  display: grid;
  gap: 8px;
}

.rubric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.rubric-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rubric-score {
  flex-shrink: 0;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

.card-link {
  width: fit-content;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: white;
}

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 6px;
  }

  .calendar-cell {
    min-height: 108px;
    padding: 10px;
  }
}
