@font-face {
  font-family: "DM Mono";
  src: url("assets/fonts/dm-mono-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("assets/fonts/dm-mono-medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("assets/fonts/dm-mono-italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --surface-2: rgba(255, 255, 255, 0.42);
  --surface-3: rgba(0, 0, 0, 0.045);
  --ink: #1d1d1f;
  --ink-2: #3a3a3c;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --line: rgba(0, 0, 0, 0.075);
  --line-soft: rgba(0, 0, 0, 0.045);
  --blue: #0a84ff;
  --blue-2: #0071e3;
  --green: #1a7f37;
  --orange: #b25e00;
  --red: #d70015;
  --accent: #d70015;
  --radius: 18px;
  --glass: blur(26px) saturate(170%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI Variable", "Segoe UI", "Helvetica Neue", "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 0% 0%, rgba(255, 255, 255, 0.95), transparent 62%),
    radial-gradient(760px 520px at 100% 8%, rgba(232, 232, 236, 0.85), transparent 60%),
    linear-gradient(180deg, #f6f6f8 0%, #ececef 100%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(10, 132, 255, 0.18); }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 48px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 5px 8px;
  border: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.065);
  border-radius: 0;
  background: #fbfbfc;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow-y: auto;
  overflow-x: hidden;
}
.main-wrap {
  flex: 1;
  min-width: 0;
  margin-left: 48px;
}
main { max-width: 1280px; margin: 0 auto; padding: 12px 30px 96px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  height: 40px;
  padding: 6px 28px 5px;
  background: #fbfbfc;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.065);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-search { position: relative; flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; padding: 0 18px; }
.topbar-search .search { width: 100%; max-width: 640px; height: 28px; background-color: rgba(0, 0, 0, 0.045); border-color: transparent; }
.topbar-search .search:focus { background-color: #fff; border-color: rgba(10, 132, 255, 0.35); }
.topbar-search .search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border: 0;
  background: center / 12px 12px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' fill='none' stroke='%236e6e73' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  opacity: 0.7;
  cursor: pointer;
}
.topbar-search .search::-webkit-search-cancel-button:hover { opacity: 1; }
body[data-view="analysis"] .topbar-search { visibility: hidden; pointer-events: none; }
.search-suggest {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 36px));
  z-index: 130;
  max-height: 460px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.15);
}
.search-suggest-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 8px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.search-suggest-item:hover,
.search-suggest-item.active { background: rgba(0, 0, 0, 0.055); }
.search-suggest-item .ss-main { flex: 0 0 auto; font-size: 12.5px; font-weight: 700; }
.search-suggest-item .ss-sub {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}
.search-suggest-item .ss-type {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.search-suggest-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 9px 6px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 8px 8px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.search-suggest-all:hover { background: rgba(10, 132, 255, 0.07); }

/* Search results header */
.search-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line-soft);
}
.search-head-row { display: flex; align-items: baseline; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }
.search-head h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.15;
}
.search-term-badge {
  display: inline-flex;
  align-items: center;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}
.search-term-badge::before { content: "·"; margin-right: 7px; color: var(--faint); }
.search-summary {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
}
.search-count {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.search-count b { color: var(--ink); font-size: 12.5px; font-weight: 700; }
.search-for { color: var(--muted); font-size: 12px; }
.search-query {
  display: inline-flex;
  align-items: center;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 600;
}
.search-hint { color: var(--muted); font-size: 12px; }

/* Recommendations */
.rec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rec-head h1 { margin: 0 0 8px; }
.rec-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rec-dept-dd { width: 210px; flex: 0 0 auto; }
.rec-formula { margin-left: auto; color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; }
.nav-arrow {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-arrow:hover:not(:disabled) { background: rgba(0, 0, 0, 0.055); color: var(--ink); }
.nav-arrow:disabled { opacity: 0.32; cursor: default; }
.nav-arrow svg { width: 17px; height: 17px; }

/* ---------- Rail brand / settings ---------- */
.rail-brand {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  margin: 2px 0 6px;
  border: 0;
  border-radius: 9px;
  background: #ececef;
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s;
}
.rail-brand:hover { background: #e5e5e9; box-shadow: none; }
.rail-settings {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.rail-settings:hover { background: rgba(0, 0, 0, 0.045); color: var(--ink); }
.rail-settings svg { width: 16px; height: 16px; }

/* ---------- Sidebar ---------- */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(29, 29, 31, 0.9);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand-text { min-width: 0; }
.brand-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { margin-top: 1px; color: var(--faint); font-size: 10.5px; white-space: nowrap; }
.sidebar-toggle {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #ececef;
  color: var(--faint);
  cursor: pointer;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.06), -2px -2px 6px rgba(255, 255, 255, 0.85);
  transition: background 0.15s, color 0.15s, transform 0.24s;
}
.sidebar-toggle:hover { background: #f6f6f8; color: var(--ink); }
.sidebar-toggle svg { width: 17px; height: 17px; }

.nav { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.nav button {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.nav button:hover { background: rgba(0, 0, 0, 0.045); color: var(--ink); }
.nav button.active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  box-shadow: none;
}
.nav-ico {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  color: inherit;
}
.nav-ico svg { width: 17px; height: 17px; display: block; }
.nav-label { display: none; }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 0 2px;
  border-top: 1px solid var(--line-soft);
}
.term-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 2px rgba(0, 0, 0, 0.03);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.term-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.source-note { font-size: 10.5px; color: var(--faint); line-height: 1.4; }
.term-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 2px rgba(0, 0, 0, 0.03);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  backdrop-filter: blur(16px);
}
.term-select:focus { border-color: rgba(10, 132, 255, 0.35); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.10); }

/* Collapsed sidebar */
body.sidebar-collapsed .sidebar { width: 76px; padding-left: 8px; padding-right: 8px; }
body.sidebar-collapsed .main-wrap { margin-left: 108px; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .source-note { display: none; }
body.sidebar-collapsed .term-select { display: none; }
body.sidebar-collapsed .sidebar-top { flex-direction: column; gap: 10px; }
body.sidebar-collapsed .sidebar-toggle { transform: rotate(180deg); }
body.sidebar-collapsed .nav button { justify-content: center; padding: 10px; }
body.sidebar-collapsed .nav-ico { color: var(--ink-2); }
body.sidebar-collapsed .sidebar-foot { align-items: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .term-chip {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  background: var(--blue);
  font-size: 0;
}
body.sidebar-collapsed .term-chip::before { display: none; }

/* ---------- View headers ---------- */
.view-head { margin-bottom: 24px; }
.view-head.hero { margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.view-head h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.view-head .sub {
  margin: 0;
  max-width: 700px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.view-head.row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  margin: 4px 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Controls ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.search-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.search-row .search { flex: 1; min-width: 0; }
.search-row .scope-bar { flex: 0 0 auto; }
.search {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.42);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px center;
  background-size: 15px 15px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  outline: none;
  backdrop-filter: blur(20px);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.search::placeholder { color: var(--muted); font-weight: 500; }
.search:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(10, 132, 255, 0.35);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.10);
}

.term-switch,
.scope-bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(16px);
  overflow-x: auto;
}
.term-switch .btn,
.scope-bar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}
.term-switch .btn { min-width: 100px; }
.scope-bar .btn { min-width: 88px; }
.term-switch .btn:hover,
.scope-bar .btn:hover { background: rgba(255, 255, 255, 0.6); }
.term-switch .btn.active,
.scope-bar .btn.active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  overflow: visible;
  padding-bottom: 2px;
}
.filter-dd { position: relative; flex: 1 1 150px; min-width: 0; }
.filter-dd-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.filter-dd-btn:hover { background: rgba(255, 255, 255, 0.78); border-color: rgba(255, 255, 255, 0.95); }
.filter-dd-btn svg { flex: 0 0 auto; color: var(--muted); transition: transform 0.16s; }
.filter-dd.open .filter-dd-btn { border-color: rgba(10, 132, 255, 0.35); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.10); background: rgba(255, 255, 255, 0.85); }
.filter-dd.open .filter-dd-btn svg { transform: rotate(180deg); }
.filter-dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-dd-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 45;
  max-height: 300px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translateY(-4px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.filter-dd.open .filter-dd-menu { opacity: 1; transform: none; pointer-events: auto; }
.filter-dd-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.filter-dd-menu button:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.filter-dd-menu button.active { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.filter-dd-menu button.active::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--ink);
}
.filters .filter-label { flex: 0 0 auto; padding: 0 8px; }
.select, .input {
  height: 34px;
  min-width: 120px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  outline: none;
  backdrop-filter: blur(20px);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.input { width: 100%; }
.select:focus, .input:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(10, 132, 255, 0.35);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.10);
}
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.select:hover { background-color: rgba(255, 255, 255, 0.78); border-color: rgba(255, 255, 255, 0.95); }
.select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a84ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.filter-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.filter-label.checked { background: rgba(10, 132, 255, 0.10); color: var(--blue-2); }
.filter-label input { accent-color: var(--blue); }
.meta-line { margin: 8px 2px 14px; color: var(--faint); font-size: 12px; }

/* ---------- Buttons ---------- */
.btn {
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: rgba(29, 29, 31, 0.92); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.ghost {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  backdrop-filter: blur(12px);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.8); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.center { display: block; margin: 18px auto; }

/* ---------- Course rows ---------- */
.course-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 1145px;
}
.course-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  min-height: 180px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.34));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 12px 30px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.course-card:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.46));
  border-color: rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 18px 44px rgba(0, 0, 0, 0.10);
}
.cc-main { min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.cc-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  margin: -16px -18px 0;
  padding: 3px 18px;
  border-radius: 11px 11px 0 0;
  background: rgba(0, 0, 0, 0.055);
}
.cc-top .cc-code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-top .cc-code { color: var(--ink-2); }
.cc-top .chip.term { background: rgba(255, 255, 255, 0.72); color: var(--ink-2); }
.cc-top .chip.term { height: 16px; padding: 0 6px; font-size: 8.5px; }
.cc-top .chip.term { flex: 0 0 auto; }
.cc-top .cc-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.cc-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-bottom: 6px;
}
.cc-code-row .cc-code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-code-row .chip.term {
  flex: 0 0 auto;
  margin-left: auto;
}
.cc-code { color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: 0.045em; }
.cc-title {
  margin: 0 0 -3px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.075);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.cc-meta .chip { flex: 0 0 auto; }
.cc-meta .chip.term { margin-left: auto; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.chip.alt { background: rgba(26, 127, 55, 0.10); color: var(--green); }
.chip.warn { background: rgba(178, 94, 0, 0.10); color: var(--orange); }
.chip.term { background: rgba(0, 0, 0, 0.05); color: var(--ink-2); }
.chip.drop { background: rgba(255, 149, 0, 0.12); color: #9a5200; }
.chip.drop.mid { background: rgba(255, 99, 0, 0.13); color: #a04400; }
.chip.drop.high { background: rgba(255, 59, 48, 0.12); color: #c0001a; }
.cc-line { color: var(--muted); font-size: 12px; }
.cc-line b { color: var(--ink-2); font-weight: 600; }
.cc-instructor {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-times { display: flex; flex-direction: column; gap: 2px; }
.meeting {
  color: var(--ink-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.005em;
}
.meeting.more { color: var(--faint); }
.meeting.tba { color: var(--faint); }
.cc-info { display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; min-width: 0; margin-top: 2px; }
.info-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-2);
  font: inherit;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.info-pill:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.info-pill:active { transform: scale(0.98); }
.info-pill svg { width: 12px; height: 12px; flex: 0 0 12px; opacity: 0.62; }
.info-pill span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-pill.instructor-pill {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  padding: 3px 9px;
  border: 0;
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
  box-shadow: none;
}
.info-pill.instructor-pill:hover {
  border: 0;
  background: rgba(0, 0, 0, 0.075);
  box-shadow: none;
}
.cc-meta .instructor-pill {
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.info-pill.day-pill { flex: 0 0 auto; cursor: default; }
.info-pill.day-pill:hover {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: none;
}
.info-pill.time-pill { flex: 0 1 auto; font-variant-numeric: tabular-nums; }
.info-pill.muted { color: var(--faint); cursor: default; }
.info-pill.muted:hover { background: rgba(255, 255, 255, 0.55); border-color: rgba(0, 0, 0, 0.06); box-shadow: none; }
.info-more { color: var(--faint); font-size: 10.5px; }
.day-strip { display: flex; align-items: center; gap: 3px; margin-top: 1px; }
.day-box {
  width: 20px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--faint);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.day-box.active {
  background: #dbeafe;
  color: #0a5faf;
  cursor: pointer;
  box-shadow: none;
}
.day-box.active:hover { background: #cde1ff; }
.day-tba { margin-left: 4px; color: var(--faint); font-size: 10px; }
.day-strip .time-pill {
  height: 22px;
  margin-left: auto;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  box-shadow: none;
}
.day-strip .time-pill:hover { background: rgba(0, 0, 0, 0.075); }
.cc-reason {
  align-self: flex-start;
  padding: 2px 0 2px 9px;
  border-left: 2px solid rgba(26, 127, 55, 0.35);
  background: transparent;
  color: var(--green);
  font-size: 11.5px;
  line-height: 1.4;
}
.cc-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.cc-bottom .enroll-bar { flex: 1; margin-top: 0; }
.enroll-bar-spacer { flex: 1; }
.cc-bottom .cc-enroll-inline { flex: 0 0 auto; margin-left: 0; }
.card-add-wrap { position: relative; }
.course-card .card-add-wrap { margin-left: auto; }
.card-add {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink-2);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.card-add:hover { background: rgba(10, 132, 255, 0.10); color: #0a5faf; }
.card-add svg { display: block; }
.card-add-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 152px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}
.card-add-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.card-add-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.card-add-menu button:hover { background: rgba(0, 0, 0, 0.055); color: var(--ink); }
.cc-days-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
  margin-top: 0;
}
.cc-enroll-inline { display: flex; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; }
.enroll-box {
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.enroll-box span { color: var(--faint); font-weight: 600; }
.enroll-box.drop { color: #9a5200; }
.enroll-box.drop.mid { color: #a04400; }
.enroll-box.drop.high { color: #c0001a; }
.enroll-box.drop.up { color: var(--green); }
.enroll-box.drop.flat,
.enroll-box.drop.muted { color: var(--faint); }
.enroll-box.drop .drop-arrow { flex: 0 0 auto; margin-right: 1px; }
.enroll-box[data-tip] { position: relative; }
.enroll-box[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.enroll-box[data-tip]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(29, 29, 31, 0.92);
  pointer-events: none;
  z-index: 31;
}
.cc-enroll-inline .enroll-box:last-child[data-tip]:hover::after {
  left: auto;
  right: 0;
  transform: none;
}
.cc-enroll-inline .enroll-box:last-child[data-tip]:hover::before {
  left: auto;
  right: 8px;
  transform: none;
}
.cc-enroll-inline.low .enroll-box.pct { color: #4f7f63; }
.cc-enroll-inline.mid .enroll-box.pct { color: #8a6d32; }
.cc-enroll-inline.high .enroll-box.pct { color: #a25555; }
.cc-days-row .time-chip {
  margin-left: auto;
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink-2);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cc-days-row .time-chip:hover { background: rgba(0, 0, 0, 0.08); color: var(--ink); }
.enroll-count { color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.enroll-count span { color: var(--faint); font-size: 11px; font-weight: 500; }
.cc-days-row .enroll-cap { margin-top: 0; color: var(--muted); font-size: 10.5px; }
.cc-enroll {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.enroll-head { display: flex; align-items: baseline; justify-content: flex-start; gap: 2px; }
.enroll-line { color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.enroll-line span { color: var(--faint); font-size: 11.5px; font-weight: 500; }
.enroll-drop { margin-left: 4px; color: #9a5200; font-size: 11.5px; font-weight: 800; letter-spacing: 0; white-space: nowrap; }
.enroll-drop.mid { color: #a04400; }
.enroll-drop.high { color: #c0001a; }
.enroll-drop.up { color: var(--green); }
.enroll-drop.flat,
.enroll-drop.muted { color: var(--faint); }
.enroll-cap { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.enroll-cap b { color: var(--ink-2); font-weight: 700; }
.enroll-bar {
  height: 4px;
  margin-top: 6px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.055);
  overflow: hidden;
}
.enroll-bar > span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: #8fbfa4;
}
.enroll-bar.low > span { background: #8fbfa4; }
.enroll-bar.mid > span { background: #e2c07a; }
.enroll-bar.high > span { background: #d99a9a; }
.cc-enroll-inline.low .enroll-cap b { color: #4f7f63; }
.cc-enroll-inline.mid .enroll-cap b { color: #8a6d32; }
.cc-enroll-inline.high .enroll-cap b { color: #a25555; }
.cc-actions { display: flex; gap: 6px; }
.cc-actions .btn {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  backdrop-filter: none;
}
.cc-actions .btn:hover { background: rgba(0, 0, 0, 0.085); color: var(--ink); }
.cc-actions .btn[data-act="cal"] { background: rgba(10, 132, 255, 0.10); color: #0a5faf; }
.cc-actions .btn[data-act="cal"]:hover { background: rgba(10, 132, 255, 0.16); }

/* ---------- Cards & forms ---------- */
.card,
.daily-card {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 30px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.field-grid label, .card > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.09);
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 500;
}
.tag button {
  border: 0;
  background: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- History ---------- */
.history-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.history-add { display: flex; align-items: center; gap: 8px; }
.history-add .input { width: 210px; }
.history-links { display: flex; gap: 8px; flex-wrap: wrap; }
.history-links a {
  padding: 7px 12px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}
.history-links a:hover { background: rgba(255, 255, 255, 0.8); }

/* ---------- Analysis ---------- */
.analysis-head { align-items: center; gap: 16px; margin-bottom: 20px; }
.analysis-head h1 { margin: 0; }
.analysis-tools { display: flex; align-items: center; gap: 10px; }
.analysis-term-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  min-width: 0;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(0, 0, 0, 0.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.analysis-term-wrap:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 6px 16px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}
.analysis-term-wrap:active { transform: scale(0.985); }
.analysis-term-wrap:focus-within {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14), 0 4px 12px rgba(0, 0, 0, 0.05);
}
.analysis-term-wrap select {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  outline: none;
  cursor: pointer;
  appearance: none;
}
.term-menu-btn {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
#term-menu-label { display: inline-block; transition: opacity 0.16s ease, transform 0.16s ease; }
#term-menu-label.switching { opacity: 0; transform: translateY(-3px); }
.term-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.term-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.term-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.term-menu button:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); transform: translateX(2px); }
.term-menu button.active { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.term-menu button.active::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--ink);
}
.term-menu.open button { animation: termItemIn 0.22s both; }
.term-menu.open button:nth-child(2) { animation-delay: 0.03s; }
.term-menu.open button:nth-child(3) { animation-delay: 0.06s; }
.term-menu.open button:nth-child(4) { animation-delay: 0.09s; }
@keyframes termItemIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Top-bar term picker (opens downward) */
.topbar-term {
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.045);
  box-shadow: none;
}
.topbar-term .term-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  font-size: 12.5px;
  font-weight: 700;
}
.topbar-term .term-menu-btn svg { color: var(--muted); flex: 0 0 auto; }
.topbar-term:hover {
  background: rgba(0, 0, 0, 0.065);
  box-shadow: none;
  transform: none;
}
.topbar-term:active { transform: none; }
.topbar-term .term-menu {
  left: auto;
  right: 0;
  width: 216px;
  top: calc(100% + 8px);
  bottom: auto;
  max-height: 64vh;
  overflow-y: auto;
}
.sidebar-foot .analysis-term-wrap { width: 100%; min-width: 0; height: 42px; }
.analysis-search { width: 320px; max-width: 100%; }
.analysis-stat-controls .analysis-search { width: auto; flex: 1 1 240px; max-width: 380px; margin-left: auto; }
.analysis-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(22px);
}
.stat-card b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.stat-card span { color: var(--muted); font-size: 11.5px; }
.analysis-list { display: flex; flex-direction: column; gap: 8px; }
.analysis-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 164px 128px;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 18px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(22px);
  cursor: pointer;
  transition: background 0.15s;
}
.analysis-row:hover { background: rgba(255, 255, 255, 0.58); }
.ar-main .cc-title { font-size: 14.5px; }
.ar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.ar-spark svg { width: 164px; height: 44px; display: block; }
.ar-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ar-enroll { color: var(--faint); font-size: 11px; }
.drop-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
}
.drop-badge.high { background: rgba(255, 59, 48, 0.12); color: #c0001a; }
.drop-badge.mid { background: rgba(255, 149, 0, 0.14); color: #9a5200; }
.drop-badge.low { background: rgba(255, 204, 0, 0.16); color: #7a6000; }
.drop-badge.stable { background: rgba(26, 127, 55, 0.10); color: var(--green); }

.daily-card { margin-bottom: 18px; }
.daily-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.daily-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.daily-head-side { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.daily-dept-dd { width: 200px; min-width: 150px; flex: 0 0 auto; }
.daily-dept-dd .filter-dd-btn { height: 32px; font-size: 11.5px; }
.daily-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.08);
  color: var(--blue-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.sparkline { display: block; width: 100%; height: 100px; }
.spark-wrap { position: relative; display: flex; align-items: stretch; gap: 8px; }
.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 24px;
  padding: 8px 0 18px;
  color: var(--faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.chart-col { flex: 1; min-width: 0; }
.chart-x {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.spark-dot-hit { cursor: pointer; }
.spark-tip {
  position: absolute;
  z-index: 6;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.daily-card .sparkline { height: 140px; }
.daily-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.daily-stats div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.34);
}
.daily-stats b {
  display: block;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.daily-stats span { font-size: 16px; font-weight: 600; }
.daily-top { margin-top: 14px; }
.daily-moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; }
.move-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.34);
  font-size: 11.5px;
}
.move-code { flex: 1; font-weight: 600; }
.move-row .up { color: var(--green); font-weight: 600; }
.move-row .down { color: var(--red); font-weight: 600; }
.move-e { color: var(--faint); }
.daily-note { margin-top: 12px; color: var(--faint); font-size: 10.5px; }

/* ---------- Planner ---------- */
.planner-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.plan-template-field { margin-bottom: 4px; }
.plan-template-caption { margin-bottom: 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.plan-template-select { position: relative; }
.plan-template-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.plan-template-btn:hover { background: rgba(255, 255, 255, 0.82); }
.plan-template-btn:focus-visible { outline: none; border-color: rgba(10, 132, 255, 0.35); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.10); }
.plan-template-btn svg { flex: 0 0 auto; color: var(--muted); }
.plan-template-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translateY(-4px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.plan-template-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.plan-template-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.plan-template-menu button:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.plan-template-menu button.active { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.plan-template-menu button.active::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--ink);
}
.progress-row { margin-bottom: 14px; }
.pr-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.pr-top b { color: var(--ink); font-weight: 600; }
.bar { height: 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.055); overflow: hidden; }
.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-2), var(--blue));
}
.plan-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.bucket {
  min-height: 120px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.4);
}
.bucket h4 { margin: 0 0 6px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.b-sum { margin-bottom: 8px; color: var(--faint); font-size: 11px; }
.bucket-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.56);
  font-size: 12px;
}
.bucket-item button { border: 0; background: none; color: var(--red); cursor: pointer; }
.graph-holder { margin-top: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.4); overflow: auto; }
.graph-holder svg text { font-family: var(--font); }
.graph-scroll { overflow-x: auto; }
.graph-axis {
  margin: 10px 0 2px;
  text-align: center;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 8px 0 10px;
  color: var(--muted);
  font-size: 10.5px;
}
.graph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.graph-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

/* ---------- Calendar ---------- */
.calendar {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(22px);
  overflow-x: auto;
}
.cal-block {
  position: absolute;
  left: 2px;
  right: 2px;
  z-index: 2;
  padding: 4px 6px;
  border-radius: 7px;
  background: rgba(10, 132, 255, 0.88);
  color: #fff;
  font-size: 10.5px;
  line-height: 1.25;
  overflow: hidden;
  cursor: pointer;
}
.cal-block.conflict { background: rgba(255, 59, 48, 0.9); }
.cal-block b { display: block; font-size: 10.5px; }
.cal-list { display: flex; flex-direction: column; gap: 8px; }
.cal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}
.cal-row-main { min-width: 0; }
.cal-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.cr-main { font-size: 13px; font-weight: 600; }
.cr-sub { margin-top: 1px; color: var(--muted); font-size: 11.5px; }
.cal-row button {
  border: 0;
  background: none;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.gcal-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.gcal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}
.gcal-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gcal-item-main b { font-size: 12.5px; font-weight: 600; }
.gcal-item-main span { color: var(--muted); font-size: 10.5px; }
.gcal-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Map ---------- */
.map {
  height: 480px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  z-index: 1;
}
.map-search { max-width: 280px; }
.map-stage { position: relative; }
.map-real {
  position: relative;
  height: 520px;
  background: #e9edf1;
}
.map-embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.map-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-action {
  height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}
.map-action:hover { background: #fff; color: var(--ink); }
.map-action.primary { background: rgba(10, 95, 175, 0.92); border-color: transparent; color: #fff; }
.map-action.primary:hover { background: #0a5faf; color: #fff; }
.map-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.map-legend {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lg-dot.campus { background: #c9cdd4; }
.lg-dot.course { background: var(--blue); }
.map-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(238, 241, 245, 0.76);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
.map-tip {
  position: absolute;
  z-index: 6;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(29, 29, 31, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -130%);
  opacity: 0;
  transition: opacity 0.12s;
}
.map-tip.show { opacity: 1; }
.map-label {
  position: absolute;
  z-index: 5;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.map-label.course { background: var(--blue); color: #fff; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(30, 38, 52, 0.28);
  backdrop-filter: blur(14px) saturate(130%);
}
.modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  padding: 30px 32px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 80px rgba(20, 30, 50, 0.18);
  backdrop-filter: blur(30px) saturate(170%);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal::-webkit-scrollbar { display: none; width: 0; height: 0; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.045);
  color: var(--muted);
  cursor: pointer;
  z-index: 3;
}
.modal-close svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.08); color: var(--ink); }
.modal:has(.m-folder-tabs) .modal-close {
  top: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: var(--sa-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.modal:has(.m-folder-tabs) .modal-close:hover {
  background: #f3f3f0;
  color: #000;
}
.m-folder-tabs {
  position: sticky;
  top: -30px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: -30px -32px 22px;
  padding: 10px 58px 0 16px;
  border-bottom: 1px solid var(--sa-ink);
  background: var(--sa-ink);
}
.m-folder-tabs::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 18px;
  background: var(--sa-bg);
  pointer-events: none;
}
.m-folder-tab {
  min-height: 38px;
  padding: 0 17px;
  border: 1px solid #4c4c47;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #343431;
  color: #d8d8d1;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.m-folder-tab:hover { background: #41413d; color: #fff; }
.m-folder-tab.active {
  position: relative;
  top: 1px;
  background: var(--sa-bg);
  color: var(--ink);
  font-weight: 700;
}
.m-folder-panel[hidden] { display: none; }
.m-folder-panel { animation: m-folder-in 0.16s ease-out; }
@keyframes m-folder-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.m-folder-head h2 { padding-right: 34px; }
.m-folder-section-title { margin-top: 16px; }
.m-prereq-cell {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}
.instructor-link {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--blue-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.instructor-link:hover { color: var(--ink); }
.m-course-link { display: inline-flex; }
.modal h2 { margin: 0 0 2px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.m-sub { margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.m-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px 20px;
  margin: 16px 0;
  font-size: 13px;
}
.m-grid b {
  display: block;
  margin-bottom: 2px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.m-desc-details {
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.m-desc-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.m-desc-details summary::-webkit-details-marker { display: none; }
.m-desc-details summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.m-desc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.m-desc-toggle::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  line-height: 1;
}
.m-desc-collapse { display: none; }
.m-desc-details[open] .m-desc-expand { display: none; }
.m-desc-details[open] .m-desc-collapse { display: inline; }
.m-desc-details[open] .m-desc-toggle::before { content: "−"; }
.m-desc {
  margin: 0;
  padding: 2px 0 14px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.sections-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 5px;
  table-layout: fixed;
  font-size: 11px;
}
.sections-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sections-table td {
  padding: 9px 8px;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sections-table th:nth-child(1), .sections-table td:nth-child(1) { width: 10%; }
.sections-table th:nth-child(2), .sections-table td:nth-child(2) { width: 23%; }
.sections-table th:nth-child(3), .sections-table td:nth-child(3) { width: 12%; }
.sections-table th:nth-child(4), .sections-table td:nth-child(4) { width: 15%; }
.sections-table th:nth-child(5), .sections-table td:nth-child(5) { width: 28%; }
.sections-table th:nth-child(6), .sections-table td:nth-child(6) { width: 12%; }
.sections-table tbody tr td:first-child { border-radius: 9px 0 0 9px; }
.sections-table tbody tr td:last-child { border-radius: 0 9px 9px 0; }
.sections-table tbody tr:hover td { background: rgba(255, 255, 255, 0.82); }
.sections-table tbody tr.selected td { background: rgba(0, 0, 0, 0.055); }
.loc-link {
  max-width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.18);
  background: none;
  color: var(--ink-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loc-link:hover { color: var(--blue-2); border-bottom-color: var(--blue-2); }
.loc-link::after { content: " ↗"; color: var(--faint); font-size: 9px; }
.prereq-link { color: var(--blue-2); font-weight: 500; cursor: pointer; }
.prereq-link:hover { text-decoration: underline; }
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-top: 20px;
}
.modal-actions .btn { white-space: nowrap; }

.course-detail-locked {
  position: relative;
  isolation: isolate;
  min-height: min(620px, calc(86vh - 60px));
}

.modal.is-course-locked {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.course-detail-locked > :not(.course-lock-overlay) {
  pointer-events: none;
  user-select: none;
  opacity: .58;
  filter: blur(5px);
}

.course-lock-overlay {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: min(620px, calc(86vh - 60px));
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: transparent;
  overscroll-behavior: none;
  touch-action: none;
}

.course-lock-card {
  position: relative;
  z-index: 21;
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 26px 24px 23px;
  border: 2px solid var(--sa-ink);
  border-radius: 12px;
  background: var(--sa-bg);
  color: var(--sa-ink);
  text-align: center;
  box-shadow: 5px 6px 0 rgba(36, 36, 34, 0.12);
}

.course-lock-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border-radius: 50%;
  background: #dfeaf6;
  color: #344f70;
}

.course-lock-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.course-lock-card b {
  font-size: 17px;
  font-weight: 800;
}

.course-lock-card > span:not(.course-lock-icon) {
  color: var(--sa-ink-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.course-lock-card .btn {
  margin-top: 6px;
}

/* Enrollment analysis in modal */
.enroll-analysis {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.045);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}
.ea-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ea-head h3 { margin: 0; font-size: 12.5px; font-weight: 600; }
.ea-head span { color: var(--faint); font-size: 10.5px; }
.ea-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 4px; }
.ea-stats div { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.7); }
.ea-stats b {
  display: block;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ea-stats span { font-size: 15px; font-weight: 600; }
.ea-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.45;
}
.ea-note b { font-weight: 600; }
.ea-note.high { background: rgba(255, 59, 48, 0.08); color: #a00f25; }
.ea-note.mid { background: rgba(255, 149, 0, 0.10); color: #8a4b00; }
.ea-note.low { background: rgba(255, 204, 0, 0.12); color: #6a5200; }
.ea-note.stable { background: rgba(26, 127, 55, 0.08); color: #146b2e; }
.ea-note.info { background: rgba(10, 132, 255, 0.07); color: #0a5faf; }
.ea-hint { margin-top: 8px; color: var(--faint); font-size: 10.5px; }

.term-compare {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px);
}
.cmp-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cmp-year-group { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--sa-soft-line); }
.cmp-year-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--sa-ink);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.03em;
}
.cmp-year-heading small {
  color: var(--sa-ink-2);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
}
.cmp-row {
  display: grid;
  grid-template-columns: 118px minmax(120px, 1fr) 124px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.48);
}
.cmp-left { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cmp-term { color: var(--faint); font-size: 9.5px; }
.cmp-sec { color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.cmp-mid { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmp-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.05); overflow: hidden; }
.cmp-bar > span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: #8fbfa4;
}
.cmp-bar.low > span { background: #8fbfa4; }
.cmp-bar.mid > span { background: #e2c07a; }
.cmp-bar.high > span { background: #d99a9a; }
.cmp-mid b { color: var(--ink-2); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.cmp-drop { flex: 0 0 auto; color: #9a5200; font-size: 10px; font-weight: 700; white-space: nowrap; }
.cmp-drop.mid { color: #a04400; }
.cmp-drop.high { color: #c0001a; }
.cmp-drop.up { color: var(--green); }
.cmp-drop.flat,
.cmp-drop.muted { color: var(--faint); }
.cmp-inst {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.culpa-review-host { margin: 18px 0 4px; }
.culpa-review-loading,
.culpa-empty {
  padding: 12px 14px;
  border: 1px solid var(--sa-soft-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .36);
  color: var(--sa-ink-2);
  font-size: 10px;
}
.culpa-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--sa-ink);
  font-size: 13px;
  line-height: 1.5;
}
.culpa-empty .review-outlink {
  flex: 0 0 auto;
  color: var(--sa-ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.culpa-review-card {
  padding: 16px;
  border: 1px solid var(--sa-soft-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .46);
}
.culpa-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.culpa-kicker {
  color: var(--sa-brown);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.culpa-review-head h3 {
  margin: 5px 0 0;
  color: var(--sa-ink);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.025em;
}
.culpa-review-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}
.review-outlink {
  border-bottom: 1px solid currentColor;
  color: var(--sa-ink);
  font-size: 9px;
  line-height: 1.4;
  text-decoration: none;
}
.review-outlink:hover { color: var(--sa-brown); }
.culpa-review-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 13px;
  border-top: 1px solid var(--sa-line);
  border-bottom: 1px solid var(--sa-line);
}
.culpa-review-summary div {
  display: grid;
  gap: 3px;
  padding: 10px 12px 10px 0;
}
.culpa-review-summary div + div {
  padding-left: 14px;
  border-left: 1px solid var(--sa-soft-line);
}
.culpa-review-summary b {
  color: var(--sa-ink);
  font-size: 19px;
  font-weight: 500;
}
.culpa-review-summary span {
  color: var(--sa-ink-2);
  font-size: 8.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.culpa-review-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.culpa-review {
  padding: 11px 12px;
  border: 1px solid var(--sa-soft-line);
  border-radius: 8px;
  background: rgba(248, 248, 245, .72);
}
.culpa-review-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--sa-ink-2);
  font-size: 9px;
}
.culpa-review-meta span {
  color: var(--sa-brown);
  letter-spacing: .07em;
}
.culpa-review-meta b { color: var(--sa-ink); font-weight: 500; }
.culpa-review-meta time { margin-left: auto; white-space: nowrap; }
.culpa-review p {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--sa-ink-2);
  font-size: 10.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.culpa-review small {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--sa-ink-2);
  font-size: 9px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.culpa-review small b { color: var(--sa-ink); font-weight: 500; }
.culpa-disclaimer {
  margin: 10px 0 0;
  color: var(--sa-ink-2);
  font-size: 8.5px;
  line-height: 1.5;
}
@media (max-width: 600px) {
  .culpa-review-head { display: block; }
  .culpa-review-links {
    justify-content: flex-start;
    margin-top: 9px;
  }
  .culpa-empty { align-items: flex-start; flex-direction: column; }
}

/* ---------- Feedback ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.9);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}
.notice { margin: 12px 0; padding: 12px 16px; border-radius: 12px; font-size: 13px; }
.notice.error { border: 1px solid rgba(215, 0, 21, 0.12); background: rgba(255, 59, 48, 0.07); color: #b00020; }
.notice.info { border: 1px solid rgba(10, 132, 255, 0.10); background: rgba(10, 132, 255, 0.06); color: #0a5faf; }
.loading { padding: 26px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- Account / sign-in ---------- */
.rail-brand.is-user { padding: 0; overflow: hidden; }
.rail-brand.is-user img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-brand .rail-initials { font-size: 12px; font-weight: 700; }
.account-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 20, 24, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.account-card {
  position: relative;
  width: 100%;
  max-width: 384px;
  padding: 26px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 20, 30, 0.22);
}
.account-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.account-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.account-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
  background: #ececef;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.account-card h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.02em; }
.account-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.account-google { display: flex; justify-content: center; min-height: 40px; margin: 4px 0 12px; }
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  height: 40px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.google-btn:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(60, 64, 67, 0.18); }
.google-btn .google-g { width: 18px; height: 18px; flex: 0 0 18px; }
.account-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--faint); font-size: 11px; }
.account-divider::before, .account-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.account-field { display: flex; gap: 8px; }
.account-field input {
  flex: 1;
  height: 36px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.account-field input:focus { border-color: rgba(10, 132, 255, 0.4); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1); }
.account-field button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.account-hint { margin-top: 12px; color: var(--faint); font-size: 11.5px; line-height: 1.5; }
.account-user { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.account-user img,
.account-user .account-initials {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: #ececef;
  font-weight: 700;
  font-size: 16px;
}
.account-user .au-name { font-weight: 600; font-size: 14px; }
.account-user .au-email { color: var(--muted); font-size: 12px; }
.account-actions { display: flex; gap: 8px; }
.account-actions button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.account-actions button.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.account-status { margin-top: 12px; color: var(--muted); font-size: 11.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .planner-grid { grid-template-columns: 1fr; }
  .analysis-summary { grid-template-columns: repeat(2, 1fr); }
  .analysis-row { grid-template-columns: minmax(0, 1fr) 120px; }
  .ar-spark { display: none; }
  .analysis-head { flex-wrap: wrap; }
  .analysis-tools { width: 100%; }
  .analysis-search { width: auto; flex: 1; }
  .course-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view-head h1 { font-size: 30px; }
}

/* Individual postage cards */
#course-list,
#search-results {
  column-gap: 14px;
  row-gap: 14px;
  border: 0;
}
#course-list > .course-card,
#search-results > .course-card {
  min-height: 184px;
  padding: 18px 20px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}
#course-list > .course-card::before,
#course-list > .course-card::after,
#search-results > .course-card::before,
#search-results > .course-card::after {
  content: none;
}
.course-card > .stamp-shape {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--sa-ink);
  filter: drop-shadow(0 5px 7px rgba(36, 36, 34, 0.08));
  -webkit-mask: url("assets/stamp-card-mask.svg?v=20261122-stamp-8") center / 100% 100% no-repeat;
  mask: url("assets/stamp-card-mask.svg?v=20261122-stamp-8") center / 100% 100% no-repeat;
  pointer-events: none;
}
.course-card > .stamp-shape::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 18px;
  background-color: #fbfaf5;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(36, 36, 34, 0.048) 0.55px, transparent 0.72px),
    linear-gradient(105deg, rgba(255,255,255,.45), rgba(230,228,218,.12));
  background-size: 4px 4px, 100% 100%;
}
.course-card > .cc-main,
.course-card > .cc-bottom {
  position: relative;
  z-index: 1;
}
#course-list > .course-card:hover,
#search-results > .course-card:hover {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.course-card:hover > .stamp-shape {
  filter: drop-shadow(0 7px 10px rgba(36, 36, 34, 0.13));
}
.course-card > .cc-main > .cc-top {
  margin: -18px -20px 0;
  padding: 4px 20px;
  border-radius: 0;
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    margin: 0;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.065);
    border-radius: 0;
    background: #fbfbfc;
    box-shadow: none;
    backdrop-filter: none;
    overflow-x: auto;
    z-index: 80;
  }
  .rail-brand { width: 32px; height: 32px; flex: 0 0 32px; margin: 0; }
  .nav { flex: 1; flex-direction: row; align-items: center; justify-content: center; gap: 4px; }
  .nav button { width: 34px; height: 34px; }
  .sidebar-foot { margin: 0; padding: 0; border: 0; width: auto; }
  .main-wrap { margin-left: 0; }
  .topbar {
    position: static;
    height: auto;
    flex-wrap: wrap;
    padding: 6px 14px 5px;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
  .topbar-search { order: 3; flex: 1 1 100%; padding: 6px 0 0; }
  .topbar-search .search { max-width: none; }
  main { padding: 6px 14px 80px; }
  .view-head h1 { font-size: 28px; }
  .search-row { flex-wrap: wrap; }
  .search-row .scope-bar { width: 100%; }
  .course-card { min-height: 0; }
  .field-grid { grid-template-columns: 1fr; }
  .daily-stats { grid-template-columns: repeat(2, 1fr); }
  .ea-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .course-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nav-label,
  body.sidebar-collapsed .nav-label { display: none; }
  .nav button,
  body.sidebar-collapsed .nav button { padding: 8px; }
  .sidebar-foot,
  body.sidebar-collapsed .sidebar-foot { display: none; }
  .scope-bar { width: 100%; }
  .scope-bar .btn { flex: 1; text-align: center; }
  .view-head h1 { font-size: 25px; }
  .analysis-summary { grid-template-columns: repeat(2, 1fr); }
  .analysis-row { grid-template-columns: 1fr; }
  .ar-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .cmp-row { grid-template-columns: 1fr; gap: 6px; }
  .cmp-inst { text-align: left; }
  .gcal-item { flex-direction: column; align-items: flex-start; }
  .daily-dept-dd { width: 100%; }
  .history-add { width: 100%; }
  .history-add .input { flex: 1; width: auto; }
}

/* ---------- Story Archive-inspired editorial system ---------- */
body {
  --sa-bg: #f3f3f0;
  --sa-ink: #242422;
  --sa-ink-2: #66665f;
  --sa-line: #272724;
  --sa-soft-line: #d8d8d2;
  --sa-green: #426b50;
  --sa-brown: #7a4c2f;
  --sa-font: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  background: var(--sa-bg);
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 15px;
  line-height: 1.5;
}

body,
button,
input,
select,
textarea {
  font-family: var(--sa-font);
}

.app-shell { display: block; min-height: 100vh; }
.main-wrap { margin-left: 0; }
main {
  max-width: none;
  margin: 0;
  padding: 20px 32px 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  height: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 16px 32px 0;
  border: 0;
  background: var(--sa-bg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.topbar-brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 55px;
  padding: 3px 0;
  border-top: 2px solid var(--sa-line);
}

.topbar-meta-row {
  min-height: 57px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 3px 0;
}

.topbar-meta-row > .topbar-term {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.rail-brand {
  grid-column: 1;
  justify-self: start;
  width: auto;
  height: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
}

.rail-brand:hover {
  background: transparent;
  color: var(--sa-brown);
  box-shadow: none;
}

.rail-brand .brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-brand .brand-name {
  color: currentColor;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.rail-brand .brand-name span { color: inherit; font-weight: inherit; }

.topbar-actions {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
}

.topbar .nav-arrow,
.topbar-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
}

.topbar .nav-arrow:hover:not(:disabled),
.topbar-icon:hover {
  background: transparent;
  color: var(--sa-brown);
}

.topbar .nav-arrow:disabled { opacity: 0.35; }
.topbar .nav-arrow svg,
.topbar-icon svg {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.topbar-icon.is-user {
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--sa-ink);
  box-sizing: border-box;
}

.topbar-icon.is-user img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-icon .topbar-initials {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 2px solid var(--sa-ink);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 500;
}

.topbar .nav {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.topbar .nav button {
  width: auto;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  box-shadow: none;
}

.topbar .nav button:hover,
.topbar .nav button.active {
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
}

.topbar .nav button:not(:last-child)::after {
  content: ",";
  display: inline-block;
  margin: 0 0.2em;
  color: var(--sa-ink-2);
}

.topbar .nav .nav-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0;
  font: inherit;
  white-space: nowrap;
}

.topbar .nav .nav-hand-ink {
  position: absolute;
  top: -8px;
  left: -14px;
  width: calc(100% + 28px);
  height: 54px;
  overflow: visible;
  color: var(--sa-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.ink-filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.topbar .nav button[data-view="browse"] .nav-hand-ink {
  left: -14px;
  width: calc(100% + 28px);
}

.topbar .nav button[data-view="analysis"] .nav-hand-ink {
  left: -18px;
  width: calc(100% + 36px);
}

.topbar .nav button[data-view="planner"] .nav-hand-ink {
  left: -16px;
  width: calc(100% + 32px);
}

.topbar .nav button[data-view="calendar"] .nav-hand-ink {
  left: -18px;
  width: calc(100% + 36px);
}

.topbar .nav button[data-view="map"] .nav-hand-ink {
  left: -15px;
  width: calc(100% + 30px);
}

.topbar .nav button.active .nav-hand-ink,
.topbar .nav button[data-view="browse"]:hover .nav-hand-ink,
.topbar .nav button[data-view="browse"]:focus-visible .nav-hand-ink {
  opacity: 1;
}

.topbar .nav:has(button[data-view="browse"]:hover) button.active:not([data-view="browse"]) .nav-hand-ink,
.topbar .nav:has(button[data-view="browse"]:focus-visible) button.active:not([data-view="browse"]) .nav-hand-ink {
  opacity: 0;
}

.nav-ink-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1.05;
  stroke-dashoffset: 1.05;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
  filter: url(#nav-pencil-edge);
}

.nav-ink-grain {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0.005 0.016;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  pointer-events: none;
}

.topbar .nav button.active .nav-ink-line,
.topbar .nav button[data-view="browse"]:hover .nav-ink-line,
.topbar .nav button[data-view="browse"]:focus-visible .nav-ink-line {
  animation: nav-ink-draw 0.62s cubic-bezier(0.42, 0.02, 0.24, 1) both;
}

.topbar .nav button.active .nav-ink-grain,
.topbar .nav button[data-view="browse"]:hover .nav-ink-grain,
.topbar .nav button[data-view="browse"]:focus-visible .nav-ink-grain {
  animation: nav-graphite-in 0.18s steps(3, end) 0.44s both;
}

@keyframes nav-ink-draw {
  from {
    stroke-dashoffset: 1.05;
    stroke-width: 1.65;
    opacity: 0;
  }
  10% { opacity: 0.92; }
  62% { stroke-width: 2.6; }
  to {
    stroke-dashoffset: 0;
    stroke-dasharray: 2;
    stroke-width: 2.2;
    opacity: 1;
  }
}

/* ---------- Instructor dossier ---------- */
.instructor-page {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.instructor-loading {
  min-height: 340px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border-top: 2px solid var(--sa-line);
  border-bottom: 1px solid var(--sa-soft-line);
}

.instructor-loading span {
  width: 34px;
  height: 34px;
  border: 2px solid var(--sa-soft-line);
  border-top-color: var(--sa-brown);
  border-radius: 50%;
  animation: prof-spin .8s linear infinite;
}

.instructor-loading b {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 500;
}

.instructor-loading small { color: var(--sa-ink-2); }

@keyframes prof-spin { to { transform: rotate(360deg); } }

.prof-toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--sa-soft-line);
  color: var(--sa-ink-2);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.prof-toolbar span { justify-self: end; }
.prof-back {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sa-ink);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.prof-back:hover { color: var(--sa-brown); }

.prof-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 30px 0 28px;
  border-bottom: 2px solid var(--sa-line);
}

.prof-monogram {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 2px solid #33485d;
  border-radius: 50%;
  color: #fbf8f0;
  background: #33485d;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .04em;
}

.prof-kicker {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  margin: 10px 0 0;
  padding: 6px 10px;
  border: 1.5px solid #9fb1c5;
  border-radius: 999px;
  background: #e8eef5;
  color: #354f6c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.prof-department {
  display: block;
  margin-bottom: 4px;
  color: #506174;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.prof-identity h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.045em;
}

.prof-identity > p {
  margin: 9px 0 13px;
  color: var(--sa-ink-2);
  font-size: 16px;
  font-weight: 600;
}

.prof-identity-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  max-width: 100%;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.prof-identity-tags::-webkit-scrollbar { display: none; }

.prof-identity-tags span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1.5px solid;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
}

.prof-identity-tags .is-department {
  border-color: #33485d;
  background: #33485d;
  color: #fbf8f0;
}

.prof-identity-tags .is-courses {
  border-color: #b28b5b;
  background: #f4e9d8;
  color: #6f4321;
}

.prof-identity-tags .is-terms {
  border-color: #9caf9f;
  background: #e6eee7;
  color: #34513c;
}

.prof-identity-tags .is-enrollment {
  border-color: #9eb1c7;
  background: #e7edf5;
  color: #344f70;
}

.prof-identity-tags .is-drop-good {
  border-color: #87a78e;
  background: #e1eee5;
  color: #26563a;
}

.prof-identity-tags .is-drop-mid {
  border-color: #c6a064;
  background: #f5ead5;
  color: #704a19;
}

.prof-identity-tags .is-drop-high {
  border-color: #c18b7e;
  background: #f4e4e0;
  color: #7c372b;
}

.prof-identity-tags .is-drop-pending,
.prof-identity-tags .is-review {
  border-color: #b6b1a6;
  background: #efede7;
  color: #545047;
}

.prof-identity-tags .is-courses,
.prof-identity-tags .is-terms,
.prof-identity-tags .is-enrollment,
.prof-identity-tags .is-drop-good,
.prof-identity-tags .is-drop-mid,
.prof-identity-tags .is-drop-high,
.prof-identity-tags .is-drop-pending,
.prof-identity-tags .is-review {
  border-color: #9eb1c5;
  background: #e8eef5;
  color: #354f6c;
}

.prof-score {
  --ring-color: var(--sa-green);
  position: relative;
  width: 126px;
  height: 126px;
  display: grid;
  align-content: center;
  justify-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--score) * 1%), var(--sa-soft-line) 0);
}

.prof-score::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: var(--sa-bg);
}

.prof-score > * { position: relative; }
.prof-score span,
.prof-score small {
  color: var(--sa-ink-2);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.prof-score b {
  margin: -1px 0 -3px;
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}
.prof-score.strong { --ring-color: #e4a11d; }
.prof-score.steady { --ring-color: #d66b3b; }
.prof-score.developing { --ring-color: #ba637c; }
.prof-score.unrated { --ring-color: #8d9aa7; }
.prof-score.is-unrated b {
  font-size: 23px;
  letter-spacing: .04em;
}

.prof-dashboard {
  display: grid;
  grid-template-columns: minmax(350px, .9fr) minmax(0, 1.4fr);
  gap: 0;
  margin-top: 20px;
  border-top: 2px solid var(--sa-soft-line);
  border-bottom: 2px solid var(--sa-soft-line);
}

.prof-panel {
  min-width: 0;
  padding: 20px;
}

.prof-radar-panel {
  position: relative;
  background: transparent;
  color: var(--sa-ink);
  border-right: 1.5px solid var(--sa-soft-line);
  padding-left: 0;
}

.prof-radar-panel .prof-panel-head h2 { color: var(--sa-ink); }

.prof-course-panel {
  grid-column: 1 / -1;
  border-top: 1.5px solid var(--sa-soft-line);
  padding-left: 0;
}

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

.prof-panel-head span {
  display: block;
  color: var(--sa-ink-2);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.prof-panel-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.prof-panel-head small {
  max-width: 230px;
  color: var(--sa-ink-2);
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.prof-radar-chart {
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
  margin: 2px auto 0;
  overflow: visible;
}

.prof-radar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 2px;
}

.prof-radar-legend span {
  padding: 3px 7px;
  border: 1px solid #bdc9d7;
  border-radius: 999px;
  background: #edf2f8;
  color: #40566d;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.prof-radar-grid {
  fill: none;
  stroke: #bfc2c0;
  stroke-width: 1.4;
}

.prof-radar-spoke {
  stroke: #c9ccca;
  stroke-width: 1.3;
}

.prof-radar-area {
  fill: #3b88d4;
  fill-opacity: .2;
  stroke: #2f76bd;
  stroke-width: 2.7;
}

.prof-score-note {
  max-width: 340px;
  margin: 0 auto;
  color: var(--sa-ink-2);
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
}

.prof-term-chart {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.prof-chart-grid {
  stroke: var(--sa-soft-line);
  stroke-dasharray: 2 4;
  stroke-width: 1.15;
}

.prof-chart-bar {
  fill: color-mix(in srgb, var(--sa-green) 74%, var(--sa-bg));
}

.prof-chart-bar.stable { fill: #2f9164; }
.prof-chart-bar.watch { fill: #e5a51f; }
.prof-chart-bar.risk { fill: #dc5a48; }
.prof-chart-bar.pre { fill: #3e7fc1; }
.prof-chart-bar:hover { fill: #163e73; }

.prof-drop-line {
  fill: none;
  stroke: #b45534;
  stroke-width: 2.8;
}

.prof-drop-dot {
  fill: #fffaf2;
  stroke: #b45534;
  stroke-width: 2.4;
}

.prof-chart-label,
.prof-chart-axis-label {
  fill: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.prof-chart-axis-label {
  letter-spacing: .04em;
  text-transform: uppercase;
}

.prof-chart-key {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-top: -7px;
  color: var(--sa-ink-2);
  font-size: 12px;
}

.prof-chart-key span { display: inline-flex; align-items: center; gap: 6px; }
.prof-chart-key span {
  padding: 4px 8px;
  border: 1px solid #c9c5ba;
  border-radius: 999px;
  background: #f3f0e9;
  color: #4d4940;
  font-weight: 700;
}
.prof-chart-key i { display: block; width: 18px; }
.prof-chart-key i.bar { height: 8px; background: var(--sa-green); }
.prof-chart-key i.line { height: 3px; background: var(--sa-brown); }

.prof-panel-head .prof-chart-key {
  gap: 5px;
  margin: 1px 0 0;
}

.prof-panel-head .prof-chart-key span {
  padding: 3px 6px;
  font-size: 9px;
}

.prof-panel-head .prof-chart-key i { width: 12px; }

.prof-course-bars {
  display: grid;
  gap: 8px;
}

.prof-course-bar-row {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(150px, 1.25fr) minmax(220px, auto);
  align-items: center;
  gap: 16px;
  min-height: 44px;
  border-bottom: 1px dotted var(--sa-soft-line);
}

.prof-course-bar-head {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(150px, 1.25fr) minmax(220px, auto);
  align-items: center;
  gap: 16px;
  padding: 0 0 7px;
  border-bottom: 1.5px solid var(--sa-soft-line);
  color: var(--sa-ink-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.prof-course-bar-head-stats {
  display: grid;
  grid-template-columns: 1fr .65fr .85fr;
  gap: 5px;
  text-align: center;
}

.prof-course-bar-head-stats i { font-style: normal; }

.prof-course-bar-label,
.prof-course-bar-stat {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.prof-course-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.prof-course-bar-label b,
.prof-course-bar-stat b {
  font-size: 13px;
  font-weight: 800;
}

.prof-course-bar-label b {
  width: max-content;
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1.5px solid #8fa9c4;
  border-radius: 999px;
  background: #dfeaf6;
  color: #344f70;
  font-size: 12px;
}

.prof-course-bar-label strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #3d3932;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prof-course-bar-label span,
.prof-course-bar-stat span {
  overflow: hidden;
  color: var(--sa-ink-2);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prof-course-bar-track {
  height: 12px;
  overflow: hidden;
  background: var(--sa-soft-line);
}

.prof-course-bar-track i {
  display: block;
  height: 100%;
  background: var(--sa-green);
}

.prof-course-bar-track i.stable { background: #2f9164; }
.prof-course-bar-track i.watch { background: #e5a51f; }
.prof-course-bar-track i.risk { background: #dc5a48; }
.prof-course-bar-track i.pre { background: #3e7fc1; }

.prof-course-bar-stat { text-align: right; }

.prof-course-bar-stat {
  display: grid;
  grid-template-columns: 1fr .65fr .85fr;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.prof-course-bar-stat .prof-stat-enrollment {
  width: auto;
  justify-self: center;
  font-size: 14px;
}

.prof-course-bar-stat span {
  display: block;
  padding: 2px 6px;
  border: 1px solid #c9c5ba;
  border-radius: 999px;
  background: #f3f0e9;
  color: #4d4940;
  font-size: 11.5px;
  font-weight: 700;
}

.prof-course-bar-stat .prof-stat-drop.stable {
  border-color: #87a78e;
  background: #e1eee5;
  color: #26563a;
}

.prof-course-bar-stat .prof-stat-drop.watch {
  border-color: #c6a064;
  background: #f5ead5;
  color: #704a19;
}

.prof-course-bar-stat .prof-stat-drop.risk {
  border-color: #c18b7e;
  background: #f4e4e0;
  color: #7c372b;
}

.prof-course-bar-stat .prof-stat-drop.pending {
  border-color: #b6b1a6;
  background: #efede7;
  color: #545047;
}

.prof-history {
  margin-top: 26px;
  border-top: 3px solid var(--sa-line);
}

.prof-history > .prof-panel-head { padding-top: 16px; }
.prof-term-group { border-top: 1.5px solid var(--sa-soft-line); }

.prof-term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  color: var(--sa-ink-2);
  font-size: 11px;
}

.prof-term-head b {
  color: var(--sa-ink);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
}

.prof-offering-list { border-top: 1px dotted var(--sa-soft-line); }

.prof-offering {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 112px 116px;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--sa-soft-line);
}

.prof-offering.current { cursor: pointer; }
.prof-offering.current:hover { background: color-mix(in srgb, var(--sa-green) 5%, transparent); }

.prof-offering-code {
  width: max-content;
  padding: 3px 8px;
  border: 1.5px solid #8fa9c4;
  border-radius: 999px;
  background: #dfeaf6;
  color: #344f70;
  font-size: 12px;
  font-weight: 800;
}

.prof-offering-main,
.prof-offering-metric {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.prof-offering-main b,
.prof-offering-metric b {
  font-size: 13px;
  font-weight: 800;
}

.prof-offering-metric b {
  width: max-content;
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid #cbc6bb;
  border-radius: 999px;
  background: #f3f0e9;
  color: #403c35;
}

.prof-offering-metric .prof-archive-link {
  margin-left: 2px;
  color: #235c89;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.prof-offering-metric .prof-archive-link:hover { text-decoration: underline; }

.prof-offering-main span,
.prof-offering-metric span {
  overflow: hidden;
  color: var(--sa-ink-2);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prof-offering-metric { text-align: right; }
.prof-offering-metric.warn b {
  border-color: #c18b7e;
  background: #f4e4e0;
  color: #8b382c;
}

/* ---------- Department dossier ---------- */
.department-page {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.dept-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr);
  align-items: end;
  gap: 40px;
  padding: 6px 0 28px;
  border-bottom: 3px solid var(--sa-line);
}

.dept-back,
.m-dept-link,
.prof-department[data-department] {
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sa-ink-2);
  font-family: inherit;
  cursor: pointer;
}

.dept-back {
  margin-bottom: 25px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.dept-back:hover,
.m-dept-link:hover,
.prof-department[data-department]:hover {
  color: var(--sa-brown);
}

.dept-kicker {
  display: block;
  margin-bottom: 8px;
  color: #506174;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.dept-hero h1 {
  margin: 0;
  font-size: clamp(54px, 8vw, 104px);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.075em;
}

.dept-hero-main > p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--sa-ink-2);
  font-size: 16px;
  font-weight: 700;
}

.dept-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1.5px solid var(--sa-ink);
  border-bottom: 1.5px solid var(--sa-ink);
}

.dept-hero-metrics > div {
  min-width: 0;
  padding: 17px 14px 15px;
  border-right: 1px solid var(--sa-soft-line);
}

.dept-hero-metrics > div:first-child { padding-left: 0; }
.dept-hero-metrics > div:last-child { border-right: 0; }

.dept-hero-metrics b {
  display: block;
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.035em;
}

.dept-hero-metrics span {
  display: block;
  margin-top: 6px;
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.dept-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 0 13px;
  border-bottom: 2px solid var(--sa-line);
}

.dept-section-head.compact { padding-top: 0; }

.dept-section-head span {
  color: var(--sa-brown);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.dept-section-head h2 {
  margin: 3px 0 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.dept-section-head p {
  max-width: 470px;
  margin: 0;
  color: var(--sa-ink-2);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.dept-ranking-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dept-ranking-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1.5px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.dept-ranking-toggle:hover {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.dept-ranking-toggle svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}

.dept-ranking-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.dept-course-rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 2px solid var(--sa-soft-line);
}

.dept-rank-panel {
  min-width: 0;
  padding: 18px 26px 16px 0;
}

.dept-rank-panel + .dept-rank-panel {
  padding-right: 0;
  padding-left: 26px;
  border-left: 1px solid var(--sa-soft-line);
}

.dept-rank-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--sa-ink);
}

.dept-rank-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.dept-rank-title span {
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dept-course-rank {
  min-height: 61px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px dotted var(--sa-soft-line);
}

.dept-rank-index {
  color: #9b9487;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}

.dept-rank-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 8px;
}

.dept-rank-main b {
  width: max-content;
  padding: 3px 7px;
  border: 1.5px solid #8fa9c4;
  border-radius: 999px;
  background: #dfeaf6;
  color: #344f70;
  font-size: 10px;
  font-weight: 800;
}

.dept-rank-main strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-rank-main > span {
  grid-column: 1 / -1;
  color: var(--sa-ink-2);
  font-size: 9px;
}

.dept-rank-value {
  min-width: 65px;
  text-align: right;
}

.dept-rank-value b {
  display: block;
  color: #1f7048;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.dept-rank-value.drop b { color: #235c89; }

.dept-rank-value span {
  display: block;
  margin-top: 4px;
  color: var(--sa-ink-2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.dept-prof-panel,
.dept-term-panel {
  margin-top: 28px;
  padding-top: 2px;
  border-top: 3px solid var(--sa-line);
}

.dept-prof-panel .dept-section-head,
.dept-term-panel .dept-section-head {
  margin-bottom: 0;
  padding-top: 15px;
}

.dept-prof-head,
.dept-prof-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(170px, .55fr) 46px;
  align-items: center;
  gap: 14px;
}

.dept-prof-head {
  min-height: 31px;
  margin-top: 5px;
  border-bottom: 1.5px solid var(--sa-ink);
  color: var(--sa-ink-2);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.dept-prof-head span:nth-child(3) { text-align: center; }
.dept-prof-head span:last-child { text-align: right; }

.dept-prof-row {
  width: 100%;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted var(--sa-soft-line);
  background: transparent;
  color: var(--sa-ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.dept-prof-row:hover { background: color-mix(in srgb, var(--sa-green) 5%, transparent); }

.dept-prof-rank {
  color: #9b9487;
  font-size: 9px;
  font-weight: 800;
}

.dept-prof-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dept-prof-identity b {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-prof-identity span {
  color: var(--sa-ink-2);
  font-size: 9px;
}

.dept-prof-scale {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sa-soft-line);
}

.dept-prof-scale i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #3b88d4;
}

.dept-prof-row:nth-child(2n) .dept-prof-scale i { background: #2f9164; }

.dept-prof-score {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  justify-self: end;
  border: 1.5px solid #79a0c8;
  border-radius: 50%;
  background: #e8f0f8;
  color: #1c4f7d;
  font-size: 13px;
  font-weight: 800;
}

.dept-prof-score.strong {
  border-color: #caa04a;
  background: #f7ead0;
  color: #73500b;
}

.dept-prof-score.steady {
  border-color: #cf9078;
  background: #f4e2db;
  color: #773a29;
}

.dept-ranking-note {
  padding-top: 9px;
  color: var(--sa-ink-2);
  font-size: 9px;
  text-align: right;
}

.dept-course-table {
  margin-top: 9px;
  border-top: 1.5px solid var(--sa-ink);
}

.dept-course-table-head,
.dept-course-row {
  display: grid;
  grid-template-columns: 118px minmax(280px, 1fr) minmax(180px, .52fr) 112px;
  align-items: center;
  gap: 16px;
}

.dept-course-table-head {
  min-height: 31px;
  border-bottom: 1.5px solid var(--sa-ink);
  color: var(--sa-ink-2);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.dept-course-table-head span:last-child { text-align: right; }

.dept-course-row {
  width: 100%;
  min-height: 58px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px dotted var(--sa-soft-line);
  background: transparent;
  color: var(--sa-ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.dept-course-row:hover {
  background: color-mix(in srgb, var(--sa-green) 5%, transparent);
}

.dept-course-code {
  width: max-content;
  max-width: 100%;
  padding: 3px 8px;
  border: 1.5px solid #8fa9c4;
  border-radius: 999px;
  background: #dfeaf6;
  color: #344f70;
  font-size: 11px;
  font-weight: 800;
}

.dept-course-main,
.dept-course-schedule,
.dept-course-enrollment {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dept-course-main b,
.dept-course-schedule b,
.dept-course-enrollment b {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-course-main span,
.dept-course-schedule span,
.dept-course-enrollment span {
  overflow: hidden;
  color: var(--sa-ink-2);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-course-main i {
  margin-left: 7px;
  padding-left: 7px;
  border-left: 1px solid var(--sa-soft-line);
  color: #6d665c;
  font-style: normal;
  font-weight: 700;
}

.dept-course-enrollment { text-align: right; }

.dept-course-enrollment b {
  color: #225f42;
  font-size: 13px;
}

.dept-empty {
  padding: 22px 0;
  color: var(--sa-ink-2);
  font-size: 11px;
  font-weight: 600;
}

.m-dept-link {
  color: inherit;
  font-size: inherit;
  font-weight: 700;
}

/* ---------- Campus leaderboard ---------- */
.rankings-page {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.rankings-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, .75fr);
  align-items: end;
  gap: 42px;
  padding: 10px 0 30px;
  border-bottom: 3px solid var(--sa-line);
}

.rankings-hero h1 {
  margin: 0;
  font-size: clamp(54px, 7vw, 92px);
  font-weight: 800;
  line-height: .88;
  letter-spacing: -.07em;
}

.rankings-hero p {
  max-width: 560px;
  margin: 15px 0 0;
  color: var(--sa-ink-2);
  font-size: 14px;
  font-weight: 700;
}

.rankings-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1.5px solid var(--sa-ink);
  border-bottom: 1.5px solid var(--sa-ink);
}

.rankings-stats > div {
  min-width: 0;
  padding: 17px 13px 15px;
  border-right: 1px solid var(--sa-soft-line);
}

.rankings-stats > div:first-child { padding-left: 0; }
.rankings-stats > div:last-child { border-right: 0; }

.rankings-stats b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.035em;
}

.rankings-stats span {
  display: block;
  margin-top: 6px;
  color: var(--sa-ink-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.school-ranking-panel {
  margin-top: 28px;
  border-top: 3px solid var(--sa-line);
}

.rankings-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0 13px;
  border-bottom: 2px solid var(--sa-line);
}

.rankings-toolbar h2 {
  margin: 3px 0 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.rankings-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rankings-search {
  width: 210px;
  height: 34px;
  padding: 0 12px;
  border: 1.5px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 11px;
}

.rankings-search:focus {
  border-color: var(--sa-brown);
  outline: none;
}

.rankings-modes {
  display: flex;
  gap: 4px;
}

.rankings-modes button {
  height: 34px;
  padding: 0 11px;
  border: 1.5px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.rankings-modes button:hover,
.rankings-modes button.active {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.school-instructor-list {
  max-height: 690px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #aaa397 transparent;
}

.school-rank-head,
.school-rank-row {
  display: grid;
  grid-template-columns: 44px minmax(260px, 1fr) minmax(180px, .55fr) 92px;
  align-items: center;
  gap: 15px;
}

.school-rank-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 31px;
  border-bottom: 1.5px solid var(--sa-ink);
  background: var(--sa-bg);
  color: var(--sa-ink-2);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.school-rank-head span:nth-child(3),
.school-rank-head span:last-child { text-align: right; }

.school-rank-row {
  width: 100%;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted var(--sa-soft-line);
  background: transparent;
  color: var(--sa-ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.school-rank-row:hover { background: color-mix(in srgb, var(--sa-green) 5%, transparent); }

.school-rank-index {
  color: #9b9487;
  font-size: 9px;
  font-weight: 800;
}

.school-rank-person {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.school-rank-person b {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-rank-person span {
  color: var(--sa-ink-2);
  font-size: 9px;
}

.school-rank-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sa-soft-line);
}

.school-rank-meter i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #3b88d4;
}

.school-rank-row:nth-child(2n) .school-rank-meter i { background: #2f9164; }

.school-rank-result {
  min-width: 54px;
  display: grid;
  place-items: center;
  justify-self: end;
  padding: 7px 9px;
  border: 1.5px solid #79a0c8;
  border-radius: 999px;
  background: #e8f0f8;
  color: #1c4f7d;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.school-rank-result.strong {
  border-color: #caa04a;
  background: #f7ead0;
  color: #73500b;
}

.school-rank-result.steady {
  border-color: #cf9078;
  background: #f4e2db;
  color: #773a29;
}

.school-rank-more {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 11px 0 2px;
}

.school-rank-more span {
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 700;
}

.school-rank-more button {
  padding: 5px 10px;
  border: 1.5px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.school-rank-more button:hover {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

/* ---------- Personal course rating ---------- */
.course-rating-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1.5px solid var(--sa-soft-line);
  border-bottom: 1.5px solid var(--sa-soft-line);
}

.course-rating-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.course-rating-copy > span {
  color: var(--sa-brown);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.course-rating-copy b {
  font-size: 15px;
  font-weight: 800;
}

.course-rating-copy small {
  color: var(--sa-ink-2);
  font-size: 9.5px;
}

.course-rating-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.course-rating-stars {
  display: flex;
  gap: 2px;
}

.course-rating-stars button {
  width: 31px;
  height: 34px;
  padding: 0;
  border: 1.5px solid #c8c3b8;
  border-radius: 6px;
  background: transparent;
  color: #b5b0a6;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.course-rating-stars button:hover,
.course-rating-stars button.active {
  border-color: #d49b1e;
  background: #f5e8c7;
  color: #b87900;
}

.course-rating-clear {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.course-rating-clear:hover { color: var(--sa-brown); }

/* ---------- Signed-in workspace and protected data ---------- */
body.auth-authenticated .floating-cta { display: none; }

.course-data-lock {
  min-width: 150px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px dashed #aaa59b;
  border-radius: 999px;
  color: var(--sa-ink-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.my-page {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.my-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .7fr);
  align-items: end;
  gap: 38px;
  padding: 8px 0 28px;
  border-bottom: 3px solid var(--sa-line);
}

.my-identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.my-avatar {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 2px solid #8fa9c4;
  border-radius: 50%;
  background: #dfeaf6;
  color: #344f70;
  font-size: 24px;
  font-weight: 800;
}

.my-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-identity h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
}

.my-identity p {
  margin: 8px 0 0;
  color: var(--sa-ink-2);
  font-size: 12px;
}

.my-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1.5px solid var(--sa-ink);
  border-bottom: 1.5px solid var(--sa-ink);
}

.my-stats > div {
  min-width: 0;
  padding: 16px 13px 14px;
  border-right: 1px solid var(--sa-soft-line);
}

.my-stats > div:first-child { padding-left: 0; }
.my-stats > div:last-child { border-right: 0; }

.my-stats b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.my-stats span {
  display: block;
  margin-top: 6px;
  color: var(--sa-ink-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.my-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 26px;
  border-top: 3px solid var(--sa-line);
  border-bottom: 2px solid var(--sa-soft-line);
}

.my-panel {
  min-width: 0;
  padding: 20px 24px 20px 0;
  border-bottom: 1px solid var(--sa-soft-line);
}

.my-panel:nth-child(even) {
  padding-right: 0;
  padding-left: 24px;
  border-left: 1px solid var(--sa-soft-line);
}

.my-panel-head span {
  color: var(--sa-brown);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.my-panel-head h2 {
  margin: 3px 0 13px;
  font-size: 20px;
  font-weight: 800;
}

.my-account-panel > p {
  margin: 0 0 13px;
  color: var(--sa-ink-2);
  font-size: 11px;
}

.my-course-list,
.my-rating-list {
  display: grid;
  gap: 0;
  border-top: 1.5px solid var(--sa-ink);
}

.my-course-list button,
.my-rating-list button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px dotted var(--sa-soft-line);
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  text-align: left;
  cursor: pointer;
}

.my-course-list button:hover,
.my-rating-list button:hover {
  background: color-mix(in srgb, var(--sa-green) 5%, transparent);
}

.my-course-list b,
.my-rating-list b {
  width: max-content;
  padding: 3px 8px;
  border: 1.5px solid #8fa9c4;
  border-radius: 999px;
  background: #dfeaf6;
  color: #344f70;
  font-size: 10px;
}

.my-course-list span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-rating-list span {
  color: #b87900;
  font-size: 15px;
  letter-spacing: .06em;
}

.my-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.my-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 15px;
}

@media (max-width: 980px) {
  .prof-dashboard { grid-template-columns: 1fr; }
  .prof-radar-panel {
    padding-left: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--sa-soft-line);
  }
  .prof-course-panel { grid-column: auto; padding-left: 20px; }
  .prof-term-chart { max-width: 680px; }
  .prof-hero { grid-template-columns: minmax(0, 1fr) auto; }
  .prof-monogram { width: 70px; height: 70px; font-size: 22px; }
  .prof-score { width: 108px; height: 108px; }
  .prof-score b { font-size: 32px; }
  .dept-hero { grid-template-columns: 1fr; gap: 24px; }
  .dept-hero-metrics { max-width: 560px; }
  .dept-course-table-head,
  .dept-course-row {
    grid-template-columns: 110px minmax(230px, 1fr) minmax(150px, .45fr) 100px;
  }
  .rankings-hero { grid-template-columns: 1fr; gap: 24px; }
  .rankings-stats { max-width: 560px; }
  .rankings-toolbar { align-items: flex-start; flex-direction: column; }
  .rankings-controls { width: 100%; }
  .rankings-search { flex: 1; width: auto; }
  .school-rank-head,
  .school-rank-row {
    grid-template-columns: 38px minmax(210px, 1fr) minmax(140px, .45fr) 82px;
  }
  .my-hero { grid-template-columns: 1fr; gap: 24px; }
  .my-stats { max-width: 560px; }
}

@media (max-width: 720px) {
  .prof-toolbar { grid-template-columns: 1fr auto; }
  .prof-toolbar span:nth-child(2) { display: none; }
  .prof-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 15px;
    padding: 24px 0;
  }
  .prof-monogram { width: 54px; height: 54px; font-size: 17px; }
  .prof-score {
    grid-column: auto;
    grid-row: 1;
    width: 92px;
    height: 92px;
    margin-top: 0;
  }
  .prof-score b { font-size: 28px; }
  .prof-radar-chart { max-width: 100%; }
  .prof-panel { padding: 16px; }
  .prof-radar-panel,
  .prof-course-panel { padding-left: 16px; }
  .prof-course-bar-row {
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
  }
  .prof-course-bar-head { display: none; }
  .prof-course-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .prof-course-bar-stat { grid-column: 2; grid-row: 1; }
  .prof-offering {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 5px 12px;
    padding: 10px 0;
  }
  .prof-offering-metric { text-align: left; }
  .prof-offering-metric b { margin-left: 0; }
  .prof-offering-metric:nth-last-child(2) { grid-column: 1; }
  .prof-offering-metric:last-child { grid-column: 2; }
  .dept-hero { padding-top: 0; }
  .dept-back { margin-bottom: 18px; }
  .dept-hero h1 { font-size: 58px; }
  .dept-hero-metrics > div { padding: 13px 8px; }
  .dept-hero-metrics b { font-size: 22px; }
  .dept-section-head { display: block; }
  .dept-section-head p { margin-top: 7px; text-align: left; }
  .dept-ranking-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }
  .dept-course-rank-grid { grid-template-columns: 1fr; }
  .dept-rank-panel { padding-right: 0; }
  .dept-rank-panel + .dept-rank-panel {
    padding: 20px 0 16px;
    border-top: 1px solid var(--sa-soft-line);
    border-left: 0;
  }
  .dept-prof-head { display: none; }
  .dept-prof-row {
    grid-template-columns: 30px minmax(0, 1fr) 38px;
    gap: 9px;
  }
  .dept-prof-scale { display: none; }
  .dept-course-table-head { display: none; }
  .dept-course-row {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 10px 0;
  }
  .dept-course-schedule {
    grid-column: 2;
    grid-row: 2;
  }
  .dept-course-enrollment {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .rankings-hero h1 { font-size: 54px; }
  .rankings-stats > div { padding: 13px 8px; }
  .rankings-stats b { font-size: 22px; }
  .rankings-controls { align-items: flex-start; flex-direction: column; }
  .rankings-modes { width: 100%; }
  .rankings-modes button { flex: 1; }
  .school-ranking-panel { margin-top: 22px; }
  .school-instructor-list { max-height: 620px; }
  .school-rank-head { display: none; }
  .school-rank-row {
    grid-template-columns: 30px minmax(0, 1fr) 64px;
    gap: 9px;
    padding: 8px 0;
  }
  .school-rank-meter { display: none; }
  .school-rank-result { grid-column: 3; }
  .course-rating-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .course-rating-stars button {
    width: 38px;
    height: 38px;
  }
  .my-identity { align-items: flex-start; gap: 14px; }
  .my-avatar { width: 62px; height: 62px; flex-basis: 62px; font-size: 18px; }
  .my-identity h1 { font-size: 36px; }
  .my-stats > div { padding: 13px 8px; }
  .my-stats b { font-size: 22px; }
  .my-grid { grid-template-columns: 1fr; }
  .my-panel,
  .my-panel:nth-child(even) {
    grid-column: auto;
    padding: 18px 0;
    border-left: 0;
  }
}

@keyframes nav-graphite-in {
  from { opacity: 0; }
  to { opacity: 0.18; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar .nav button.active .nav-ink-line {
    animation: none;
    stroke-dashoffset: 0;
  }
  .topbar .nav button[data-view="browse"]:hover .nav-ink-line,
  .topbar .nav button[data-view="browse"]:focus-visible .nav-ink-line {
    animation: none;
    stroke-dashoffset: 0;
  }
  .topbar .nav button.active .nav-ink-grain,
  .topbar .nav button[data-view="browse"]:hover .nav-ink-grain,
  .topbar .nav button[data-view="browse"]:focus-visible .nav-ink-grain {
    animation: none;
    opacity: 0.18;
  }
}

.topbar-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-term,
.topbar-term:hover {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.topbar-term .term-menu-btn {
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
  font-family: var(--sa-font);
  font-size: 15px;
  font-weight: 700;
}

.topbar-term .term-menu-btn::before {
  content: none;
}

.topbar-term .term-menu-btn svg { color: var(--sa-ink); }

.topbar-term .term-menu {
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  min-width: 190px;
  padding: 6px;
  border: 2px solid var(--sa-ink);
  border-radius: 12px;
  background: var(--sa-bg);
  box-shadow: none;
}

.topbar-term .term-menu button {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 14px;
  font-weight: 400;
}

.topbar-term .term-menu button:hover,
.topbar-term .term-menu button.active {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 3px 0;
  border-top: 2px solid var(--sa-line);
  border-bottom: 2px solid var(--sa-line);
}

.topbar-search .search-icon {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  margin-left: -2px;
  color: var(--sa-ink);
}

.topbar-search .search {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 51px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
  font-family: var(--sa-font);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  outline: none;
  backdrop-filter: none;
}

.topbar-search .search::placeholder {
  color: #777777;
  font-weight: 400;
  opacity: 1;
}

.search-caret {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 2px;
  height: 27px;
  background: #777777;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: search-caret-blink 1.06s steps(1, end) infinite;
}

.data-as-of {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 70;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--sa-soft-line);
  background: rgba(243, 243, 240, .9);
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 10px;
  line-height: 1.3;
  box-shadow: 1px 2px 0 rgba(36, 36, 34, .08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.data-as-of-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--sa-green);
}
.data-as-of-main b {
  color: var(--sa-ink);
  font-weight: 500;
}
.data-as-of-separator { color: var(--sa-soft-line); }
.data-as-of-time { color: var(--sa-ink-2); }
.data-as-of-refresh {
  margin-left: 5px;
  padding: 0 0 1px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--sa-brown);
  font: inherit;
  cursor: pointer;
}
.data-as-of.is-syncing .data-as-of-dot {
  background: var(--sa-brown);
  animation: data-sync-pulse 1.1s ease-in-out infinite;
}
.data-as-of.is-error .data-as-of-dot { background: #b12626; }
.data-as-of.is-stale .data-as-of-dot { background: #b26920; }
@keyframes data-sync-pulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes search-caret-blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@media (max-width: 700px) {
  .data-as-of {
    right: 12px;
    bottom: 88px;
    left: auto;
    width: fit-content;
    margin-left: 0;
    justify-content: flex-start;
    gap: 6px;
    font-size: 9px;
  }
  .data-as-of-separator,
  .data-as-of-cadence { display: none; }
  .data-as-of-time { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .search-caret { animation: none; }
  .data-as-of.is-syncing .data-as-of-dot { animation: none; }
}

.filter-toggle {
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 18px;
  font-weight: 400;
  box-shadow: none;
}

.filter-toggle:hover,
.filter-toggle[aria-expanded="true"] {
  color: var(--sa-brown);
  background: transparent;
}

.filter-toggle svg {
  width: 17px;
  height: 17px;
}

.filter-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--sa-ink);
  color: var(--sa-bg);
  font-size: 10px;
  font-weight: 500;
}

body:not([data-view="browse"]) .filter-toggle {
  display: none;
}

body:not([data-view="browse"]) .filter-panel {
  display: none !important;
}

.filter-panel {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 150;
  width: min(720px, 100%);
  padding: 16px;
  border: 2px solid var(--sa-ink);
  border-radius: 12px;
  background: var(--sa-bg);
  box-shadow: none;
}

.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sa-ink);
  color: var(--sa-ink);
  font-size: 20px;
  font-weight: 500;
}

.filter-panel-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sa-ink);
  font-size: 24px;
  line-height: 1;
}

.filter-panel-close:hover {
  color: var(--sa-brown);
}

.filter-panel .filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
}

.filter-panel .filter-dd {
  min-width: 0;
}

.filter-panel .filter-dd-btn {
  width: 100%;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.filter-panel .filter-dd-menu {
  right: 0;
  left: 0;
  width: 100%;
  z-index: 160;
}

.filter-dd-menu {
  max-height: none;
  overflow: hidden;
}

.filter-dd-input {
  width: 100%;
  height: 34px;
  margin: 0 0 6px;
  padding: 0 9px;
  border: 1px solid var(--sa-soft-line);
  border-radius: 6px;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 13px;
  font-weight: 400;
  outline: none;
}

.filter-dd-input::placeholder {
  color: var(--sa-ink-2);
  opacity: 0.72;
}

.filter-dd-input:focus {
  border-color: var(--sa-ink);
}

.filter-dd-options {
  max-height: 238px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: #8b8176 transparent;
}

.search-suggest {
  scrollbar-width: thin;
  scrollbar-color: #8b8176 transparent;
}

.filter-dd-options::-webkit-scrollbar,
.search-suggest::-webkit-scrollbar {
  width: 7px;
}

.filter-dd-options::-webkit-scrollbar-track,
.search-suggest::-webkit-scrollbar-track {
  background: transparent;
}

.filter-dd-options::-webkit-scrollbar-thumb,
.search-suggest::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #8b8176;
  background-clip: padding-box;
}

.filter-dd-options::-webkit-scrollbar-thumb:hover,
.search-suggest::-webkit-scrollbar-thumb:hover {
  background: #655d55;
  background-clip: padding-box;
}

.filter-panel-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--sa-soft-line);
}

.filter-clear {
  height: 34px;
  padding: 0 14px;
  border: 2px solid var(--sa-ink);
  border-radius: 6px;
  background: var(--sa-ink);
  color: var(--sa-bg);
  font-family: var(--sa-font);
  font-size: 13px;
  font-weight: 500;
}

.filter-clear:hover {
  background: var(--sa-brown);
  border-color: var(--sa-brown);
}

.topbar-search .search:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.topbar-search .search-suggest {
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: min(520px, 68vh);
  padding: 8px;
  border: 2px solid var(--sa-ink);
  border-radius: 12px;
  background: var(--sa-bg);
  box-shadow: none;
  transform: none;
}

.search-suggest-item {
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--sa-ink);
}

.search-suggest-item:hover,
.search-suggest-item.active {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.search-suggest-item:hover .ss-sub,
.search-suggest-item:hover .ss-type,
.search-suggest-item.active .ss-sub,
.search-suggest-item.active .ss-type {
  color: #d4d4d4;
}

.search-suggest-item .ss-main {
  color: inherit;
  font-size: 13px;
  font-weight: 500;
}

.search-suggest-item .ss-sub { font-size: 13px; }
.search-suggest-item .ss-type { font-size: 10px; }

.search-suggest-all {
  padding: 11px 9px 7px;
  border-top: 1px solid var(--sa-ink);
  border-radius: 0;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-weight: 500;
}

.search-suggest-all:hover {
  background: transparent;
  color: var(--sa-brown);
}

.topbar-search .search-suggest-grouped {
  width: min(980px, calc(100% - 36px));
  max-height: min(560px, 70vh);
  padding: 8px;
}
.search-suggest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr) minmax(0, 1fr);
}
.search-suggest-col {
  min-width: 0;
  padding: 2px 8px 8px;
  border-right: 1px solid var(--sa-soft-line);
}
.search-suggest-col:last-child { border-right: 0; }
.search-suggest-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 5px;
  padding: 4px 9px 7px;
  border-bottom: 1px solid var(--sa-line);
  color: var(--sa-ink);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.search-suggest-heading small {
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
}
.search-suggest-col .search-suggest-item {
  min-height: 36px;
  padding: 7px 9px;
}
.search-suggest-col .search-suggest-item .ss-type { display: none; }
.search-suggest-empty {
  padding: 9px;
  color: var(--sa-ink-2);
  font-size: 11px;
}

@media (max-width: 700px) {
  .topbar-search .search-suggest-grouped {
    width: 100%;
    max-height: 66vh;
  }
  .search-suggest-grid {
    grid-template-columns: 1fr;
  }
  .search-suggest-col {
    padding: 3px 4px 9px;
    border-right: 0;
    border-bottom: 1px solid var(--sa-soft-line);
  }
  .search-suggest-col:last-child { border-bottom: 0; }
}

.view-head {
  margin: 0 0 26px;
  padding: 0 0 18px;
  border-bottom: 2px solid var(--sa-line);
}

.view-head h1,
.analysis-head h1 {
  margin: 0;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.view-head .sub {
  max-width: 780px;
  margin-top: 10px;
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 15px;
  line-height: 1.5;
}

.eyebrow,
.meta-line {
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 12px;
  font-weight: 400;
}

.toolbar {
  gap: 12px;
  margin: 0 0 22px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  flex-wrap: wrap;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--sa-ink);
}

.filter-dd { position: relative; }

.filter-dd-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 17px;
  border: 2px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
  font-family: var(--sa-font);
  font-size: 15px;
  font-weight: 400;
}

.filter-dd-btn:hover,
.filter-dd.open .filter-dd-btn {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.filter-dd-btn svg { stroke-width: 2; }

.filter-dd-menu {
  top: calc(100% + 7px);
  min-width: 210px;
  padding: 8px;
  border: 2px solid var(--sa-ink);
  border-radius: 12px;
  background: var(--sa-bg);
  box-shadow: none;
}

.filter-dd-menu button {
  min-height: 35px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 14px;
  font-weight: 400;
}

.filter-dd-menu button:hover,
.filter-dd-menu button.active {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.course-list {
  max-width: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.course-card {
  color: var(--ink);
  font-family: var(--font);
  border: 2px solid var(--sa-ink);
  background: #f8f8f6;
  box-shadow: none;
}

.course-card:hover {
  border-color: var(--sa-ink);
  background: #fbfbfa;
  box-shadow: none;
}

.course-card:hover,
.course-card:focus-within {
  z-index: 20;
}

.course-card .card-add,
.course-card .instructor-pill,
.course-card .time-chip,
.course-card .day-box,
.course-card .cc-meta > .chip {
  border: 1.5px solid var(--sa-ink);
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  box-shadow: none;
}

.course-card .card-add {
  border-width: 2px;
  border-radius: 6px;
  position: relative;
  padding: 0;
  line-height: 0;
}

.course-card .instructor-pill,
.course-card .cc-meta > .chip {
  border-radius: 999px;
}

.course-card .time-chip {
  border-width: 2px;
  border-radius: 5px;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: 0;
  padding-right: 6px;
  padding-left: 6px;
  font-size: 9.5px;
}

.course-card .day-box {
  border-radius: 5px;
  padding: 0;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1;
}

.course-card .cc-days-row {
  width: 100%;
  gap: 5px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow: hidden;
}

.course-card .day-strip {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 2px;
}

.course-card .day-box {
  width: 22px;
  min-width: 22px;
  flex: 0 0 22px;
  height: 22px;
}

.course-card .day-strip:has(.day-box:nth-child(7)) .day-box {
  width: 18px;
  height: 18px;
}

.course-card .card-add:hover,
.course-card .instructor-pill:hover,
.course-card .time-chip:hover {
  border-color: var(--sa-ink);
  background: var(--sa-ink);
  color: var(--sa-bg);
  box-shadow: none;
}

.course-card .day-box.active {
  display: flex;
  padding: 0;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--sa-ink);
  background: var(--sa-ink);
  color: var(--sa-bg);
  box-shadow: none;
}

.course-card .day-box.active:hover {
  background: #3a3a3a;
  color: #fff;
}

.course-card .card-add-menu {
  border: 2px solid var(--sa-ink);
  border-radius: 8px;
  background: var(--sa-bg);
  box-shadow: none;
}

.course-card .card-add-menu button {
  border-radius: 4px;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-weight: 400;
}

.course-card .card-add-menu button:hover {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.course-card .cc-enroll-inline.low .enroll-box.count,
.course-card .cc-enroll-inline.low .enroll-box.pct {
  background: rgba(38, 166, 91, 0.10);
  color: #168447;
}

.course-card .cc-enroll-inline.mid .enroll-box.count,
.course-card .cc-enroll-inline.mid .enroll-box.pct {
  background: rgba(225, 157, 25, 0.11);
  color: #b77800;
}

.course-card .cc-enroll-inline.high .enroll-box.count,
.course-card .cc-enroll-inline.high .enroll-box.pct {
  background: rgba(220, 54, 71, 0.10);
  color: #c52234;
}

.course-card .cc-enroll-inline.low .enroll-box.enroll-combo { color: #168447; }
.course-card .cc-enroll-inline.mid .enroll-box.enroll-combo { color: #b77800; }
.course-card .cc-enroll-inline.high .enroll-box.enroll-combo { color: #c52234; }

.course-card .enroll-combo {
  gap: 2px;
}

.course-card .enroll-combo .enroll-capacity {
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 500;
}

.course-card .enroll-combo .enroll-capacity b {
  color: var(--sa-ink);
  font-size: 10px;
  font-weight: 700;
}

.course-card .enroll-combo .enroll-combo-pct {
  margin-left: 4px;
  padding-left: 6px;
  border-left: 1px solid currentColor;
  color: inherit;
  font-size: 10px;
  font-weight: 700;
}

.course-card .enroll-box.drop {
  background: rgba(255, 132, 0, 0.13);
  color: #bd5b00;
}

.course-card .enroll-box.drop.mid {
  background: rgba(255, 92, 0, 0.14);
  color: #c94500;
}

.course-card .enroll-box.drop.high {
  background: rgba(230, 35, 58, 0.13);
  color: #c4142e;
}

.course-card .enroll-box.drop.up {
  background: rgba(21, 150, 70, 0.12);
  color: #0d8a41;
}

.course-card .enroll-box.drop.flat,
.course-card .enroll-box.drop.muted {
  background: rgba(0, 0, 0, 0.05);
  color: #666666;
}

.course-card .enroll-box {
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font-family: var(--sa-font);
  box-shadow: none;
}

.course-card .enroll-box[data-tip] {
  overflow: visible;
}

.course-card .enroll-box[data-tip]:hover {
  z-index: 60;
}

.course-card .enroll-box[data-tip]:hover::after {
  bottom: calc(100% + 10px);
  z-index: 100;
}

.course-card .cc-enroll-inline.low .enroll-box.count,
.course-card .cc-enroll-inline.low .enroll-box.pct,
.course-card .cc-enroll-inline.mid .enroll-box.count,
.course-card .cc-enroll-inline.mid .enroll-box.pct,
.course-card .cc-enroll-inline.high .enroll-box.count,
.course-card .cc-enroll-inline.high .enroll-box.pct,
.course-card .enroll-box.drop,
.course-card .enroll-box.drop.mid,
.course-card .enroll-box.drop.high,
.course-card .enroll-box.drop.up,
.course-card .enroll-box.drop.flat,
.course-card .enroll-box.drop.muted {
  background: transparent;
}

.course-card .enroll-bar.low > span { background: #38a86c; }
.course-card .enroll-bar.mid > span { background: #e0a125; }
.course-card .enroll-bar.high > span { background: #dc4d5a; }

.course-card .enroll-bar {
  height: 7px;
  border-radius: 999px;
}

.course-card .enroll-bar > span {
  border-radius: 999px;
}

.course-card .cc-title {
  font-family: var(--sa-font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.course-card .cc-code {
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1.5px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  font-family: var(--sa-font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

.cc-code-tags {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.course-card .section-chip {
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1.5px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

.course-card .cc-code,
.course-card .section-chip {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: none;
}

.cc-code-tags { gap: 9px; }

.course-card .cc-meta > .chip.term {
  margin-left: 0;
}

.course-card .cc-meta {
  width: 100%;
  gap: 3px;
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  overflow: hidden;
}

.course-card .cc-meta > .chip,
.course-card .cc-meta .instructor-pill {
  flex: 0 0 auto;
  padding-right: 7px;
  padding-left: 7px;
  font-size: 9.5px;
}

.course-card .cc-meta .instructor-pill {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  box-sizing: border-box;
  border-width: 1.5px;
  transform: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.course-card .cc-meta .instructor-pill:hover,
.course-card .cc-meta .instructor-pill:active {
  border: 1.5px solid var(--sa-ink);
  padding-right: 7px;
  padding-left: 7px;
  font-size: 9.5px;
  font-weight: 500;
  transform: none;
}

.course-card .card-add svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  stroke-width: 3;
  transform: translate(-50%, -50%);
}

.course-title-tip {
  position: fixed;
  z-index: 240;
  max-width: min(420px, calc(100vw - 24px));
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(35, 28, 23, 0.96);
  color: #ffffff;
  font-family: var(--sa-font);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: none;
}

.search-head {
  align-items: baseline;
  gap: 16px;
  padding: 0 0 16px;
  border-bottom: 2px solid var(--sa-line);
}

.search-head h1 {
  font-family: var(--sa-font);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.search-summary {
  padding-left: 15px;
  border-left: 1px solid var(--sa-ink);
  font-family: var(--sa-font);
}

.search-count,
.search-for,
.search-query,
.search-hint { font-family: var(--sa-font); }
.search-query { color: var(--sa-green); }

.btn,
.select,
.input,
.analysis-search,
.map-search {
  border: 2px solid var(--sa-ink);
  border-radius: 6px;
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
  font-family: var(--sa-font);
  font-weight: 400;
  backdrop-filter: none;
}

.btn:hover,
.btn.ghost:hover {
  border-color: var(--sa-ink);
  background: var(--sa-ink);
  color: var(--sa-bg);
  box-shadow: none;
}

.btn.ghost {
  border: 2px solid var(--sa-ink);
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
  backdrop-filter: none;
}

.btn.ghost:hover {
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.btn.primary {
  border-color: var(--sa-ink);
  background: var(--sa-ink);
  color: var(--sa-bg);
}

.btn.primary:hover {
  background: #3a3a3a;
  color: #fff;
}

.notice {
  border: 2px solid var(--sa-ink);
  border-radius: 10px;
  background: transparent;
  color: var(--sa-ink);
  box-shadow: none;
}

.notice.info { border-left-width: 2px; }

.modal,
.account-card {
  border: 2px solid var(--sa-ink);
  border-radius: 12px;
  background: var(--sa-bg);
  box-shadow: none;
  backdrop-filter: none;
}

.modal-backdrop,
.account-backdrop {
  background: rgba(243, 243, 240, 0.88);
  backdrop-filter: blur(6px);
}

.section-title {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--sa-line);
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 17px;
  font-weight: 500;
}

.calendar,
.planner-grid,
.analysis-list,
.cal-list {
  border-color: var(--sa-soft-line);
}

body[data-view="analysis"] .topbar-search {
  visibility: visible;
  pointer-events: auto;
}

.term-chip {
  padding: 5px 10px;
  border: 2px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 13px;
  font-weight: 400;
}

.term-chip::before { display: none; }

.calendar {
  border: 2px solid var(--sa-ink);
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

@media (max-width: 1199px) {
  .course-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .topbar { padding: 12px 20px 0; }
  .topbar-meta-row { min-height: 48px; }
  .rail-brand .brand-mark { width: 31px; height: 31px; flex-basis: 31px; }
  .rail-brand .brand-name { font-size: 19px; }
  .topbar .nav button { height: 44px; font-size: 18px; }
  .topbar .nav .nav-label { height: 32px; }
  .topbar-search .search { height: 43px; font-size: 18px; }
  .filter-toggle { font-size: 15px; }
  .filter-panel { width: min(620px, 100%); }
  main { padding: 16px 20px 48px; }
  .course-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar { padding: 9px 14px 0; }
  .topbar-meta-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 44px;
  }
  .rail-brand { gap: 10px; }
  .rail-brand .brand-mark { width: 27px; height: 27px; flex-basis: 27px; }
  .rail-brand .brand-name { font-size: 16px; }
  .topbar-actions { gap: 3px; }
  .topbar .nav {
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar .nav::-webkit-scrollbar { display: none; }
  .topbar .nav button { height: 40px; font-size: 15px; }
  .topbar .nav .nav-label { height: 29px; }
  .topbar .nav .nav-hand-ink {
    top: -6px;
    left: -7px;
    width: calc(100% + 14px);
    height: 34px;
  }
  .topbar .nav button[data-view="browse"] .nav-hand-ink {
    left: -10px;
    width: calc(100% + 20px);
  }
  .topbar .nav button[data-view="analysis"] .nav-hand-ink {
    left: -16px;
    width: calc(100% + 32px);
  }
  .topbar .nav button[data-view="planner"] .nav-hand-ink {
    left: -12px;
    width: calc(100% + 24px);
  }
  .topbar .nav button[data-view="calendar"] .nav-hand-ink {
    left: -15px;
    width: calc(100% + 30px);
  }
  .topbar .nav button[data-view="map"] .nav-hand-ink {
    left: -12px;
    width: calc(100% + 24px);
  }
  .topbar-term .term-menu-btn { height: 34px; font-size: 12px; }
  .topbar-term .term-menu-btn::before { margin-right: 5px; }
  .topbar-search { gap: 10px; }
  .topbar-search .search-icon { width: 19px; height: 19px; flex-basis: 19px; }
  .topbar-search .search { height: 39px; font-size: 15px; }
  .filter-toggle { gap: 4px; padding-left: 6px; font-size: 13px; }
  .filter-toggle svg { width: 15px; height: 15px; }
  .filter-panel {
    width: calc(100vw - 28px);
    padding: 13px;
  }
  .filter-panel .filters { grid-template-columns: 1fr; }
  main { padding: 14px 14px 44px; }
  .view-head h1,
  .analysis-head h1 { font-size: 24px; }
  .course-list { grid-template-columns: 1fr; }
}

/* ---------- Enrollment analytics editorial layout ---------- */
.analysis-overview {
  margin-bottom: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.analysis-control-label,
.analysis-count,
#analysis-count {
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.analysis-summary {
  counter-reset: analysis-stat;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-bottom: 2px solid var(--sa-line);
}

.analysis-summary .stat-card {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 17px 22px 18px 0;
  border: 0;
  border-right: 1px solid var(--sa-soft-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.analysis-summary .stat-card:not(:first-child) {
  padding-left: 22px;
}

.analysis-summary .stat-card:nth-child(4) {
  border-right: 0;
}

.analysis-summary .stat-card::before {
  counter-increment: analysis-stat;
  content: "0" counter(analysis-stat);
  margin-bottom: 13px;
  color: var(--sa-brown);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.analysis-summary .stat-card b {
  margin-bottom: 4px;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}

.analysis-summary .stat-card span {
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.025em;
}

.analysis-stat-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 0;
  padding: 15px 0;
  border-bottom: 1px solid var(--sa-line);
}

.analysis-sort-block {
  display: flex;
  align-items: center;
  gap: 11px;
}

.analysis-sort-block .scope-bar {
  width: auto;
  max-width: none;
  height: auto;
  display: flex;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.analysis-sort-block .btn.small {
  min-width: 0;
  height: 31px;
  padding: 0 11px;
  border: 1.5px solid var(--sa-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 11.5px;
  font-weight: 500;
  box-shadow: none;
}

.analysis-sort-block .btn.small:hover,
.analysis-sort-block .btn.small.active {
  background: var(--sa-ink);
  color: var(--sa-bg);
  box-shadow: none;
}

.analysis-stat-controls .analysis-search {
  width: min(330px, 100%);
  height: 36px;
  padding-left: 36px;
  border: 1.5px solid var(--sa-ink);
  border-radius: 6px;
  background-color: transparent;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 12px;
  font-weight: 400;
}

.analysis-stat-controls .analysis-search::placeholder {
  color: var(--sa-ink-2);
}

.analysis-stat-controls .analysis-search:focus {
  background: transparent;
  border-color: var(--sa-brown);
  box-shadow: none;
}

.analysis-daily.daily-card,
.daily-card {
  margin: 22px 0 30px;
  padding: 18px;
  border: 2px solid var(--sa-ink);
  border-radius: 12px;
  background: #f8f8f6;
}

.analysis-overview .daily-card {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.daily-head {
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sa-line);
}

.daily-head h3 {
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.daily-head-sub {
  margin: 5px 0 0;
  color: var(--sa-ink-2);
  font-size: 10.5px;
  line-height: 1.4;
}

.daily-head-side { gap: 9px; }
.daily-dept-dd { width: 192px; }

.analysis-overview .daily-dept-dd .filter-dd-btn {
  box-sizing: border-box;
  height: 34px;
  min-height: 34px;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 1.5px;
  font-family: var(--sa-font);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

.daily-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: var(--sa-green);
  font-family: var(--sa-font);
  font-size: 11.5px;
  font-weight: 600;
}

.daily-card .spark-wrap {
  padding: 6px 0 0;
  border-top: 1px solid var(--sa-soft-line);
}

.daily-card .sparkline {
  height: 150px;
}

.enrollment-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 2.65fr) minmax(240px, .75fr);
  align-items: stretch;
  gap: 20px;
}
.flow-panel,
.capacity-panel {
  position: relative;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.capacity-panel {
  padding-left: 20px;
  border-left: 1px solid var(--sa-soft-line);
}
.pulse-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.pulse-panel-head > div:first-child {
  display: grid;
  gap: 2px;
}
.pulse-panel-head span {
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.pulse-panel-head b {
  color: var(--sa-ink);
  font-size: 17px;
  font-weight: 500;
}
.flow-legend {
  display: flex;
  gap: 10px;
  color: var(--sa-ink-2);
  font-size: 9px;
}
.flow-legend span { display: inline-flex; align-items: center; gap: 5px; }
.flow-legend i {
  width: 7px;
  height: 7px;
  border-radius: 1px;
}
.flow-legend i.add { background: var(--sa-green); }
.flow-legend i.drop { background: #b45241; }
.flow-legend i.line {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--sa-brown);
}
.flow-chart {
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 356;
  display: block;
  overflow: visible;
}
.flow-chart:focus-visible {
  outline: 1px solid var(--sa-brown);
  outline-offset: 3px;
}
.flow-grid-line {
  stroke: var(--sa-soft-line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.flow-baseline {
  stroke: var(--sa-ink);
  stroke-width: 1.15;
}
.flow-pane-divider {
  stroke: var(--sa-soft-line);
  stroke-width: 1;
}
.flow-pane-label {
  fill: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .07em;
}
.flow-axis-label {
  fill: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 9px;
}
.flow-right-label { fill: var(--sa-brown); }
.flow-axis-caption {
  fill: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 7.5px;
  letter-spacing: .03em;
}
.flow-date-label { font-size: 9.5px; }
.flow-bar-add { fill: var(--sa-green); }
.flow-bar-drop { fill: #b45241; }
.flow-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  cursor: crosshair;
  outline: none;
}
.flow-hit.active {
  fill: rgba(39, 39, 36, .045);
  stroke: rgba(39, 39, 36, .2);
  stroke-width: 1;
}
.flow-total-strip {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding-top: 9px;
  border-top: 1px solid var(--sa-soft-line);
}
.flow-total-label {
  display: grid;
  gap: 2px;
}
.flow-total-label span {
  color: var(--sa-ink-2);
  font-size: 8px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.flow-total-label b {
  color: var(--sa-ink);
  font-size: 14px;
  font-weight: 500;
}
.enrollment-line-chart {
  width: 100%;
  height: 68px;
  display: block;
  overflow: visible;
}
.enrollment-line-area {
  fill: rgba(122, 76, 47, .09);
}
.enrollment-line {
  fill: none;
  stroke: var(--sa-brown);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.enrollment-line-dot {
  fill: var(--sa-brown);
  stroke: #f8f8f6;
  stroke-width: 1.5;
}
.flow-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 168px;
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--sa-ink);
  background: rgba(248, 248, 245, .97);
  color: var(--sa-ink-2);
  font-size: 9px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 3px 4px 0 rgba(36, 36, 34, .1);
}
.flow-tooltip b {
  margin-bottom: 2px;
  color: var(--sa-ink);
  font-size: 10px;
  font-weight: 500;
}
.flow-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.flow-tooltip em {
  color: var(--sa-ink);
  font-style: normal;
  font-weight: 500;
}
.flow-tooltip em.up { color: var(--sa-green); }
.flow-tooltip em.down { color: #a33d34; }
.flow-total-line {
  fill: none;
  stroke: var(--sa-brown);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.flow-total-dot { fill: var(--sa-brown); }
.flow-caption {
  margin-top: 2px;
  color: var(--sa-ink-2);
  font-size: 9px;
}
.capacity-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.capacity-ring {
  width: 142px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-self: center;
  margin: 5px auto 10px;
  border-radius: 50%;
  background: conic-gradient(var(--sa-green) var(--fill), #dddcd5 0);
  position: relative;
}
.capacity-ring::before {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: #f8f8f5;
}
.capacity-ring > div {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  line-height: 1;
}
.capacity-ring b {
  color: var(--sa-ink);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.05em;
}
.capacity-ring span {
  margin-top: 4px;
  color: var(--sa-ink-2);
  font-size: 9px;
}
.capacity-copy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 8px 0;
  border-top: 1px solid var(--sa-soft-line);
  border-bottom: 1px solid var(--sa-soft-line);
}
.capacity-copy span {
  display: grid;
  gap: 2px;
  color: var(--sa-ink-2);
  font-size: 8.5px;
  text-transform: uppercase;
}
.capacity-copy b {
  color: var(--sa-ink);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
}
.pulse-movers {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 10px;
}
.pulse-movers > span {
  color: var(--sa-ink-2);
  font-size: 8.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pulse-movers div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--sa-ink-2);
  font-size: 9px;
}
.pulse-movers b { font-weight: 500; color: var(--sa-ink); }
.pulse-movers em { font-style: normal; font-weight: 500; }
.pulse-movers small {
  color: var(--sa-ink-2);
  font-size: 8.5px;
  line-height: 1.45;
}
.pulse-movers .up { color: var(--sa-green); }
.pulse-movers .down { color: #a33d34; }
.pulse-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--sa-line);
  border-bottom: 1px solid var(--sa-line);
}
.pulse-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 11px 0;
  border-right: 1px solid var(--sa-soft-line);
}
.pulse-stat:not(:first-child) { padding-left: 16px; }
.pulse-stat:last-child { border-right: 0; }
.pulse-stat > span {
  color: var(--sa-ink-2);
  font-size: 8.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pulse-stat > b {
  margin-top: 5px;
  color: var(--sa-ink);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.035em;
}
.pulse-stat > small {
  margin-top: 3px;
  color: var(--sa-ink-2);
  font-size: 8.5px;
}

@media (max-width: 900px) {
  .enrollment-dashboard { grid-template-columns: 1fr; }
  .capacity-panel {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid var(--sa-soft-line);
    border-left: 0;
  }
  .pulse-movers { margin-top: 0; }
  .capacity-panel .pulse-panel-head { grid-column: 1 / -1; }
  .capacity-ring { width: 118px; margin: 0; }
  .capacity-copy { align-content: center; }
}

@media (max-width: 600px) {
  .analysis-overview { padding: 15px; }
  .pulse-stats { grid-template-columns: 1fr 1fr; }
  .pulse-stat:nth-child(2) { border-right: 0; }
  .pulse-stat:nth-child(n + 3) { border-top: 1px solid var(--sa-soft-line); }
  .pulse-stat:nth-child(3) { padding-left: 0; }
  .capacity-panel { grid-template-columns: 1fr; }
  .capacity-ring { width: 126px; }
  .flow-chart { height: 220px; }
}

.chart-y,
.chart-x {
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
}

.daily-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--sa-line);
}

.daily-stats.analysis-total-stats {
  grid-template-rows: repeat(2, minmax(68px, auto));
  grid-auto-flow: column;
  margin-top: 16px;
  background: transparent;
}

.daily-stats div {
  padding: 13px 15px 4px 0;
  border-right: 1px solid var(--sa-soft-line);
  border-radius: 0;
  background: transparent;
}

.daily-stats div:not(:first-child) {
  padding-left: 15px;
}

.daily-stats.analysis-total-stats > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: 12px 16px;
  border-top: 0;
}

.daily-stats.analysis-total-stats > div:nth-child(even) {
  border-top: 1px solid var(--sa-soft-line);
}

.daily-stats.analysis-total-stats > div:nth-child(n + 7) {
  border-right: 0;
}

.daily-stats b {
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.daily-stats span {
  margin-top: 7px;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.analysis-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 130px;
  gap: 16px;
  padding: 9px 2px;
  border-top: 2px solid var(--sa-line);
  border-bottom: 1px solid var(--sa-line);
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.analysis-table-head span:last-child,
.analysis-row .ar-side {
  text-align: right;
}

.analysis-list {
  display: block;
  border-bottom: 2px solid var(--sa-line);
}

.analysis-row {
  grid-template-columns: minmax(0, 1fr) 180px 130px;
  gap: 16px;
  padding: 18px 2px;
  border: 0;
  border-bottom: 1px solid var(--sa-soft-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.analysis-row:last-child { border-bottom: 0; }
.analysis-row:hover { background: rgba(0, 0, 0, 0.025); }

.ar-code {
  color: #5f4130;
  font-family: var(--sa-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.35;
  text-transform: uppercase;
}

.ar-title {
  margin-top: 6px;
  overflow: hidden;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-spark svg {
  width: 180px;
  height: 48px;
}

.ar-side {
  justify-content: center;
  gap: 5px;
}

.drop-badge {
  padding: 4px 9px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font-family: var(--sa-font);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 980px) {
  .analysis-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-summary .stat-card:nth-child(2) { border-right: 0; }
  .analysis-summary .stat-card:nth-child(n + 3) {
    border-top: 1px solid var(--sa-soft-line);
  }
  .analysis-summary .stat-card:nth-child(3) { padding-left: 0; }
  .analysis-table-head,
  .analysis-row {
    grid-template-columns: minmax(0, 1fr) 145px 105px;
  }
  .ar-spark svg { width: 145px; }
}

@media (max-width: 700px) {
  .analysis-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-summary .stat-card { min-height: 96px; padding: 14px 14px 14px 0; }
  .analysis-summary .stat-card:nth-child(2n) { border-right: 0; }
  .analysis-summary .stat-card:nth-child(2) { padding-left: 14px; }
  .analysis-summary .stat-card:nth-child(3) { padding-left: 0; }
  .analysis-summary .stat-card b { font-size: 27px; }
  .analysis-stat-controls { align-items: stretch; }
  .analysis-sort-block { flex-wrap: wrap; }
  .analysis-stat-controls .analysis-search { width: 100%; }
  .daily-card { padding: 13px; }
  .daily-head { align-items: flex-start; }
  .daily-head-side { width: 100%; justify-content: flex-start; }
  .daily-dept-dd { width: 100%; }
  .daily-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-stats.analysis-total-stats {
    grid-template-rows: none;
    grid-auto-flow: row;
  }
  .daily-stats.analysis-total-stats > div:nth-child(2n) {
    border-right: 0;
  }
  .daily-stats.analysis-total-stats > div:nth-child(n + 3) {
    padding-top: 12px;
    border-top: 1px solid var(--sa-soft-line);
  }
  .analysis-table-head { display: none; }
  .analysis-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 13px 0;
  }
  .ar-spark { display: none; }
  .ar-side { min-width: 74px; }
}

/* ---------- Morningside Atlas automatic opening ---------- */
.intro-skip .intro-splash { display: none; }
html.intro-running,
html.intro-running body { overflow: hidden; }
.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  background: #b9d9eb;
  color: var(--sa-ink);
}
.intro-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 61, 165, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 61, 165, 0.1) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, #000 5%, transparent 68%);
}
.intro-hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 68px 32px 74px;
  text-align: center;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.intro-frame-top,
.intro-frame-bottom {
  position: absolute;
  z-index: 2;
  left: 32px;
  right: 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 9.5px;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}
.intro-frame-top {
  top: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sa-line);
}
.intro-frame-top span:nth-child(2) { justify-self: center; }
.intro-frame-top span:last-child { justify-self: end; }
.intro-frame-bottom {
  bottom: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--sa-line);
}
.intro-frame-bottom > span:last-child { justify-self: end; }
.intro-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.intro-index {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  transform: translateY(-50%);
}
.intro-index b {
  color: var(--sa-brown);
  font-size: 13px;
  font-weight: 600;
}
.intro-accent {
  width: 14px;
  height: 14px;
  margin-bottom: clamp(56px, 10vh, 104px);
  background: var(--sa-brown);
  animation: intro-accent-in 0.58s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s both;
}
.intro-wordmark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.22em;
  max-width: 98vw;
  overflow: hidden;
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: clamp(54px, 9.35vw, 140px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.88;
  white-space: nowrap;
}
.intro-wordmark span {
  display: block;
  transform: translateY(116%);
  animation: intro-word-rise 0.85s cubic-bezier(0.16, 0.84, 0.22, 1) both;
}
.intro-wordmark span:first-child { animation-delay: 0.22s; }
.intro-wordmark span:last-child {
  margin-left: -0.025em;
  animation-delay: 0.34s;
}
.intro-tagline {
  margin: 24px 0 0;
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: clamp(10px, 1vw, 13px);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0;
  animation: intro-meta-in 0.55s ease-out 0.75s both;
}
.intro-scroll-cue {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--sa-ink-2);
  font-family: var(--sa-font);
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0;
  animation: intro-meta-in 0.55s ease-out 1.05s both;
}
.intro-scroll-cue i {
  width: 1px;
  height: 24px;
  overflow: hidden;
  background: rgba(36, 36, 34, 0.18);
}
.intro-scroll-cue i::after {
  content: "";
  display: block;
  width: 100%;
  height: 45%;
  background: var(--sa-ink);
  animation: intro-cue-line 1.35s ease-in-out infinite;
}
.intro-tiles {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}
.intro-tiles-word {
  z-index: 4;
  opacity: 0;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMid meet'%3E%3Ctext x='800' y='500' text-anchor='middle' fill='white' font-family='Arial Black,Arial,sans-serif' font-size='220' font-weight='900' letter-spacing='-8' textLength='1460' lengthAdjust='spacingAndGlyphs'%3EANTIVERGIL%3C/text%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMid meet'%3E%3Ctext x='800' y='500' text-anchor='middle' fill='white' font-family='Arial Black,Arial,sans-serif' font-size='220' font-weight='900' letter-spacing='-8' textLength='1460' lengthAdjust='spacingAndGlyphs'%3EANTIVERGIL%3C/text%3E%3C/svg%3E");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.intro-word-fill {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}
.intro-word-fill svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.intro-word-fill text {
  filter:
    drop-shadow(0 3px 0 rgba(0, 61, 165, 0.3))
    drop-shadow(0 0 22px rgba(0, 61, 165, 0.2));
}
.intro-tile {
  position: absolute;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform-origin: 50% 50%;
  box-shadow: inset 0 0 0 1px rgba(243, 243, 240, 0.52);
  will-change: transform, opacity;
}
@keyframes intro-accent-in {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes intro-word-rise {
  to { transform: translateY(0); }
}
@keyframes intro-meta-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes intro-cue-line {
  0% { transform: translateY(-110%); }
  55%, 100% { transform: translateY(230%); }
}

@media (max-width: 700px) {
  .intro-hero { padding-inline: 16px; }
  .intro-frame-top,
  .intro-frame-bottom {
    left: 16px;
    right: 16px;
    grid-template-columns: 1fr auto;
  }
  .intro-frame-top span:nth-child(2),
  .intro-frame-bottom > span:first-child {
    display: none;
  }
  .intro-index { display: none; }
  .intro-accent { margin-bottom: 62px; }
  .intro-wordmark {
    flex-direction: column;
    align-items: center;
    gap: 0.02em;
    font-size: clamp(48px, 15vw, 74px);
    line-height: 0.84;
    white-space: normal;
  }
  .intro-wordmark span:last-child { margin-left: 0; }
  .intro-tagline {
    max-width: 280px;
    margin-top: 20px;
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-splash { display: none; }
}

/* ---------- Calendar workspace ---------- */
body[data-view="calendar"] main {
  max-width: none;
  padding: 10px 18px 22px;
}
.calendar-view {
  --cal-border: #dfe3e8;
  --cal-line: #e8eaed;
  --cal-ink: #202124;
  --cal-muted: #5f6368;
  --cal-soft: #f6f8fb;
  --cal-blue: #1a73e8;
  min-height: 0;
}
.calendar-app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  height: calc(100vh - 74px);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid var(--cal-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(34, 46, 58, 0.09);
  color: var(--cal-ink);
}
.calendar-sidebar {
  position: relative;
  z-index: 8;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  padding: 16px 14px 12px;
  border-right: 1px solid var(--cal-border);
  background: #f8fafc;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.calendar-sidebar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.calendar-create-wrap { position: relative; }
.calendar-create-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid #dadce0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.12);
  color: #3c4043;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}
.calendar-create-btn:hover { box-shadow: 0 4px 14px rgba(60, 64, 67, 0.18); }
.calendar-create-plus {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}
.calendar-create-btn svg {
  width: 14px;
  height: 14px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.calendar-create-menu {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  z-index: 30;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--cal-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(34, 46, 58, 0.2);
}
.calendar-create-menu button {
  display: grid;
  grid-template-columns: 24px 1fr;
  width: 100%;
  gap: 0 8px;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cal-ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.calendar-create-menu button:hover { background: #f1f5f9; }
.calendar-create-menu small {
  grid-column: 2;
  margin-top: 1px;
  color: var(--cal-muted);
  font-size: 10.5px;
}
.ccm-icon {
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--cal-blue);
  font-size: 17px;
  text-align: center;
}

.mini-calendar {
  padding: 9px 8px 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.08);
}
.mini-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 2px 0 6px;
  font-size: 13px;
  font-weight: 650;
}
.mini-calendar-nav { display: flex; gap: 2px; }
.mini-calendar-nav button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
}
.mini-calendar-nav button:hover { background: #eef2f6; }
.mini-calendar-nav svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.mini-weekdays,
.mini-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}
.mini-weekdays {
  margin-bottom: 2px;
  color: #80868b;
  font-size: 9px;
  font-weight: 700;
}
.mini-day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #3c4043;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.mini-day:hover { background: #eef2f6; }
.mini-day.outside { color: #b7bcc2; }
.mini-day.today { background: var(--cal-blue); color: #fff; font-weight: 700; }
.mini-day.selected:not(.today) { box-shadow: inset 0 0 0 1.5px var(--cal-blue); color: var(--cal-blue); font-weight: 700; }
.mini-day.has-event::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.calendar-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 13px;
  background: #edf2f7;
  color: #5f6368;
}
.calendar-search svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.calendar-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cal-ink);
  font: inherit;
  font-size: 12.5px;
}
.calendar-search input::placeholder { color: #6b7280; }
.calendar-source-section { display: flex; flex-direction: column; gap: 7px; }
.calendar-source-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  color: #3c4043;
  font-size: 12px;
  font-weight: 700;
}
.calendar-source-heading button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
}
.calendar-source-heading button:hover { background: #eef2f6; }
.calendar-source-list { display: flex; flex-direction: column; gap: 2px; }
.calendar-source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 31px;
  padding: 0 5px;
  border-radius: 8px;
  color: #3c4043;
  font-size: 12px;
  cursor: pointer;
}
.calendar-source-row:hover { background: #eef2f6; }
.calendar-source-row input { position: absolute; opacity: 0; pointer-events: none; }
.calendar-source-check {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  color: var(--source-color);
}
.calendar-source-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg);
}
.calendar-source-row input:checked + .calendar-source-check { background: var(--source-color); border-color: var(--source-color); }
.calendar-source-row input:checked + .calendar-source-check::after { opacity: 1; }
.calendar-source-count { margin-left: auto; color: #8a9098; font-size: 10px; }
.calendar-sidebar-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding: 10px 5px 1px;
  border-top: 1px solid #e3e7eb;
  color: #7b8189;
  font-size: 9.5px;
}
.calendar-local-dot { width: 6px; height: 6px; border-radius: 50%; background: #35a665; box-shadow: 0 0 0 3px rgba(53,166,101,.12); }

.calendar-main-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
.calendar-toolbar {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid #edf0f3;
}
.calendar-period-nav { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; }
.calendar-today-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #dadce0;
  border-radius: 18px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.calendar-today-btn:hover { background: #f8fafd; box-shadow: 0 1px 4px rgba(60,64,67,.15); }
.calendar-arrow-group { display: flex; }
.calendar-arrow-group button,
.calendar-icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  font: inherit;
  cursor: pointer;
}
.calendar-arrow-group button:hover,
.calendar-icon-btn:hover { background: #f1f3f4; }
.calendar-arrow-group svg,
.calendar-icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.calendar-range-block { min-width: 0; margin-inline-start: auto; text-align: end; }
.calendar-range-block h1 {
  margin: 0;
  overflow: hidden;
  color: #202124;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-range-block span { display: block; margin-top: 3px; color: #7a8189; font-size: 10px; }
.calendar-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.calendar-timezone { margin-right: 5px; color: #7a8189; font-size: 10px; white-space: nowrap; }
.calendar-icon-btn { width: 34px; height: 34px; font-size: 10px; font-weight: 700; }
.calendar-view-switch {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: #f1f3f4;
}
.calendar-view-switch button {
  min-width: 51px;
  height: 29px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5f6368;
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}
.calendar-view-switch button:hover { color: #202124; }
.calendar-view-switch button.active { background: #fff; color: var(--cal-blue); box-shadow: 0 1px 3px rgba(60,64,67,.18); }
.calendar-subtoolbar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 16px;
  border-bottom: 1px solid #edf0f3;
  color: #6f7780;
  font-size: 10.5px;
}
.calendar-term-line,
.calendar-subtoolbar-actions { display: flex; align-items: center; gap: 8px; }
.calendar-term-line .term-chip { padding: 3px 8px; border-width: 1px; font-size: 10.5px; }
.calendar-text-btn {
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5f6368;
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}
.calendar-text-btn:hover { background: #f1f3f4; color: #202124; }
.calendar-conflict-banner {
  margin: 8px 12px 0;
  padding: 8px 11px;
  border: 1px solid #f3c4c0;
  border-radius: 10px;
  background: #fff4f3;
  color: #a33631;
  font-size: 10.5px;
}
.calendar-engine { min-height: 0; flex: 1; overflow: hidden; }

.calendar-week-shell { display: flex; height: 100%; flex-direction: column; }
.calendar-week-head,
.calendar-all-day-row,
.calendar-week-body {
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(0, 1fr));
}
.calendar-week-head { flex: 0 0 auto; border-bottom: 1px solid var(--cal-line); }
.calendar-gutter { min-width: 0; }
.calendar-day-head {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 8px 5px 7px;
  border-left: 1px solid var(--cal-line);
}
.calendar-day-head small {
  color: #70757a;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.calendar-day-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  border-radius: 50%;
  color: #3c4043;
  font-size: 17px;
  font-weight: 500;
}
.calendar-day-head.today .calendar-day-number { background: var(--cal-blue); color: #fff; }
.calendar-day-head.weekend small { color: #9aa0a6; }
.calendar-day-head.selected:not(.today) .calendar-day-number { box-shadow: inset 0 0 0 1.5px var(--cal-blue); color: var(--cal-blue); }
.calendar-day-head em {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #7d848b;
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-all-day-row {
  min-height: 30px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--cal-line);
}
.calendar-all-day-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px;
  color: #80868b;
  font-size: 9px;
}
.calendar-all-day-cell {
  min-width: 0;
  padding: 3px 3px;
  border-left: 1px solid var(--cal-line);
}
.calendar-all-day-event {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 3px 7px;
  border: 0;
  border-radius: 5px;
  background: var(--event-color);
  color: #fff;
  font: inherit;
  font-size: 9.5px;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.calendar-week-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.calendar-week-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.calendar-week-body {
  position: relative;
  height: 100%;
  min-height: calc(var(--calendar-hour-height) * var(--calendar-visible-hours));
}
.calendar-hour-rail { position: relative; }
.calendar-hour-label {
  position: absolute;
  right: 8px;
  color: #80868b;
  font-size: 9px;
  transform: translateY(-6px);
}
.calendar-hour-label.is-end {
  transform: translateY(calc(-100% - 2px));
}
.calendar-hour-label.is-start {
  transform: none;
}
.calendar-day-column {
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--cal-line);
  background-image: linear-gradient(to bottom, var(--cal-line) 1px, transparent 1px);
  background-size: 100% var(--calendar-hour-step);
}
.calendar-day-column.weekend { background-color: #fbfcfd; }
.calendar-day-column:hover { background-color: #fafcff; }
.calendar-now-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  height: 2px;
  background: #ea4335;
  pointer-events: none;
}
.calendar-now-line::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ea4335;
}
.calendar-now-label {
  position: absolute;
  right: 4px;
  bottom: 5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #ea4335;
  color: #fff;
  font-size: 8px;
}
.calendar-event {
  position: absolute;
  z-index: 3;
  min-height: 22px;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.35);
  border-left: 4px solid var(--event-color);
  border-radius: 7px;
  background: color-mix(in srgb, var(--event-color) 14%, #fff);
  color: color-mix(in srgb, var(--event-color) 72%, #111);
  box-shadow: 0 1px 2px rgba(60,64,67,.12);
  cursor: pointer;
  transition: box-shadow .12s ease, filter .12s ease;
}
.calendar-event:hover { z-index: 6; box-shadow: 0 5px 13px rgba(60,64,67,.2); filter: saturate(1.08); }
.calendar-event.solid { background: var(--event-color); border-color: var(--event-color); color: #fff; }
.calendar-event.conflict { border-color: #d93025; box-shadow: 0 0 0 1px #d93025 inset; }
.calendar-event.draggable { cursor: grab; }
.calendar-event.draggable:active { cursor: grabbing; }
.calendar-event b {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  font-size: 8.5px;
  line-height: 1.25;
  opacity: .84;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event.compact { padding-top: 2px; padding-bottom: 2px; }
.calendar-event.compact span { display: none; }

.calendar-month-shell { height: 100%; overflow: auto; background: #fff; }
.calendar-month-weekdays,
.calendar-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-month-weekdays {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--cal-line);
  background: #fff;
}
.calendar-month-weekdays span {
  padding: 9px 8px;
  border-left: 1px solid var(--cal-line);
  color: #70757a;
  font-size: 9px;
  font-weight: 650;
  text-align: center;
  text-transform: uppercase;
}
.calendar-month-grid { grid-auto-rows: minmax(98px, 1fr); }
.calendar-month-day {
  min-width: 0;
  overflow: hidden;
  padding: 5px 5px 6px;
  border-right: 1px solid var(--cal-line);
  border-bottom: 1px solid var(--cal-line);
  background: #fff;
  cursor: pointer;
}
.calendar-month-day:hover { background: #fafcff; }
.calendar-month-day.outside { background: #fbfcfd; color: #aeb4bb; }
.calendar-month-day.today { background: #f4f8ff; }
.calendar-month-date {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-bottom: 3px;
  border-radius: 50%;
  font-size: 11px;
}
.calendar-month-day.today .calendar-month-date { background: var(--cal-blue); color: #fff; font-weight: 700; }
.calendar-month-event {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  margin: 2px 0;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #3c4043;
  font: inherit;
  font-size: 8.5px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.calendar-month-event::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--event-color); }
.calendar-month-more { padding: 2px 5px; border: 0; background: transparent; color: #5f6368; font: inherit; font-size: 8.5px; cursor: pointer; }

.calendar-agenda-shell { height: 100%; overflow: auto; padding: 14px 18px 30px; }
.calendar-agenda-empty { display: grid; min-height: 280px; place-items: center; color: var(--cal-muted); font-size: 12px; }
.calendar-agenda-day {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cal-line);
}
.calendar-agenda-date { color: #5f6368; font-size: 10px; }
.calendar-agenda-date b { display: block; color: #202124; font-size: 17px; font-weight: 550; }
.calendar-agenda-events { display: flex; flex-direction: column; gap: 5px; }
.calendar-agenda-event {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-left: 4px solid var(--event-color);
  border-radius: 7px;
  background: #f8fafc;
  color: #202124;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.calendar-agenda-event:hover { background: #f1f5f9; }
.calendar-agenda-event time { color: #6b7280; font-size: 9px; }
.calendar-agenda-event b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-agenda-event small { color: #7b8189; font-size: 9px; }

.calendar-inspector {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: auto;
  padding: 16px 14px 12px;
  border-left: 1px solid var(--cal-border);
  background: #fbfcfe;
}
.calendar-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #3c4043;
  font-size: 13px;
  font-weight: 700;
}
.calendar-live-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #658274;
  font-size: 9px;
  font-weight: 650;
}
.calendar-live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #38a169; box-shadow: 0 0 0 3px rgba(56,161,105,.12); }
.calendar-focus { margin-top: 11px; }
.calendar-focus-card {
  padding: 14px;
  border: 1px solid #dbe5ef;
  border-radius: 15px;
  background: linear-gradient(145deg, #f5faff, #fff);
}
.calendar-focus-card .focus-kicker { color: #7a8189; font-size: 9px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.calendar-focus-card h3 { margin: 6px 0 3px; color: #202124; font-size: 15px; font-weight: 650; line-height: 1.25; }
.calendar-focus-card p { margin: 0; color: #6b7280; font-size: 10px; }
.calendar-focus-time { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--cal-blue); font-size: 11px; font-weight: 700; }
.calendar-focus-time::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.calendar-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 2px 9px;
  color: #70757a;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.calendar-insights { display: grid; gap: 7px; }
.calendar-insight {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e7ebef;
  border-radius: 10px;
  background: #fff;
}
.calendar-insight-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #eef5ff; color: var(--cal-blue); font-size: 13px; }
.calendar-insight span { display: block; color: #697078; font-size: 9px; }
.calendar-insight b { display: block; margin-top: 1px; color: #202124; font-size: 11px; font-weight: 650; }
.calendar-insight em { color: #7b8189; font-size: 9px; font-style: normal; }
.calendar-course-list { gap: 5px; }
.calendar-course-list .cal-row { padding: 8px; border-color: #e7ebef; border-radius: 9px; background: #fff; }
.calendar-course-list .cal-row-actions { display: none; }
.calendar-course-list .cr-main { font-size: 10px; }
.calendar-course-list .cr-sub { font-size: 8.5px; line-height: 1.35; }
.calendar-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  margin-top: auto;
  padding: 14px 2px 0;
  color: #8a9098;
  font-size: 8.5px;
}
.calendar-shortcuts span { display: flex; align-items: center; gap: 4px; }
.calendar-shortcuts kbd {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid #d9dee3;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  color: #5f6368;
  font: inherit;
  font-size: 8px;
}

/* Calendar event composer */
.calendar-event-form { display: flex; flex-direction: column; gap: 14px; }
.calendar-event-form .form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.calendar-event-form h2 { margin: 0; }
.calendar-event-form .form-kicker { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.calendar-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.calendar-form-grid .wide { grid-column: 1 / -1; }
.calendar-event-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10.5px; font-weight: 650; }
.calendar-event-form input,
.calendar-event-form select,
.calendar-event-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  outline: none;
}
.calendar-event-form textarea { min-height: 78px; resize: vertical; }
.calendar-event-form input:focus,
.calendar-event-form select:focus,
.calendar-event-form textarea:focus { border-color: rgba(10,132,255,.42); box-shadow: 0 0 0 3px rgba(10,132,255,.1); }
.calendar-event-form .form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 13px; border-top: 1px solid var(--line); }
.calendar-event-form .form-delete { margin-right: auto; }
.calendar-event-form .calendar-all-day-toggle {
  flex-direction: row;
  align-items: center;
  gap: 11px;
  min-height: 49px;
  padding: 8px 11px;
  border: 1px solid #c8c8c1;
  border-radius: 7px;
  background: #f3f3ef;
  color: var(--sa-ink);
  cursor: pointer;
}
.calendar-event-form .calendar-all-day-toggle:hover { background: #ecece7; }
.calendar-event-form .calendar-all-day-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.calendar-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  border: 1.5px solid var(--sa-line);
  border-radius: 999px;
  background: transparent;
  transition: background .16s ease;
}
.calendar-toggle-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sa-line);
  transition: transform .16s ease, background .16s ease;
}
.calendar-all-day-toggle input:checked + .calendar-toggle-track { background: var(--sa-line); }
.calendar-all-day-toggle input:checked + .calendar-toggle-track i { background: var(--sa-bg); transform: translateX(15px); }
.calendar-all-day-toggle input:focus-visible + .calendar-toggle-track { outline: 2px solid var(--sa-brown); outline-offset: 3px; }
.calendar-toggle-copy { display: flex; flex-direction: column; gap: 1px; }
.calendar-toggle-copy b { font-size: 11px; font-weight: 600; }
.calendar-toggle-copy small { color: var(--sa-ink-2); font-size: 9px; font-weight: 400; }

@media (max-width: 1280px) {
  .calendar-app { grid-template-columns: 232px minmax(0, 1fr); }
}
@media (max-width: 980px) {
  body[data-view="calendar"] main { padding: 8px; }
  .calendar-app { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 62px); min-height: 610px; }
  .calendar-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    transform: translateX(-104%);
    box-shadow: 18px 0 40px rgba(34,46,58,.16);
    transition: transform .2s ease;
  }
  .calendar-app.sidebar-open .calendar-sidebar { transform: translateX(0); }
  .calendar-sidebar-toggle { display: grid !important; }
  .calendar-timezone { display: none; }
  .calendar-toolbar { align-items: flex-start; }
  .calendar-toolbar-actions { flex-wrap: wrap; }
  .calendar-range-block h1 { font-size: 17px; }
}
@media (max-width: 700px) {
  .calendar-week-head,
  .calendar-all-day-row,
  .calendar-week-body { grid-template-columns: 48px repeat(7, minmax(88px, 1fr)); }
  .calendar-engine { overflow: auto; }
  .calendar-week-shell { min-width: 700px; }
  .calendar-view-switch button { min-width: 43px; padding-inline: 7px; }
  .calendar-subtoolbar-actions { display: none; }
  .calendar-form-grid { grid-template-columns: 1fr; }
  .calendar-form-grid .wide { grid-column: auto; }
}
@media (min-width: 981px) {
  .calendar-sidebar-toggle { display: none; }
}

/* Editorial pass: keep the calendar native to the Morningside Atlas shell */
body[data-view="calendar"] main {
  padding: 8px 20px 16px;
}
body[data-view="calendar"] { overflow-y: auto; }
.calendar-view {
  --calendar-hour-height: 40px;
  --calendar-visible-hours: 13;
  --calendar-hour-step: 7.6923076923%;
  --cal-border: #272724;
  --cal-line: #d3d3cd;
  --cal-ink: #242422;
  --cal-muted: #66665f;
  --cal-soft: #e8e8e3;
  --cal-blue: #315f82;
  color: var(--sa-ink);
  font-family: var(--sa-font);
}
.calendar-app {
  grid-template-columns: 238px minmax(0, 1fr);
  height: calc(100vh - 168px);
  min-height: 520px;
  border: 2px solid var(--sa-line);
  border-radius: 12px;
  background: var(--sa-bg);
  box-shadow: 5px 5px 0 rgba(36, 36, 34, 0.08);
}
.calendar-sidebar {
  gap: 13px;
  padding: 13px 12px 10px;
  border-right: 2px solid var(--sa-line);
  background: #e9e9e4;
}
.calendar-create-btn {
  height: 47px;
  border: 2px solid var(--sa-line);
  border-radius: 10px;
  background: var(--sa-bg);
  box-shadow: 3px 3px 0 rgba(36, 36, 34, 0.1);
  color: var(--sa-ink);
  font-size: 14px;
}
.calendar-create-btn:hover { box-shadow: 1px 1px 0 rgba(36,36,34,.18); transform: translate(1px,1px); }
.calendar-create-plus { font-size: 24px; }
.calendar-create-menu {
  top: 52px;
  border: 2px solid var(--sa-line);
  border-radius: 8px;
  background: var(--sa-bg);
  box-shadow: 5px 5px 0 rgba(36,36,34,.12);
}
.calendar-create-menu button:hover { background: #dfdfd9; }
.calendar-create-menu small { color: var(--sa-ink-2); }
.ccm-icon { color: var(--sa-brown); }
.mini-calendar {
  padding: 8px 6px 7px;
  border: 1px solid #c9c9c3;
  border-radius: 8px;
  background: rgba(243,243,240,.62);
  box-shadow: none;
}
.mini-calendar-head { font-size: 11.5px; font-weight: 500; }
.mini-calendar-nav button:hover { background: #dcdcd6; }
.mini-weekdays { color: #77776f; font-size: 8px; }
.mini-day { font-size: 10px; }
.mini-day:hover { background: #dddCD6; }
.mini-day.today { background: var(--sa-ink); color: var(--sa-bg); }
.mini-day.selected:not(.today) { box-shadow: inset 0 0 0 1.5px var(--sa-line); color: var(--sa-line); }
.calendar-search {
  min-height: 38px;
  border: 1px solid #c9c9c3;
  border-radius: 8px;
  background: #eeeeea;
  color: #6b6b64;
}
.calendar-search input { color: var(--sa-ink); font-size: 11px; }
.calendar-source-heading { color: var(--sa-ink); font-size: 10.5px; font-weight: 500; }
.calendar-source-row { min-height: 29px; font-size: 10.5px; }
.calendar-source-row:hover { background: #deded8; }
.calendar-source-check { border-radius: 3px; }
.calendar-sidebar-foot { border-top: 1px solid #c9c9c3; color: #77776f; font-size: 8.5px; }
.calendar-local-dot { background: var(--sa-green); }
.calendar-main-panel { background: var(--sa-bg); }
.calendar-toolbar {
  min-height: 66px;
  padding: 9px 14px 7px;
  border-bottom: 2px solid var(--sa-line);
  background: var(--sa-bg);
}
.calendar-today-btn {
  border: 2px solid var(--sa-line);
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink);
  font-size: 10px;
  font-weight: 500;
}
.calendar-today-btn:hover { background: var(--sa-ink); color: var(--sa-bg); box-shadow: none; }
.calendar-arrow-group button,
.calendar-icon-btn { color: var(--sa-ink); }
.calendar-arrow-group button:hover,
.calendar-icon-btn:hover { background: #deded8; }
.calendar-range-block h1 {
  color: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.calendar-range-block span,
.calendar-timezone { color: var(--sa-ink-2); font-size: 8.5px; }
.calendar-view-switch {
  padding: 2px;
  border: 1px solid var(--sa-line);
  border-radius: 999px;
  background: transparent;
}
.calendar-view-switch button {
  min-width: 45px;
  height: 25px;
  border-radius: 999px;
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 400;
}
.calendar-view-switch button.active {
  background: var(--sa-ink);
  color: var(--sa-bg);
  box-shadow: none;
}
.calendar-subtoolbar {
  min-height: 34px;
  padding: 4px 14px;
  border-bottom: 1px solid var(--sa-line);
  color: var(--sa-ink-2);
  font-size: 9px;
}
.calendar-term-line .term-chip {
  border-color: var(--sa-line);
  color: var(--sa-ink);
  font-size: 9px;
}
.calendar-text-btn {
  border: 1px solid var(--sa-line);
  border-radius: 999px;
  color: var(--sa-ink);
  font-size: 9px;
}
.calendar-text-btn:hover { background: var(--sa-ink); color: var(--sa-bg); }
.calendar-engine { background: var(--sa-bg); }
.calendar-week-head { border-bottom: 1px solid var(--sa-line); background: var(--sa-bg); }
.calendar-day-head {
  border: 0;
  border-left: 1px solid #c9c9c3;
  background: transparent;
  color: var(--sa-ink);
  font: inherit;
  cursor: pointer;
}
.calendar-day-head:hover { background: #ebeBE6; }
.calendar-day-head small {
  color: var(--sa-ink-2);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .06em;
}
.calendar-day-head.today small { color: var(--sa-brown); }
.calendar-day-number { font-family: var(--sa-font); font-size: 14px; }
.calendar-day-head.today .calendar-day-number { background: var(--sa-brown); color: #fff; }
.calendar-day-head em { color: var(--sa-ink-2); font-size: 8px; }
.calendar-all-day-row { border-bottom: 1px solid var(--sa-line); background: #efefeb; }
.calendar-all-day-label { justify-content: flex-start; color: var(--sa-ink-2); font-size: 8px; }
.calendar-all-day-cell { border-left: 1px solid #c9c9c3; }
.calendar-all-day-event {
  border-left: 3px solid var(--event-color);
  border-radius: 3px;
  background: color-mix(in srgb, var(--event-color) 18%, #fff);
  color: var(--sa-ink);
  font-size: 8.5px;
  font-weight: 500;
}
.calendar-day-column {
  border-left: 1px solid #c9c9c3;
  background-image: linear-gradient(to bottom, #deded8 1px, transparent 1px);
  background-size: 100% var(--calendar-hour-step);
}
.calendar-day-column.weekend { background-color: #eeeEEA; }
.calendar-day-column:hover { background-color: #f6f6f2; }
.calendar-hour-label { color: var(--sa-ink-2); font-size: 8px; }
.calendar-now-line,
.calendar-now-line::before { background: var(--sa-brown); }
.calendar-now-label { background: var(--sa-brown); border-radius: 2px; font-size: 7.5px; }
.calendar-event {
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--event-color) 48%, #fff);
  border-left: 3px solid var(--event-color);
  border-radius: 4px;
  background: color-mix(in srgb, var(--event-color) 14%, #f7f7f2);
  color: var(--sa-ink);
  box-shadow: 1px 1px 0 rgba(36,36,34,.08);
}
.calendar-event:hover { box-shadow: 3px 3px 0 rgba(36,36,34,.12); filter: none; }
.calendar-event.solid {
  border-color: var(--event-color);
  background: color-mix(in srgb, var(--event-color) 22%, #f7f7f2);
  color: var(--sa-ink);
}
.calendar-event b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.28;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.calendar-event span {
  margin-top: 3px;
  font-size: 9.5px;
  line-height: 1.3;
  opacity: .76;
}
.calendar-event.compact {
  padding-top: 3px;
  padding-bottom: 3px;
}
.calendar-event.compact b {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.calendar-month-shell { background: var(--sa-bg); }
.calendar-month-weekdays { background: var(--sa-bg); }
.calendar-month-weekdays span { color: var(--sa-ink-2); font-size: 8px; }
.calendar-month-day { background: var(--sa-bg); }
.calendar-month-day:hover { background: #ecece7; }
.calendar-month-day.outside { background: #e9e9e4; }
.calendar-month-day.today { background: #e4e1d8; }
.calendar-month-date { font-size: 10px; }
.calendar-month-day.today .calendar-month-date { background: var(--sa-brown); color: #fff; }
.calendar-month-event { color: var(--sa-ink); font-size: 8px; }
.calendar-month-event::before { background: var(--event-color); }
.calendar-month-more { color: var(--sa-ink-2); }
.calendar-agenda-shell { background: var(--sa-bg); }
.calendar-agenda-day { border-bottom: 1px solid #cfcfc9; }
.calendar-agenda-date { color: var(--sa-ink-2); }
.calendar-agenda-date b { color: var(--sa-ink); font-weight: 500; }
.calendar-agenda-event { background: #ecece7; color: var(--sa-ink); }
.calendar-agenda-event:hover { background: #e3e3dd; }
.calendar-agenda-event time,
.calendar-agenda-event small { color: var(--sa-ink-2); }
.calendar-agenda-event b { font-weight: 500; }
.calendar-inspector {
  padding: 14px 12px 10px;
  border-left: 2px solid var(--sa-line);
  background: #e9e9e4;
}
.calendar-inspector-head { color: var(--sa-ink); font-size: 11px; font-weight: 500; }
.calendar-live-pill { color: var(--sa-green); }
.calendar-live-pill i { background: var(--sa-green); }
.calendar-focus-card {
  padding: 12px;
  border: 1px solid var(--sa-line);
  border-radius: 7px;
  background: var(--sa-bg);
}
.calendar-focus-card .focus-kicker,
.calendar-focus-card p { color: var(--sa-ink-2); }
.calendar-focus-card h3 { color: var(--sa-ink); font-size: 13px; font-weight: 500; }
.calendar-focus-time { color: var(--sa-brown); font-size: 9.5px; }
.calendar-section-label { color: var(--sa-ink-2); font-size: 8px; font-weight: 500; }
.calendar-insight { border-color: #c9c9c3; background: #f3f3f0; }
.calendar-insight-icon { background: #deded8; color: var(--sa-brown); }
.calendar-insight span,
.calendar-insight em { color: var(--sa-ink-2); }
.calendar-insight b { color: var(--sa-ink); font-weight: 500; }
.calendar-course-list .cal-row { border-color: #c9c9c3; background: #f3f3f0; }
.calendar-course-list .cal-row button { color: var(--sa-brown); }
.calendar-shortcuts { border-top: 1px solid #cfcfc9; color: var(--sa-ink-2); }
.calendar-shortcuts kbd { border-color: #b9b9b2; background: var(--sa-bg); color: var(--sa-ink); }
.calendar-event-form .form-kicker { color: var(--sa-brown); }
.calendar-event-form input,
.calendar-event-form select,
.calendar-event-form textarea { border-color: #bfbfb8; border-radius: 5px; background: #fbfbf8; }
.calendar-event-form .form-head,
.calendar-event-form .form-actions { border-color: #cecec8; }

.calendar-course-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--sa-line);
  border-left: 1px solid var(--sa-line);
}

.calendar-course-event-grid > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 66px;
  padding: 11px 12px;
  border-right: 1px solid var(--sa-line);
  border-bottom: 1px solid var(--sa-line);
}

.calendar-course-event-grid .wide {
  grid-column: 1 / -1;
}

.calendar-course-event-grid span {
  color: var(--sa-ink-2);
  font-size: 8.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.calendar-course-event-grid strong,
.calendar-course-event-grid b {
  color: var(--sa-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.calendar-course-event-grid b {
  font-size: 16px;
  font-weight: 500;
}

.calendar-remove-course-btn {
  margin-right: auto;
  border-color: rgba(180, 29, 45, .55) !important;
  color: #a51f2d !important;
}

.calendar-remove-course-btn:hover {
  border-color: #a51f2d !important;
  background: #a51f2d !important;
  color: #fff !important;
}

.calendar-remove-course-btn span {
  font-size: 15px;
  line-height: 1;
}

@media (max-width: 1280px) {
  .calendar-app { grid-template-columns: 224px minmax(0, 1fr); }
}
@media (max-width: 980px) {
  body[data-view="calendar"] main { padding: 6px 10px 10px; }
  .calendar-app {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    height: calc(100vh - 145px);
  }
  .calendar-sidebar {
    width: min(250px, calc(100% - 52px));
    visibility: hidden;
    background: #e9e9e4;
    border-right: 2px solid var(--sa-line);
  }
  .calendar-app.sidebar-open .calendar-sidebar { visibility: visible; }
  .calendar-toolbar-actions .calendar-sidebar-toggle { order: 1; }
}

/* Calendar type weight */
.calendar-app,
.calendar-app button,
.calendar-app input,
.calendar-app select,
.calendar-app textarea {
  font-weight: 500;
}
.calendar-create-btn,
.mini-calendar-head,
.calendar-source-heading,
.calendar-range-block h1,
.calendar-view-switch button.active,
.calendar-day-head small,
.calendar-day-number,
.calendar-month-weekdays span,
.calendar-agenda-date,
.calendar-agenda-event b,
.calendar-event-form label,
.calendar-event-form h2 {
  font-weight: 600;
}
.mini-weekdays,
.mini-day,
.calendar-day-head em,
.calendar-hour-label,
.calendar-source-row,
.calendar-today-btn,
.calendar-text-btn,
.calendar-view-switch button,
.calendar-all-day-event,
.calendar-event b,
.calendar-event span,
.calendar-month-event,
.calendar-month-more,
.calendar-agenda-event time,
.calendar-agenda-event small,
.calendar-form-grid b {
  font-weight: 500;
}
.calendar-event b { font-weight: 600; }
.calendar-day-head small { letter-spacing: .075em; }
.calendar-term-line .term-chip { font-weight: 600; }
.calendar-text-btn.is-connected {
  border-color: #9eb9af;
  background: #e3eee8;
  color: #315f48;
}
.calendar-text-btn.is-connected::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #3f8a66;
  vertical-align: 1px;
}
.calendar-text-btn:disabled { opacity: .65; cursor: wait; }

.google-calendar-dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.google-calendar-dialog .form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d8d8d2;
}
.google-calendar-dialog h2 { margin: 0; font-size: 22px; font-weight: 600; }
.google-calendar-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #c9c9c3;
  border-radius: 999px;
  color: #77776f;
  font-size: 9px;
  white-space: nowrap;
}
.google-calendar-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9a9a92;
}
.google-calendar-status.connected { border-color: #a7c8b8; color: #315f48; background: #e6f0eb; }
.google-calendar-status.connected i { background: #3f8a66; }
.google-calendar-warning {
  padding: 10px 12px;
  border: 1px solid #d5b090;
  border-radius: 7px;
  background: #f4e8dc;
  color: #713f25;
  font-size: 10.5px;
  line-height: 1.55;
}
.google-calendar-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #c9c9c3;
  border-radius: 8px;
  background: #eeeEE9;
}
.google-calendar-account-card > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.google-calendar-account-card b { font-size: 12px; font-weight: 600; }
.google-calendar-account-card span { color: var(--sa-ink-2); font-size: 9.5px; }
.google-calendar-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1.5px solid var(--sa-line);
  border-radius: 9px;
  background: var(--sa-bg);
  font-size: 18px;
  font-weight: 700;
}
.google-calendar-client-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--sa-ink-2);
  font-size: 10px;
  font-weight: 600;
}
.google-calendar-client-field input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #bfbfb8;
  border-radius: 5px;
  background: #fbfbf8;
  color: var(--sa-ink);
  font: inherit;
  font-size: 11px;
  outline: none;
}
.google-calendar-client-field input:focus { border-color: var(--sa-brown); box-shadow: 0 0 0 3px rgba(122,76,47,.12); }
.google-calendar-setup {
  padding: 11px 12px;
  border-left: 3px solid var(--sa-brown);
  background: #eeeEE9;
  color: var(--sa-ink-2);
  font-size: 9.5px;
  line-height: 1.55;
}
.google-calendar-setup b { color: var(--sa-ink); font-size: 10px; }
.google-calendar-setup ol { margin: 6px 0 0; padding-left: 18px; }
.google-calendar-setup code {
  padding: 1px 4px;
  border: 1px solid #d0d0c9;
  border-radius: 3px;
  background: var(--sa-bg);
  color: var(--sa-ink);
  font-size: 8.5px;
  overflow-wrap: anywhere;
}
.google-calendar-sync-help {
  padding: 11px 12px;
  border: 1px solid #c9c9c3;
  background: #eeeEE9;
  color: var(--sa-ink-2);
  font-size: 10px;
}
.google-calendar-actions { justify-content: flex-end; }

/* ---------- Isometric campus model ---------- */
.campus-model-heading {
  align-items: flex-end;
  margin-bottom: 15px;
}
.campus-model-heading .eyebrow { margin-bottom: 5px; }
.campus-model-heading h1 { font-size: 29px; }
.campus-model-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  height: clamp(470px, calc(100vh - 260px), 680px);
  min-height: 470px;
  overflow: hidden;
  border: 2px solid var(--sa-line);
  border-radius: 12px;
  background: var(--sa-bg);
  box-shadow: 5px 5px 0 rgba(36, 36, 34, 0.08);
}
.campus-model-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #f7f7f3;
}
.campus-model-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 55px;
  padding: 8px 13px;
  border-bottom: 1px solid #c7c7c1;
}
.campus-model-title { display: flex; align-items: center; gap: 10px; }
.campus-model-title > div { display: flex; flex-direction: column; }
.campus-model-title b { color: var(--sa-ink); font-size: 11px; font-weight: 600; }
.campus-model-title small { color: var(--sa-ink-2); font-size: 8.5px; }
.campus-model-mark {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--sa-ink);
  background: repeating-linear-gradient(45deg, transparent 0 3px, #bbb 3px 4px);
  transform: rotate(45deg);
}
.campus-model-controls { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.campus-model-controls button {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #bdbdb6;
  border-radius: 999px;
  background: transparent;
  color: var(--sa-ink-2);
  font: inherit;
  font-size: 8px;
  font-weight: 500;
  cursor: pointer;
}
.campus-model-controls button:hover { background: #e6e6e0; color: var(--sa-ink); }
.campus-model-controls button.active { border-color: var(--sa-ink); background: var(--sa-ink); color: var(--sa-bg); }
.campus-model-angle {
  min-width: 88px;
  padding: 0 4px;
  color: #7b7b73;
  font-size: 7.5px;
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
}
.campus-model-viewport {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(255,255,255,.98) 0 40%, rgba(245,245,241,.76) 82%),
    linear-gradient(rgba(36,36,34,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36,36,34,.022) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
}
#campus-model-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#campus-model-svg.dragging { cursor: grabbing; }
.campus-model-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(243,243,240,.88);
  color: var(--sa-ink-2);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.campus-model-compass {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: 22px auto;
  align-items: center;
  color: var(--sa-ink-2);
  font-size: 8px;
  text-transform: uppercase;
}
.campus-model-compass span { grid-row: 1 / span 2; color: var(--sa-ink); font-size: 12px; font-weight: 600; }
.campus-model-compass i { width: 36px; height: 1px; background: var(--sa-ink); }
.campus-model-compass small { margin-top: 2px; font-size: 6.5px; letter-spacing: .1em; }
.campus-model-legend {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 38px;
  padding: 6px 13px;
  border-top: 1px solid #c7c7c1;
  color: var(--sa-ink-2);
  font-size: 8px;
}
.campus-model-legend span { display: flex; align-items: center; gap: 5px; }
.campus-model-legend i { width: 9px; height: 9px; border: 1px solid var(--sa-ink); }
.campus-model-legend i.landmark { background: #d7c6a4; }
.campus-model-legend i.building { background: #f6f6f2; }
.campus-model-legend i.walk { width: 15px; height: 4px; border: 0; background: #e5cfac; box-shadow: 0 0 0 1px var(--sa-ink); }
.campus-model-source { margin-left: auto; color: #88887f; font-size: 7px; }
.campus-model-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 15px 13px 12px;
  border-left: 2px solid var(--sa-line);
  background: #e9e9e4;
}
.campus-rail-kicker {
  color: var(--sa-brown);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.campus-model-rail-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin-top: 8px;
  padding: 0 9px;
  border: 1px solid #bdbdb6;
  border-radius: 6px;
  background: var(--sa-bg);
  color: var(--sa-ink-2);
}
.campus-model-rail-search svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.campus-model-rail-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--sa-ink);
  font: inherit;
  font-size: 9px;
}
.campus-model-rail-search input::placeholder { color: #77776f; }
.campus-model-selection {
  margin-top: 9px;
  padding: 12px;
  border: 1px solid var(--sa-line);
  border-radius: 7px;
  background: var(--sa-bg);
}
.campus-model-selection b { display: block; color: var(--sa-ink); font-size: 12px; font-weight: 600; }
.campus-model-selection span { display: block; margin-top: 3px; color: var(--sa-ink-2); font-size: 8.5px; line-height: 1.45; }
.campus-model-rail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 17px 2px 8px;
  color: var(--sa-ink-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.campus-landmarks {
  display: flex;
  max-height: 140px;
  flex-direction: column;
  gap: 3px;
  overflow: auto;
  scrollbar-width: none;
}
.campus-landmarks::-webkit-scrollbar { display: none; }
.campus-landmark-btn {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  width: 100%;
  padding: 7px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--sa-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.campus-landmark-btn:hover,
.campus-landmark-btn.active { background: #dcdcd6; }
.campus-landmark-index { color: var(--sa-brown); font-size: 8px; }
.campus-landmark-btn b { display: block; overflow: hidden; font-size: 9px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.campus-landmark-btn small { display: block; color: var(--sa-ink-2); font-size: 7.5px; }
.campus-model-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid #c7c7c1;
}
.campus-model-links a { color: var(--sa-ink-2); font-size: 8px; text-decoration: none; }
.campus-model-links a:hover { color: var(--sa-brown); text-decoration: underline; }
.campus-course-rail-title { margin-top: 13px; }
.cal-list.campus-model-course-list {
  min-height: 0;
  flex: 1;
  gap: 5px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: none;
}
.campus-model-course-list::-webkit-scrollbar { display: none; }
.campus-model-course-list .cal-row {
  padding: 7px;
  border-color: #c9c9c3;
  border-radius: 6px;
  background: var(--sa-bg);
}
.campus-model-course-list .cr-main { font-size: 9px; }
.campus-model-course-list .cr-sub { font-size: 7.5px; line-height: 1.35; }
.campus-model-course-list .notice {
  padding: 8px;
  font-size: 8.5px;
  line-height: 1.45;
}
.campus-course-locations {
  margin-top: 14px;
  border: 1px solid #c9c9c2;
  border-radius: 8px;
  background: rgba(250,250,247,.5);
}
.campus-course-locations summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  color: var(--sa-ink);
  font-size: 10px;
  cursor: pointer;
}
.campus-course-locations summary span { color: var(--sa-ink-2); }
.campus-course-locations .cal-list { padding: 0 10px 10px; }

/* SVG model primitives */
.campus-block { stroke: #282825; stroke-width: 1.1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.campus-block-roof { fill: #fbfbf8; }
.campus-block-side-a { fill: #ededE8; }
.campus-block-side-b { fill: #f5f5f1; }
.campus-block.context .campus-block-roof { fill: #fafaf7; }
.campus-block.context .campus-block-side-a { fill: #efefe9; stroke: #85857d; stroke-width: .35; stroke-opacity: .28; }
.campus-block.context .campus-block-side-b { fill: #f6f6f1; stroke: #85857d; stroke-width: .35; stroke-opacity: .28; }
.campus-block.context .campus-block-roof { stroke: #77776f; stroke-width: .55; stroke-opacity: .62; }
.campus-block-base { fill: none; }
.campus-block.context.campus-block-base { stroke: #77776f; stroke-width: .55; stroke-opacity: .5; }
.campus-block-edge {
  fill: none;
  stroke: #6e6e66;
  stroke-width: .55;
  stroke-opacity: .55;
  vector-effect: non-scaling-stroke;
}
.campus-block-edge.landmark { stroke: #282825; stroke-width: .85; stroke-opacity: .9; }
.campus-block.low .campus-block-roof { fill: #e8e4da; }
.campus-block.landmark { stroke-width: 1.5; }
.campus-model-svg-static { pointer-events: none; }
.campus-ground-line { fill: none; stroke: #2c2c29; stroke-width: 1; vector-effect: non-scaling-stroke; }
.campus-road-casing { fill: none; stroke: #2c2c29; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.campus-road-surface { fill: none; stroke: #fafaf7; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.campus-road-surface.road-major { stroke: #e5cfac; }
.campus-road-surface.road-cross { stroke: #f1e6d3; }
.campus-walk-line { fill: none; stroke: #343431; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.campus-walk-line.walk-primary { stroke: #dfc99f; }
.campus-walk-dash { stroke-dasharray: 3 4; opacity: .75; }
.campus-green-area {
  fill: url("#campus-grass-hatch");
  stroke: #59614f;
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.campus-plate-side { fill: #ecece7; stroke: #2c2c29; stroke-width: 1; vector-effect: non-scaling-stroke; }
.campus-plate-top { fill: #f8f8f4; stroke: #2c2c29; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.campus-building-label {
  fill: #32322e;
  font-family: var(--sa-font);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .01em;
  paint-order: stroke;
  stroke: rgba(247,247,243,.92);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}
.campus-building-label.landmark { font-size: 10px; font-weight: 600; }
.campus-building-label.major { font-size: 8.5px; fill: #66665f; }
.campus-model-pin { cursor: pointer; }
.campus-model-pin .pin-hit { fill: transparent; }
.campus-model-pin .pin-dot { fill: #f8f8f4; stroke: #282825; stroke-width: 1.2; }
.campus-model-pin:hover .pin-dot,
.campus-model-pin.active .pin-dot { fill: var(--sa-brown); stroke: var(--sa-brown); }
.campus-building-node {
  fill: #f7f7f2;
  stroke: #4f4f49;
  stroke-width: .7;
  opacity: .78;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
}
.campus-building-node.landmark { opacity: 1; stroke: var(--sa-brown); }
.campus-course-cursor { pointer-events: none; }
.course-cursor-pulse {
  fill: none;
  stroke: var(--sa-brown);
  stroke-width: 1.2;
  opacity: .8;
  transform-box: fill-box;
  transform-origin: center;
  animation: campus-course-pulse 1.8s ease-out infinite;
}
.course-cursor-dot { fill: var(--sa-brown); stroke: #fff; stroke-width: 1.2; }
.course-cursor-stem { fill: none; stroke: var(--sa-brown); stroke-width: 1.1; }
.course-cursor-label-bg { fill: var(--sa-brown); stroke: #fff; stroke-width: .7; }
.course-cursor-label {
  fill: #fff;
  font-family: var(--sa-font);
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.campus-course-cursor.off-campus .course-cursor-pulse,
.campus-course-cursor.off-campus .course-cursor-stem { stroke: var(--cal-blue); }
.campus-course-cursor.off-campus .course-cursor-dot,
.campus-course-cursor.off-campus .course-cursor-label-bg { fill: var(--cal-blue); stroke: #fff; }
.course-cursor-destination {
  fill: var(--cal-blue);
  font-family: var(--sa-font);
  font-size: 7px;
  font-weight: 600;
  paint-order: stroke;
  stroke: rgba(247,247,243,.92);
  stroke-width: 2.5px;
}
@keyframes campus-course-pulse {
  0% { transform: scale(.5); opacity: .9; }
  75%, 100% { transform: scale(1.45); opacity: 0; }
}
.campus-pin-number {
  fill: var(--sa-ink);
  font-family: var(--sa-font);
  font-size: 6.5px;
  font-weight: 600;
  pointer-events: none;
}
.campus-model-pin:hover .campus-pin-number,
.campus-model-pin.active .campus-pin-number { fill: #fff; }
.campus-model-pin .pin-line { stroke: #282825; stroke-width: 1; }
.campus-gate-piece { fill: #f7f7f1; stroke: #242422; stroke-width: 1.3; stroke-linejoin: round; }
.campus-gate-detail { fill: none; stroke: #242422; stroke-width: 1; }
.campus-model-watermark {
  fill: #77776f;
  font-family: var(--sa-font);
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
@media (max-width: 1100px) {
  .campus-model-shell { grid-template-columns: minmax(0, 1fr) 205px; }
}
@media (max-width: 900px) {
  .campus-model-shell { grid-template-columns: 1fr; }
  .campus-model-rail { display: none; }
  .campus-model-shell { height: calc(100vh - 210px); min-height: 500px; }
  .campus-model-viewport, #campus-model-svg { min-height: 0; }
  .campus-model-controls button { padding-inline: 6px; }
  .campus-model-source { display: none !important; }
}

/* Postage-sheet course index */
#course-list,
#search-results {
  column-gap: 0;
  row-gap: 0;
  border-top: 2px solid var(--sa-ink);
  border-left: 2px solid var(--sa-ink);
}
#course-list > .course-card,
#search-results > .course-card {
  overflow: visible;
  border: 0;
  border-right: 2px solid var(--sa-ink);
  border-bottom: 2px solid var(--sa-ink);
  border-radius: 0;
  background-color: #faf9f4;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(36, 36, 34, 0.045) 0.55px, transparent 0.7px),
    linear-gradient(100deg, rgba(255,255,255,.38), rgba(233,231,222,.12));
  background-size: 4px 4px, 100% 100%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
  isolation: isolate;
}
#course-list > .course-card:hover,
#search-results > .course-card:hover {
  border-color: var(--sa-ink);
  background-color: #fdfcf7;
  box-shadow: inset 0 0 0 2px rgba(36, 36, 34, 0.055);
}
#course-list > .course-card::after,
#search-results > .course-card::after {
  content: "";
  position: absolute;
  z-index: 12;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 10px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 5px 5px, var(--sa-bg) 3.1px, transparent 3.5px) 0 0 / 10px 11px repeat-y;
}
#course-list > .course-card::before,
#search-results > .course-card::before {
  content: "";
  position: absolute;
  z-index: 12;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 10px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 5px 5px, var(--sa-bg) 3.1px, transparent 3.5px) 0 0 / 11px 10px repeat-x;
}
#course-list > .course-card.stamp-edge-right::after,
#search-results > .course-card.stamp-edge-right::after { opacity: 1; }
#course-list > .course-card.stamp-edge-bottom::before,
#search-results > .course-card.stamp-edge-bottom::before { opacity: 1; }
#course-list > .course-card .cc-top,
#search-results > .course-card .cc-top { border-radius: 0; }
@media (max-width: 980px) {
  #course-list > .course-card.stamp-edge-right::after,
  #course-list > .course-card.stamp-edge-bottom::before,
  #search-results > .course-card.stamp-edge-right::after,
  #search-results > .course-card.stamp-edge-bottom::before { opacity: 1; }
}

/* Connected postage-sheet treatment */
#course-list,
#search-results {
  position: relative;
  isolation: isolate;
  max-width: 1440px;
  margin-inline: auto;
  column-gap: 0;
  row-gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
#course-list > .course-card,
#search-results > .course-card {
  position: relative;
  min-height: 184px;
  padding: 18px 20px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#course-list > .course-card::before,
#course-list > .course-card::after,
#search-results > .course-card::before,
#search-results > .course-card::after { content: none !important; }
.course-card > .stamp-shape {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  background: transparent url("assets/stamp-card-shape-narrow-tall.svg?v=20261122-stamp-38") center / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 4px 7px rgba(36, 36, 34, 0.05));
  -webkit-mask: none;
  mask: none;
  pointer-events: none;
}
.course-card > .stamp-shape::before {
  content: none;
}
.course-card > .cc-main,
.course-card > .cc-bottom {
  position: relative;
  z-index: 1;
}
#course-list > .course-card:hover,
#search-results > .course-card:hover {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.course-card:hover > .stamp-shape {
  box-shadow: none;
  filter: drop-shadow(0 6px 10px rgba(36, 36, 34, 0.07));
}
.course-card > .cc-main > .cc-top {
  margin: -18px -20px 0;
  padding: 4px 20px;
  border-radius: 0;
}
.course-card .day-strip .day-box,
.course-card .day-strip:has(.day-box:nth-child(7)) .day-box,
.course-card .cc-days-row .time-chip {
  height: 22px;
}
.course-card .cc-days-row .time-chip {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  flex: 0 0 104px;
  box-sizing: border-box;
  justify-content: center;
}

.course-card .cc-enroll-inline.high .enroll-box.enroll-combo,
.course-card .cc-enroll-inline.high .enroll-box.count,
.course-card .cc-enroll-inline.high .enroll-box.pct {
  color: #b80b24;
}
.course-card .cc-enroll-inline.mid .enroll-box.enroll-combo,
.course-card .cc-enroll-inline.mid .enroll-box.count,
.course-card .cc-enroll-inline.mid .enroll-box.pct {
  color: #c48900;
}
.course-card .enroll-box.drop.high { color: #b80b24; }
.course-card .enroll-box.drop.mid { color: #cc7c05; }
.course-card .enroll-bar.high > span { background: #b80b24; }
.course-card .enroll-bar.mid > span { background: #f4bf3a; }

.course-card .enroll-bar {
  background: #ecece8;
}
.course-card .enroll-bar.low > span,
.course-card .enroll-bar.mid > span,
.course-card .enroll-bar.high > span {
  background: #20201e;
}
.course-card .enroll-box {
  border: 1.5px solid var(--sa-ink);
  border-radius: 5px;
  background: transparent;
}
.course-card .cc-enroll-inline .enroll-box.drop {
  width: 48px;
  min-width: 48px;
  padding-right: 4px;
  padding-left: 4px;
  box-sizing: border-box;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
#course-list .course-card .enroll-box.enroll-combo,
#search-results .course-card .enroll-box.enroll-combo,
.course-card .enroll-combo b,
.course-card .enroll-combo .enroll-capacity {
  color: var(--sa-ink);
}
.course-card .enroll-combo .enroll-combo-pct {
  border-left-color: var(--sa-ink);
}
.course-card .cc-enroll-inline.low .enroll-combo-pct { color: #168447; }
.course-card .cc-enroll-inline.mid .enroll-combo-pct { color: #c48900; }
.course-card .cc-enroll-inline.high .enroll-combo-pct { color: #b80b24; }

.floating-cta {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: max-content;
  max-width: calc(100vw - 28px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 56px;
  padding: 8px;
  border: 1.5px solid #8c8c85;
  border-radius: 4px;
  background: var(--sa-bg);
  color: #252522;
  box-shadow: 3px 4px 0 rgba(36, 36, 34, 0.12);
  font-family: var(--sa-font);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  transition: opacity 160ms ease, transform 160ms ease;
}
body[data-view]:not([data-view="browse"]) .floating-cta {
  display: none;
}
.floating-cta.is-dismissing {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
.floating-cta-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.floating-cta-choice {
  min-width: 82px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px 0 4px;
  border: 1.5px solid #8c8c85;
  border-radius: 4px;
  background: #fffefa;
  box-shadow: 1.5px 1.5px 0 rgba(36, 36, 34, 0.11);
  color: #252522;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.floating-cta-choice.is-later {
  padding-right: 8px;
  font-weight: 700;
}
.floating-cta-icon {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 2px;
  color: #fff;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}
.floating-cta-icon svg {
  width: 11px;
  height: 11px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floating-cta-choice.is-join .floating-cta-icon svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}
.floating-cta-choice.is-join .floating-cta-icon { background: #4169e1; }
.floating-cta-choice.is-later .floating-cta-icon { background: #d83a32; }
.floating-cta-choice:hover {
  box-shadow: 1px 1px 0 rgba(36, 36, 34, 0.18);
  transform: translate(2px, 2px);
}
.floating-cta-choice:focus-visible {
  outline: 2px solid #242422;
  outline-offset: 2px;
}
body.intro-running .floating-cta {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 640px) {
  .floating-cta {
    right: 12px;
    bottom: 12px;
    width: max-content;
    max-width: calc(100vw - 20px);
    gap: 6px;
    padding: 8px;
    font-size: 11px;
  }
  .floating-cta-actions { gap: 4px; }
  .floating-cta-choice { min-width: 78px; height: 34px; font-size: 11.5px; }
  .floating-cta-icon { width: 23px; height: 23px; flex-basis: 23px; font-size: 16px; }
}

/* Printable course-plan receipt */
.planner-head {
  align-items: flex-end;
}

.plan-receipt-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.plan-receipt-trigger svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receipt-preview {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.receipt-machine {
  position: relative;
  width: min(430px, 100%);
  padding-top: 18px;
  overflow: hidden;
  isolation: isolate;
}

.receipt-slot {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  width: min(300px, 76%);
  height: 18px;
  overflow: hidden;
  border: 2px solid #4b4b45;
  border-radius: 999px;
  background: #11110f;
  box-shadow:
    inset 0 5px 8px rgba(0, 0, 0, 0.96),
    0 4px 9px rgba(28, 28, 25, 0.16);
  transform: translateX(-50%);
}

.receipt-slot span {
  position: absolute;
  top: 6px;
  right: 18px;
  left: 18px;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 5px rgba(255, 250, 232, 0.5);
}

.receipt-output {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-bottom: 20px;
}

.receipt-sheet {
  position: relative;
  z-index: 1;
  width: min(374px, 100%);
  padding: 28px 24px 24px;
  border: 1px solid #c9c7be;
  background: #fffdf7;
  color: #20201e;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  line-height: 1.35;
  box-shadow: 0 18px 32px rgba(36, 36, 34, 0.14);
  animation: receipt-feed 880ms cubic-bezier(0.16, 0.78, 0.24, 1) both;
}

@keyframes receipt-feed {
  from {
    opacity: 0.75;
    transform: translateY(-72%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .receipt-sheet {
    animation: none;
  }
}

.receipt-brand {
  color: #20201e;
  font-family: var(--sa-font);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-align: center;
}

.receipt-title {
  margin: 6px 0 3px;
  color: #20201e;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-align: center;
}

.receipt-tagline {
  margin: 0;
  color: #65655f;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-align: center;
}

.receipt-rule {
  height: 1px;
  margin: 16px 0;
  background: #20201e;
}

.receipt-rule.dashed {
  height: 0;
  border-top: 1px dashed #20201e;
  background: transparent;
}

.receipt-meta {
  display: grid;
  gap: 8px;
}

.receipt-meta div,
.receipt-subtotal,
.receipt-totals div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.receipt-meta span,
.receipt-subtotal span,
.receipt-totals span,
.receipt-section-head span {
  color: #6d6d65;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.receipt-meta b,
.receipt-subtotal b,
.receipt-totals b {
  font-weight: 700;
  text-align: right;
}

.receipt-items {
  display: grid;
  gap: 18px;
}

.receipt-section {
  break-inside: avoid;
}

.receipt-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.receipt-section-head b {
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.receipt-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px dotted #b8b6ae;
}

.receipt-line > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.receipt-line b {
  font-size: 11px;
  font-weight: 700;
}

.receipt-line span {
  overflow-wrap: anywhere;
  color: #484841;
  font-size: 9.5px;
}

.receipt-line em {
  color: #20201e;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.receipt-subtotal {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #b8b6ae;
}

.receipt-totals {
  display: grid;
  gap: 8px;
}

.receipt-totals div:last-child {
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px solid #20201e;
  font-size: 12px;
}

.receipt-thanks {
  margin-top: 22px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.receipt-barcode {
  height: 34px;
  margin: 18px 10px 0;
  background: repeating-linear-gradient(
    90deg,
    #20201e 0 2px,
    transparent 2px 4px,
    #20201e 4px 5px,
    transparent 5px 8px,
    #20201e 8px 11px,
    transparent 11px 14px
  );
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.receipt-code {
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-align: center;
}

.receipt-fineprint {
  margin: 16px auto 0;
  max-width: 290px;
  color: #6d6d65;
  font-size: 8.5px;
  line-height: 1.45;
  text-align: center;
}

.receipt-preview-actions {
  position: sticky;
  bottom: -30px;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 0 2px;
  background: linear-gradient(180deg, rgba(243, 243, 240, 0), var(--sa-bg) 28%);
}

@media print {
  @page {
    margin: 10mm;
  }

  html,
  body {
    width: auto !important;
    min-width: 0 !important;
    background: #fff !important;
  }

  body > :not(#modal) {
    display: none !important;
  }

  #modal {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    background: #fff !important;
    backdrop-filter: none !important;
  }

  #modal > .modal {
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  #modal-close,
  .receipt-preview-actions {
    display: none !important;
  }

  #modal-body,
  .receipt-preview {
    display: block !important;
  }

  .receipt-machine {
    width: auto !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .receipt-output {
    display: block !important;
  }

  .receipt-sheet {
    width: 80mm;
    margin: 0 auto;
    padding: 4mm 3mm;
    border: 0;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none;
    animation: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .receipt-brand,
  .receipt-title,
  .receipt-line b,
  .receipt-line em,
  .receipt-totals b {
    color: #000 !important;
  }
}

/* Every navigation item draws the hand-ink circle on hover and keyboard focus */
.topbar .nav button:hover .nav-hand-ink,
.topbar .nav button:focus-visible .nav-hand-ink {
  opacity: 1;
}

.topbar .nav:has(button:hover) button.active:not(:hover) .nav-hand-ink,
.topbar .nav:has(button:focus-visible) button.active:not(:focus-visible) .nav-hand-ink {
  opacity: 0;
}

.topbar .nav button:hover .nav-ink-line,
.topbar .nav button:focus-visible .nav-ink-line {
  animation: nav-ink-draw 0.62s cubic-bezier(0.42, 0.02, 0.24, 1) both;
}

.topbar .nav button:hover .nav-ink-grain,
.topbar .nav button:focus-visible .nav-ink-grain {
  animation: nav-graphite-in 0.18s steps(3, end) 0.44s both;
}

@media (prefers-reduced-motion: reduce) {
  .topbar .nav button:hover .nav-ink-line,
  .topbar .nav button:focus-visible .nav-ink-line {
    animation: none;
    stroke-dashoffset: 0;
  }

  .topbar .nav button:hover .nav-ink-grain,
  .topbar .nav button:focus-visible .nav-ink-grain {
    animation: none;
    opacity: 0.18;
  }
}

/* Calendar focus mode, collapsible sidebar, and share/import code */
body[data-view="calendar"] .topbar-search {
  display: none !important;
}

html:has(body[data-view="calendar"]),
body[data-view="calendar"] {
  height: 100vh;
  overflow: hidden !important;
}

body[data-view="calendar"] main {
  padding-bottom: 0;
}

body[data-view="calendar"] .data-as-of {
  display: none;
}

.calendar-sidebar-tools {
  display: flex;
  align-items: stretch;
  padding: 0 0 8px;
  border-bottom: 1px solid #cfcfc9;
}

.calendar-sidebar-tools .calendar-text-btn {
  flex: 1;
  min-height: 27px;
  padding: 4px 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
}

.calendar-sidebar-tools .calendar-text-btn + .calendar-text-btn {
  border-left: 1px solid #cfcfc9;
}

.calendar-sidebar-tools .calendar-text-btn:hover {
  background: #deded8;
  color: var(--sa-ink);
}

@media (min-width: 981px) {
  .calendar-sidebar-toggle {
    display: grid !important;
  }

  body[data-view="calendar"] .calendar-app {
    height: calc(100vh - 108px);
  }

  .calendar-app {
    transition: grid-template-columns 220ms ease;
  }

  .calendar-app .calendar-sidebar {
    transition: transform 220ms ease, opacity 160ms ease, visibility 220ms;
  }

  .calendar-app.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .calendar-app.sidebar-collapsed .calendar-sidebar {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    border-right-color: transparent;
  }

  .calendar-app.sidebar-collapsed .calendar-main-panel {
    border-left: 0;
  }

  .calendar-app.sidebar-collapsed .calendar-sidebar-toggle svg {
    transform: scaleX(-1);
  }
}

.calendar-text-btn svg,
.calendar-sidebar-toggle svg {
  transition: transform 180ms ease;
}

.calendar-share-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--sa-line);
  border-radius: 999px;
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.calendar-share-field {
  gap: 7px !important;
}

.calendar-share-field textarea {
  min-height: 82px !important;
  resize: vertical;
  font-family: "Courier New", Courier, monospace !important;
  font-size: 11px !important;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#calendar-share-output {
  background: #eeeeea !important;
}

.calendar-copy-code {
  align-self: flex-start;
}

.calendar-copy-code.is-copied {
  border-color: var(--sa-green) !important;
  color: var(--sa-green) !important;
}

.calendar-share-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sa-ink-2);
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.calendar-share-divider::before,
.calendar-share-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--sa-line);
}

.calendar-share-note {
  margin: -3px 0 0;
  color: var(--sa-ink-2);
  font-size: 10px;
  line-height: 1.5;
}

.calendar-share-status {
  padding: 9px 11px;
  border: 1px solid rgba(48, 108, 77, .3);
  border-radius: 6px;
  background: rgba(48, 108, 77, .07);
  color: #265e43;
  font-size: 11px;
  line-height: 1.45;
}

.calendar-share-status.is-error {
  border-color: rgba(181, 62, 55, .32);
  background: rgba(181, 62, 55, .07);
  color: #8f2d2d;
}

.join-page {
  --join-navy: #4169e1;
  --join-navy-deep: #3156c9;
  --join-navy-soft: #4d72ea;
  --join-blue: #4169e1;
  --join-blue-bright: #4169e1;
  --join-paper: #fcfbf8;
  --join-paper-light: #f4f1ea;
  --join-paper-deep: #e1ddd4;
  --join-ink: #1e2024;
  --join-muted: #777a7e;
  --join-rule: #d5d3cf;
  --join-rule-light: rgba(238, 234, 226, .22);
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow-y: auto;
  background: rgba(9, 20, 39, .66);
  backdrop-filter: blur(8px) saturate(.82);
  -webkit-backdrop-filter: blur(8px) saturate(.82);
  color: var(--join-ink);
  font-family: var(--sa-font);
  scrollbar-color: #315a8d var(--join-navy-deep);
  scrollbar-width: thin;
}
.join-page::-webkit-scrollbar {
  width: 8px;
}
.join-page::-webkit-scrollbar-track {
  background: var(--join-navy-deep);
}
.join-page::-webkit-scrollbar-thumb {
  border: 2px solid var(--join-navy-deep);
  background: #315a8d;
}
body.join-page-open {
  overflow: hidden;
}
.join-layout {
  position: relative;
  isolation: isolate;
  width: min(1120px, calc(100vw - 96px));
  min-height: min(650px, calc(100vh - 64px));
  max-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
  overflow: hidden;
  border: 1px solid var(--join-paper-deep);
  background: var(--join-paper);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .34) inset,
    0 34px 100px rgba(0, 6, 22, .4);
}
.join-layout::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.34'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
  opacity: .045;
}
.join-layout::after {
  display: none;
}
.join-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 30px clamp(38px, 5vw, 68px) 34px;
  background-color: var(--join-paper);
  background-image:
    radial-gradient(circle at 10% 4%, rgba(255, 255, 255, .95), transparent 32%),
    radial-gradient(circle at 100% 100%, rgba(226, 221, 211, .2), transparent 36%),
    linear-gradient(118deg, rgba(255, 255, 255, .44), transparent 48%);
}
.join-content::after {
  display: none;
}
.join-brand {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  width: fit-content;
  color: var(--join-ink);
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.055em;
}
.join-copy {
  width: min(470px, 100%);
  margin: auto;
  text-align: center;
}
.join-close {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--join-muted);
  font: inherit;
  font-size: 12px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: color 160ms ease;
}
.join-close svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
.join-close:hover,
.join-close:focus-visible {
  color: var(--join-ink);
}
.join-close:focus-visible,
.join-submit:focus-visible,
.join-google-button:focus-visible {
  outline: 1px solid var(--join-blue-bright);
  outline-offset: 4px;
}
.join-form input:focus-visible,
.join-form textarea:focus-visible {
  border-color: var(--join-blue);
  box-shadow: 0 0 0 3px rgba(13, 72, 189, .1);
}
.join-copy h1 {
  max-width: none;
  margin: 0;
  font-family: var(--sa-font);
  font-size: clamp(27px, 2.6vw, 35px);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -.055em;
  white-space: nowrap;
}
.join-auth {
  margin-top: 27px;
}
.join-google-button {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid var(--join-rule);
  border-radius: 5px;
  background: #fff;
  color: #292b2e;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(22, 32, 52, .035);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.join-google-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.join-google-button:hover {
  border-color: #b9b8b5;
  box-shadow: 0 4px 12px rgba(22, 32, 52, .07);
}
.join-google-button:active {
  transform: translateY(1px);
}
.join-google-button:disabled {
  opacity: .58;
  cursor: wait;
}
.join-domain-note {
  margin: 11px 0 0;
  color: var(--join-muted);
  font-size: 9px;
  line-height: 1.5;
}
.join-domain-note b {
  color: var(--join-ink);
  font-weight: 500;
}
.join-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  width: 100%;
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid var(--join-rule);
}
.join-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
}
.join-form label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.join-form input,
.join-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--join-rule);
  border-radius: 5px;
  outline: 0;
  background: rgba(255, 255, 255, .82);
  color: var(--join-ink);
  font: inherit;
  font-size: 13px;
  resize: none;
}
.join-form input {
  height: 49px;
  padding: 0 15px;
}
.join-form textarea {
  min-height: 79px;
  padding: 13px 15px;
}
.join-form input::placeholder,
.join-form textarea::placeholder {
  color: rgba(23, 40, 70, .42);
}
.join-form input:focus,
.join-form textarea:focus {
  border-color: var(--join-blue);
}
.join-submit {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--join-navy);
  border-radius: 5px;
  background: var(--join-navy);
  color: var(--join-paper-light);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.join-submit svg {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}
.join-submit:hover {
  border-color: var(--join-navy-deep);
  background: var(--join-navy-deep);
}
.join-submit:active {
  transform: translateY(1px);
}
.join-status {
  max-width: 100%;
  margin: 13px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--join-rule);
  background: rgba(255, 255, 255, .58);
  color: #8f2d2d;
  font-size: 10px;
  line-height: 1.5;
  text-align: left;
}
.join-status.is-error {
  border-color: rgba(143, 45, 45, .32);
  background: rgba(181, 62, 55, .07);
  color: #8f2d2d;
}
.join-status.is-success {
  border-color: rgba(48, 108, 77, .3);
  background: rgba(48, 108, 77, .07);
  color: #265e43;
}
.join-status.is-info {
  border-color: rgba(35, 65, 112, .25);
  background: rgba(45, 70, 127, .055);
  color: #344f7c;
}
.join-art {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 0;
  border-left: 1px solid rgba(255, 255, 255, .16);
  background:
    radial-gradient(100% 76% at 80% 15%, rgba(105, 134, 190, .2), transparent 70%),
    linear-gradient(160deg, var(--join-navy-soft), var(--join-navy-deep));
}
.join-art::before {
  display: none;
}
.join-art-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 45%;
  filter: saturate(.94) contrast(1.015);
}
@media (max-width: 900px) {
  .join-page {
    padding: 0;
    background: var(--join-paper);
  }
  .join-layout {
    width: 100%;
    min-height: 100%;
    max-height: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto 230px;
    border: 0;
    box-shadow: none;
    background: var(--join-paper);
  }
  .join-content {
    min-height: 0;
    overflow: visible;
    padding: 26px clamp(24px, 8vw, 56px) 34px;
  }
  .join-copy h1 {
    max-width: 680px;
    font-size: clamp(22px, 5.4vw, 32px);
  }
  .join-art {
    display: flex;
    min-height: 230px;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, .16);
    border-left: 0;
  }
  .join-art-image {
    object-position: center 42%;
  }
}
@media (max-width: 560px) {
  .join-close {
    top: 18px;
    right: 18px;
  }
  .join-content {
    padding: 24px 20px 30px;
  }
  .join-copy h1 {
    font-size: clamp(21px, 5.8vw, 27px);
    letter-spacing: -.05em;
  }
  .join-form {
    grid-template-columns: 1fr;
    margin-top: 22px;
    gap: 10px;
  }
  .join-message-field,
  .join-submit,
  .join-privacy {
    grid-column: 1;
  }
}

/* Three-up course index with a proportional card scale */
#course-list,
#search-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#course-list > .course-card,
#search-results > .course-card {
  min-height: 224px;
  gap: 12px;
  padding: 22px 24px;
}

.course-card > .cc-main {
  gap: 12px;
}

.course-card > .cc-main > .cc-top {
  margin: -22px -24px 0;
  padding: 5px 24px;
}

.course-card .cc-title {
  padding-bottom: 9px;
  font-size: 19px;
  line-height: 1.28;
}

.course-card .cc-code,
.course-card .section-chip {
  font-size: 13px;
}

.course-card .cc-code-tags {
  gap: 11px;
}

.course-card .cc-code-row {
  margin-bottom: 7px;
}

.course-card .cc-meta {
  gap: 4px;
  justify-content: flex-start;
}

.course-card .cc-meta > .chip,
.course-card .cc-meta .instructor-pill,
.course-card .cc-meta .instructor-pill:hover,
.course-card .cc-meta .instructor-pill:active {
  height: 26px;
  padding-right: 9px;
  padding-left: 9px;
  font-size: 11.5px;
}

#course-list .course-card .day-strip .day-box,
#course-list .course-card .day-strip:has(.day-box:nth-child(7)) .day-box,
#search-results .course-card .day-strip .day-box,
#search-results .course-card .day-strip:has(.day-box:nth-child(7)) .day-box {
  width: 26px;
  min-width: 26px;
  flex-basis: 26px;
  height: 26px;
  border-width: 2px;
  font-size: 11.5px;
}

#course-list .course-card .cc-days-row .time-chip,
#search-results .course-card .cc-days-row .time-chip {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  height: 26px;
  flex-basis: 128px;
  font-size: 11.5px;
}

.course-card .day-strip {
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 2px;
}

#course-list .course-card .cc-days-row .time-chip,
#search-results .course-card .cc-days-row .time-chip {
  margin-left: auto;
}

.course-card .cc-bottom {
  gap: 10px;
}

.course-card .enroll-bar {
  height: 9px;
}

.course-card .enroll-box {
  height: 26px;
  padding-right: 8px;
  padding-left: 8px;
  border-width: 2px;
  font-size: 11.5px;
}

.course-card .enroll-combo .enroll-capacity {
  font-size: 11px;
}

.course-card .enroll-combo .enroll-capacity b {
  font-size: 12px;
}

.course-card .enroll-combo .enroll-combo-pct {
  font-size: 11.5px;
}

.course-card .cc-enroll-inline .enroll-box.drop {
  width: 58px;
  min-width: 58px;
}

.course-card .card-add {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.course-card .card-add svg {
  width: 18px;
  height: 18px;
}

.course-card .card-add-menu {
  min-width: 172px;
}

.course-card .card-add-menu button {
  padding: 10px 12px;
  font-size: 13.5px;
}

@media (max-width: 980px) {
  #course-list,
  #search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #course-list,
  #search-results {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #course-list > .course-card,
  #search-results > .course-card {
    padding-right: 20px;
    padding-left: 20px;
  }

  #course-list .course-card .day-strip .day-box,
  #course-list .course-card .day-strip:has(.day-box:nth-child(7)) .day-box,
  #search-results .course-card .day-strip .day-box,
  #search-results .course-card .day-strip:has(.day-box:nth-child(7)) .day-box {
    width: 24px;
    min-width: 24px;
    flex-basis: 24px;
    height: 24px;
  }

  #course-list .course-card .cc-days-row .time-chip,
  #search-results .course-card .cc-days-row .time-chip {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    flex-basis: 112px;
  }
}

.mobile-nav-toggle { display: none; }

/* Collapse navigation into a single header row on narrow screens. */
@media (max-width: 760px) {
  .topbar-meta-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px;
  }

  .topbar-meta-row > .topbar-term {
    grid-column: 1;
    justify-self: start;
  }

  .topbar-meta-row > .topbar-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .topbar-term .term-menu {
    left: 0;
    right: auto;
    max-height: min(340px, 65dvh);
    scrollbar-width: none;
    transform-origin: top left;
  }

  .mobile-nav-toggle {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 44px;
    padding: 0 3px;
    border: 0;
    background: transparent;
    color: var(--sa-ink);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
  }

  .topbar-term .term-menu::-webkit-scrollbar { display: none; }

  .mobile-nav-toggle span {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-toggle svg {
    flex: 0 0 13px;
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
  }

  .mobile-nav-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

  .topbar .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 4px;
    width: 100%;
    overflow: visible;
  }

  .mobile-nav-toggle[aria-expanded="true"] + .nav { display: grid; }

  .topbar .nav button {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 3px;
    font-size: clamp(12px, 2.8vw, 15px);
  }

  .topbar .nav button:not(:last-child)::after { content: none; }
  .topbar .nav .nav-label { display: inline-flex; }
  .topbar .nav button .nav-label .nav-hand-ink {
    left: -5px;
    width: calc(100% + 10px);
  }

  .topbar .topbar-icon,
  .topbar .nav-arrow { min-width: 32px; min-height: 44px; }

  .topbar-search .search {
    height: 44px;
    font-size: 16px;
  }

  .search-caret { display: none; }
  .filter-toggle { min-height: 44px; }
  .filter-panel { width: 100%; }
  .filter-panel .filter-dd-btn,
  .filter-panel-close { min-height: 44px; }
  .filter-panel .filter-dd-menu { max-height: min(270px, 45dvh); overflow-y: auto; }

  #course-list,
  #search-results { grid-template-columns: minmax(0, 1fr); }

  :is(#course-list, #search-results) > .course-card {
    min-width: 0;
    min-height: 0;
    padding: 16px;
  }

  :is(#course-list, #search-results) .course-card > .cc-main > .cc-top {
    margin: -16px -16px 0;
    padding-inline: 16px;
  }

  .course-card .cc-title {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .course-card .cc-code-row,
  .course-card .cc-meta,
  .course-card .cc-days-row { flex-wrap: wrap; }

  :is(#course-list, #search-results) .course-card .cc-days-row .time-chip {
    margin-left: auto;
    min-height: 32px;
  }

  .course-card .card-add { width: 44px; height: 44px; }
  .course-card .cc-bottom { min-width: 0; }
  .course-card .cc-enroll-inline { min-width: 0; flex-wrap: wrap; }

  .planner-head,
  .history-picker,
  .analysis-stat-controls { flex-wrap: wrap; }

  .planner-grid { grid-template-columns: minmax(0, 1fr); }
  .planner-grid > .card,
  #graph-input,
  .history-add .input { min-width: 0; max-width: 100%; }
  .graph-holder { max-width: 100%; overflow: auto; }

  .analysis-sort-block,
  .analysis-stat-controls .analysis-search {
    min-width: 0;
    max-width: 100%;
  }

  .analysis-stat-controls .analysis-search {
    flex: 1 1 100%;
    margin-left: 0;
  }

  html:has(body[data-view="calendar"]),
  body[data-view="calendar"] {
    height: auto;
    overflow-y: auto !important;
  }

  .calendar-app { min-height: 490px; height: calc(100dvh - 64px); }
  .calendar-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 6px 8px;
  }

  .calendar-period-nav { gap: 4px; }
  .calendar-range-block h1 {
    font-size: clamp(13px, 4vw, 17px);
    white-space: normal;
  }

  .calendar-toolbar-actions {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 2px;
  }

  .calendar-view-switch { flex: 1; }
  .calendar-view-switch button {
    flex: 1;
    min-width: 0;
    padding-inline: 5px;
  }

  .calendar-view-switch button,
  .calendar-today-btn,
  .calendar-arrow-group button,
  .calendar-toolbar-actions .calendar-icon-btn { min-height: 40px; }

  .calendar-main-panel { min-width: 0; }
  .calendar-engine { min-width: 0; overscroll-behavior-inline: contain; }

  .calendar-month-day { min-width: 0; padding-inline: 2px; }
  .calendar-month-grid { grid-auto-rows: minmax(72px, auto); }

  .campus-model-shell {
    height: clamp(360px, 67dvh, 680px);
    min-height: 0;
  }

  .campus-model-controls button { min-height: 36px; }
  .modal-close { min-width: 44px; min-height: 44px; }
  .modal-actions { flex-wrap: wrap; }

  .floating-cta {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    max-width: calc(100% - 20px);
  }

  .floating-cta-choice { min-height: 44px; }
  .data-as-of {
    position: static;
    width: fit-content;
    max-width: calc(100% - 28px);
    margin: 0 14px 16px auto;
    flex-wrap: wrap;
  }

  body:has(.floating-cta:not([hidden]))[data-view="browse"] .data-as-of {
    margin-bottom: 84px;
  }
}

@media (max-width: 375px) {
  .topbar { padding-inline: 8px; }
  .topbar-meta-row { gap: 2px; }
  .mobile-nav-toggle { gap: 2px; padding-inline: 0; font-size: 11px; }
  .mobile-nav-toggle svg { flex-basis: 10px; width: 10px; height: 10px; }

  :is(#course-list, #search-results) .course-card .cc-days-row .time-chip {
    margin-left: auto;
    margin-right: 0;
  }

  .floating-cta-choice { min-width: 0; }
}

/* Day view uses a single flexible date column at every width. */
.calendar-week-shell:not(:has(.calendar-day-head ~ .calendar-day-head)) {
  min-width: 0;
}

.calendar-week-shell:not(:has(.calendar-day-head ~ .calendar-day-head))
  :is(.calendar-week-head, .calendar-all-day-row, .calendar-week-body) {
  grid-template-columns: clamp(46px, 8vw, 62px) minmax(0, 1fr);
}
/* Connected white perforated course stamps. */
#course-list,
#search-results { gap: 0; }

:is(#course-list, #search-results) .course-card > .stamp-shape {
  background: #fff;
  -webkit-mask:
    radial-gradient(circle at 50% 0, transparent 3px, #000 3.5px) 0 0 / 12px 100% repeat-x,
    radial-gradient(circle at 50% 100%, transparent 3px, #000 3.5px) 0 0 / 12px 100% repeat-x,
    radial-gradient(circle at 0 50%, transparent 3px, #000 3.5px) 0 0 / 100% 12px repeat-y,
    radial-gradient(circle at 100% 50%, transparent 3px, #000 3.5px) 0 0 / 100% 12px repeat-y;
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle at 50% 0, transparent 3px, #000 3.5px) 0 0 / 12px 100% repeat-x,
    radial-gradient(circle at 50% 100%, transparent 3px, #000 3.5px) 0 0 / 12px 100% repeat-x,
    radial-gradient(circle at 0 50%, transparent 3px, #000 3.5px) 0 0 / 100% 12px repeat-y,
    radial-gradient(circle at 100% 50%, transparent 3px, #000 3.5px) 0 0 / 100% 12px repeat-y;
  mask-composite: intersect;
  filter: none;
}

:is(#course-list, #search-results) .course-card > .stamp-shape::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 0;
  background: radial-gradient(rgba(70,70,70,.025) .5px, transparent .8px) 0 0 / 4px 4px;
  border-radius: 0;
}

@media (max-width: 760px) {
  #course-list, #search-results { gap: 0; }
  :is(#course-list, #search-results) > .course-card { padding: 22px; }
  :is(#course-list, #search-results) .course-card > .cc-main > .cc-top {
    margin: -22px -22px 0;
    padding: 10px 22px 0;
  }
}

:is(#course-list, #search-results) > .course-card,
:is(#course-list, #search-results) > .course-card:hover {
  filter: drop-shadow(0 5px 6px rgba(36, 36, 34, .18));
}

:is(#course-list, #search-results) .cc-days-row .time-chip {
  margin-left: auto;
  margin-right: 0;
}
/* Compact course information while retaining touch-sized actions. */
:is(#course-list, #search-results) > .course-card {
  min-height: 0;
  gap: 7px;
  padding: 17px 22px;
}
:is(#course-list, #search-results) .course-card > .cc-main { gap: 7px; }
:is(#course-list, #search-results) .course-card .cc-title {
  padding-bottom: 5px;
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
}
:is(#course-list, #search-results) .course-card .cc-code-row { margin-bottom: 0; }
:is(#course-list, #search-results) .course-card .cc-meta { row-gap: 4px; }
:is(#course-list, #search-results) .course-card .cc-bottom { gap: 8px; }
@media (max-width: 760px) {
  :is(#course-list, #search-results) > .course-card { padding: 16px 20px; }
  :is(#course-list, #search-results) .course-card .cc-title { font-size: 18px; }
  :is(#course-list, #search-results) .course-card .cc-days-row { min-height: 32px; }
}

/* Monochrome ticket compartments. */
:is(#course-list, #search-results) > .course-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  gap: 0;
  padding: 12px;
  align-content: start;
}
:is(#course-list, #search-results) .course-card > .cc-main { display: contents; }
:is(#course-list, #search-results) .course-card .cc-code-row {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: stretch;
  margin: 0;
  padding: 10px 8px 10px 6px;
  border-right: 1px dashed #777;
  border-bottom: 1px solid #252525;
}
:is(#course-list, #search-results) .course-card .cc-code-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}
:is(#course-list, #search-results) .course-card .cc-code {
  white-space: normal;
  overflow: visible;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  color: #222;
  letter-spacing: 0;
}
:is(#course-list, #search-results) .course-card .section-chip {
  height: auto;
  padding: 0;
  white-space: normal;
  font-size: 10px;
  line-height: 1.5;
}
:is(#course-list, #search-results) .course-card .cc-title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 9px 10px 6px;
  border-bottom: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.2;
}
:is(#course-list, #search-results) .course-card .cc-meta {
  grid-column: 2;
  grid-row: 2;
  padding: 0 10px 9px;
  border-bottom: 1px solid #252525;
  gap: 4px 7px;
}
:is(#course-list, #search-results) .course-card .cc-meta > .chip,
:is(#course-list, #search-results) .course-card .cc-meta .instructor-pill {
  height: auto;
  min-height: 20px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font-size: 10px;
}
:is(#course-list, #search-results) .course-card .cc-meta .instructor-pill {
  max-width: 100%;
  flex-basis: 100%;
  justify-content: flex-start;
  text-align: left;
}
:is(#course-list, #search-results) .course-card .cc-days-row {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0;
  padding: 8px 4px;
  min-height: 44px;
  border-bottom: 1px solid #aaa;
  overflow: visible;
}
:is(#course-list, #search-results) .course-card .cc-bottom {
  grid-column: 1 / -1;
  grid-row: 4;
  margin: 0;
  padding: 6px 4px 2px;
  align-items: center;
}
:is(#course-list, #search-results) .course-card .course-data-lock {
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 9px;
}
:is(#course-list, #search-results) .course-card .card-add {
  width: 40px;
  height: 40px;
  border-radius: 0;
}
:is(#course-list, #search-results) .course-card .cc-reason {
  grid-column: 1 / -1;
  padding: 6px;
}
@media (max-width: 375px) {
  :is(#course-list, #search-results) > .course-card { grid-template-columns: 58px minmax(0, 1fr); }
  :is(#course-list, #search-results) .course-card .cc-title { font-size: 16px; }
}
:is(#course-list, #search-results) .course-card > .cc-main > * {
  position: relative;
  z-index: 1;
}

/* Fine paper and restrained letterpress details. */
:is(#course-list, #search-results) .course-card > .stamp-shape {
  background-color: #fefefd;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23555555' opacity='.055' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
:is(#course-list, #search-results) .course-card > .stamp-shape::before { content: none; }
:is(#course-list, #search-results) .course-card {
  color: #30302d;
}
:is(#course-list, #search-results) .course-card .cc-title {
  letter-spacing: -.035em;
  text-shadow: .25px .2px .35px rgba(20,20,18,.22);
}
:is(#course-list, #search-results) .course-card .cc-code-row {
  border-right-color: #99998f;
  border-bottom-color: #73736b;
}
:is(#course-list, #search-results) .course-card .cc-meta { border-bottom-color: #73736b; }
:is(#course-list, #search-results) .course-card .cc-days-row {
  padding-block: 5px;
  min-height: 34px;
  border-bottom: 1px dashed #b5b5ac;
}
:is(#course-list, #search-results) .course-card .day-strip .day-box,
:is(#course-list, #search-results) .course-card .day-strip:has(.day-box:nth-child(7)) .day-box {
  width: 20px;
  min-width: 20px;
  flex-basis: 20px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #aaa9a2;
  font-size: 10px;
}
:is(#course-list, #search-results) .course-card .day-strip .day-box.active {
  background: #373733;
  color: #fff;
}
:is(#course-list, #search-results) .course-card .cc-days-row .time-chip {
  width: auto;
  min-width: 0;
  max-width: none;
  flex: 0 1 auto;
  min-height: 26px;
  height: auto;
  padding: 3px 0 3px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #33332f;
  font-size: 11px;
  font-weight: 700;
}
:is(#course-list, #search-results) .course-card .cc-bottom { padding-block: 3px 0; }
:is(#course-list, #search-results) .course-card .course-data-lock {
  color: #81817a;
  font-weight: 400;
  font-size: 9px;
}
:is(#course-list, #search-results) .course-card .card-add {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border: 1px solid #85857b;
  border-radius: 50%;
  background: transparent;
  color: #45453e;
}
:is(#course-list, #search-results) .course-card .card-add svg { width: 14px; height: 14px; }
:is(#course-list, #search-results) .course-card .card-add:hover {
  background: #33332f;
  color: white;
}
:is(#course-list, #search-results) .course-card button:focus-visible {
  outline: 2px solid #333;
  outline-offset: 3px;
}
:is(#course-list, #search-results) .course-card .day-strip:has(.day-box:nth-child(7)) .day-box.active {
  background: #373733;
  color: #fff;
}

:is(#course-list, #search-results) .course-card > .stamp-shape::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(65, 65, 58, .65);
  background: transparent;
}

/* Ruled metadata cells inside the ticket information panel. */
:is(#course-list, #search-results) .course-card .cc-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr) auto;
  gap: 0;
  padding: 0;
  border-top: 1px solid #b5b5ac;
}
:is(#course-list, #search-results) .course-card .cc-meta > .chip,
:is(#course-list, #search-results) .course-card .cc-meta .instructor-pill {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  min-height: 30px;
  margin: 0;
  padding: 5px 7px;
  border-right: 1px solid #b5b5ac;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
}
:is(#course-list, #search-results) .course-card .cc-meta > :last-child { border-right: 0; }
:is(#course-list, #search-results) .course-card .cc-meta .instructor-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  :is(#course-list, #search-results) .course-card .cc-meta {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  :is(#course-list, #search-results) .course-card .cc-meta > :nth-child(2n) { border-right: 0; }
  :is(#course-list, #search-results) .course-card .cc-meta > :nth-child(n + 3) { border-top: 1px solid #b5b5ac; }
}

:is(#course-list, #search-results) .course-card .cc-meta {
  align-items: stretch;
}
:is(#course-list, #search-results) .course-card .cc-meta > .chip,
:is(#course-list, #search-results) .course-card .cc-meta .instructor-pill {
  height: auto;
  align-self: stretch;
  font-weight: 700;
}
/* Fixed ticket format; available width determines only the column count. */
#course-list,
#search-results {
  grid-template-columns: repeat(auto-fill, 394px);
  grid-auto-rows: 188px;
  justify-content: center;
  max-width: none;
  overflow-x: auto;
}
:is(#course-list, #search-results) > .course-card {
  box-sizing: border-box;
  width: 394px;
  height: 188px;
  min-height: 188px;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 40px 34px 34px;
  padding: 8px;
}
:is(#course-list, #search-results) .course-card .cc-title {
  font-size: 18px;
  max-height: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
:is(#course-list, #search-results) .course-card .cc-meta {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr) auto;
}
:is(#course-list, #search-results) .course-card .cc-meta > :nth-child(n) {
  border-top: 0;
  border-right: 1px solid #b5b5ac;
}
:is(#course-list, #search-results) .course-card .cc-meta > :last-child { border-right: 0; }
@media (max-width: 430px) {
  #course-list, #search-results {
    justify-content: start;
    grid-template-columns: 394px;
  }
}

/* Use the available space when only one standard ticket fits. */
@media (min-width: 431px) and (max-width: 827px) {
  #course-list, #search-results { grid-template-columns: minmax(0, 1fr); }
  :is(#course-list, #search-results) > .course-card { width: 394px; }
}

#course-list,
#search-results { max-width: 1182px; }

/* Integrated action cell in the ticket footer. */
:is(#course-list, #search-results) .course-card .cc-bottom {
  padding: 0;
  gap: 0;
  align-items: stretch;
}
:is(#course-list, #search-results) .course-card .course-data-lock {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  flex: 1;
}
:is(#course-list, #search-results) .course-card .card-add-wrap {
  display: flex;
  align-self: stretch;
  margin-left: auto;
  border-left: 1px solid #b5b5ac;
}
:is(#course-list, #search-results) .course-card .card-add {
  width: 38px;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

#course-list, #search-results {
  grid-auto-rows: calc(188px * var(--ticket-scale, 1));
}
:is(#course-list, #search-results) > .course-card {
  zoom: var(--ticket-scale, 1);
}
/* Barcode strokes encode occupied seats against deep-gray vacant seats. */
:is(#course-list, #search-results) .course-card .enroll-bar {
  height: 22px;
  min-width: 34px;
  margin: 0 6px;
  align-self: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: repeating-linear-gradient(to right,
    #b8b8b2 0 1px, transparent 1px 3px,
    #b8b8b2 3px 6px, transparent 6px 8px,
    #b8b8b2 8px 10px, transparent 10px 11px,
    #b8b8b2 11px 12px, transparent 12px 15px,
    #b8b8b2 15px 19px, transparent 19px 21px);
}
:is(#course-list, #search-results) .course-card .enroll-bar > span {
  display: block;
  height: 100%;
  border-radius: 0;
  background: repeating-linear-gradient(to right,
    #111 0 1px, transparent 1px 3px,
    #111 3px 6px, transparent 6px 8px,
    #111 8px 10px, transparent 10px 11px,
    #111 11px 12px, transparent 12px 15px,
    #111 15px 19px, transparent 19px 21px);
  transition: width .2s ease;
}

@media (max-width: 827px) {
  #course-list, #search-results { grid-template-columns: minmax(0, 1fr); }
}
:is(#course-list, #search-results) .course-card .cc-enroll-inline {
  flex: 0 1 auto;
  min-width: 0;
  gap: 3px;
}
:is(#course-list, #search-results) .course-card .cc-bottom .card-add-wrap {
  flex: 0 0 38px;
}

:is(#course-list, #search-results) .course-card .cc-title {
  display: grid;
  align-content: center;
  text-align: center;
  padding: 4px 10px;
}

/* Align the schedule divider with the instructor cell above. */
:is(#course-list, #search-results) .course-card .cc-meta {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr) 38px;
}
:is(#course-list, #search-results) .course-card .cc-meta > .chip {
  overflow: hidden;
  overflow-wrap: anywhere;
}
:is(#course-list, #search-results) .course-card .cc-days-row {
  display: grid;
  grid-template-columns: calc(72px + (100% - 110px) * .4375) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  align-items: stretch;
}
:is(#course-list, #search-results) .course-card .cc-days-row .day-strip {
  align-self: stretch;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  border-right: 1px solid #b5b5ac;
}
:is(#course-list, #search-results) .course-card .cc-days-row .time-chip {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 3px 6px;
  justify-content: center;
  text-align: center;
}

:is(#course-list, #search-results) .course-card .cc-meta .instructor-pill:hover,
:is(#course-list, #search-results) .course-card .cc-meta .instructor-pill:active {
  color: #30302d;
  background: rgba(40,40,35,.06);
}
:is(#course-list, #search-results) .course-card .cc-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 50px 38px;
  margin: 0 -4px -4px;
  padding: 0;
}
:is(#course-list, #search-results) .course-card .cc-bottom .cc-enroll-inline {
  display: contents;
}
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 3px 6px;
  border: 0;
  border-left: 1px solid #b5b5ac;
  border-radius: 0;
  background: transparent;
  color: #30302d;
  font-size: 10px;
}
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box.drop {
  width: auto;
  min-width: 0;
}
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-combo-pct {
  border: 0;
  margin-left: 4px;
  padding-left: 0;
  font-size: 9px;
}
:is(#course-list, #search-results) .course-card .cc-bottom .card-add-wrap {
  grid-column: 4;
  width: 38px;
  margin: 0;
}
:is(#course-list, #search-results) .course-card .course-data-lock {
  grid-column: 1 / 4;
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 3px 10px;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

:is(#course-list, #search-results) .course-card .cc-title {
  font-size: 16px;
  line-height: 1.25;
}

/* Explicitly place analytics cells so Drop never auto-flows behind Add. */
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-bar,
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-bar-spacer {
  grid-column: 1;
  grid-row: 1;
}
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-combo {
  grid-column: 2;
  grid-row: 1;
}
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box.drop {
  grid-column: 3;
  grid-row: 1;
  position: relative;
  z-index: 1;
  visibility: visible;
  opacity: 1;
  white-space: nowrap;
  overflow: visible;
  font-size: 10px;
}
:is(#course-list, #search-results) .course-card .cc-bottom .card-add-wrap,
:is(#course-list, #search-results) .course-card .cc-bottom .course-data-lock {
  grid-row: 1;
}

:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box.drop { color: #39764c; }
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box.drop.mid { color: #9c680b; }
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box.drop.high { color: #b12f35; }
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box.drop.up { color: #39764c; }
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box.drop.flat,
:is(#course-list, #search-results) .course-card .cc-bottom .enroll-box.drop.muted { color: #73736b; }

/* Keep the mobile header balanced and let ticket cards grow with the grid. */
.topbar .nav-arrow { display: none !important; }

@media (max-width: 760px) {
  .topbar-meta-row > .topbar-term {
    grid-column: 3;
    justify-self: end;
  }

  .topbar-meta-row > .topbar-actions {
    grid-column: 1;
    justify-self: start;
    flex-direction: row-reverse;
  }
}

@media (max-width: 560px) {
  .topbar-search .search { font-size: 13px; }
}

@media (max-width: 380px) {
  .topbar-search .search { font-size: 12px; }
}

main:has(> #view-browse:not([hidden])) {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding-inline: 12px;
  box-sizing: border-box;
}

#course-list,
#search-results {
  width: 100%;
  max-width: 1575px;
  margin-inline: auto;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(394px, 1fr));
  grid-auto-rows: calc(188px * var(--ticket-scale, 1));
  justify-content: center;
}

@media (max-width: 827px) {
  #course-list,
  #search-results { grid-template-columns: minmax(0, 1fr); }
}

/* Keep the course grid centered and its ticket titles slightly more compact. */
:is(#course-list, #search-results) .course-card .cc-title {
  font-size: 14px;
}

@media (max-width: 760px) {
  .topbar-meta-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .topbar-meta-row > .topbar-term { grid-column: 3; justify-self: end; }
  .topbar-meta-row > .topbar-term .term-menu-btn { font-weight: 700; }
  .topbar-meta-row > .mobile-nav-toggle { grid-column: 2; justify-self: center; width: 100%; font-size: 16px; }
  .topbar-meta-row > .topbar-actions { grid-column: 1; justify-self: start; flex-direction: row; }
  .topbar .topbar-icon { flex: 0 0 36px; width: 36px; height: 36px; min-width: 36px; min-height: 36px; aspect-ratio: 1; }
  .topbar-icon.is-user img { width: 100%; height: 100%; object-fit: cover; }
}

@media (max-width: 375px) {
  .topbar-meta-row > .mobile-nav-toggle { font-size: 14px; }
}

/* Collapse the full navigation before the top row runs out of room. */
@media (max-width: 1200px) {
  .topbar-meta-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .topbar-meta-row > .topbar-term { grid-column: 3; justify-self: end; }
  .topbar-meta-row > .topbar-term .term-menu-btn { font-weight: 700; }
  .topbar-meta-row > .topbar-actions { grid-column: 1; justify-self: start; }
  .topbar-meta-row > .mobile-nav-toggle {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 3px;
    border: 0;
    background: transparent;
    color: var(--sa-ink);
    font: inherit;
    font-size: 18px;
    cursor: pointer;
  }
  .mobile-nav-toggle span {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-nav-toggle svg {
    flex: 0 0 13px;
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
  }
  .topbar .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 4px;
    width: 100%;
    overflow: visible;
  }
  .mobile-nav-toggle[aria-expanded="true"] + .nav { display: grid; }
  .topbar .nav button {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding-inline: 3px;
    font-size: clamp(12px, 2vw, 15px);
  }
  .topbar .nav button:not(:last-child)::after { content: none; }
  .topbar .nav .nav-label { display: inline-flex; }
}

@media (max-width: 760px) {
  .search-head {
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 10px;
  }
  .search-head-row { flex: 0 0 auto; }
  .search-head h1 { font-size: 20px; line-height: 1.2; white-space: nowrap; }
  .search-summary {
    min-width: 0;
    flex-wrap: nowrap;
    gap: 4px;
    padding-left: 8px;
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
  }
  .search-count,
  .search-for,
  .search-query { font-size: 10px; }
  .search-count b { font-size: 11px; }
}

@media (max-width: 375px) {
  .search-head { gap: 6px; }
  .search-head h1 { font-size: 18px; }
  .search-summary { gap: 3px; padding-left: 6px; font-size: 9px; }
  .search-count,
  .search-for,
  .search-query { font-size: 9px; }
  .search-count b { font-size: 10px; }
}

:is(#course-list, #search-results) .course-card .cc-days-row {
  border-bottom-style: solid;
}

:is(#course-list, #search-results) .course-card .cc-code-row {
  border-right-style: solid;
}

:is(#course-list, #search-results) .course-card .cc-code-tags {
  padding-left: 3px;
}

body[data-view="browse"] .topbar,
body[data-view="search"] .topbar {
  max-width: 1600px;
  margin-inline: auto;
}

@media (min-width: 861px) {
  body[data-view="browse"] .topbar-search,
  body[data-view="search"] .topbar-search {
    margin-inline: -20px;
  }
}

@media (max-width: 720px) {
  .prof-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 62px;
    align-items: start;
    gap: 12px;
    padding: 18px 0 16px;
  }
  .prof-identity {
    min-width: 0;
    padding: 0;
  }
  .prof-department {
    max-width: 100%;
    font-size: 10px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .prof-identity h1 {
    font-size: clamp(26px, 6.2vw, 32px);
    overflow-wrap: anywhere;
  }
  .prof-identity-tags {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: start;
    gap: 5px 6px;
    margin-top: 8px;
    overflow: visible;
  }
  .prof-identity-tags span {
    font-size: 9px;
    padding: 3px 6px;
  }
  .prof-score {
    position: static;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    width: 58px;
    height: 58px;
    margin: 0;
  }
  .prof-score::before { inset: 5px; }
  .prof-score b { font-size: 20px; }
  .prof-score span,
  .prof-score small { font-size: 8px; }

  .prof-panel { padding: 12px 0; }
  .prof-radar-panel,
  .prof-course-panel { padding-left: 0; }
  .prof-panel-head { gap: 8px; margin-bottom: 8px; }
  .prof-panel-head h2 { font-size: 17px; }
  .prof-radar-chart {
    width: min(100%, 320px);
    max-width: 320px;
    margin: 0 auto;
  }

  .prof-course-bars { gap: 0; }
  .prof-course-bar-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    min-height: 0;
    padding: 9px 0;
  }
  .prof-course-bar-label {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    gap: 7px;
  }
  .prof-course-bar-label b {
    padding: 3px 7px;
    font-size: 11px;
  }
  .prof-course-bar-label strong { font-size: 12px; }
  .prof-course-bar-stat {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    text-align: left;
  }
  .prof-course-bar-stat .prof-stat-enrollment {
    justify-self: auto;
    font-size: 12px;
  }
  .prof-course-bar-stat .prof-stat-enrollment::after {
    content: " enrolled";
    color: var(--sa-ink-2);
    font-size: 9px;
    font-weight: 600;
  }
  .prof-course-bar-stat .prof-stat-term::after { content: " terms"; }
  .prof-course-bar-stat .prof-stat-drop::before { content: "drop "; }
  .prof-course-bar-stat span { font-size: 10px; }
  .prof-course-bar-track {
    grid-column: 1;
    grid-row: 3;
    height: 6px;
  }

  .prof-history { margin-top: 16px; }
  .prof-history > .prof-panel-head { padding: 12px 0 8px; }
  .prof-term-head { padding: 7px 0; }
  .prof-offering {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 5px 8px;
    padding: 8px 0;
  }
  .prof-offering-code {
    max-width: 100%;
    padding: 3px 6px;
    font-size: 10.5px;
  }
  .prof-offering-main b {
    font-size: 11.5px;
    line-height: 1.25;
  }
  .prof-offering-metric {
    text-align: left;
  }
  .prof-offering-metric b {
    margin-left: 0;
    font-size: 12px;
  }
  .prof-offering-metric:nth-last-child(2) b::after {
    content: " enrolled";
    color: var(--sa-ink-2);
    font-size: 9px;
    font-weight: 600;
  }
  .prof-offering-metric:last-child b::before {
    content: "drop ";
    font-size: 9px;
    font-weight: 600;
  }
  .prof-offering-metric:nth-last-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .prof-offering-metric:last-child {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 380px) {
  .prof-hero { grid-template-columns: minmax(0, 1fr) 50px; gap: 8px; }
  .prof-score { width: 48px; height: 48px; }
  .prof-score::before { inset: 4px; }
  .prof-score b { font-size: 17px; }
  .prof-identity h1 { font-size: 25px; }
  .prof-identity-tags { grid-template-columns: max-content; }
  .prof-course-bar-label { flex-wrap: wrap; }
}

/* Instructor profile: replace the pill-heavy presentation with simple type and rules. */
.prof-identity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 0;
  overflow: visible;
}
.prof-identity-tags span[class] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}
.prof-identity-tags span[class] + span[class]::before {
  content: "·";
  margin: 0 8px;
  color: #a09c92;
}

.prof-score {
  width: auto;
  height: auto;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  border-radius: 0;
  background: transparent;
}
.prof-score::before { display: none; }
.prof-score b {
  margin: 0;
  color: var(--sa-ink);
  font-size: 42px;
  line-height: 1;
}
.prof-score::after {
  content: "/ 100";
  color: var(--sa-ink-2);
  font-size: 11px;
}
.prof-score.is-unrated b { font-size: 26px; }

.prof-course-bar-label b {
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink-2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.prof-course-bar-label strong { font-size: 13px; }
.prof-course-bar-stat span {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 11px;
}
.prof-course-bar-stat .prof-stat-drop.stable { color: #26563a; }
.prof-course-bar-stat .prof-stat-drop.watch { color: #704a19; }
.prof-course-bar-stat .prof-stat-drop.risk { color: #7c372b; }
.prof-course-bar-stat .prof-stat-drop.pending { color: var(--sa-ink-2); }
.prof-course-bar-track { height: 5px; }

.prof-panel-head .prof-chart-key span {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 10px;
}
.prof-chart-key span { gap: 5px; }

.prof-term-head { border-bottom: 1px solid var(--sa-soft-line); }
.prof-offering-list { border-top: 0; }
.prof-offering {
  gap: 8px 14px;
  border-bottom: 1px solid var(--sa-soft-line);
}
.prof-offering-code {
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink-2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.prof-offering-metric b {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
  font-size: 12px;
}
.prof-offering-metric.warn b { color: #8b382c; }

@media (max-width: 720px) {
  .prof-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: 16px 0 14px;
  }
  .prof-identity { width: 100%; min-width: 0; padding: 0; }
  .prof-department { font-size: 10px; line-height: 1.35; }
  .prof-identity h1 { font-size: clamp(28px, 7vw, 34px); line-height: 1.1; }
  .prof-identity-tags { margin-top: 8px; }
  .prof-identity-tags span[class] { font-size: 10px; }
  .prof-score {
    position: static;
    width: auto;
    height: auto;
    display: flex;
    grid-column: auto;
    grid-row: auto;
    justify-content: flex-start;
    gap: 4px;
    margin: 2px 0 0;
  }
  .prof-score b { font-size: 20px; }
  .prof-score::after { content: "/ 100 · teaching score"; font-size: 10px; }
  .prof-score.is-unrated b { font-size: 18px; }

  .prof-course-bar-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 9px 0;
  }
  .prof-course-bar-label { gap: 7px; }
  .prof-course-bar-label strong { font-size: 12px; }
  .prof-course-bar-stat { gap: 9px; }
  .prof-course-bar-stat .prof-stat-enrollment { font-size: 12px; }
  .prof-course-bar-stat .prof-stat-enrollment::after,
  .prof-course-bar-stat .prof-stat-term::after,
  .prof-course-bar-stat .prof-stat-drop::before { font-size: 9px; }
  .prof-course-bar-track { height: 4px; }

  .prof-offering {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 10px;
    padding: 8px 0;
  }
  .prof-offering-code { font-size: 10px; }
  .prof-offering-main b { font-size: 11.5px; }
  .prof-offering-metric:nth-last-child(2) { grid-column: 1; grid-row: 2; }
  .prof-offering-metric:last-child { grid-column: 2; grid-row: 2; }
}

@media (max-width: 380px) {
  .prof-identity h1 { font-size: 26px; }
  .prof-identity-tags span[class] { font-size: 9.5px; }
  .prof-identity-tags span[class] + span[class]::before { margin-inline: 5px; }
  .prof-offering { grid-template-columns: minmax(0, 1fr) auto; }
}

/* Profile header: clear identity and a compact, rule-based stat grid. */
.prof-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 16px 24px;
  border-bottom: 0;
}
.prof-identity { grid-column: 1; grid-row: 1; min-width: 0; }
.prof-score {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: 112px;
  height: 112px;
  display: grid;
  align-content: center;
  justify-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, #e4a11d) calc(var(--score) * 1%), var(--sa-soft-line) 0);
}
.prof-score::before {
  content: "";
  position: absolute;
  display: block;
  inset: 7px;
  border-radius: inherit;
  background: var(--sa-bg);
}
.prof-score > * { position: relative; }
.prof-score b { font-size: 34px; }
.prof-score::after { content: none; }
.prof-score.is-unrated b { font-size: 22px; }

.prof-identity-tags {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--sa-line);
  border-bottom: 1px solid var(--sa-soft-line);
}
.prof-identity-tags span[class] {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 54px;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--sa-soft-line);
  border-radius: 0;
  background: transparent;
  color: var(--sa-ink);
}
.prof-identity-tags span[class]:last-child { border-right: 0; }
.prof-identity-tags span[class] + span[class]::before { content: none; margin: 0; }
.prof-identity-tags span[class] b {
  color: var(--sa-ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.prof-identity-tags span[class] small {
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.prof-radar-marker {
  fill: var(--sa-bg);
  stroke: #2f76bd;
  stroke-width: 2;
  pointer-events: none;
}
.prof-radar-axis-label,
.prof-radar-axis-score {
  font-family: var(--sa-font);
  pointer-events: none;
}
.prof-radar-axis-label {
  fill: var(--sa-ink-2);
  font-size: 14px;
  font-weight: 700;
}
.prof-radar-axis-score {
  fill: #1f5f9d;
  stroke: var(--sa-bg);
  stroke-width: 4px;
  paint-order: stroke;
  font-size: 20px;
  font-weight: 800;
}

/* Course history rows open a compact detail panel instead of showing metrics inline. */
.prof-offering {
  display: block;
  min-height: 0;
  padding: 0;
  border-bottom: 1px solid var(--sa-soft-line);
}
.prof-offering.current,
.prof-offering.current:hover { background: transparent; }
.prof-offering-summary {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 2px;
  cursor: pointer;
  list-style: none;
}
.prof-offering-summary::-webkit-details-marker { display: none; }
.prof-offering-summary::marker { content: ""; }
.prof-offering-summary:hover { background: color-mix(in srgb, var(--sa-green) 4%, transparent); }
.prof-offering-code { color: var(--sa-ink-2); font-variant-numeric: tabular-nums; }
.prof-offering-main { display: block; min-width: 0; }
.prof-offering-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-offering-chevron {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--sa-ink-2);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .15s ease;
}
.prof-offering[open] .prof-offering-chevron { transform: rotate(180deg); }
.prof-offering-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  padding: 4px 16px 12px 142px;
  border-left: 2px solid var(--sa-soft-line);
  margin: 0 0 8px 2px;
}
.prof-offering-detail {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--sa-soft-line);
}
.prof-offering-detail span {
  color: var(--sa-ink-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.prof-offering-detail b {
  justify-self: start;
  max-width: 100%;
  color: var(--sa-ink);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.prof-offering-detail b.warn { color: #8b382c; }
.prof-offering-detail.is-schedule { grid-column: 1 / -1; }
.prof-offering-details .prof-archive-link,
.prof-offering-open {
  align-self: center;
  justify-self: start;
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #235c89;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.prof-offering-open:hover,
.prof-offering-details .prof-archive-link:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .prof-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 12px 10px;
    padding: 16px 0 14px;
  }
  .prof-identity { grid-column: 1; grid-row: 1; width: auto; padding: 0; }
  .prof-identity h1 { font-size: clamp(26px, 6.8vw, 32px); line-height: 1.1; }
  .prof-department { max-width: 100%; font-size: 9px; line-height: 1.35; }
  .prof-score {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    width: 76px;
    height: 76px;
    justify-self: end;
    margin: 0;
  }
  .prof-score::before { inset: 5px; }
  .prof-score b { font-size: 25px; }
  .prof-score.is-unrated b { font-size: 18px; }
  .prof-identity-tags {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .prof-identity-tags span[class] {
    min-height: 48px;
    padding: 8px 12px;
  }
  .prof-identity-tags span[class]:nth-child(-n+4) { border-bottom: 1px solid var(--sa-soft-line); }
  .prof-identity-tags span[class]:nth-child(2n) { border-right: 0; }
  .prof-identity-tags span[class]:last-child:not(:nth-child(2n)) { border-right: 1px solid var(--sa-soft-line); }

  .prof-offering-summary {
    grid-template-columns: minmax(88px, 30%) minmax(0, 1fr) 15px;
    gap: 8px;
    min-height: 42px;
  }
  .prof-offering-details { padding: 4px 8px 12px 12px; }
}

@media (max-width: 380px) {
  .prof-hero { grid-template-columns: minmax(0, 1fr) 68px; gap: 10px 8px; }
  .prof-score { width: 64px; height: 64px; }
  .prof-score b { font-size: 21px; }
  .prof-identity-tags span[class] { padding-inline: 8px; }
  .prof-offering-summary { grid-template-columns: minmax(75px, 32%) minmax(0, 1fr) 14px; gap: 6px; }
}

.prof-term-head b { font-weight: 800; }

.prof-course-bars { gap: 7px; }
.prof-course-bar-row {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 4px;
  gap: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--sa-line);
}
.prof-course-bar-label {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0;
  min-height: 40px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--sa-soft-line);
}
.prof-course-bar-label b {
  justify-self: start;
  padding: 0 10px 0 0;
  border-right: 1px solid var(--sa-soft-line);
  color: var(--sa-ink-2);
}
.prof-course-bar-label strong {
  padding-left: 11px;
  font-size: 12px;
}
.prof-course-bar-stat {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: 1.2fr .8fr 1fr;
  gap: 0;
  text-align: left;
}
.prof-course-bar-stat > * {
  justify-self: stretch;
  align-self: stretch;
  padding: 7px 10px;
  border-right: 1px solid var(--sa-soft-line);
  text-align: left;
}
.prof-course-bar-stat > *:last-child { border-right: 0; }
.prof-course-bar-stat .prof-stat-enrollment { font-size: 12px; }
.prof-course-bar-stat .prof-stat-enrollment::after,
.prof-course-bar-stat .prof-stat-term::after,
.prof-course-bar-stat .prof-stat-drop::before { font-size: 9px; }
.prof-course-bar-stat .prof-stat-drop.stable { color: #26563a; }
.prof-course-bar-stat .prof-stat-drop.watch { color: #704a19; }
.prof-course-bar-stat .prof-stat-drop.risk { color: #7c372b; }
.prof-course-bar-stat .prof-stat-drop.pending { color: var(--sa-ink-2); }
.prof-course-bar-track {
  grid-column: 1;
  grid-row: 3;
  height: 4px;
}

@media (max-width: 380px) {
  .prof-course-bar-label { grid-template-columns: 100px minmax(0, 1fr); padding-inline: 7px; }
  .prof-course-bar-label strong { padding-left: 8px; }
  .prof-course-bar-stat > * { padding-inline: 7px; }
}

/* Instructor profile refinements: one even summary row and a score anchored radar popover. */
@property --score-progress {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
.prof-score {
  place-items: center;
  overflow: visible;
  background: conic-gradient(var(--ring-color, #e4a11d) var(--score-progress, 0%), var(--sa-soft-line) 0);
  animation: prof-score-fill .9s cubic-bezier(.2, .7, .2, 1) forwards;
  cursor: help;
  z-index: 2;
}
@keyframes prof-score-fill {
  from { --score-progress: 0%; }
  to { --score-progress: var(--score-target, 0%); }
}
.prof-score > b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  line-height: 1;
  text-align: center;
  z-index: 1;
}
.prof-score-popover {
  position: absolute;
  top: 100%;
  right: 0;
  display: block;
  width: min(240px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--sa-soft-line);
  background: var(--sa-bg);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  color: var(--sa-ink);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 20;
}
.prof-score:hover .prof-score-popover,
.prof-score:focus .prof-score-popover,
.prof-score:focus-within .prof-score-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.prof-score-popover .prof-radar-chart {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto;
}

.prof-identity-tags {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
  align-items: stretch;
}
.prof-identity-tags.has-review { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.prof-identity-tags span[class] {
  min-width: 0;
  min-height: 56px;
  padding: 7px 5px;
  border-bottom: 0;
  text-align: center;
}
.prof-identity-tags span[class]:nth-child(-n+4) { border-bottom: 0; }
.prof-identity-tags span[class]:nth-child(2n) { border-right: 1px solid var(--sa-soft-line); }
.prof-identity-tags span[class]:last-child { border-right: 0; }
.prof-identity-tags span[class] b {
  justify-self: center;
  font-size: clamp(12px, 2.8vw, 18px);
  white-space: nowrap;
}
.prof-identity-tags span[class] small {
  overflow: hidden;
  font-size: clamp(6px, 1.55vw, 8px);
  letter-spacing: 0;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .prof-score { animation: none; --score-progress: var(--score-target, 0%); }
  .prof-score-popover { transition: none; }
}
/* Center every course metric cell and remove tinted drop-rate badges. */
.prof-course-bar-stat > * {
  display: grid;
  place-items: center;
  min-width: 0;
  text-align: center;
}
.prof-course-bar-stat .prof-stat-drop.stable,
.prof-course-bar-stat .prof-stat-drop.watch,
.prof-course-bar-stat .prof-stat-drop.risk,
.prof-course-bar-stat .prof-stat-drop.pending {
  padding: 7px 10px;
  border: 0;
  border-right: 1px solid var(--sa-soft-line);
  border-radius: 0;
  background: transparent;
}
.prof-course-bar-stat > .prof-stat-drop:last-child { border-right: 0; }
/* Keep the compact header identity readable on narrow screens. */
.prof-dept-line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 4px;
}
.prof-dept-line .prof-department {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prof-department-more { position: relative; flex: 0 0 auto; }
.prof-department-more > summary {
  display: grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  padding: 0 5px;
  border-left: 1px solid var(--sa-soft-line);
  color: var(--sa-ink-2);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.prof-department-more > summary::-webkit-details-marker { display: none; }
.prof-department-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  min-width: min(220px, calc(100vw - 40px));
  padding: 3px 10px;
  border: 1px solid var(--sa-soft-line);
  background: var(--sa-bg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
}
.prof-department-menu span {
  padding: 7px 0;
  color: var(--sa-ink-2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}
.prof-department-menu span + span { border-top: 1px solid var(--sa-soft-line); }
@media (max-width: 760px) {
  .topbar .topbar-icon.is-user {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
  }
}
/* Keep enrolled, terms, and drop as three equal, clearly separated columns. */
.prof-course-bar-stat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prof-course-bar-stat > *,
.prof-course-bar-stat > span {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  min-width: 0;
  border-right: 1px solid var(--sa-soft-line);
  text-align: center;
}
.prof-course-bar-stat > span { justify-self: stretch; }
.prof-course-bar-stat > *:last-child,
.prof-course-bar-stat > span:last-child { border-right: 0; }

@media (max-width: 760px) {
  .prof-trend-panel .prof-panel-head h2 {
    font-size: 15px;
    line-height: 1.2;
  }
  .prof-trend-panel .prof-panel-head .prof-chart-key {
    flex: 0 0 auto;
    gap: 4px;
    font-size: 8px;
    white-space: nowrap;
  }
  .prof-trend-panel .prof-chart-key span {
    gap: 4px;
    padding: 2px 4px;
    font-size: 8px;
    white-space: nowrap;
  }
  .prof-trend-panel .prof-chart-key i { width: 9px; }
}
/* Keep each stat and its suffix on one centered line inside its equal column. */
.prof-course-bar-stat > b,
.prof-course-bar-stat > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}
.prof-course-bar-stat > span { border-right: 1px solid var(--sa-soft-line); }
.prof-course-bar-stat > span:last-child { border-right: 0; }

/* ------------------------------------------------------------
 * Mobile layout refinement
 * Keep controls reachable, remove avoidable truncation, and let
 * data-heavy pages use the full width of a phone.
 * ---------------------------------------------------------- */
@media (max-width: 760px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    min-height: 100dvh;
    overflow-x: hidden;
  }

  main {
    padding: 14px clamp(10px, 3.8vw, 16px)
      max(28px, calc(env(safe-area-inset-bottom) + 18px));
  }

  .topbar {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-inline: clamp(10px, 3.8vw, 16px);
  }

  .topbar-meta-row {
    grid-template-columns: 40px minmax(0, 1fr) max-content;
    column-gap: 8px;
    min-height: 52px;
  }

  .topbar-meta-row > .mobile-nav-toggle {
    gap: 6px;
    overflow: visible;
    font-size: clamp(14px, 3.8vw, 16px);
    letter-spacing: -.025em;
  }

  .topbar-meta-row > .mobile-nav-toggle span {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  .topbar-meta-row > .topbar-term .term-menu-btn {
    font-size: clamp(11px, 3.2vw, 13px);
  }

  .topbar-search {
    padding-inline: 0;
  }

  .topbar-search .search {
    height: 48px;
    font-size: 16px;
  }

  .filter-toggle {
    padding-inline: 8px;
    font-size: 13px;
  }

  #course-list,
  #search-results {
    padding-bottom: 20px;
  }

  :is(#course-list, #search-results) .course-card .cc-title {
    padding-inline: 8px;
    line-height: 1.22;
  }

  .calendar-view-switch button,
  .calendar-today-btn,
  .calendar-arrow-group button,
  .calendar-toolbar-actions .calendar-icon-btn {
    min-height: 44px;
  }

  .calendar-engine {
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .calendar-engine::-webkit-scrollbar {
    display: none;
  }

  .calendar-agenda-shell {
    padding: 12px 12px 28px;
  }

  .calendar-agenda-day {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
  }

  .calendar-agenda-event {
    grid-template-columns: 56px minmax(0, 1fr);
    min-height: 48px;
    gap: 6px;
    padding: 9px 10px;
  }

  .calendar-agenda-event small {
    display: none;
  }

  .calendar-agenda-event b {
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .campus-model-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(340px, 56svh) auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .campus-model-main {
    min-height: 0;
  }

  .campus-model-rail {
    display: flex;
    max-height: none;
    overflow: visible;
    padding: 16px;
    border-top: 2px solid var(--sa-line);
    border-left: 0;
  }

  .campus-model-rail-search {
    min-height: 44px;
  }

  .campus-model-rail-search input {
    font-size: 16px;
  }

  .campus-landmarks {
    max-height: none;
    overflow: visible;
  }

  .cal-list.campus-model-course-list {
    max-height: 250px;
  }

  .campus-model-links {
    margin-top: 4px;
  }
}

@media (max-width: 560px) {
  .rankings-toolbar {
    gap: 14px;
  }

  .rankings-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .rankings-search {
    width: 100%;
    height: 44px;
    font-size: 16px;
  }

  .rankings-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .rankings-modes button {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding-inline: 5px;
    font-size: 10px;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .rankings-hero h1 {
    font-size: 13.7vw;
    line-height: .88;
    letter-spacing: -.075em;
  }

  .rankings-stats b {
    font-size: 23px;
  }

  .calendar-agenda-event b {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.3;
  }
}

/* ------------------------------------------------------------
 * Phone usability pass
 * One page scroll per document, full-width inputs, safe-area
 * spacing, and bottom-sheet dialogs for touch devices.
 * ---------------------------------------------------------- */
@media (max-width: 760px) {
  body {
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  .topbar {
    padding-top: max(6px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  main {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(30px, calc(env(safe-area-inset-bottom) + 20px));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  #filter-panel {
    max-height: calc(100dvh - 132px - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* Let the instructor ranking use the page scrollbar instead of a tiny
     nested scroll area on phones. */
  .school-instructor-list {
    max-height: none;
    overflow: visible;
    scrollbar-width: auto;
  }

  .school-rank-row {
    min-height: 58px;
    padding-block: 8px;
  }

  .school-rank-person b {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .school-rank-more {
    position: static;
    padding-block: 14px;
  }

  /* Course tickets keep their desktop proportions, but labels no longer
     break into unnecessary extra lines in the narrow ticket stub. */
  :is(#course-list, #search-results) .course-card .section-chip {
    padding-inline: 4px;
    font-size: 8px;
    white-space: nowrap;
  }

  :is(#course-list, #search-results) .course-card .cc-code-tags {
    gap: 4px;
  }

  /* The week grid scrolls horizontally as one surface. Make that gesture
     discoverable without covering dates or events. */
  .calendar-app:has(.calendar-week-shell) .calendar-toolbar::after {
    content: "Swipe sideways to see the full week";
    grid-column: 1 / -1;
    color: var(--sa-ink-2);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .035em;
    line-height: 1.2;
  }

  .calendar-week-scroll {
    overscroll-behavior: contain;
    scroll-behavior: smooth;
  }

  .modal-backdrop,
  .account-backdrop {
    align-items: flex-end;
    padding:
      max(10px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .modal,
  .account-card {
    width: 100%;
    max-height: calc(100dvh - max(18px, env(safe-area-inset-top)));
    border-radius: 14px;
    overscroll-behavior: contain;
  }
}

@media (max-width: 430px) {
  .topbar-meta-row {
    column-gap: 4px;
  }

  .mobile-nav-toggle {
    font-size: 15px;
  }

  .rankings-toolbar {
    padding-top: 12px;
  }

  .rankings-hero {
    gap: 18px;
    padding-bottom: 22px;
  }

  .rankings-hero h1 {
    font-size: clamp(46px, 14vw, 56px);
  }

  .planner-head {
    gap: 12px;
  }

  .plan-receipt-trigger {
    min-height: 42px;
  }

  .campus-model-legend {
    gap: 8px 12px;
    padding-inline: 12px;
  }

  .modal,
  .account-card {
    padding: 22px 18px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 360px) {
  .course-card .cc-days-row {
    row-gap: 7px;
  }

  :is(#course-list, #search-results) .course-card .cc-days-row .time-chip {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-left: 0;
    flex-basis: 100%;
  }

  .calendar-view-switch button {
    font-size: 8px;
    padding-inline: 2px;
  }
}
