:root {
  --theme-background: #f5f2ec;
  --theme-accent: #a6192e;
  --theme-text: #16202a;
  --theme-ui: #7b848d;
  --paper: var(--theme-background);
  --ink: var(--theme-text);
  --muted: color-mix(in srgb, var(--theme-text) 62%, var(--theme-background));
  --surface: color-mix(in srgb, var(--theme-ui) 10%, var(--theme-background));
  --surface-soft: color-mix(in srgb, var(--theme-ui) 6%, var(--theme-background));
  --surface-raised: color-mix(in srgb, var(--theme-ui) 17%, var(--theme-background));
  --line: color-mix(in srgb, var(--theme-ui) 46%, var(--theme-background));
  --red: var(--theme-accent);
  --red-dark: color-mix(in srgb, var(--theme-accent) 76%, var(--theme-text));
  --gold: var(--theme-accent);
  --shadow: 0 14px 35px color-mix(in srgb, var(--theme-text) 11%, transparent);
  --toolbar-sticky-height: 5rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}

:root[data-theme="sdsu-dark"] {
  --theme-background: #000000;
  --theme-accent: #d41736;
  --theme-text: #cdcdc8;
  --theme-ui: #ffffff;
  color-scheme: dark;
}

:root[data-theme="80s-after-dark"] {
  --theme-background: #1b1d36;
  --theme-accent: #fca6d1;
  --theme-text: #e1e7ec;
  --theme-ui: #99d6ea;
  color-scheme: dark;
}

:root[data-theme="aether"] {
  --theme-background: #101820;
  --theme-accent: #eedaea;
  --theme-text: #eedaea;
  --theme-ui: #cf6bdd;
  color-scheme: dark;
}

:root[data-theme="aurora"] {
  --theme-background: #011926;
  --theme-accent: #00e980;
  --theme-text: #ffffff;
  --theme-ui: #245c69;
  color-scheme: dark;
}

:root[data-theme="blue-dolphin"] {
  --theme-background: #003950;
  --theme-accent: #ffcefb;
  --theme-text: #82eaff;
  --theme-ui: #00e4ff;
  color-scheme: dark;
}

:root[data-theme="blueberry-dark"] {
  --theme-background: #212b42;
  --theme-accent: #add7ff;
  --theme-text: #91b4d5;
  --theme-ui: #5c7da5;
  color-scheme: dark;
}

:root[data-theme="bushido"] {
  --theme-background: #242933;
  --theme-accent: #ec4c56;
  --theme-text: #f6f0e9;
  --theme-ui: #596172;
  color-scheme: dark;
}

:root[data-theme="catppuccin"] {
  --theme-background: #1e1e2e;
  --theme-accent: #cba6f7;
  --theme-text: #cdd6f4;
  --theme-ui: #7f849c;
  color-scheme: dark;
}

:root[data-theme="chaos-theory"] {
  --theme-background: #141221;
  --theme-accent: #fd77d7;
  --theme-text: #dde5ed;
  --theme-ui: #676e8a;
  color-scheme: dark;
}

:root[data-theme="cyberspace"] {
  --theme-background: #181c18;
  --theme-accent: #00ce7c;
  --theme-text: #c2fbe1;
  --theme-ui: #9578d3;
  color-scheme: dark;
}

:root[data-theme="dark"] {
  --theme-background: #111111;
  --theme-accent: #eeeeee;
  --theme-text: #eeeeee;
  --theme-ui: #444444;
  color-scheme: dark;
}

:root[data-theme="dark-magic-girl"] {
  --theme-background: #091f2c;
  --theme-accent: #f5b1cc;
  --theme-text: #a288d9;
  --theme-ui: #93e8d3;
  color-scheme: dark;
}

:root[data-theme="dots"] {
  --theme-background: #121520;
  --theme-accent: #ffffff;
  --theme-text: #ffffff;
  --theme-ui: #676e8a;
  color-scheme: dark;
}

:root[data-theme="dracula"] {
  --theme-background: #282a36;
  --theme-accent: #bd93f9;
  --theme-text: #f8f8f2;
  --theme-ui: #6272a4;
  color-scheme: dark;
}

:root[data-theme="drowning"] {
  --theme-background: #191826;
  --theme-accent: #4a6fb5;
  --theme-text: #9393a7;
  --theme-ui: #50688c;
  color-scheme: dark;
}

:root[data-theme="ez-mode"] {
  --theme-background: #0068c6;
  --theme-accent: #fa62d5;
  --theme-text: #ffffff;
  --theme-ui: #138bf7;
  color-scheme: dark;
}

:root[data-theme="fire"] {
  --theme-background: #0f0000;
  --theme-accent: #b31313;
  --theme-text: #ffffff;
  --theme-ui: #683434;
  color-scheme: dark;
}

:root[data-theme="fledgling"] {
  --theme-background: #3b363f;
  --theme-accent: #fc6e83;
  --theme-text: #e6d5d3;
  --theme-ui: #8e5568;
  color-scheme: dark;
}

:root[data-theme="future-funk"] {
  --theme-background: #2e1a47;
  --theme-accent: #f7f2ea;
  --theme-text: #f7f2ea;
  --theme-ui: #c18fff;
  color-scheme: dark;
}

:root[data-theme="hammerhead"] {
  --theme-background: #030613;
  --theme-accent: #4fcdb9;
  --theme-text: #e2f1f5;
  --theme-ui: #213c53;
  color-scheme: dark;
}

:root[data-theme="husqy"] {
  --theme-background: #000000;
  --theme-accent: #c58aff;
  --theme-text: #ebd7ff;
  --theme-ui: #972fff;
  color-scheme: dark;
}

:root[data-theme="iceberg-dark"] {
  --theme-background: #161821;
  --theme-accent: #84a0c6;
  --theme-text: #c6c8d1;
  --theme-ui: #595e76;
  color-scheme: dark;
}

:root[data-theme="ishtar"] {
  --theme-background: #202020;
  --theme-accent: #91170c;
  --theme-text: #fae1c3;
  --theme-ui: #847869;
  color-scheme: dark;
}

:root[data-theme="joker"] {
  --theme-background: #1a0e25;
  --theme-accent: #99de1e;
  --theme-text: #e9e2f5;
  --theme-ui: #7554a3;
  color-scheme: dark;
}

:root[data-theme="laser"] {
  --theme-background: #221b44;
  --theme-accent: #009eaf;
  --theme-text: #dbe7e8;
  --theme-ui: #b82356;
  color-scheme: dark;
}

:root[data-theme="luna"] {
  --theme-background: #221c35;
  --theme-accent: #f67599;
  --theme-text: #ffe3eb;
  --theme-ui: #5a3a7e;
  color-scheme: dark;
}

:root[data-theme="mashu"] {
  --theme-background: #2b2b2c;
  --theme-accent: #76689a;
  --theme-text: #f1e2e4;
  --theme-ui: #d8a0a6;
  color-scheme: dark;
}

:root[data-theme="matcha-moccha"] {
  --theme-background: #523525;
  --theme-accent: #7ec160;
  --theme-text: #ecddcc;
  --theme-ui: #9e6749;
  color-scheme: dark;
}

:root[data-theme="matrix"] {
  --theme-background: #000000;
  --theme-accent: #15ff00;
  --theme-text: #d1ffcd;
  --theme-ui: #006500;
  color-scheme: dark;
}

:root[data-theme="metaverse"] {
  --theme-background: #232323;
  --theme-accent: #d82934;
  --theme-text: #e8e8e8;
  --theme-ui: #5e5e5e;
  color-scheme: dark;
}

:root[data-theme="miami-nights"] {
  --theme-background: #18181a;
  --theme-accent: #e4609b;
  --theme-text: #ffffff;
  --theme-ui: #47bac0;
  color-scheme: dark;
}

:root[data-theme="mint"] {
  --theme-background: #05385b;
  --theme-accent: #5cdb95;
  --theme-text: #edf5e1;
  --theme-ui: #20688a;
  color-scheme: dark;
}

:root[data-theme="monokai"] {
  --theme-background: #272822;
  --theme-accent: #a6e22e;
  --theme-text: #e2e2dc;
  --theme-ui: #e6db74;
  color-scheme: dark;
}

:root[data-theme="mountain"] {
  --theme-background: #0f0f0f;
  --theme-accent: #e7e7e7;
  --theme-text: #e7e7e7;
  --theme-ui: #4c4c4c;
  color-scheme: dark;
}

:root[data-theme="nautilus"] {
  --theme-background: #132237;
  --theme-accent: #ebb723;
  --theme-text: #1cbaac;
  --theme-ui: #0b4c6c;
  color-scheme: dark;
}

:root[data-theme="nebula"] {
  --theme-background: #212135;
  --theme-accent: #be3c88;
  --theme-text: #838686;
  --theme-ui: #19b3b8;
  color-scheme: dark;
}

:root[data-theme="night-runner"] {
  --theme-background: #212121;
  --theme-accent: #feff04;
  --theme-text: #e8e8e8;
  --theme-ui: #5c4a9c;
  color-scheme: dark;
}

:root[data-theme="our-theme"] {
  --theme-background: #ce1226;
  --theme-accent: #fcd116;
  --theme-text: #ffffff;
  --theme-ui: #6d0f19;
  color-scheme: dark;
}

:root[data-theme="passion-fruit"] {
  --theme-background: #7c2142;
  --theme-accent: #f4a3b4;
  --theme-text: #ffffff;
  --theme-ui: #9994b8;
  color-scheme: dark;
}

:root[data-theme="red-dragon"] {
  --theme-background: #1a0b0c;
  --theme-accent: #ff3a32;
  --theme-text: #4a4d4e;
  --theme-ui: #e2a528;
  color-scheme: dark;
}

:root[data-theme="red-samurai"] {
  --theme-background: #84202c;
  --theme-accent: #c79e6e;
  --theme-text: #e2dad0;
  --theme-ui: #55131b;
  color-scheme: dark;
}

:root[data-theme="rgb"] {
  --theme-background: #111111;
  --theme-accent: #eeeeee;
  --theme-text: #eeeeee;
  --theme-ui: #444444;
  color-scheme: dark;
}

:root[data-theme="rose-pine"] {
  --theme-background: #1f1d27;
  --theme-accent: #9ccfd8;
  --theme-text: #e0def4;
  --theme-ui: #c4a7e7;
  color-scheme: dark;
}

:root[data-theme="rose-pine-moon"] {
  --theme-background: #2a273f;
  --theme-accent: #9ccfd8;
  --theme-text: #e0def4;
  --theme-ui: #c4a7e7;
  color-scheme: dark;
}

:root[data-theme="ryujinscales"] {
  --theme-background: #081426;
  --theme-accent: #f17754;
  --theme-text: #ffe4bc;
  --theme-ui: #ffbc90;
  color-scheme: dark;
}

:root[data-theme="sewing-tin"] {
  --theme-background: #241963;
  --theme-accent: #f2ce83;
  --theme-text: #ffffff;
  --theme-ui: #446ad5;
  color-scheme: dark;
}

:root[data-theme="shadow"] {
  --theme-background: #000000;
  --theme-accent: #eeeeee;
  --theme-text: #eeeeee;
  --theme-ui: #444444;
  color-scheme: dark;
}

:root[data-theme="solarized-dark"] {
  --theme-background: #002b36;
  --theme-accent: #859900;
  --theme-text: #268bd2;
  --theme-ui: #2aa198;
  color-scheme: dark;
}

:root[data-theme="sonokai"] {
  --theme-background: #2c2e34;
  --theme-accent: #9ed072;
  --theme-text: #e2e2e3;
  --theme-ui: #e7c664;
  color-scheme: dark;
}

:root[data-theme="superuser"] {
  --theme-background: #262a33;
  --theme-accent: #43ffaf;
  --theme-text: #e5f7ef;
  --theme-ui: #526777;
  color-scheme: dark;
}

:root[data-theme="trance"] {
  --theme-background: #00021b;
  --theme-accent: #e51376;
  --theme-text: #ffffff;
  --theme-ui: #3c4c79;
  color-scheme: dark;
}

:root[data-theme="tron-orange"] {
  --theme-background: #0d1c1c;
  --theme-accent: #f0e800;
  --theme-text: #ffffff;
  --theme-ui: #ff6600;
  color-scheme: dark;
}

:root[data-theme="voc"] {
  --theme-background: #190618;
  --theme-accent: #e0caac;
  --theme-text: #eeeae4;
  --theme-ui: #4c1e48;
  color-scheme: dark;
}

:root[data-theme="watermelon"] {
  --theme-background: #1f4437;
  --theme-accent: #d6686f;
  --theme-text: #cdc6bc;
  --theme-ui: #3e7a65;
  color-scheme: dark;
}

:root[data-theme="wavez"] {
  --theme-background: #1c292f;
  --theme-accent: #6bde3b;
  --theme-text: #e9efe6;
  --theme-ui: #1f5e6b;
  color-scheme: dark;
}

:root[data-theme="8008"] {
  --theme-background: #333a45;
  --theme-accent: #f44c7f;
  --theme-text: #e9ecf0;
  --theme-ui: #939eae;
  color-scheme: dark;
}

:root[data-theme="9009"] {
  --theme-background: #eeebe2;
  --theme-accent: #080909;
  --theme-text: #080909;
  --theme-ui: #99947f;
  color-scheme: light;
}

:root[data-theme="alduin"] {
  --theme-background: #1c1c1c;
  --theme-accent: #dfd7af;
  --theme-text: #f5f3ed;
  --theme-ui: #444444;
  color-scheme: dark;
}

:root[data-theme="after-dark"] {
  --theme-background: #1f2238;
  --theme-accent: #73c9ff;
  --theme-text: #eef3ff;
  --theme-ui: #9b8ee3;
  color-scheme: dark;
}

:root[data-theme="neon-sunset"] {
  --theme-background: #2f2b46;
  --theme-accent: #ff3b3b;
  --theme-text: #f0ad20;
  --theme-ui: #858d92;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--theme-text); background: var(--theme-background); }
button, input, select { font: inherit; }
button, select, input { color: inherit; }

.site-header {
  padding: .95rem 1.5rem .55rem;
  color: var(--theme-ui);
  background: transparent;
}
.site-header-inner {
  display: flex;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  align-items: center;
  gap: .35rem;
}
.brand-wrap {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .4rem;
  color: var(--theme-ui);
  text-decoration: none;
}
.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 3.25rem;
  height: 2.5rem;
  background: var(--theme-accent);
  -webkit-mask: url("/static/classcatalog_outline_cc_logo_v5.svg?v=3") center / contain no-repeat;
  mask: url("/static/classcatalog_outline_cc_logo_v5.svg?v=3") center / contain no-repeat;
}
.site-header h1 {
  margin: 0;
  font-size: 1.82rem;
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1;
  color: var(--theme-ui);
  /* The visible notebook/CC artwork sits slightly above the SVG canvas center.
     Match the wordmark to the CC artwork rather than the full SVG viewBox. */
  transform: translateY(-.06rem);
}
.header-note { max-width: 34rem; margin: 0; color: var(--muted); font-size: .9rem; text-align: right; }
.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: .08rem;
  margin-left: .45rem;
}
.header-nav-button {
  position: relative;
  display: inline-flex;
  width: 2.6rem;
  min-width: 2.6rem;
  height: 2.6rem;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: .5rem;
  color: var(--theme-ui);
  background: transparent;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  transition: color .14s ease, background .14s ease, transform .14s ease;
}
.header-nav-button:hover,
.header-nav-button.is-active {
  color: var(--red);
  background: rgba(166,25,46,.06);
}
.header-nav-button:active { transform: translateY(1px); }
.header-nav-button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(166,25,46,.15); }
.header-nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.header-nav-icon {
  display: block;
  width: 1.42rem;
  height: 1.42rem;
  flex: 0 0 1.42rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-nav-favorite-icon {
  color: var(--gold);
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.25;
}
.header-nav-count {
  position: absolute;
  top: .08rem;
  right: .03rem;
  display: inline-grid;
  min-width: 1.08rem;
  height: 1.08rem;
  place-items: center;
  padding: 0 .22rem;
  border-radius: 999px;
  color: #2b3137;
  background: var(--theme-accent);
  font-size: .57rem;
  font-weight: 900;
  line-height: 1;
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 4rem) 3rem;
}
.eyebrow { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(390px, 1.45fr) minmax(240px, .9fr) minmax(300px, 1fr) minmax(125px, auto);
  gap: 1rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.control-label, label { font-size: .78rem; font-weight: 750; }
.control-label { display: block; margin-bottom: .45rem; color: var(--muted); }
input, select {
  width: 100%;
  min-height: 2.7rem;
  padding: .62rem .72rem;
  border: 1px solid #cdd3d8;
  border-radius: .65rem;
  background: white;
  outline: none;
}
input:focus, select:focus, button:focus-visible { border-color: var(--red); box-shadow: 0 0 0 3px rgba(166,25,46,.15); }
.segmented { display: flex; flex-wrap: wrap; gap: .4rem; }
.segmented button {
  padding: .63rem .8rem;
  border: 1px solid #cfd4d9;
  border-radius: .62rem;
  background: #f8f9fa;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 750;
}
.segmented button[aria-pressed="true"] { border-color: var(--red); color: white; background: var(--red); }
.result-summary {
  display: flex;
  min-height: 2.7rem;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: .35rem .2rem .2rem .75rem;
  border-left: 1px solid var(--line);
  text-align: right;
}
.result-summary span { display: block; font-size: 1.8rem; font-weight: 900; line-height: .9; letter-spacing: -.045em; }
.result-summary small { margin-top: .3rem; color: var(--muted); font-size: .67rem; white-space: nowrap; }

.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.25rem; margin-top: 1.25rem; align-items: start; }
/* Desktop filter popouts behave like a select menu: the normal 300px filter
   rail never changes size or position. The active filter body is layered over
   part of the rail and extends toward the left without reserving layout space. */
.filters {
  --filter-flyout-width: 20.625rem;
  --filter-flyout-overlap: 6.25rem;
  --filter-flyout-x-shift: 0px;
  --filter-flyout-y-shift: 0px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

@media (min-width: 761px) {
  .layout {
    align-items: start;
    overflow: visible;
  }
  .filters {
    position: sticky;
    top: calc(var(--toolbar-sticky-height) + 1rem);
    max-height: calc(100vh - var(--toolbar-sticky-height) - 2rem);
    overflow: visible;
  }
  .results {
    min-height: 0;
    overflow: visible;
    padding-right: .25rem;
  }
}
.filter-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid var(--line); }
.filter-header h2 { margin: .15rem 0 0; font-size: 1.25rem; }
.text-button { border: 0; color: var(--red); background: transparent; cursor: pointer; font-size: .8rem; font-weight: 800; }
.filters > details { position: relative; border-bottom: 1px solid var(--line); }
.filters > details:last-child { border-bottom: 0; }
.filters > details > summary {
  display: flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .84rem 1rem;
  cursor: pointer;
  list-style: none;
  color: #36424d;
  font-size: .84rem;
  font-weight: 850;
  transition: color .14s ease, background .14s ease;
}
.filters > details > summary::-webkit-details-marker { display: none; }
.filters > details > summary::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  transition: color .14s ease, transform .14s ease;
}
.filters > details > summary:hover {
  color: var(--red-dark);
  background: color-mix(in srgb, var(--theme-ui) 9%, var(--theme-background));
}
.filters > details[open] > summary {
  color: var(--red);
  background: color-mix(in srgb, var(--theme-accent) 10%, var(--theme-background));
}
.filters > details[open] > summary::after { color: var(--red); transform: rotate(180deg); }
.filter-body { padding: 0 1rem 1rem; }

/* On desktop, clicking a filter row opens a dropdown-like popout. It overlaps
   the left portion of the filter rail (rather than moving/shrinking the rail)
   and extends left when room is available. setupFilterFlyouts() keeps exactly
   one group open and nudges the overlay back inside the viewport when needed. */
.filters.filters-side-flyout > details > summary::after {
  content: "‹";
  font-size: 1.28rem;
  transform: none;
}
.filters.filters-side-flyout > details[open] > summary::after { transform: translateX(-2px); }
.filters.filters-side-flyout > details[open] > .filter-body {
  position: absolute;
  z-index: 45;
  top: -.45rem;
  right: var(--filter-flyout-overlap);
  width: min(var(--filter-flyout-width), calc(100vw - 1.5rem));
  max-height: calc(100vh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  color: var(--theme-text);
  background: var(--surface);
  box-shadow: none;
  overscroll-behavior: contain;
  transform: translate(var(--filter-flyout-x-shift), var(--filter-flyout-y-shift));
}
.filters.filters-side-flyout > details[open] > .filter-body.stack { display: grid; }
.stack { display: grid; gap: .75rem; }
.completed-course-field { display: grid; gap: .35rem; position: relative; }
.completed-course-label { color: #36424d; font-size: .78rem; font-weight: 750; }
.completed-course-picker { display: grid; gap: .45rem; }
.completed-course-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.completed-course-chips:empty { display: none; }
.completed-course-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 1.9rem;
  padding: .28rem .35rem .28rem .55rem;
  border: 1px solid #d7c1c6;
  border-radius: 999px;
  background: #fff6f7;
  color: var(--red-dark);
  font-size: .75rem;
  font-weight: 800;
}
.completed-course-remove {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--red-dark);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.completed-course-remove:hover { background: rgba(166,25,46,.10); }
.completed-course-autocomplete { position: relative; }
.completed-course-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + .3rem);
  right: 0;
  left: 0;
  max-height: 18rem;
  overflow-y: auto;
  padding: .3rem;
  border: 1px solid #cfd4d9;
  border-radius: .7rem;
  background: white;
  box-shadow: 0 12px 28px rgba(22,32,42,.16);
}
.completed-course-suggestion {
  display: grid;
  width: 100%;
  gap: .12rem;
  padding: .6rem .65rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.completed-course-suggestion strong { font-size: .78rem; }
.completed-course-suggestion span { color: var(--muted); font-size: .7rem; font-weight: 600; }
.completed-course-suggestion:hover, .completed-course-suggestion.is-active { background: #f5f0ed; }
.completed-course-help { color: var(--muted); font-size: .68rem; font-weight: 550; line-height: 1.35; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
label { display: grid; gap: .35rem; color: #36424d; }
.check-list { display: grid; gap: .5rem; }
.check-row { display: flex; grid-template-columns: none; align-items: center; gap: .55rem; font-weight: 600; }
.check-row input { width: 1rem; min-height: 1rem; accent-color: var(--red); }
.unavailable-option { color: #7d8790; }
.unavailable-option input { cursor: not-allowed; opacity: .58; }
.filter-unavailable-note { margin-top: .25rem; padding-top: .55rem; border-top: 1px dashed #d8dde1; }
.time-filter-control { display: grid; gap: .35rem; }
.time-filter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
}
.time-filter-label-row label { display: block; min-width: 0; }
.time-reset {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: .24rem .5rem;
  border: 1px solid var(--red);
  border-radius: .45rem;
  color: var(--red);
  background: #fff7f8;
  cursor: pointer;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.time-reset:hover { border-color: var(--red); color: var(--red-dark); background: #fff0f2; }
.day-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.day-grid .day-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: .35rem .45rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  color: var(--theme-text);
  background: var(--surface-raised);
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 850;
}
.day-grid .day-toggle:hover { border-color: var(--theme-accent); }
.day-grid .day-toggle[data-state="include"] {
  border-color: var(--theme-accent);
  color: var(--theme-background);
  background: var(--theme-accent);
}
.day-grid .day-toggle[data-state="exclude"] {
  border-color: color-mix(in srgb, var(--theme-text) 82%, var(--theme-background));
  color: var(--theme-background);
  background: color-mix(in srgb, var(--theme-text) 88%, var(--theme-background));
}
.day-filter-help { grid-column: 1 / -1; margin-top: -.05rem; }
.microcopy { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }

.results { min-width: 0; scroll-margin-top: 6rem; }
.results-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  min-height: 2.8rem;
  margin-bottom: .7rem;
}
.active-filters { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.filter-chip { padding: .35rem .55rem; border: 1px solid #d5dade; border-radius: 999px; background: rgba(255,255,255,.75); color: #46525d; font-size: .72rem; }
.loading, .error, .empty { padding: 2rem; border: 1px dashed #cbd1d6; border-radius: 1rem; color: var(--muted); text-align: center; background: rgba(255,255,255,.55); }
.error { color: #8b1d2c; }
.service-alerts { display: grid; gap: .45rem; width: min(1180px, calc(100% - 2rem)); margin: .8rem auto 0; }
.service-alerts[hidden] { display: none; }
.service-alert { padding: .7rem .85rem; border: 1px solid #ead9a8; border-radius: .72rem; color: #785810; background: #fffaf0; font-size: .76rem; font-weight: 750; box-shadow: 0 4px 12px rgba(22,32,42,.035); }
.course-list { display: grid; gap: .85rem; }
.course-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(230px, .75fr);
  gap: 1rem;
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(22,32,42,.035);
}
.course-card:hover { border-color: #c4cbd1; box-shadow: var(--shadow); transform: translateY(-1px); transition: .16s ease; }
.course-top { display: flex; gap: .8rem; align-items: start; }
.course-code-wrap {
  position: relative;
  display: flex;
  flex: 0 0 6.8rem;
  align-items: center;
  gap: .42rem;
  min-width: 6.8rem;
}
.course-code { margin: 0; color: var(--red); font-size: 1.03rem; font-weight: 900; white-space: nowrap; }
.course-info {
  position: static;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.22rem;
  height: 1.22rem;
  padding: 0;
  border: 1px solid #b9c1c8;
  border-radius: 999px;
  color: #586574;
  background: white;
  cursor: help;
  font-family: Georgia, serif;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1;
}
.course-info:hover, .course-info:focus { border-color: var(--red); color: var(--red); }
.course-favorite {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: .38rem;
  color: #65717c;
  background: transparent;
  cursor: pointer;
}
.course-favorite:hover, .course-favorite:focus-visible { color: #b68416; background: #fff6dd; outline: none; }
.favorite-star-icon { display: block; width: 1.15rem; height: 1.15rem; overflow: visible; }
.favorite-star-icon path { fill: transparent; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; transition: fill .12s ease, stroke .12s ease; }
.course-favorite.is-favorite { color: #e0ac27; }
.course-favorite.is-favorite .favorite-star-icon path { fill: #f4c542; stroke: #d9a51f; }
.course-tooltip {
  position: absolute;
  top: calc(100% + .55rem);
  left: 0;
  z-index: 30;
  width: min(25rem, calc(100vw - 3rem));
  padding: .72rem .8rem;
  border: 1px solid #ccd2d7;
  border-radius: .68rem;
  color: var(--ink);
  background: white;
  box-shadow: 0 12px 28px rgba(22,32,42,.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .75rem;
  font-weight: 520;
  line-height: 1.48;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(0, -.2rem);
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
  visibility: hidden;
  white-space: normal;
}
.course-tooltip::before {
  position: absolute;
  bottom: 100%;
  left: 5.35rem;
  width: .65rem;
  height: .65rem;
  border-top: 1px solid #ccd2d7;
  border-left: 1px solid #ccd2d7;
  background: white;
  content: "";
  transform: translate(-50%, 50%) rotate(45deg);
}
.course-info:hover .course-tooltip, .course-info:focus .course-tooltip {
  opacity: 1;
  transform: translate(0, 0);
  visibility: visible;
}
.course-card h3 { margin: 0; font-size: 1.1rem; letter-spacing: -.02em; }
.course-meta { margin: .28rem 0 0; color: var(--muted); font-size: .78rem; }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .85rem; }
.badge { padding: .28rem .5rem; border-radius: 999px; background: #eef1f3; color: #3f4b56; font-size: .68rem; font-weight: 780; }
.badge.open { color: #075c33; background: #e0f4e9; }
.badge.waitlist { color: #7f4a00; background: #fff0d8; }
.badge.closed { color: #8a2130; background: #fae5e8; }
.schedule-grid { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); gap: .8rem; margin-top: 1rem; }
.data-label { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.data-value { display: block; font-size: .82rem; font-weight: 720; }
.seat-value { font-weight: 850; }
.data-subvalue { display: block; margin-top: .16rem; color: var(--muted); font-size: .67rem; line-height: 1.25; }
.professor-panel { padding: .9rem; border-radius: .8rem; background: #f5f6f7; }
.professor-panel p { margin: 0; }
.professor-name { margin: 0; font-size: 1.08rem; font-weight: 850; line-height: 1.2; }
.professor-profile-link { display: inline-flex; align-items: center; gap: .22rem; color: inherit; font-weight: 850; text-decoration: none; }
.professor-profile-link:hover { color: var(--red); text-decoration: underline; text-underline-offset: .15em; }
.external-link-mark { font-size: .72em; }
.rmp-source-label { margin-top: .18rem !important; color: var(--muted); font-size: .62rem; font-weight: 750; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .75rem; }
.professor-metrics { margin-top: .7rem; }
.rmp-stat-list { overflow: hidden; border: 1px solid #e0e4e7; border-radius: .65rem; background: white; }
.rmp-stat-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .48rem .62rem; }
.rmp-stat-row + .rmp-stat-row { border-top: 1px solid #edf0f2; }
.rmp-stat-row span { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.rmp-stat-row strong { flex: 0 0 auto; color: #18222b; font-size: .82rem; font-weight: 850; text-align: right; }
.rmp-score { display: inline-flex; align-items: center; justify-content: center; min-width: 3.5rem; padding: .2rem .42rem; border-radius: .42rem; border: 1px solid transparent; line-height: 1.1; }
.rmp-score.neutral { color: #27333d; background: #f2f4f5; border-color: #e3e7e9; }
.rmp-score.good { color: #075c33; background: #e4f5eb; border-color: #bfe6cf; }
.rmp-score.mixed { color: #7a4a00; background: #fff2cf; border-color: #f1d88f; }
.rmp-score.poor { color: #8a2130; background: #fae5e8; border-color: #efc2c8; }
.metric { padding: .55rem; border-radius: .65rem; background: white; text-align: center; }
.metric strong { display: block; font-size: 1.12rem; }
.metric span { color: var(--muted); font-size: .61rem; text-transform: uppercase; letter-spacing: .06em; }
.review-flags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; color: var(--muted); font-size: .68rem; }
.review-flags span { padding: .26rem .42rem; border: 1px solid #d8dde1; border-radius: .45rem; background: white; }

.pagination {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  min-height: 4.5rem;
  margin-top: 1.15rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255,255,255,.72);
}
.pagination-summary { margin: 0; color: var(--muted); font-size: .78rem; font-weight: 750; text-align: center; }
.pagination-top {
  flex: 0 0 auto;
  flex-direction: row;
  gap: .55rem;
  min-height: auto;
  margin: 0;
  padding: .34rem .4rem .34rem .65rem;
  border-radius: .78rem;
  background: rgba(255,255,255,.86);
}
.pagination-top .pagination-summary { white-space: nowrap; }
.pagination-top .page-button { min-width: 2.05rem; min-height: 2rem; padding: .32rem .48rem; }
.pagination-top .page-nav { min-width: 4.65rem; }
.page-controls, .page-buttons { display: flex; align-items: center; justify-content: center; gap: .35rem; }
.page-button {
  min-width: 2.45rem;
  min-height: 2.35rem;
  padding: .48rem .65rem;
  border: 1px solid #ccd2d7;
  border-radius: .62rem;
  background: white;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
}
.page-button:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.page-button.current { border-color: var(--red); color: white; background: var(--red); }
.page-button:disabled { cursor: not-allowed; opacity: .48; }
.page-button.current:disabled { opacity: 1; }
.page-nav { min-width: 5.3rem; }
.page-ellipsis { min-width: 1.7rem; color: var(--muted); text-align: center; }

footer { padding: 1.4rem clamp(1rem, 4vw, 4rem) 2rem; color: var(--muted); text-align: center; font-size: .75rem; }
.footer-inner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .45rem 1rem; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--red-dark); font-weight: 800; }

.about-view { width: min(1040px, 100%); margin: 0 auto; }
.about-hero { padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 1rem; background: white; box-shadow: var(--shadow); }
.about-hero h2 { margin: .28rem 0 .7rem; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.035em; }
.about-hero > p:not(.eyebrow):not(.about-updated) { max-width: 760px; margin: 0; color: #46535f; font-size: .92rem; line-height: 1.65; }
.about-updated { margin: .9rem 0 0; color: var(--muted); font-size: .68rem; font-weight: 750; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.about-card { padding: 1.1rem 1.15rem; border: 1px solid var(--line); border-radius: 1rem; background: white; box-shadow: 0 6px 18px rgba(22,32,42,.035); }
.about-card-wide { grid-column: 1 / -1; }
.about-section-heading { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.about-section-heading h3 { margin: .12rem 0 0; font-size: 1.06rem; }
.about-icon { display: grid; place-items: center; flex: 0 0 auto; width: 2.25rem; height: 2.25rem; border-radius: .65rem; color: var(--red-dark); background: #f8e9ec; font-weight: 900; }
.about-card > p { margin: .65rem 0 0; color: #4e5b66; font-size: .78rem; line-height: 1.6; }
.privacy-table { overflow: hidden; border: 1px solid #e2e6e9; border-radius: .78rem; }
.privacy-row { display: grid; grid-template-columns: minmax(140px, .32fr) minmax(0, 1fr); gap: 1rem; padding: .78rem .85rem; background: #fafbfb; }
.privacy-row + .privacy-row { border-top: 1px solid #e2e6e9; }
.privacy-row strong { font-size: .76rem; }
.privacy-row span { color: #53616c; font-size: .74rem; line-height: 1.5; }
.about-note { padding: .75rem .85rem; border-left: 3px solid var(--gold); color: #4a5560; background: #fffaf0; }
.source-list { display: grid; gap: .75rem; }
.source-item { padding: .8rem .85rem; border: 1px solid #e2e6e9; border-radius: .78rem; background: #fafbfb; }
.source-item > strong { font-size: .8rem; }
.source-item p { margin: .35rem 0 .55rem; color: #53616c; font-size: .74rem; line-height: 1.5; }
.source-links { display: flex; flex-wrap: wrap; gap: .38rem .75rem; }
.source-links a { color: var(--red-dark); font-size: .7rem; font-weight: 800; }
.about-verification { border-color: #d9c58e; background: #fffdf8; }

.favorites-view { width: min(1120px, 100%); margin: 0 auto; }
.favorites-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1.05rem 1.15rem; border: 1px solid var(--line); border-radius: 1rem; background: white; box-shadow: 0 6px 18px rgba(22,32,42,.035); }
.favorites-heading h2 { margin: .18rem 0 .25rem; font-size: 1.45rem; }
.favorites-heading p:last-child { margin: 0; color: var(--muted); font-size: .82rem; }
.favorites-empty { margin-top: .85rem; }

@media (max-width: 1240px) {
  .toolbar { grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr) minmax(120px, auto); }
  .term-control { grid-column: 1 / -1; }
  .layout { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 1050px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .results-top-row { align-items: stretch; flex-direction: column; }
  .pagination-top { align-self: flex-end; }
  .term-control { grid-column: 1 / -1; }
  .result-summary { align-items: flex-start; border-left: 0; border-top: 1px solid var(--line); padding: .75rem 0 0; text-align: left; }
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .course-card { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { padding: .8rem 1rem .4rem; }
  .site-header-inner { gap: .25rem; }
  .brand-logo { width: 2.8rem; height: 2.15rem; }
  .site-header h1 { font-size: 1.55rem; }
  .header-actions { gap: 0; margin-left: .2rem; }
  .header-nav-button { width: 2rem; min-width: 2rem; height: 2rem; min-height: 2rem; }
  .header-note { text-align: left; }
  .favorites-heading { align-items: flex-start; flex-direction: column; }
  .about-grid { grid-template-columns: 1fr; }
  .about-card-wide { grid-column: auto; }
  .privacy-row { grid-template-columns: 1fr; gap: .3rem; }
  .toolbar { position: static; grid-template-columns: 1fr; }
  .term-control { grid-column: auto; }
  .layout { grid-template-columns: 1fr; }
  .layout { height: auto; overflow: visible; }
  .filters { height: auto; overflow: visible; order: 1; }
  .results { height: auto; overflow: visible; order: 0; }
  .course-top { flex-direction: column; gap: .35rem; }
  .course-code-wrap { flex-basis: auto; min-width: 0; }
  .pagination-top { align-self: stretch; flex-direction: column; }
  .pagination-top .page-controls { width: 100%; }
  .schedule-grid { grid-template-columns: 1fr 1fr; }
  .page-controls { flex-wrap: wrap; }
  .page-buttons { order: -1; width: 100%; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .schedule-grid, .two-col { grid-template-columns: 1fr; }
  .page-nav { flex: 1; }
}

.catalog-status {
  display: grid;
  gap: .18rem;
  padding: .65rem .7rem;
  border: 1px solid #d8dde1;
  border-radius: .65rem;
  color: #5e6872;
  background: #f7f8f9;
  font-size: .68rem;
  line-height: 1.4;
}
.catalog-status strong { color: #3c4853; font-size: .73rem; }
.catalog-status span { display: block; }
.catalog-status-loaded {
  border-color: #b7d9c6;
  color: #286343;
  background: #edf8f1;
}
.catalog-status-loaded strong { color: #174c31; }
.program-summary {
  display: grid;
  gap: .45rem;
  padding: .72rem;
  border: 1px solid #d6dce1;
  border-radius: .7rem;
  background: #fbfcfc;
}
.program-summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem;
}
.program-summary-heading strong { font-size: .76rem; line-height: 1.35; }
.program-summary-heading a { flex: 0 0 auto; color: var(--red); font-size: .66rem; font-weight: 850; }
.program-summary p { margin: 0; color: #4c5965; font-size: .68rem; line-height: 1.45; }
.program-summary .microcopy { color: var(--muted); font-size: .64rem; }

.course-card-grouped { grid-template-columns: 1fr; }
.component-group {
  margin-top: .95rem;
}
.component-group-title {
  margin: 0 0 .38rem;
  color: #24303a;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.component-table {
  overflow: hidden;
  border: 1px solid #d7dce0;
  border-radius: .55rem;
  background: #fff;
}
.component-header,
.component-row {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(190px, 1.3fr) minmax(170px, 1.1fr) minmax(140px, 1fr) minmax(135px, .9fr);
  gap: 1rem;
  align-items: center;
}
.component-header {
  padding: .46rem .8rem;
  border-bottom: 1px solid #d7dce0;
  background: #f6f7f8;
  color: var(--muted);
  font-size: .57rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.component-row {
  padding: .72rem .8rem;
  border-top: 1px solid #e7eaec;
  font-size: .76rem;
  line-height: 1.35;
}
.component-row:nth-child(2) { border-top: 0; }
.component-class,
.component-cell { min-width: 0; }
.component-name {
  display: block;
  color: #1e5f9e;
  font-size: .8rem;
  line-height: 1.25;
}
.component-class-number {
  display: block;
  margin-top: .14rem;
  color: #27333d;
  font-size: .69rem;
  font-weight: 750;
}
.component-subvalue { display: block; margin-top: .12rem; color: var(--muted); font-size: .65rem; }
.component-seat { font-weight: 800; }
.component-seat.open { color: #075c33; }
.component-seat.waitlist { color: #7f4a00; }
.component-seat.closed { color: #8a2130; }
.component-professor-name { display: inline-flex; color: #1f2933; font-size: .84rem; font-weight: 850; line-height: 1.25; }
.component-professor-meta { display: block; margin-top: .16rem; color: var(--muted); font-size: .63rem; line-height: 1.35; }
.rmp-component-metrics { display: block; margin-top: .3rem; border-top: 1px solid #e2e6e9; }
.rmp-component-stat { display: flex !important; align-items: baseline; justify-content: space-between; gap: .55rem; padding: .18rem 0; }
.rmp-component-stat + .rmp-component-stat { border-top: 1px solid #eef1f3; }
.rmp-component-stat > span { color: var(--muted); font-size: .58rem; font-weight: 750; text-transform: uppercase; letter-spacing: .025em; }
.rmp-component-stat strong { font-size: .66rem; font-weight: 850; white-space: nowrap; }
.rmp-component-stat .rmp-score { min-width: 2.9rem; padding: .12rem .3rem; border-radius: .34rem; }
.grouped-badges { margin-top: .7rem; margin-bottom: .15rem; }
.shared-course-info {
  margin-top: .95rem;
  padding-top: .85rem;
  border-top: 1px solid #dfe3e6;
}
.shared-course-title {
  margin: 0 0 .65rem;
  color: #24303a;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.shared-tag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: .7rem 1rem;
  margin-bottom: .7rem;
}
.shared-badges { margin-top: .28rem; }
.shared-empty { color: var(--muted); font-size: .7rem; }
.grouped-shared-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
@media (max-width: 1100px) {
  .component-header, .component-row { grid-template-columns: minmax(140px, .8fr) repeat(2, minmax(150px, 1fr)); align-items: start; }
  .component-header > :nth-child(4), .component-header > :nth-child(5) { display: none; }
  .grouped-shared-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}
@media (max-width: 720px) {
  .component-header { display: none; }
  .component-row { grid-template-columns: 1fr; gap: .45rem; align-items: start; }
  .component-cell::before { display: block; margin-bottom: .08rem; color: var(--muted); font-size: .56rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
  .component-row .component-cell:nth-child(2)::before { content: "Meetings"; }
  .component-row .component-cell:nth-child(3)::before { content: "Location"; }
  .component-row .component-cell:nth-child(4)::before { content: "Professor"; }
  .component-row .component-cell:nth-child(5)::before { content: "Seats"; }
  .shared-tag-grid, .grouped-shared-grid { grid-template-columns: 1fr; }
}



.admin-view { width: min(1180px, 100%); margin: 0 auto; }
.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  box-shadow: 0 6px 18px rgba(22,32,42,.035);
}
.admin-heading h2 { margin: .18rem 0 .25rem; font-size: 1.55rem; }
.admin-heading p:last-child { margin: 0; color: var(--muted); font-size: .82rem; }
.admin-refresh {
  min-height: 2.45rem;
  padding: .55rem .9rem;
  border: 1px solid #cbd2d8;
  border-radius: .68rem;
  background: white;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 850;
}
.admin-refresh:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.admin-refresh:disabled { cursor: wait; opacity: .55; }
.admin-loading { margin-bottom: 1rem; }
.admin-dashboard { display: grid; gap: 1rem; }
.admin-status-card,
.admin-section {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  box-shadow: 0 6px 18px rgba(22,32,42,.035);
}
.admin-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
}
.admin-kicker { margin: 0 0 .25rem; color: var(--muted); font-size: .67rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.admin-status-line { display: flex; align-items: center; gap: .55rem; font-size: 1rem; }
.admin-status-dot { width: .72rem; height: .72rem; border-radius: 50%; background: #9aa4ad; box-shadow: 0 0 0 4px rgba(154,164,173,.13); }
.admin-status-dot.is-good { background: #278352; box-shadow: 0 0 0 4px rgba(39,131,82,.13); }
.admin-status-dot.is-bad { background: var(--red); box-shadow: 0 0 0 4px rgba(166,25,46,.13); }
.admin-checked-at { margin: 0; color: var(--muted); font-size: .75rem; }
.admin-section { padding: 1rem 1.15rem 1.15rem; }
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.admin-section-heading h3 { margin: 0; font-size: 1.02rem; }
.admin-health-badge { padding: .35rem .6rem; border-radius: 999px; color: #596671; background: #eef1f3; font-size: .68rem; font-weight: 900; }
.admin-health-badge.is-good { color: #1d6440; background: #e5f5eb; }
.admin-health-badge.is-bad { color: #8e1728; background: #fbe7ea; }
.admin-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.admin-metric-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-metric { display: grid; gap: .18rem; min-height: 5rem; padding: .75rem .8rem; border: 1px solid #e2e6e9; border-radius: .75rem; background: #fafbfb; }
.admin-metric-label { color: var(--muted); font-size: .68rem; font-weight: 750; }
.admin-metric-value { align-self: end; font-size: 1.28rem; line-height: 1; letter-spacing: -.025em; }
.admin-metric-note { color: var(--muted); font-size: .64rem; }
.admin-metric-good { border-color: #b9dfc8; background: #f2faf5; }
.admin-metric-good .admin-metric-value { color: #236e46; }
.admin-metric-warning { border-color: #ead9a8; background: #fffaf0; }
.admin-metric-warning .admin-metric-value { color: #8a6514; }
.admin-metric-bad { border-color: #ebbbc3; background: #fff5f6; }
.admin-metric-bad .admin-metric-value { color: var(--red); }
.admin-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-progress { height: .48rem; margin-top: .85rem; overflow: hidden; border-radius: 999px; background: #e8ecef; }
.admin-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: #278352; transition: width .2s ease; }
.admin-note { margin: .6rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.admin-seat-refresh-form {
  display: grid;
  gap: .4rem;
  margin: 0 0 .85rem;
  padding: .8rem;
  border: 1px solid #e2e6e9;
  border-radius: .75rem;
  background: #fafbfb;
}
.admin-seat-refresh-form label { font-size: .72rem; font-weight: 800; }
.admin-seat-refresh-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; }
.admin-seat-course-autocomplete { position: relative; }
.admin-seat-course-autocomplete input { width: 100%; min-height: 2.45rem; }
.admin-seat-refresh-result { min-height: 1rem; margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.admin-seat-refresh-result.is-success { color: #236e46; }
.admin-seat-refresh-result.is-error { color: #8e1728; font-weight: 700; }
.admin-seat-failure-note { margin: -.25rem 0 .75rem; }
.admin-seat-failure-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e6e9;
  border-radius: .78rem;
}
.admin-seat-failure-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: white;
  font-size: .7rem;
}
.admin-seat-failure-table th,
.admin-seat-failure-table td {
  padding: .68rem .72rem;
  border-bottom: 1px solid #e6eaed;
  text-align: left;
  vertical-align: top;
}
.admin-seat-failure-table th {
  color: #53606a;
  background: #f6f8f9;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-seat-failure-table tbody tr:last-child td { border-bottom: 0; }
.admin-seat-failure-course { display: grid; gap: .22rem; min-width: 8rem; }
.admin-seat-failure-course strong { color: #222d35; font-size: .76rem; }
.admin-seat-failure-course a { color: var(--red); font-size: .64rem; font-weight: 750; }
.admin-seat-failure-error { min-width: 18rem; max-width: 34rem; color: #4b555d; line-height: 1.42; overflow-wrap: anywhere; }
.admin-seat-failure-error strong { color: #7f1222; }
.admin-seat-failure-status { display: inline-flex; padding: .25rem .48rem; border-radius: 999px; font-size: .63rem; font-weight: 900; }
.admin-seat-failure-status.is-unresolved { color: #8e1728; background: #fbe7ea; }
.admin-seat-failure-status.is-recovered { color: #1d6440; background: #e5f5eb; }
.admin-seat-failure-retry { min-height: 2rem; padding: .38rem .62rem; white-space: nowrap; }
.admin-seat-failure-empty { padding: 1rem !important; color: var(--muted); text-align: center !important; }
.admin-professor-override-note { margin: -.25rem 0 .75rem; }
.admin-professor-override-form {
  display: grid;
  gap: .45rem;
  margin-bottom: .85rem;
  padding: .8rem;
  border: 1px solid #e2e6e9;
  border-radius: .75rem;
  background: #fafbfb;
}
.admin-professor-override-fields {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(300px, 1.2fr) auto;
  align-items: end;
  gap: .6rem;
}
.admin-professor-override-fields label { min-width: 0; font-size: .72rem; font-weight: 800; }
.admin-professor-override-fields input { width: 100%; min-height: 2.45rem; }
.admin-professor-autocomplete { position: relative; display: block; }
.admin-professor-override-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e6e9;
  border-radius: .78rem;
}
.admin-professor-override-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: white;
  font-size: .7rem;
}
.admin-professor-override-table th,
.admin-professor-override-table td {
  padding: .68rem .72rem;
  border-bottom: 1px solid #e6eaed;
  text-align: left;
  vertical-align: top;
}
.admin-professor-override-table th {
  color: #53606a;
  background: #f6f8f9;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-professor-override-table tbody tr:last-child td { border-bottom: 0; }
.admin-professor-override-table td > strong,
.admin-professor-override-table td > span { display: block; }
.admin-professor-override-table td > span { margin-top: .18rem; color: var(--muted); font-size: .64rem; }
.admin-professor-override-table a { color: var(--red); font-weight: 800; }
.admin-professor-override-actions { display: flex; gap: .35rem; }
.admin-professor-override-actions .admin-refresh { min-height: 2rem; padding: .38rem .62rem; white-space: nowrap; }
.admin-professor-override-remove { color: #8e1728; }
.admin-warning-list { margin-top: .85rem; padding: .8rem; border: 1px solid #ebbbc3; border-radius: .75rem; color: #7f1222; background: #fff5f6; font-size: .72rem; }
.admin-warning-list strong { display: block; margin-bottom: .35rem; }
.admin-warning-list ul { margin: 0; padding-left: 1.15rem; }
.admin-file-list { display: grid; gap: .55rem; }
.admin-file-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .75rem; border: 1px solid #e2e6e9; border-radius: .72rem; background: #fafbfb; }
.admin-file-row > div:first-child { display: grid; gap: .12rem; min-width: 0; }
.admin-file-row strong { font-size: .76rem; }
.admin-file-row > div:first-child span { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-file-meta { display: grid; gap: .12rem; flex: 0 0 auto; color: var(--muted); font-size: .65rem; text-align: right; }
.admin-error-list { display: grid; gap: .65rem; }
.admin-error-row { display: grid; gap: .45rem; padding: .8rem .85rem; border: 1px solid #ebbbc3; border-radius: .78rem; background: #fff8f9; }
.admin-error-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.admin-error-heading strong { color: #7f1222; font-size: .78rem; }
.admin-error-heading span { flex: 0 0 auto; color: var(--muted); font-size: .65rem; }
.admin-error-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; color: var(--muted); font-size: .65rem; }
.admin-error-meta code { overflow-wrap: anywhere; color: #36414a; font-size: .65rem; }
.admin-error-status { padding: .18rem .38rem; border-radius: .35rem; color: #fff; background: #9c2436; font-weight: 900; }
.admin-error-row p { margin: 0; color: #4b555d; font-size: .69rem; line-height: 1.45; overflow-wrap: anywhere; }
.admin-error-row small { color: var(--muted); font-size: .62rem; }
.admin-errors-empty { margin: 0; padding: .85rem; border: 1px dashed #cbd1d6; border-radius: .75rem; color: var(--muted); background: #fafbfb; font-size: .72rem; text-align: center; }

@media (max-width: 900px) {
  .admin-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-two-column { grid-template-columns: 1fr; }
  .admin-professor-override-fields { grid-template-columns: 1fr 1fr; }
  .admin-professor-override-fields .admin-refresh { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .admin-heading, .admin-status-card, .admin-file-row { align-items: flex-start; flex-direction: column; }
  .admin-refresh { width: 100%; }
  .admin-metric-grid, .admin-metric-grid-compact { grid-template-columns: 1fr; }
  .admin-file-meta { text-align: left; }
  .admin-error-heading { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .admin-seat-refresh-row { grid-template-columns: 1fr; }
  .admin-professor-override-fields { grid-template-columns: 1fr; }
  .admin-professor-override-fields .admin-refresh { grid-column: auto; }
}

.admin-heading-actions { display: flex; align-items: center; gap: .55rem; }
.admin-logout { color: #7d1e2c; }
.admin-auth-panel { width: min(520px, 100%); margin: 0 auto; }
.admin-login-card {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  box-shadow: 0 6px 18px rgba(22,32,42,.035);
}
.admin-login-card h3 { margin: .18rem 0 .35rem; font-size: 1.08rem; }
.admin-login-card > p:not(.admin-kicker):not(.admin-login-error) { margin: 0 0 .9rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.admin-login-form { display: grid; gap: .4rem; }
.admin-login-form label { font-size: .72rem; font-weight: 800; }
.admin-login-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; }
.admin-login-row input { min-height: 2.45rem; }
.admin-login-error { margin: .65rem 0 0; color: #8e1728; font-size: .72rem; font-weight: 700; }

@media (max-width: 560px) {
  .admin-heading-actions { width: 100%; }
  .admin-heading-actions .admin-refresh { flex: 1; }
  .admin-login-row { grid-template-columns: 1fr; }
}


.seat-freshness {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.seat-freshness.is-fresh {
  color: #147a43;
}

.seat-freshness.is-stale {
  color: #9a6700;
}

#admin-seat-refresh-now[disabled] {
  opacity: 0.55;
  cursor: wait;
}

.seat-card-freshness,
.component-seat-freshness {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  margin-top: .28rem;
  font-size: .66rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.seat-card-freshness.fresh,
.component-seat-freshness.fresh {
  color: #147a43;
}

.seat-card-freshness.stale,
.component-seat-freshness.stale {
  color: #9a6700;
}

.seat-card-freshness.pending,
.component-seat-freshness.pending {
  color: var(--muted);
  font-weight: 600;
}


/* Four-color theme system -------------------------------------------------- */
html,
body { transition: background-color .16s ease, color .16s ease; }

.site-header h1 { color: var(--theme-ui); }
.header-nav-favorite-icon { color: var(--theme-accent); }
.header-nav-count { color: var(--theme-background); background: var(--theme-accent); }

.toolbar,
.filters,
.course-card,
.pagination,
.pagination-top,
.about-hero,
.about-card,
.favorites-heading,
.admin-heading,
.admin-section,
.admin-login-card,
.component-table,
.program-summary {
  color: var(--theme-text);
  border-color: var(--line);
  background: var(--surface);
}

.toolbar { background: color-mix(in srgb, var(--surface) 94%, transparent); }
.filters.filters-side-flyout > details[open] > .filter-body,
.course-tooltip,
.course-tooltip::before,
.completed-course-suggestions {
  color: var(--theme-text);
  border-color: var(--line);
  background: var(--surface);
}

input,
select,
.segmented button,
.page-button,
.day-grid .day-toggle,
.time-reset,
.completed-course-chip,
.filter-chip,
.badge:not(.open):not(.waitlist):not(.closed),
.professor-panel,
.rmp-stat-list,
.metric,
.review-flags span,
.catalog-status,
.privacy-row,
.source-item,
.admin-metric,
.admin-file-row,
.admin-errors-empty,
.component-header {
  color: var(--theme-text);
  border-color: var(--line);
  background: var(--surface-raised);
}

input::placeholder { color: var(--muted); }
.control-label,
.result-summary small,
.microcopy,
.course-meta,
.data-label,
.data-subvalue,
.rmp-source-label,
.rmp-stat-row span,
.metric span,
.pagination-summary,
footer,
.favorites-heading p:last-child,
.about-updated,
.component-subvalue,
.component-professor-meta,
.program-summary .microcopy,
.admin-heading p:last-child {
  color: var(--muted);
}

label,
.completed-course-label,
.filters > details > summary,
.filter-chip,
.course-info,
.rmp-stat-row strong,
.component-group-title,
.shared-course-title,
.component-class-number,
.component-professor-name,
.about-hero > p:not(.eyebrow):not(.about-updated),
.about-card > p,
.privacy-row span,
.source-item p,
.program-summary p {
  color: var(--theme-text);
}

.segmented button[aria-pressed="true"],
.day-grid .day-toggle[data-state="include"],
.page-button.current {
  border-color: var(--theme-accent);
  color: var(--theme-background);
  background: var(--theme-accent);
}

.filters > details > summary:hover {
  color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 7%, var(--surface));
}
.filters > details[open] > summary {
  color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 10%, var(--surface));
}

.completed-course-chip,
.time-reset {
  color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 8%, var(--surface));
}
.completed-course-remove { color: var(--theme-accent); }
.completed-course-remove:hover,
.time-reset:hover,
.completed-course-suggestion:hover,
.completed-course-suggestion.is-active {
  color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 12%, var(--surface));
}

.course-info { background: var(--surface-raised); }
.course-favorite { color: var(--theme-ui); }
.course-favorite:hover,
.course-favorite:focus-visible,
.course-favorite.is-favorite { color: var(--theme-accent); background: color-mix(in srgb, var(--theme-accent) 10%, transparent); }
.course-favorite.is-favorite .favorite-star-icon path { fill: var(--theme-accent); stroke: var(--theme-accent); }

.badge:not(.open):not(.waitlist):not(.closed),
.filter-chip,
.review-flags span {
  background: color-mix(in srgb, var(--theme-ui) 18%, var(--theme-background));
}

.pagination,
.loading,
.empty { background: color-mix(in srgb, var(--theme-ui) 8%, var(--theme-background)); }
.page-button:not(.current) { background: var(--surface-raised); }

.about-icon {
  color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 12%, var(--surface));
}
.privacy-row,
.source-item,
.program-summary,
.component-header,
.catalog-status {
  background: color-mix(in srgb, var(--theme-ui) 9%, var(--surface));
}

/* Bottom-right theme picker */
.theme-picker {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 100;
  display: grid;
  justify-items: end;
  gap: .55rem;
}
.theme-picker-toggle {
  display: grid;
  min-width: 4.95rem;
  height: 2.7rem;
  place-items: center;
  padding: .35rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--theme-text);
  background: color-mix(in srgb, var(--theme-ui) 20%, var(--theme-background));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--theme-text) 18%, transparent);
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.theme-picker-toggle:hover,
.theme-picker-toggle[aria-expanded="true"] {
  border-color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-ui) 28%, var(--theme-background));
}
.theme-toggle-swatches,
.theme-swatches {
  display: flex;
  align-items: center;
}
.theme-toggle-swatches { gap: .24rem; }
.theme-toggle-dot,
.theme-swatches i {
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
}
.theme-toggle-dot {
  width: .78rem;
  height: .78rem;
  border: 1px solid color-mix(in srgb, var(--theme-text) 18%, transparent);
}
.theme-toggle-background { background: var(--theme-background); }
.theme-toggle-accent { background: var(--theme-accent); }
.theme-toggle-text { background: var(--theme-text); }
.theme-toggle-ui { background: var(--theme-ui); }
.theme-picker-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + .6rem);
  width: min(20rem, calc(100vw - 2rem));
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  color: var(--theme-text);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 18px 45px color-mix(in srgb, var(--theme-text) 18%, transparent);
  backdrop-filter: blur(16px);
}
.theme-picker-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding: .25rem .35rem .55rem;
}
.theme-picker-heading strong { font-size: .8rem; }
.theme-picker-heading span { color: var(--muted); font-size: .64rem; font-weight: 700; }
.theme-options {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: .65rem;
}
.theme-option {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .55rem .65rem;
  border: 1px solid transparent;
  border-radius: 0;
  color: var(--theme-text);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.theme-option:hover { background: color-mix(in srgb, var(--theme-ui) 12%, transparent); }
.theme-option[aria-checked="true"] {
  border-color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 11%, transparent);
}
.theme-option-name { font-size: .76rem; font-weight: 800; }
.theme-swatches { gap: .22rem; }
.theme-swatches i {
  width: 1rem;
  height: 1rem;
  border: 1px solid color-mix(in srgb, white 22%, transparent);
  background: var(--swatch);
}
.theme-picker-key {
  margin: .55rem .35rem .1rem;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-align: right;
}

@media (max-width: 760px) {
  .theme-picker { right: .75rem; bottom: .75rem; }
  .theme-picker-toggle { min-width: 4.6rem; height: 2.5rem; }
  .theme-picker-panel { width: min(19rem, calc(100vw - 1.5rem)); }
}

/* Theme polish: flat surfaces and reliable About-page contrast ------------ */
:root {
  --shadow: none;
}

.toolbar,
.filters,
.course-card,
.pagination,
.pagination-top,
.about-hero,
.about-card,
.favorites-heading,
.admin-heading,
.admin-section,
.admin-login-card,
.component-table,
.program-summary,
.theme-picker-toggle,
.theme-picker-panel {
  box-shadow: none;
}

.toolbar,
.theme-picker-toggle,
.theme-picker-panel {
  backdrop-filter: none;
}

.header-nav-button:focus-visible,
input:focus,
select:focus,
button:focus-visible {
  box-shadow: none;
  outline: 2px solid var(--theme-accent);
  outline-offset: 2px;
}

.about-note {
  color: var(--theme-text);
  border-left-color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-ui) 10%, var(--theme-background));
}
.about-note strong {
  color: var(--theme-text);
}

/* Header optical alignment + complete Admin theme coverage ---------------- */
/* The CC cover is the visual reference. Text glyphs and icon SVGs sit a little
   low inside their own line/view boxes, so offset those elements—not the logo. */
.site-header h1 {
  transform: translateY(-.20rem);
}
.header-actions {
  transform: translateY(-.10rem);
}

/* Admin surfaces should use the same four-color theme model as the browse UI. */
.admin-view {
  color: var(--theme-text);
}

.admin-heading,
.admin-status-card,
.admin-section,
.admin-login-card {
  color: var(--theme-text);
  border-color: var(--line);
  background: var(--surface);
}

.admin-refresh,
.admin-seat-refresh-form,
.admin-professor-override-form,
.admin-file-row,
.admin-errors-empty,
.admin-seat-failure-table,
.admin-professor-override-table {
  color: var(--theme-text);
  border-color: var(--line);
  background: var(--surface-raised);
}

.admin-refresh:hover:not(:disabled) {
  color: var(--theme-accent);
  border-color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 8%, var(--surface-raised));
}

.admin-kicker,
.admin-checked-at,
.admin-note,
.admin-seat-refresh-result,
.admin-file-row > div:first-child span,
.admin-file-meta,
.admin-error-heading span,
.admin-error-meta,
.admin-error-row small,
.admin-professor-override-table td > span,
.admin-login-card > p:not(.admin-kicker):not(.admin-login-error) {
  color: var(--muted);
}

.admin-metric {
  color: var(--theme-text);
  border-color: var(--line);
  background: color-mix(in srgb, var(--theme-ui) 9%, var(--theme-background));
}
.admin-metric-label,
.admin-metric-note {
  color: var(--muted);
}
.admin-metric-good,
.admin-metric-warning,
.admin-metric-bad {
  border-color: color-mix(in srgb, var(--theme-accent) 45%, var(--line));
  background: color-mix(in srgb, var(--theme-accent) 8%, var(--surface));
}
.admin-metric-good .admin-metric-value,
.admin-metric-warning .admin-metric-value,
.admin-metric-bad .admin-metric-value {
  color: var(--theme-accent);
}

.admin-health-badge,
.admin-health-badge.is-good,
.admin-health-badge.is-bad,
.admin-seat-failure-status,
.admin-seat-failure-status.is-unresolved,
.admin-seat-failure-status.is-recovered {
  color: var(--theme-text);
  border: 1px solid color-mix(in srgb, var(--theme-ui) 46%, var(--theme-background));
  background: color-mix(in srgb, var(--theme-ui) 18%, var(--theme-background));
}
.admin-health-badge.is-good,
.admin-seat-failure-status.is-recovered {
  color: var(--theme-background);
  border-color: var(--theme-accent);
  background: var(--theme-accent);
}
.admin-health-badge.is-bad,
.admin-seat-failure-status.is-unresolved {
  color: var(--theme-accent);
  border-color: color-mix(in srgb, var(--theme-accent) 60%, var(--line));
  background: color-mix(in srgb, var(--theme-accent) 12%, var(--surface));
}

.admin-status-dot,
.admin-status-dot.is-good,
.admin-status-dot.is-bad {
  box-shadow: none;
}
.admin-status-dot {
  background: var(--theme-ui);
}
.admin-status-dot.is-good {
  background: var(--theme-accent);
}
.admin-status-dot.is-bad {
  background: color-mix(in srgb, var(--theme-accent) 70%, var(--theme-text));
}

.admin-progress {
  background: color-mix(in srgb, var(--theme-ui) 18%, var(--theme-background));
}
.admin-progress span {
  background: var(--theme-accent);
}

.admin-seat-failure-table-wrap,
.admin-professor-override-table-wrap {
  border-color: var(--line);
  background: var(--surface-raised);
}
.admin-seat-failure-table th,
.admin-seat-failure-table td,
.admin-professor-override-table th,
.admin-professor-override-table td {
  color: var(--theme-text);
  border-bottom-color: var(--line);
}
.admin-seat-failure-table th,
.admin-professor-override-table th {
  color: var(--muted);
  background: color-mix(in srgb, var(--theme-ui) 14%, var(--theme-background));
}
.admin-seat-failure-course strong,
.admin-seat-failure-error,
.admin-seat-failure-error strong,
.admin-error-heading strong,
.admin-error-meta code,
.admin-error-row p {
  color: var(--theme-text);
}
.admin-seat-failure-course a,
.admin-professor-override-table a {
  color: var(--theme-accent);
}

.admin-warning-list,
.admin-error-row {
  color: var(--theme-text);
  border-color: color-mix(in srgb, var(--theme-accent) 48%, var(--line));
  background: color-mix(in srgb, var(--theme-accent) 8%, var(--surface));
}
.admin-warning-list strong,
.admin-error-heading strong {
  color: var(--theme-accent);
}
.admin-error-status {
  color: var(--theme-background);
  background: var(--theme-accent);
}

.admin-seat-refresh-result.is-success {
  color: var(--theme-accent);
}
.admin-seat-refresh-result.is-error,
.admin-login-error,
.admin-professor-override-remove,
.admin-logout {
  color: color-mix(in srgb, var(--theme-accent) 78%, var(--theme-text));
}

.admin-seat-course-autocomplete input,
.admin-professor-override-fields input,
.admin-login-row input {
  color: var(--theme-text);
  border-color: var(--line);
  background: var(--surface-raised);
}


/* Theme picker right rail ---------------------------------------------------
   Keep the desktop picker in a dedicated page rail so it never covers course
   cards. On narrower screens it returns to normal document flow. */
@media (min-width: 901px) {
  body {
    padding-right: 11.5rem;
  }

  .theme-picker {
    right: .75rem;
    bottom: 1rem;
    width: 10rem;
    justify-items: stretch;
  }

  .theme-picker-toggle {
    width: 100%;
    min-width: 0;
  }

  .theme-picker-panel {
    right: 0;
    width: 10rem;
  }

  .theme-picker-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .1rem;
  }

  .theme-option {
    align-items: flex-start;
    flex-direction: column;
    gap: .32rem;
  }

  .theme-swatches {
    width: 100%;
    justify-content: flex-start;
  }

  .theme-picker-key {
    text-align: left;
  }
}

@media (max-width: 900px) {
  body {
    padding-right: 0;
  }

  .theme-picker {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(20rem, calc(100% - 2rem));
    margin: 0 1rem 1rem auto;
  }

  .theme-picker-panel {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-bottom: .55rem;
  }
}

/* Large theme library: keep the picker contained within the viewport. */
.theme-picker-panel {
  max-height: min(42rem, calc(100vh - 5.5rem));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.theme-options {
  overflow: visible;
}
