/* ============================================================
   UteGrades - University of Utah grade + professor lookup
   Design: ink neutral base, single crimson mark, semantic GPA
   scale (green->red) reserved strictly for grade data.
   Dials: variance 4 / motion 2 / density 6. One radius scale.
   ============================================================ */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --text: #1b1a17;
  --text-2: #56544e;
  --text-3: #8a887f;
  --border: #e7e4dd;
  --border-2: #d8d4ca;
  --ink: #1b1a17;
  --crimson: #9e1b32;       /* wordmark + active only */
  --link: #1b1a17;
  --focus: #2f6fdb;

  --r: 10px;                /* cards, inputs, buttons */
  --r-sm: 6px;              /* chips */
  --shadow: 0 1px 2px rgba(28, 26, 20, .04), 0 6px 20px rgba(28, 26, 20, .05);
  --shadow-sm: 0 1px 2px rgba(28, 26, 20, .05);
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system,
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151300;
    --bg: #141311;
    --surface: #1d1c19;
    --surface-2: #201f1b;
    --text: #f2f0ea;
    --text-2: #b6b3aa;
    --text-3: #86837a;
    --border: #302e29;
    --border-2: #3c3a34;
    --ink: #f2f0ea;
    --crimson: #f0899b;
    --link: #f2f0ea;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--crimson); }

.num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20;
  height: 60px;
  display: flex; align-items: center; gap: 20px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: baseline; gap: 2px;
  font-weight: 800; font-size: 19px; letter-spacing: -.02em;
  color: var(--ink); flex-shrink: 0;
}
.brand b { color: var(--crimson); font-weight: 800; }
.brand:hover { color: var(--ink); }

.nav-search { flex: 1; max-width: 460px; position: relative; }
.nav-search input { height: 38px; }
.nav-search .ico { top: 10px; }
.hdr[data-home="1"] .nav-search { display: none; }

.hdr-spacer { flex: 1; }
.signin { flex-shrink: 0; height: 36px; font-weight: 650; }

/* ---------- search input ---------- */
.search { position: relative; width: 100%; }
.search .ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-3); pointer-events: none;
}
.search input {
  width: 100%; height: 44px;
  padding: 0 14px 0 40px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}

/* ---------- layout ---------- */
main { max-width: 1000px; margin: 0 auto; padding: 32px 22px 96px; }
.wrap-narrow { max-width: 820px; }

/* ---------- home hero (clean, search-first) ---------- */
.home-hero {
  text-align: center; max-width: 620px; margin: 0 auto;
  padding: clamp(44px, 11vh, 104px) 0 12px;
}
.home-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.6vw, 42px);
  line-height: 1.06; letter-spacing: -.03em; font-weight: 800;
}
.home-hero .sub { margin: 0 0 30px; color: var(--text-2); font-size: 16.5px; }
.hero-search .ico { width: 20px; height: 20px; left: 16px; }
.hero-search input {
  height: 56px; font-size: 17px; padding-left: 48px; border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.home-browse {
  text-align: center; color: var(--text-3); font-size: 13px;
  margin: 30px 0 0;
}

/* ---------- explore lists (home) ---------- */
.explore-wrap { margin-top: clamp(48px, 9vh, 96px); }
.explore { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .explore { grid-template-columns: 1fr; } }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel h3 {
  margin: 0; padding: 14px 16px; font-size: 13px; font-weight: 700;
  letter-spacing: .01em; color: var(--text-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel h3 span { color: var(--text-3); font-weight: 500; font-size: 12px; }
.rowlink {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.rowlink:last-child { border-bottom: 0; }
.rowlink:hover { background: var(--surface-2); }
.rowlink .code { font-weight: 700; color: var(--text); flex-shrink: 0; }
.rowlink .ttl { color: var(--text-2); font-size: 13.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.rowlink .spacer { flex: 1; }

/* ---------- search results ---------- */
.results { margin-top: 8px; }
.res-head { color: var(--text-3); font-size: 13px; margin: 4px 2px 14px; }
.res {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; background: var(--surface);
  border: 1px solid var(--border); border-top: 0;
  transition: background .1s;
}
.res:first-child { border-top: 1px solid var(--border);
  border-radius: var(--r) var(--r) 0 0; }
.res:last-child { border-radius: 0 0 var(--r) var(--r); }
.res:hover { background: var(--surface-2); }
.res .kind {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  letter-spacing: .03em;
}
.kind.p { background: color-mix(in srgb, var(--crimson) 12%, transparent);
  color: var(--crimson); }
.kind.c { background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--text-2); }
.res .body { flex: 1; min-width: 0; }
.res .name { font-weight: 650; color: var(--text); }
.res .sub { color: var(--text-3); font-size: 13px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

/* ---------- gpa chip ---------- */
.gpa {
  flex-shrink: 0; display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 9px; border-radius: var(--r-sm);
  font-weight: 700; font-size: 14px; line-height: 1;
}
.gpa small { font-weight: 600; font-size: 10.5px; opacity: .8; }
.gpa.none { color: var(--text-3); background: color-mix(in srgb, var(--text-3) 12%, transparent); font-weight: 600; }

/* ---------- entity pages ---------- */
.ehead { margin-bottom: 26px; }
.eyebrow { color: var(--text-3); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ehead h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -.02em; line-height: 1.08; font-weight: 800; }
.ehead .dept { color: var(--text-2); font-size: 15px; }

.hero-stats { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
  margin: 22px 0 4px; border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; background: var(--surface); }
.stat { padding: 14px 20px; border-right: 1px solid var(--border); flex: 1; min-width: 120px; }
.stat:last-child { border-right: 0; }
.stat .k { color: var(--text-3); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--text-3); }
.stat.big .v { font-size: 30px; }

/* prereqs + course description */
.course-info { margin-top: 18px; }
.prereq {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 15px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r); font-size: 14.5px;
}
.prereq .pre-k { font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3); }
.prereq span:last-child { color: var(--text); }
.course-desc { margin: 14px 2px 0; color: var(--text-2); font-size: 14.5px;
  max-width: 72ch; line-height: 1.62; }

/* section */
.sec { margin-top: 34px; }
.sec > h2 {
  font-size: 15px; font-weight: 700; margin: 0 0 4px; color: var(--text);
}
.sec > .hint { color: var(--text-3); font-size: 13px; margin: 0 0 14px; }

/* distribution bar */
.dist { display: flex; height: 40px; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--border); }
.dist span { display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: #fff; min-width: 0; }
.dist-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px;
  color: var(--text-2); font-size: 12.5px; }
.dist-legend b { color: var(--text); }
.dist-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block;
  margin-right: 5px; vertical-align: middle; }

/* professor comparison bars */
.cmp { display: flex; flex-direction: column; gap: 2px; }
.cmp a {
  display: grid; grid-template-columns: 190px 1fr auto; align-items: center;
  gap: 14px; padding: 9px 14px; border-radius: var(--r-sm);
  transition: background .1s;
}
.cmp a:hover { background: var(--surface-2); }
.cmp .pname { font-weight: 650; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cmp .track { display: block; height: 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--text-3) 15%, transparent); position: relative; }
.cmp .fill { display: block; height: 100%; border-radius: 999px; }
.cmp .val { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; }
.cmp .n { color: var(--text-3); font-size: 12px; }
@media (max-width: 620px) {
  .cmp a { grid-template-columns: 1fr auto; }
  .cmp .track { display: none; }
}

/* data table */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--text-3); font-weight: 600; font-size: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--border-2); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; }
.tbl .term { color: var(--text-2); white-space: nowrap; }
.tbl .sec-no { color: var(--text-3); font-variant-numeric: tabular-nums; }
.tbl-wrap { border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; background: var(--surface); }
.tbl-wrap.scroll { overflow-x: auto; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }

/* grade trend bars */
.trend { display: flex; align-items: flex-end; gap: 3px; height: 72px;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); }
.trend .tbar { flex: 1; min-width: 5px; border-radius: 3px 3px 0 0; align-self: flex-end; }

/* spread mini (percentiles) */
.spread { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3);
  font-size: 12px; }
.spread .bar { width: 66px; height: 6px; border-radius: 999px; position: relative;
  background: color-mix(in srgb, var(--text-3) 16%, transparent); }
.spread .rng { position: absolute; height: 100%; border-radius: 999px;
  background: color-mix(in srgb, var(--text-2) 45%, transparent); }

/* course pills on prof page */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 12px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface); transition: border-color .1s;
}
.pill:hover { border-color: var(--border-2); }
.pill .pc { font-weight: 700; color: var(--text); }
.pill .pt { color: var(--text-3); font-size: 12.5px; max-width: 22ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: var(--r);
  font: inherit; font-weight: 650; font-size: 14px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  cursor: pointer; transition: transform .08s, background .1s, border-color .1s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- modal ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: color-mix(in srgb, #000 45%, transparent);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.scrim[hidden] { display: none; }
.modal {
  position: relative; width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: 28px 26px 24px;
}
.modal h2 { margin: 0 0 10px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.modal p { margin: 0 0 20px; color: var(--text-2); font-size: 14.5px; }
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  display: grid; place-items: center; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-3); cursor: pointer;
}
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal-x svg { width: 17px; height: 17px; }

/* back link */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3);
  font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.back:hover { color: var(--text); }
.back svg { width: 14px; height: 14px; }

/* skeleton / states */
.sk { background: linear-gradient(90deg,
  color-mix(in srgb, var(--text-3) 10%, transparent) 25%,
  color-mix(in srgb, var(--text-3) 16%, transparent) 37%,
  color-mix(in srgb, var(--text-3) 10%, transparent) 63%);
  background-size: 400% 100%; border-radius: var(--r-sm);
  animation: sh 1.3s ease infinite; }
@keyframes sh { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.sk-line { height: 14px; margin: 8px 0; }

.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty h3 { color: var(--text-2); margin: 0 0 6px; font-size: 16px; }

.foot { max-width: 1000px; margin: 0 auto; padding: 24px 22px 48px;
  color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--border); }
.foot a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  .hdr { gap: 12px; padding: 0 14px; }
  .hdr[data-home="1"] { }
  .hdr-spacer, .hdr-note { display: none; }
  .nav-search { max-width: none; }
  .brand { font-size: 17px; }
  main { padding: 22px 16px 72px; }
  .hero { padding: 24px 0 12px; }
  .stat { min-width: 45%; }
  .hero-stats { flex-wrap: wrap; }
}


/* thin-sample warning — a GPA from 1-2 graded sections is noise, and saying so
   plainly is both honest to students and the best defence against complaints */
.lown{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:999px;
  font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:none;
  color:#8a6d1a;background:#f5e6b8;border:1px solid #e6d089;vertical-align:middle;
  white-space:nowrap;cursor:help}
.stat .sub{margin-top:4px;font-size:12px;color:var(--text-3);font-weight:500}
@media (prefers-color-scheme:dark){
  .lown{color:#f0d98a;background:#3d3418;border-color:#5c4f22}
}

/* browse / filter view --------------------------------------------------- */
/* Native <select> on Safari draws its own chrome over any background you set —
   the double-arrow spinner. appearance:none removes it so the control matches
   the rest of the UI, and we draw a single chevron ourselves. */
.filters{display:grid;grid-template-columns:1.6fr 1fr 1.3fr 1fr;gap:14px;
  margin:22px 0 0;align-items:end}
.filters label{display:flex;flex-direction:column;gap:7px;min-width:0}
.filters .lbl{font-size:11.5px;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--text-3)}
.filters select{
  -webkit-appearance:none;appearance:none;
  font:inherit;font-size:14.5px;font-weight:550;color:var(--text-1);
  background-color:var(--surface);
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b8b' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 11px center;background-size:15px;
  border:1px solid var(--border);border-radius:10px;
  padding:11px 36px 11px 13px;width:100%;cursor:pointer;
  transition:border-color .13s ease,background-color .13s ease}
.filters select:hover{border-color:var(--text-3)}
.filters select:focus-visible{outline:none;border-color:var(--crimson);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--crimson) 22%,transparent)}
/* the primary filter reads heavier than the three refinements */
.filters label.primary select{font-size:15.5px;font-weight:650;padding-top:12px;padding-bottom:12px}

.filter-row2{display:flex;align-items:center;justify-content:space-between;
  gap:16px;flex-wrap:wrap;margin-top:14px}
.chk{display:flex;align-items:flex-start;gap:9px;cursor:pointer;user-select:none}
.chk input{margin:2px 0 0;width:16px;height:16px;accent-color:var(--crimson);cursor:pointer;flex:none}
.chk span{font-size:13.5px;font-weight:550;color:var(--text-2);line-height:1.35}
.chk small{display:block;font-size:11.5px;font-weight:450;color:var(--text-3);margin-top:2px}

.blist{display:flex;flex-direction:column;border:1px solid var(--border);
  border-radius:12px;overflow:hidden;margin-top:12px}
.brow{display:grid;grid-template-columns:112px 1fr auto auto auto;gap:14px;
  align-items:center;padding:12px 15px;text-decoration:none;color:inherit;
  border-top:1px solid var(--border)}
.brow:first-child{border-top:0}
.brow:hover{background:var(--surface-2)}
.bcode{font-weight:700;font-size:14px}
.btitle{color:var(--text-2);font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bn{font-size:12px;color:var(--text-3);white-space:nowrap;font-variant-numeric:tabular-nums}
.rtag{display:inline-block;margin-right:4px;padding:1px 6px;border-radius:6px;
  font-size:11px;font-weight:700;background:var(--surface-2);color:var(--text-2)}

@media(max-width:860px){ .filters{grid-template-columns:1fr 1fr} }
@media(max-width:560px){
  .filters{grid-template-columns:1fr;gap:12px}
  .brow{grid-template-columns:1fr auto;gap:7px;padding:13px 14px}
  .btitle,.breq{grid-column:1/-1}
  .filter-row2{gap:12px}
}

/* requirement badges on a course — the data was there, it just was not shown.
   Clickable: "this counts for Diversity" -> every Diversity course. */
.reqrow{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.reqchip{display:inline-flex;align-items:center;gap:7px;padding:5px 11px 5px 6px;
  border:1px solid var(--border);border-radius:999px;background:var(--surface);
  color:var(--text-2);font-size:12.5px;font-weight:600;text-decoration:none;
  transition:border-color .12s ease,color .12s ease}
.reqchip:hover{border-color:var(--crimson);color:var(--text-1)}
.reqchip .rc{display:inline-block;padding:2px 7px;border-radius:999px;
  background:var(--crimson);color:#fff;font-size:11px;font-weight:800;letter-spacing:.03em}

/* clamp long descriptions instead of dumping a screenful on mobile */
.course-desc{display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;
  overflow:hidden}
.course-desc.open{-webkit-line-clamp:unset;overflow:visible}
.linkbtn{margin-top:6px;padding:0;border:0;background:none;cursor:pointer;
  font:inherit;font-size:13px;font-weight:650;color:var(--crimson)}
.linkbtn:hover{text-decoration:underline}

/* mobile header: the search input was being clipped mid-placeholder */
@media(max-width:560px){
  .hdr{flex-wrap:wrap;row-gap:8px;padding-bottom:10px}
  .brand{font-size:19px}
  .nav-search{order:3;flex:1 1 100%;min-width:0}
  .hdr-spacer{display:none}
}

/* methodology disclosure in the footer */
#method{max-width:70ch;margin:12px auto 0;text-align:left;font-size:12.5px;
  line-height:1.65;color:var(--text-3)}
#method p{margin:0 0 10px}
#method b{color:var(--text-2)}

/* why a grade is absent — "n/a" alone read as a broken site */
.na{font-size:11.5px;font-weight:650;letter-spacing:.01em;white-space:nowrap;cursor:help}
.na.grad{color:#8ba3c7}
.na.pend{color:var(--text-3);font-weight:600}
.gpa.none{background:transparent;padding-left:0;padding-right:0}

/* co-requisite sections (lab, discussion) — graded with the parent lecture */
.na.comp{color:#7e8a99;font-weight:600}

/* enrolment-gated courses: major status, consent, program admission, Honors */
.rtag.gate{background:#4a2b2b;color:#e0a0a0}

/* delivery mode — only shown when a section is NOT ordinary in-person */
.mode{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:5px;
  font-size:10.5px;font-weight:700;letter-spacing:.02em;white-space:nowrap;
  background:#1e3a4a;color:#8fc4dd;vertical-align:middle}

/* RMP is a search, not a guaranteed profile — say so rather than let a student
   conclude the site is broken when the search comes back empty */
.rmp-row{display:flex;align-items:center;gap:13px;flex-wrap:wrap;margin-top:16px}
.rmp-note{font-size:12px;color:var(--text-3);max-width:44ch;line-height:1.45}

/* section component — lecture vs lab matters at registration time */
.comp-tag{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:5px;
  font-size:10.5px;font-weight:700;letter-spacing:.02em;white-space:nowrap;
  background:#3a3320;color:#d9c07a;vertical-align:middle}

/* ============================================================
   Schedule builder
   Same ink/crimson system as the rest of the site. The one new
   idea is the week grid: a table of times is a claim, a grid
   with no overlapping blocks is that claim demonstrated.
   ============================================================ */

.sb-pick{position:relative;margin-top:20px}
.sb-pick>.lbl{display:block;font-size:11.5px;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--text-3);margin-bottom:7px}
.sb-search{max-width:none}
.sb-sug{position:absolute;z-index:20;left:0;right:0;top:calc(100% - 22px);
  background:var(--surface);border:1px solid var(--border-2);border-radius:12px;
  box-shadow:var(--shadow);overflow:hidden;max-height:340px;overflow-y:auto}
.sb-opt{display:grid;grid-template-columns:104px 1fr auto auto;gap:12px;
  align-items:center;width:100%;text-align:left;padding:11px 14px;
  background:none;border:0;border-top:1px solid var(--border);
  font:inherit;color:inherit;cursor:pointer}
.sb-opt:first-child{border-top:0}
.sb-opt:hover,.sb-opt.on{background:var(--surface-2)}
.sb-opt .code{font-weight:700;font-size:14px}
.sb-opt .ttl{color:var(--text-2);font-size:13.5px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}

.sb-empty{margin-top:18px;padding:22px 20px;border:1px dashed var(--border-2);
  border-radius:12px;background:var(--surface-2)}
.sb-empty p{margin:0;color:var(--text-2);font-size:14px;max-width:60ch}

.sb-cart{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin-top:18px}
.sb-chip{display:inline-flex;align-items:center;gap:9px;padding:8px 8px 8px 13px;
  border:1px solid var(--border-2);border-radius:999px;background:var(--surface);
  font-size:13.5px;max-width:100%}
.sb-chip a{display:inline-flex;gap:7px;align-items:baseline;min-width:0}
.sb-chip a span{color:var(--text-2);overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;max-width:24ch}
.sb-chip .n{color:var(--text-3);font-size:12px;white-space:nowrap}
.sb-chip .x{width:22px;height:22px;flex:none;border:0;border-radius:50%;
  background:var(--surface-2);color:var(--text-3);font-size:16px;line-height:1;
  cursor:pointer;transition:background .12s ease,color .12s ease}
.sb-chip .x:hover{background:var(--crimson);color:#fff}
.sb-tot{color:var(--text-3);font-size:12.5px;font-weight:600;margin-left:2px}

.sb-filters{grid-template-columns:repeat(4,1fr)}
.sb-go{white-space:nowrap}
.sb-sort{grid-template-columns:minmax(0,300px);margin:0 0 18px}

.sb-blame{display:flex;flex-direction:column;gap:9px;margin-top:12px}
.sb-blame div{padding:12px 14px;border:1px solid var(--border);
  border-left:3px solid var(--crimson);border-radius:0 10px 10px 0;
  background:var(--surface);font-size:14px;color:var(--text-2)}

.sb-card{border:1px solid var(--border);border-radius:14px;background:var(--surface);
  padding:16px 16px 12px;margin-bottom:16px;box-shadow:var(--shadow-sm)}
.sb-head{display:flex;gap:16px;align-items:flex-start;margin-bottom:14px}
.sb-rank{flex:none;font-size:13px;font-weight:800;color:var(--text-3);
  padding:4px 10px;border-radius:999px;background:var(--surface-2);
  border:1px solid var(--border)}
.sb-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;flex:1;min-width:0}
.sb-stats .st{display:flex;flex-direction:column;gap:1px;min-width:0}
.sb-stats .k{font-size:10.5px;font-weight:700;letter-spacing:.055em;
  text-transform:uppercase;color:var(--text-3)}
.sb-stats .v{font-size:20px;font-weight:700;line-height:1.2}
.sb-stats .sub{font-size:11.5px;color:var(--text-3);overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.sb-tbl td{vertical-align:top}
.sb-tbl .ttl{font-size:12px;line-height:1.3}
.sb-card>.linkbtn{margin-top:10px}
.sb-verify{margin-top:12px;color:var(--text-3);font-size:12px;max-width:70ch}

/* week grid --------------------------------------------------------------- */
.week{display:flex;gap:0;margin-top:14px;height:clamp(300px,52vh,520px)}
.wk-times{position:relative;width:52px;flex:none;margin-top:23px}
.wk-times span{position:absolute;right:8px;transform:translateY(-50%);
  font-size:10.5px;color:var(--text-3);white-space:nowrap;font-variant-numeric:tabular-nums}
.wk-day{flex:1;min-width:0;display:flex;flex-direction:column}
.wk-lbl{height:23px;font-size:11px;font-weight:700;letter-spacing:.05em;
  text-transform:uppercase;color:var(--text-3);text-align:center}
.wk-col{position:relative;flex:1;border-left:1px solid var(--border);
  background:var(--surface-2)}
.wk-day:last-child .wk-col{border-right:1px solid var(--border)}
.wk-col>i{position:absolute;left:0;right:0;height:0;
  border-top:1px solid var(--border)}
.wk-b{position:absolute;left:2px;right:2px;min-height:15px;overflow:hidden;
  border-radius:5px;padding:3px 5px;color:var(--text);
  background:color-mix(in srgb,var(--c) 20%,var(--surface));
  border:1px solid color-mix(in srgb,var(--c) 55%,transparent);
  border-left:3px solid var(--c);cursor:help}
.wk-b b{display:block;font-size:11px;line-height:1.25;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.wk-b span{display:block;font-size:10px;color:var(--text-2);line-height:1.25;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wk-b .lo{color:var(--text-3)}

@media(max-width:860px){
  .sb-filters{grid-template-columns:1fr 1fr}
  .sb-stats{grid-template-columns:1fr 1fr;gap:12px}
}
@media(max-width:560px){
  .sb-opt{grid-template-columns:1fr auto;gap:6px}
  .sb-opt .ttl{grid-column:1/-1}
  .sb-head{flex-direction:column;gap:10px}
  .week{height:400px}
  .wk-b b{font-size:10px}
  .wk-b span{display:none}
}

/* the section that comes along automatically — you register for the other one */
.auto{display:inline-block;margin-left:5px;padding:1px 5px;border-radius:5px;
  font-size:10px;font-weight:700;letter-spacing:.03em;white-space:nowrap;
  background:var(--surface-2);color:var(--text-3);border:1px solid var(--border);
  vertical-align:middle;cursor:help}

/* On a phone a seven-column table has ~45px per column, which wraps "9:40am"
   onto three lines. Keep the columns at a readable width and let the wrapper
   scroll sideways — a table you swipe beats a table you decode. */
.sb-tbl{min-width:660px}
.sb-tbl td:nth-child(4){white-space:nowrap}
@media(max-width:560px){
  .sb-stats .sub{white-space:normal;overflow:visible;line-height:1.3}
  .sb-card{padding:14px 12px 10px}
  .sb-cart{gap:7px}
  .sb-chip a span{max-width:16ch}
}

/* header nav — the builder has to be reachable from a course page, not only
   from home, since that is where a student is standing when they decide. */
.hdr-nav{display:flex;gap:20px;flex-shrink:0;font-size:14px;font-weight:600}
.hdr-nav a{color:var(--text-2);white-space:nowrap}
.hdr-nav a:hover{color:var(--crimson)}
@media(max-width:720px){
  .hdr{gap:12px;padding:0 14px}
  .hdr-nav{gap:13px;font-size:13px}
  .hdr-nav a[href="#browse"]{display:none}
}
