:root {
  color-scheme: light;
  --bg: #f6f4f8;
  --surface: #fcfbfd;
  --surface-raised: #fefcfe;
  --surface-tint: #eee8f4;
  --line: #e2dbe9;
  --line-strong: #c8bcd3;
  --text: #251e2e;
  --text-soft: #605469;
  --text-faint: #6d6077;
  --accent: #654398;
  --accent-strong: #563584;
  --accent-ink: #fbf8fe;
  --danger: #a82736;
  --shadow: 0 16px 44px rgb(50 32 66 / .07);
  --radius: 14px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17131e;
  --surface: #211b2a;
  --surface-raised: #292232;
  --surface-tint: #362943;
  --line: #40354c;
  --line-strong: #62506e;
  --text: #f4eff7;
  --text-soft: #d2c6da;
  --text-faint: #bcacca;
  --accent: #c9a5f1;
  --accent-strong: #dbbaf8;
  --accent-ink: #24142d;
  --danger: #ff9ba4;
  --shadow: 0 18px 48px rgb(0 0 0 / .16);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --bg: #17131e;
    --surface: #211b2a;
    --surface-raised: #292232;
    --surface-tint: #362943;
    --line: #40354c;
    --line-strong: #62506e;
    --text: #f4eff7;
    --text-soft: #d2c6da;
    --text-faint: #bcacca;
    --accent: #c9a5f1;
    --accent-strong: #dbbaf8;
    --accent-ink: #24142d;
    --danger: #ff9ba4;
    --shadow: 0 18px 48px rgb(0 0 0 / .16);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI Variable", "Aptos", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.app-shell, .app-main { min-height: 100dvh; }
.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
}
.header-inner {
  display: grid;
  width: min(1320px, 100%);
  min-height: 72px;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 52px);
}
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 11px; font-size: 13px; font-weight: 800; line-height: 1.05; letter-spacing: -.025em; }
.brand-icon { display: block; width: 40px; height: 40px; flex: 0 0 40px; object-fit: contain; }
.brand-icon-dark { display: none; }
html[data-theme="dark"] .brand-icon-light { display: none; }
html[data-theme="dark"] .brand-icon-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .brand-icon-light { display: none; }
  html[data-theme="auto"] .brand-icon-dark { display: block; }
}
.nav-links { display: flex; align-items: center; gap: 3px; align-self: stretch; }
.nav-links a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 17px; color: var(--text-soft); font-size: 13px; font-weight: 700; white-space: nowrap; transition: color .18s ease; }
.nav-links a i { font-size: 18px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after { position: absolute; right: 17px; bottom: -1px; left: 17px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); content: ""; }
.header-actions { display: flex; justify-content: flex-end; gap: 8px; }
.header-actions form { display: contents; }
.icon-button { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); color: var(--text-soft); cursor: pointer; transition: border-color .18s ease, color .18s ease, transform .15s ease; }
.icon-button i { font-size: 18px; }
.icon-button:hover { border-color: var(--line-strong); color: var(--text); }
.icon-button:active { transform: scale(.96); }

.topbar { display: flex; width: min(1320px, 100%); align-items: center; justify-content: space-between; gap: 24px; margin-inline: auto; padding: 28px clamp(20px, 4vw, 52px) 0; }
.topbar h1 { margin: 0; color: var(--text-soft); font-size: 13px; font-weight: 700; }
.semester-switcher { position: relative; display: flex; align-items: center; gap: 10px; }
.semester-switcher label { color: var(--text-faint); font-size: 12px; font-weight: 700; }
.semester-switcher select { min-width: 190px; max-width: 240px; min-height: 39px; padding: 0 34px 0 12px; appearance: none; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; }
.switcher-chevron { position: absolute; right: 12px; color: var(--text-soft); font-size: 14px; pointer-events: none; }
.page-content { width: min(1320px, 100%); margin-inline: auto; padding: 30px clamp(20px, 4vw, 52px) 90px; }
.notice-stack { position: fixed; z-index: 30; top: 24px; right: 24px; display: grid; width: min(380px, calc(100vw - 32px)); gap: 10px; }
.notice { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 13px 12px 16px; border: 1px solid var(--line-strong); border-left: 3px solid var(--accent-strong); border-radius: 10px; background: var(--surface-raised); box-shadow: 0 14px 42px rgb(39 24 51 / .15); color: var(--text); font-size: 13px; font-weight: 650; }
.notice.error, .notice[data-kind="error"] { border-left-color: var(--danger); }
.notice-close { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-soft); font-size: 20px; line-height: 1; cursor: pointer; }
.notice-close:hover { background: var(--surface-tint); color: var(--text); }

.dashboard-lead, .course-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.course-hero-actions { display: flex; flex: 0 0 auto; gap: 10px; }
.period-label { margin: 0 0 6px; color: var(--accent-strong); font-size: 12px; font-weight: 800; letter-spacing: .015em; }
.dashboard-lead h2, .course-hero h2, .form-copy h2 { max-width: 760px; margin: 0; font-size: clamp(32px, 4.2vw, 52px); font-weight: 760; line-height: 1.08; letter-spacing: -.055em; }
.dashboard-lead p:not(.period-label), .course-hero p:not(.period-label), .form-copy p:not(.period-label) { max-width: 620px; margin: 9px 0 0; color: var(--text-soft); font-size: 15px; }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 800; line-height: 1.15; white-space: nowrap; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .15s ease; }
.button i { font-size: 17px; }
.button:active { transform: scale(.98); }
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: var(--accent-strong); }
.button-secondary { border-color: var(--line-strong); background: var(--surface-raised); color: var(--text); }
.button-secondary:hover { background: var(--surface-tint); }
.button-quiet { color: var(--text-soft); }
.button-quiet:hover { background: var(--surface-tint); color: var(--text); }

.metrics-grid { display: grid; grid-template-columns: 1.32fr repeat(3, 1fr); gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); }
.metric { display: flex; min-width: 0; min-height: 145px; flex-direction: column; padding: 21px 24px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric span { color: var(--text-soft); font-size: 12px; font-weight: 700; }
.metric strong { margin-top: auto; font-size: clamp(30px, 3vw, 42px); font-variant-numeric: tabular-nums; font-weight: 750; line-height: 1; letter-spacing: -.06em; }
.metric small { margin-top: 7px; color: var(--text-faint); font-size: 11px; }
.metric-primary { background: var(--surface-tint); }
.metric-primary strong { color: var(--accent-strong); }

.dashboard-grid, .course-detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .8fr); gap: 16px; margin-top: 16px; }
.chart-panel, .split-panel, .breakdown-panel, .attendance-panel { min-width: 0; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.section-heading h3 { margin: 0; font-size: 18px; font-weight: 760; letter-spacing: -.035em; }
.section-heading p { margin: 4px 0 0; color: var(--text-soft); font-size: 12px; }
.chart-total { color: var(--text-soft); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-chart { margin-top: 24px; }
.line-chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-labels { display: grid; grid-template-columns: repeat(12, 1fr); margin-top: 10px; color: var(--text-faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-labels span { min-width: 0; text-align: center; }
.donut-wrap { display: grid; justify-items: center; gap: 21px; padding-top: 18px; }
.donut { position: relative; display: grid; width: 150px; height: 150px; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) 0 var(--class), var(--line) var(--class) 100%); }
.donut::after { position: absolute; inset: 17px; border-radius: 50%; background: var(--surface-raised); content: ""; }
.donut > span { position: relative; z-index: 1; display: grid; text-align: center; }
.donut strong { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.donut small { color: var(--text-faint); font-size: 11px; }
.legend { width: 100%; margin: 0; }
.legend > div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; }
.legend dt { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12px; }
.legend dd { margin: 0; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 800; }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; }
.class-swatch { background: var(--accent); }
.self-swatch { background: var(--line-strong); }

.courses-section, .recent-section { margin-top: 45px; }
.section-heading-actions { align-items: center; }
.text-link, .text-button { border: 0; background: none; color: var(--accent-strong); font-size: 13px; font-weight: 800; cursor: pointer; }
.text-link:hover, .text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.course-list, .activity-list { margin-top: 17px; border-top: 1px solid var(--line); }
.course-row { display: grid; min-height: 82px; grid-template-columns: minmax(230px, 1.6fr) minmax(105px, .8fr) 106px 82px 18px; align-items: center; gap: 20px; padding: 8px 12px; border-bottom: 1px solid var(--line); border-radius: 9px; transition: background .18s ease; }
.course-row:hover, .activity-row:hover { background: var(--surface-tint); }
.course-identity { display: flex; min-width: 0; align-items: center; gap: 13px; }
.course-identity div { min-width: 0; }
.course-identity strong, .course-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-identity strong { font-size: 13px; }
.course-identity small, .course-hours small, .course-attendance small { margin-top: 3px; color: var(--text-faint); font-size: 11px; }
.course-monogram { display: grid; width: 41px; height: 41px; flex: 0 0 41px; place-items: center; border-radius: 10px; color: #172435; font-weight: 850; }
.course-monogram.small { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; font-size: 12px; }
.course-monogram.large { width: 69px; height: 69px; flex-basis: 69px; border-radius: var(--radius); font-size: 23px; }
.color-lime { background: #cde4b9; }.color-cyan { background: #b5dedc; }.color-amber { background: #ead8af; }
.color-rose { background: #e8c1cc; }.color-violet { background: #d1c7e6; }.color-blue { background: #b7cee9; }
.color-mint { background: #bfe4d4; }.color-peach { background: #f0cbb9; }.color-gold { background: #ead48f; }
.color-indigo { background: #c5c9ed; }.color-plum { background: #dfc3de; }.color-slate { background: #c9d4db; }
.course-progress { height: 4px; overflow: hidden; border-radius: 3px; background: var(--line); }
.course-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.course-hours, .course-attendance { display: grid; }
.course-hours strong, .course-attendance strong { font-variant-numeric: tabular-nums; }
.course-row > .ph { color: var(--text-faint); font-size: 15px; }
.activity-row { display: grid; min-height: 69px; grid-template-columns: 48px minmax(0, 1fr) 74px 18px; align-items: center; gap: 15px; padding: 7px 12px; border-bottom: 1px solid var(--line); border-radius: 9px; transition: background .18s ease; }
.activity-date { display: grid; width: 42px; text-align: center; }
.activity-date strong { font-size: 17px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.activity-date small { color: var(--text-faint); font-size: 10px; text-transform: uppercase; }
.activity-main { min-width: 0; }
.activity-main strong, .activity-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-main strong { font-size: 13px; }
.activity-main small { color: var(--text-soft); font-size: 12px; }
.activity-duration { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; }
.activity-row > .ph { color: var(--text-faint); }

.empty-inline { display: flex; min-height: 165px; align-items: center; justify-content: center; gap: 10px; color: var(--text-soft); text-align: center; }
.empty-inline i { font-size: 23px; }
.empty-state { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); }
.large-empty { display: grid; min-height: min(520px, 70dvh); place-items: center; align-content: center; padding: 38px; text-align: center; }
.large-empty h2 { margin: 15px 0 6px; font-size: clamp(27px, 4vw, 43px); letter-spacing: -.045em; }
.large-empty p { max-width: 490px; margin: 0 0 23px; color: var(--text-soft); }
.empty-icon { display: grid; width: 60px; height: 60px; place-items: center; border-radius: var(--radius); background: var(--surface-tint); color: var(--accent-strong); font-size: 28px; }
.compact-empty { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 16px; padding: 22px; }
.compact-empty h4 { margin: 0; font-size: 17px; }.compact-empty p { margin: 4px 0 0; color: var(--text-soft); }

.semester-timeline { display: grid; gap: 14px; }
.semester-card { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); }
.semester-card.is-active { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.semester-card-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.semester-card-head span:not(.status-badge) { color: var(--text-faint); font-size: 12px; font-weight: 700; }
.semester-card h3 { margin: 2px 0 0; font-size: 24px; letter-spacing: -.035em; }
.status-badge { padding: 5px 9px; border-radius: 7px; background: var(--surface-tint); color: var(--accent-strong); font-size: 11px; font-weight: 850; }
.semester-courses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin-top: 20px; }
.semester-courses a { display: grid; min-height: 43px; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.semester-courses a:hover span:nth-child(2) { color: var(--accent-strong); }
.semester-courses a > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.semester-courses small { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.semester-courses p { color: var(--text-soft); }
.semester-actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; }

.form-layout { display: grid; grid-template-columns: minmax(235px, .8fr) minmax(410px, 1.2fr); align-items: start; gap: clamp(35px, 6vw, 100px); padding-top: 18px; }
.form-copy { position: sticky; top: 26px; }
.app-form { display: grid; gap: 19px; padding: 29px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); box-shadow: var(--shadow); }
.field { display: grid; gap: 7px; }
.field label { font-size: 12px; font-weight: 800; }
.field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; min-height: 47px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text); }
.field textarea { min-height: 110px; padding-block: 11px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent); }
.field-checkbox { grid-template-columns: 20px 1fr; align-items: center; }
.field-checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.help-text { color: var(--text-soft); font-size: 11px; }
.field-error, .inline-error { color: var(--danger); font-size: 12px; font-weight: 750; }
.inline-error { padding: 12px; border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.form-actions { display: flex; gap: 10px; padding-top: 8px; }
.delete-form { grid-column: 2; margin-top: -8px; }
.danger-link { padding: 4px 0; border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 750; cursor: pointer; }
.danger-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.course-title { display: flex; min-width: 0; align-items: center; gap: 17px; }
.course-title > div { min-width: 0; }.course-title h2 { overflow-wrap: anywhere; }
.type-breakdown { margin: 19px 0 0; }
.type-breakdown > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.type-breakdown > div:last-child { border-bottom: 0; }
.type-breakdown dt { color: var(--text-soft); }.type-breakdown dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 800; }
.attendance-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 25px; }
.attendance-numbers > div { display: grid; padding: 16px; border-radius: 10px; background: var(--surface-tint); }
.attendance-numbers strong { font-size: 30px; font-variant-numeric: tabular-nums; }.attendance-numbers span { color: var(--text-soft); font-size: 12px; }

.private-auth-page { --login-glass: rgb(254 251 255 / .76); --login-edge: rgb(255 255 255 / .88); --login-depth: rgb(55 30 74 / .14); }
html[data-theme="dark"] .private-auth-page { --login-glass: rgb(43 31 55 / .68); --login-edge: rgb(216 183 244 / .2); --login-depth: rgb(12 6 18 / .35); }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .private-auth-page { --login-glass: rgb(43 31 55 / .68); --login-edge: rgb(216 183 244 / .2); --login-depth: rgb(12 6 18 / .35); }
}
.private-login { display: grid; min-height: 100dvh; place-items: center; padding: 24px; background: radial-gradient(ellipse 520px 420px at 50% 35%, rgb(116 75 148 / .11), transparent 75%), var(--bg); }
.private-entry { width: min(420px, 100%); padding: clamp(28px, 6vw, 42px); border: 1px solid var(--login-edge); border-radius: 20px; background: linear-gradient(145deg, var(--login-glass), color-mix(in srgb, var(--login-glass) 80%, transparent)); box-shadow: inset 0 1px rgb(255 255 255 / .14), 0 26px 66px var(--login-depth); backdrop-filter: blur(22px) saturate(145%); -webkit-backdrop-filter: blur(22px) saturate(145%); text-align: center; }
.private-entry h1 { margin: 0 0 28px; font-size: clamp(30px, 7vw, 38px); font-weight: 740; line-height: 1.12; letter-spacing: -.055em; }
.google-button-frame { width: min(320px, 100%); min-height: 42px; margin-inline: auto; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--login-edge)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 50%, var(--login-glass)); box-shadow: inset 0 1px rgb(255 255 255 / .15), 0 8px 22px var(--login-depth); }
.google-button { width: 100%; min-height: 40px; overflow: hidden; border-radius: 9px; opacity: .92; transition: opacity .18s ease; }
.google-button:hover, .google-button:focus-within { opacity: 1; }
.google-button iframe { color-scheme: normal; }
.google-button-frame:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.login-unavailable { margin: 0; color: var(--text-soft); font-size: 13px; }
.dev-login { margin-top: 18px; }
@media (prefers-reduced-transparency: reduce) { .private-entry { backdrop-filter: none; -webkit-backdrop-filter: none; } }

.not-found-shell { display: flex; width: min(960px, 100%); min-height: 100dvh; flex-direction: column; margin-inline: auto; padding: clamp(24px, 5vw, 52px); }
.not-found-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.not-found-brand { display: inline-flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 800; letter-spacing: -.025em; }
.not-found-brand .brand-icon { width: 35px; height: 35px; flex-basis: 35px; }
.not-found-status, .not-found-footer { color: var(--text-faint); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.not-found-status { text-transform: uppercase; }
.not-found-content { display: flex; flex: 1; flex-direction: column; justify-content: center; padding-block: 72px; }
.not-found-code { margin: 0 0 clamp(44px, 8vw, 100px); color: var(--surface-tint); font-size: clamp(126px, 25vw, 270px); font-weight: 800; line-height: .75; letter-spacing: -.13em; user-select: none; }
.not-found-code span { color: var(--accent); }
.not-found-detail { display: flex; align-items: end; justify-content: space-between; gap: 35px; padding-top: 27px; border-top: 1px solid var(--line); }
.not-found-detail h1 { margin: 0; font-size: clamp(32px, 5vw, 51px); font-weight: 760; line-height: 1.1; letter-spacing: -.055em; }
.not-found-detail p:not(.period-label) { max-width: 440px; margin: 10px 0 0; color: var(--text-soft); font-size: 15px; }
.not-found-detail .button { flex: 0 0 auto; }
.not-found-footer { padding-top: 19px; border-top: 1px solid var(--line); letter-spacing: 0; }

@media (max-width: 1080px) {
  .header-inner { grid-template-columns: auto 1fr auto; gap: 15px; }
  .nav-links { justify-content: center; }
  .nav-links a { padding-inline: 11px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric:nth-child(4) { border-top: 1px solid var(--line); }
  .course-row { grid-template-columns: minmax(220px, 1fr) minmax(85px, .55fr) 95px 18px; }
  .course-attendance { display: none; }
}

@media (max-width: 800px) {
  .header-inner { grid-template-columns: 1fr auto; min-height: 0; column-gap: 12px; padding: 13px 20px 0; }
  .nav-links { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; min-height: 50px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { height: 50px; padding-inline: 14px; }
  .nav-links a:first-child { padding-left: 0; }.nav-links a:first-child[aria-current="page"]::after { left: 0; }
  .header-actions { grid-row: 1; grid-column: 2; }
  .topbar { padding-top: 21px; }
  .page-content { padding-top: 25px; }
  .dashboard-grid, .course-detail-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 0; }
  .form-copy { position: static; }.delete-form { grid-column: 1; }
}

@media (max-width: 620px) {
  .not-found-shell { padding: 24px 20px; }
  .not-found-status { font-size: 10px; text-align: right; }
  .not-found-content { padding-block: 64px; }
  .not-found-code { margin-bottom: 65px; font-size: clamp(116px, 31vw, 190px); }
  .not-found-detail { align-items: stretch; flex-direction: column; gap: 26px; }
  .not-found-detail .button { width: 100%; }
  .header-inner { padding-inline: 17px; }
  .brand { font-size: 12px; }.brand-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .icon-button { width: 36px; height: 36px; }
  .nav-links { margin-top: 8px; }
  .nav-links a { gap: 6px; padding-inline: 11px; font-size: 12px; }.nav-links a i { font-size: 16px; }
  .topbar { align-items: start; flex-wrap: wrap; gap: 12px; padding-inline: 17px; }
  .semester-switcher { width: 100%; justify-content: space-between; }.semester-switcher select { max-width: min(68vw, 230px); }
  .page-content { padding: 26px 17px 60px; }
  .dashboard-lead, .course-hero { align-items: stretch; flex-direction: column; gap: 20px; margin-bottom: 24px; }
  .course-hero-actions { flex-direction: column; }
  .dashboard-lead h2, .course-hero h2, .form-copy h2 { font-size: clamp(32px, 9vw, 42px); }
  .dashboard-lead .button, .course-hero .button { width: 100%; }
  .metric { min-height: 128px; padding: 16px; }.metric strong { font-size: clamp(25px, 7vw, 33px); }.metric small { line-height: 1.3; }
  .chart-panel, .split-panel, .breakdown-panel, .attendance-panel { padding: 19px; }
  .line-chart svg { height: 170px; }
  .course-row { grid-template-columns: minmax(0, 1fr) auto 14px; gap: 10px; min-height: 74px; padding-inline: 5px; }
  .course-progress, .course-attendance { display: none; }.course-hours { text-align: right; }.course-monogram { width: 37px; height: 37px; flex-basis: 37px; }
  .activity-row { grid-template-columns: 42px minmax(0, 1fr) 62px; gap: 9px; padding-inline: 5px; }.activity-row > .ph { display: none; }
  .courses-section, .recent-section { margin-top: 39px; }
  .section-heading-actions { align-items: start; }.section-heading-actions .text-link { flex: 0 0 auto; }
  .compact-empty { align-items: stretch; flex-direction: column; }
  .semester-card { padding: 18px; }.semester-card h3 { font-size: 21px; }.semester-courses { grid-template-columns: 1fr; }
  .semester-actions { align-items: stretch; flex-direction: column; }.semester-actions form, .semester-actions button { width: 100%; }
  .app-form { padding: 19px; box-shadow: none; }.form-actions { align-items: stretch; flex-direction: column; }
  .course-title { align-items: start; }.course-monogram.large { width: 53px; height: 53px; flex-basis: 53px; font-size: 18px; }
  .notice-stack { top: 12px; right: 12px; left: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
