html.ds3 body > main.grade-explorer {
  --grade-ink: var(--fg-ink, #1f1f1f);
  --grade-muted: var(--fg-secondary, #6b6b6b);
  --grade-rule: var(--fg-line, #e8e8e8);
  --grade-wash: var(--fg-well, #f6f6f4);
  --grade-accent: var(--fg-ink, #1f1f1f);
  --grade-compare: var(--fg-secondary, #6b6b6b);
  --grade-a: #1b7f4c;
  --grade-b: #5f8f1f;
  --grade-c: #b27d00;
  --grade-d: #cc5f14;
  --grade-f: #bf2f2f;
  box-sizing: border-box;
  width: var(--fg-page, 1180px);
  max-width: calc(100% - 64px);
  margin-inline: auto;
  padding: 24px 0 64px;
  color: var(--grade-ink);
  font-family: Figtree, system-ui, sans-serif;
  line-height: 1.5;
}

.grade-explorer [hidden] { display: none !important; }
.grade-explorer a { color: var(--grade-accent); text-underline-offset: .18em; }
.grade-explorer :where(a, button, summary, input, select, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--grade-accent);
  outline-offset: 3px;
}

.grade-explorer h1,
.grade-explorer h2 { color: var(--grade-ink); letter-spacing: -.035em; line-height: 1.08; }
.grade-explorer h1 { margin: 0; font-size: var(--fg-t-h1, 1.625rem); font-weight: 700; }
.grade-explorer h2 { margin: 0 0 .5rem; font-size: var(--fg-t-h2, 1.25rem); font-weight: 700; }
.grade-explorer p { margin: 0 0 .75rem; }
.grade-explorer .grade-intro { margin-bottom: 1.4rem; }
.grade-explorer .grade-intro p { margin: .5rem 0 .3rem; font-size: clamp(1rem, 2.5vw, 1.125rem); }
.grade-explorer .grade-intro a { display: inline-block; padding-block: .375rem; font-weight: 600; }
.grade-explorer .grade-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.grade-controls { margin-bottom: .4rem; }
.grade-primary-filters,
.grade-secondary-filters { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); max-width: none; }
.grade-secondary-filters { align-items: end; padding: .25rem 0 1rem; }
.grade-field { display: grid; align-content: start; gap: .25rem; font-weight: 600; min-width: 0; }
.grade-explorer :where(input, select, button) { font: inherit; color: inherit; }
.grade-explorer :where(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  margin: 0;
  padding: .48rem .65rem;
  border: 1px solid #d4d4d4;
  border-radius: .375rem;
  background: #fff;
  font-size: 1rem;
  font-weight: 500;
}
.grade-explorer select { padding-inline-end: .375rem; }
.grade-explorer input::placeholder { color: var(--grade-muted); }
.grade-lookup { position: relative; }
.grade-suggestions {
  position: absolute;
  z-index: 5;
  inset-block-start: calc(100% + .25rem);
  inset-inline-start: 0;
  width: min(28rem, calc(100vw - 2.25rem));
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: .375rem;
}
.grade-secondary-filters .grade-suggestions { inset-inline: auto 0; }
.grade-explorer .grade-suggestions p { margin: 0; padding: .55rem .7rem; color: var(--grade-muted); font-size: .875rem; font-weight: 500; }
.grade-suggestions ul,
.grade-plot ol { list-style: none; padding: 0; margin: 0; }
.grade-suggestions li { margin: 0; border-top: 1px solid var(--grade-rule); }
.grade-suggestions button {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0;
  padding: .55rem .7rem;
  background: #fff;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
}
.grade-suggestions button:hover,
.grade-suggestions button:focus-visible { background: var(--grade-wash); }
.grade-suggestions button:focus-visible { outline-offset: -3px; }
.grade-suggestions strong { margin-inline-end: .2rem; }
.grade-explorer summary { box-sizing: border-box; min-height: 2.75rem; padding-block: .65rem; color: var(--grade-accent); font-weight: 600; cursor: pointer; }
.grade-explorer .grade-text-button { justify-self: start; padding: .3rem 0; border: 0; background: transparent; color: var(--grade-accent); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }

.grade-distribution,
.grade-section { border-top: 1px solid var(--grade-rule); padding-block: clamp(1.15rem, 3vw, 1.85rem); }
.grade-explorer .grade-course-title { margin: .25rem 0 0; font-size: clamp(1.125rem, 2.7vw, 1.5rem); line-height: 1.2; }
.grade-course-title strong { margin-inline-end: .2rem; }
.grade-explorer .grade-result-term { color: var(--grade-muted); margin: .2rem 0 .5rem; }
.grade-explorer .grade-coverage { max-width: 58ch; margin: 0 0 .35rem; color: var(--grade-muted); font-size: 1rem; }
.grade-explorer .grade-average { display: block; margin-block: .15rem .35rem; font-size: 1rem; }
.grade-average strong { margin-inline-start: .2rem; font-variant-numeric: tabular-nums; }
.grade-notice { color: var(--grade-muted); padding: .65rem .8rem; border-inline-start: 3px solid #d4d4d4; background: var(--grade-wash); }
.grade-notice strong { color: var(--grade-ink); }
.grade-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .875rem; margin-block: .7rem .3rem; }
.grade-legend span { display: inline-flex; align-items: center; gap: .375rem; }
.grade-legend i { width: .65rem; height: 1.25rem; background: var(--grade-accent); }
.grade-legend span:nth-child(2) i { background: var(--grade-compare); }
.grade-plot { --grade-value-width: 6.5rem; margin: .6rem 0 .65rem; }
.grade-plot-axis { display: flex; justify-content: space-between; margin-inline: 1.65rem calc(var(--grade-value-width) + .65rem); color: var(--grade-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.grade-plot li { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr); gap: .5rem; align-items: center; margin: 0; }
.grade-plot-measure { display: grid; grid-template-columns: minmax(0, 1fr) var(--grade-value-width); align-items: center; gap: .65rem; min-height: 2.6rem; }
.grade-plot-track { display: block; height: 1.25rem; background: var(--grade-wash); border-radius: .1rem; }
.grade-plot-track > span { display: block; height: 100%; background: var(--grade-accent); border-radius: .1rem; }
.grade-plot-comparison .grade-plot-track > span { background: var(--grade-compare); }
.grade-plot-value { text-align: end; font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grade-explorer .grade-compare-coverage { margin: .7rem 0 .35rem; padding-top: .7rem; border-top: 1px solid var(--grade-rule); }
.grade-raw p,
.grade-section p { max-width: 66ch; color: var(--grade-muted); }
.grade-table-scroll { overflow-x: auto; }
.grade-explorer table { border-collapse: collapse; width: 100%; margin: 0 0 .3rem; font-size: 0.875rem; }
.grade-explorer :where(th, td) {
  padding: .54rem .5rem;
  border-bottom: 1px solid var(--grade-rule);
  color: var(--grade-ink);
  text-align: start;
  vertical-align: top;
}
.grade-explorer :where(th, td):first-child { padding-inline-start: 0; }
.grade-explorer thead th { color: var(--grade-muted); font-size: 0.875rem; font-weight: 700; }
.grade-explorer td { font-variant-numeric: tabular-nums; }
.grade-raw table { white-space: nowrap; }
.grade-current-term { background: var(--grade-wash); }
.grade-explorer tr.grade-current-term th { padding-inline-start: .5rem; }
.grade-course-links,
.grade-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.grade-course-links a { padding-block: .45rem; font-weight: 600; }
.grade-actions { margin-top: .55rem; }
.grade-actions button { min-height: 2.75rem; padding: .45rem .7rem; border: 1px solid #d4d4d4; border-radius: .375rem; background: #fff; color: var(--grade-accent); font-weight: 600; cursor: pointer; }
.grade-actions button:hover { background: var(--grade-wash); }
.grade-explorer .grade-actions p { margin: 0; color: var(--grade-muted); }
.grade-actions p:empty { display: none; }
.grade-actions .grade-field { width: 100%; }
.grade-source { padding-bottom: 0; }

@media (max-width: 36rem) {
  .grade-explorer .grade-intro { margin-bottom: .9rem; }
  .grade-explorer .grade-intro a { padding-block: .2rem; }
  .grade-primary-filters { gap: .65rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .grade-secondary-filters { grid-template-columns: 1fr; gap: .5rem; }
  .grade-secondary-filters .grade-suggestions { inset-inline: 0 auto; }
  .grade-explorer .grade-result-term { font-size: 1rem; }
  .grade-plot { --grade-value-width: 5rem; }
  .grade-plot-value { font-size: 0.875rem; }
  .grade-explorer :where(th, td) { padding-inline: .35rem; }
  .grade-actions { gap: .4rem .55rem; }
  .grade-actions button { font-size: .875rem; }
}

/* Keep the explorer on the native DS3 scale and flat ledger surfaces. */
.grade-explorer .grade-intro p { font-size: 1rem; }
.grade-explorer .grade-distribution { padding-top: 1rem; }
.grade-explorer .grade-plot { margin-block: 1.25rem; }
.grade-explorer .grade-plot li > strong { font-size: 1.125rem; }
.grade-explorer .grade-plot-track { border-radius: 0; background: #f2f2f2; }
.grade-explorer .grade-plot-track > span { border-radius: 0; }
.grade-explorer .grade-coverage-details { margin-block: .25rem .5rem; }
.grade-explorer .grade-coverage-details summary { min-height: 0; padding-block: .25rem; font-size: .875rem; }
.grade-explorer .grade-view-links { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--grade-rule); margin-block: .5rem 0; }
.grade-explorer .grade-view-links a { padding-block: .75rem; font-weight: 600; text-decoration: none; }
.grade-explorer .grade-view-links a[aria-selected="true"] { border-bottom: 2px solid var(--grade-ink); color: var(--grade-ink); }
@media (min-width: 48rem) { .grade-explorer { padding-block-start: 2rem; } }

.grade-explorer .grade-answer { margin: 18px 0 6px; max-width: 62ch; color: var(--grade-ink); font-size: clamp(1.0625rem, 2.4vw, 1.25rem); font-weight: 500; line-height: 1.4; letter-spacing: -.01em; }
.grade-selection-heading { display:flex; justify-content:space-between; align-items:start; gap:24px; margin:8px 0 12px; }
.grade-selection-heading h2 span { font-weight:400; }
.grade-selection-heading .grade-average { flex-shrink:0; max-width:24rem; margin:0; font-size:14px; color:var(--grade-muted); text-align:right; }
.grade-selection-heading .grade-average strong { display:block; margin:2px 0; font-size:24px; color:var(--grade-ink); font-variant-numeric:tabular-nums; }
.grade-selection-heading .grade-average small { display:block; font-size:12px; line-height:1.35; }
.grade-explorer .grade-result-term { margin-top:8px; font-size:14px; }
.grade-explorer .grade-coverage { max-width:72ch; margin-bottom:0; font-size:14px; }

.grade-explorer .grade-fill { display:block; min-height:1px; border-radius:2px; background:var(--grade-ink); }
.grade-explorer .g-a { background:var(--grade-a); }
.grade-explorer .g-b { background:var(--grade-b); }
.grade-explorer .g-c { background:var(--grade-c); }
.grade-explorer .g-d { background:var(--grade-d); }
.grade-explorer .g-f { background:var(--grade-f); }

.grade-histogram { display:flex; gap:18px; margin:18px 0 20px; padding:48px 24px 20px; border:1px solid var(--grade-rule); border-radius:var(--fg-r-card,12px); }
.grade-histogram-axis { display:flex; flex-direction:column; justify-content:space-between; height:150px; width:30px; flex-shrink:0; font-size:12px; color:var(--grade-muted); }
.grade-histogram-plot { position:relative; flex:1; min-width:0; }
.grade-histogram ol { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:0; width:100%; padding:0; margin:0; list-style:none; }
.grade-histogram li { padding-inline:14px; text-align:center; min-width:0; }
.grade-histogram-column { height:150px; border-bottom:1px solid var(--grade-rule); display:flex; align-items:end; }
.grade-histogram-column>.grade-fill { position:relative; width:100%; max-width:100px; margin-inline:auto; border-radius:3px 3px 0 0; }
.grade-histogram-column b { position:absolute; z-index:3; bottom:calc(100% + 6px); left:50%; transform:translateX(-50%); padding-inline:3px; background:#fff; font-size:14px; font-weight:600; white-space:nowrap; }
.grade-histogram li>strong { display:block; margin-top:9px; font-size:20px; }
.grade-histogram-count { display:block; margin-top:4px; font-size:12px; color:var(--grade-muted); white-space:nowrap; }
.grade-avg-marker { position:absolute; z-index:2; top:-10px; left:var(--pos); width:2px; height:160px; margin-left:-1px; background:var(--grade-ink); box-shadow:0 0 0 1px #fff; pointer-events:none; }
.grade-avg-marker>span { position:absolute; bottom:100%; left:50%; margin-bottom:5px; padding:2px 9px; border:1px solid var(--grade-ink); border-radius:999px; background:#fff; color:var(--grade-ink); font-size:13px; font-weight:600; line-height:1.4; white-space:nowrap; transform:translateX(-50%); }
.grade-avg-marker[data-side="start"]>span { transform:translateX(-14px); }
.grade-avg-marker[data-side="end"]>span { transform:translateX(calc(-100% + 14px)); }

.grade-explorer .grade-course-links { display:flex; flex-wrap:wrap; gap:10px; margin:4px 0 8px; }
.grade-explorer a.grade-button { display:inline-flex; align-items:center; box-sizing:border-box; min-height:44px; padding:0 16px; border:1px solid #d4d4d4; border-radius:.375rem; background:#fff; color:var(--grade-ink); font-weight:600; text-decoration:none; }
.grade-explorer a.grade-button:hover { background:var(--grade-wash); }
.grade-explorer a.grade-button.is-primary { border-color:var(--grade-ink); background:var(--grade-ink); color:#fff; }
.grade-explorer a.grade-button.is-primary:hover { background:#3a3a3a; }

.grade-explorer .grade-recent { margin:22px 0 6px; }
.grade-explorer .grade-recent h3 { margin:0 0 10px; color:var(--grade-muted); font-size:14px; font-weight:600; }
.grade-recent ol { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:0; padding:0; list-style:none; }
.grade-recent li { min-width:0; margin:0; }
.grade-explorer .grade-recent a { display:grid; gap:8px; box-sizing:border-box; height:100%; padding:12px; border:1px solid var(--grade-rule); border-radius:var(--fg-r-card,12px); color:var(--grade-ink); text-decoration:none; }
.grade-explorer .grade-recent a:hover { background:var(--grade-wash); }
.grade-explorer .grade-recent a[aria-current="true"] { border-color:var(--grade-ink); box-shadow:inset 0 0 0 1px var(--grade-ink); }
.grade-recent-term { font-size:14px; font-weight:600; }
.grade-recent-bars { display:flex; align-items:flex-end; gap:4px; height:56px; border-bottom:1px solid var(--grade-rule); }
.grade-recent-bars .grade-fill { flex:1; border-radius:2px 2px 0 0; }
.grade-recent-values { color:var(--grade-muted); font-size:12px; font-variant-numeric:tabular-nums; }

.grade-explorer .grade-raw { margin-top:18px; border-top:1px solid var(--grade-rule); }
.grade-explorer .grade-raw>summary { min-height:44px; padding-block:12px; }
.grade-explorer .grade-footnote { margin:.55rem 0 0; font-size:.8125rem; line-height:1.45; }
.grade-section-kind { display:block; color:var(--grade-muted); font-size:12px; font-weight:500; white-space:nowrap; }
.grade-explorer .grade-section-note { margin:0 0 .5rem; }

.grade-bars { margin:18px 0 0; }
.grade-bars ol { display:grid; gap:20px; margin:0; padding:0; list-style:none; }
.grade-bar-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:2px 12px; margin-bottom:6px; }
.grade-bar-head a { font-weight:600; }
.grade-explorer .grade-bar-head span { color:var(--grade-muted); font-size:13px; }
.grade-bar-row { display:grid; grid-template-columns:1rem minmax(0,1fr) 3.5rem; gap:8px; align-items:center; min-height:22px; font-variant-numeric:tabular-nums; }
.grade-bar-key { color:var(--grade-muted); font-size:12px; font-weight:600; }
.grade-bar-track { position:relative; display:block; height:16px; background:#f2f2f2; }
.grade-bar-track>.grade-fill { height:100%; border-radius:0 2px 2px 0; }
.grade-bar-row b { font-size:14px; text-align:end; }
.grade-bar-row.is-f { min-height:12px; margin-top:3px; }
.grade-bar-row.is-f .grade-bar-track { height:6px; }
.grade-bar-row.is-f b { color:var(--grade-muted); font-size:12px; font-weight:600; }
.grade-bar-ref { position:absolute; top:-4px; bottom:-4px; width:0; border-left:2px dashed var(--grade-ink); }
.grade-bars figcaption,
.grade-trend figcaption { margin-top:16px; color:var(--grade-muted); font-size:13px; line-height:1.45; }

.grade-trend { display:grid; grid-template-columns:2.4rem minmax(0,1fr); column-gap:6px; margin:18px 0 0; padding:20px 16px 16px; border:1px solid var(--grade-rule); border-radius:var(--fg-r-card,12px); }
.grade-trend figcaption { grid-column:1 / -1; }
.grade-trend-gutter,
.grade-trend a { display:grid; grid-template-rows:20px 110px 34px 30px 20px; }
.grade-trend-gutter { color:var(--grade-muted); font-size:11px; text-align:end; }
.grade-trend-ticks { display:flex; flex-direction:column; justify-content:space-between; grid-row:2; }
.grade-trend-fkey { grid-row:4; align-self:end; }
.grade-trend ol { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:4px; margin:0; padding:0; list-style:none; }
.grade-trend li { min-width:0; }
.grade-explorer .grade-trend a { justify-items:center; height:100%; border-radius:6px; color:var(--grade-ink); text-decoration:none; }
.grade-explorer .grade-trend a:hover { background:var(--grade-wash); }
.grade-trend li.is-current a { background:var(--grade-wash); box-shadow:inset 0 0 0 1px #d4d4d4; }
.grade-trend-value { align-self:end; font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; line-height:1.2; }
.grade-trend-value.is-f { align-self:start; color:var(--grade-muted); font-size:11px; padding-top:2px; }
.grade-trend-plot,
.grade-trend-fplot { display:flex; align-items:flex-end; justify-content:center; box-sizing:border-box; width:100%; }
.grade-trend-plot { height:110px; border-bottom:1px solid var(--grade-rule); }
.grade-trend-fplot { height:30px; }
.grade-trend-plot>.grade-fill,
.grade-trend-fplot>.grade-fill { width:min(70%,34px); border-radius:3px 3px 0 0; }
.grade-trend-fplot>.grade-fill { width:min(40%,20px); }
.grade-trend-term { display:grid; align-content:center; font-size:12px; line-height:1.25; text-align:center; }
.grade-trend-term span:first-child { font-weight:600; }
.grade-trend-term span:last-child:not(:first-child) { color:var(--grade-muted); }
.grade-hollow { display:block; box-sizing:border-box; width:14px; height:14px; margin-bottom:8px; border:2px solid var(--grade-muted); border-radius:50%; background:#fff; }
.grade-trend-value:not(.is-f):is(:first-child) { color:var(--grade-ink); }

@media(max-width:760px) {
 html.ds3 body>main.grade-explorer { width:calc(100% - 32px); max-width:none; padding-top:20px; }
 .grade-explorer .grade-intro { margin-bottom:20px; }
 .grade-explorer .grade-intro p { font-size:14px; }
 .grade-selection-heading { flex-direction:column; gap:10px; }
 .grade-selection-heading .grade-average { max-width:none; text-align:start; }
 .grade-selection-heading .grade-average strong { font-size:22px; white-space:nowrap; }
 .grade-histogram { gap:8px; margin:12px 0 16px; padding:46px 12px 14px; }
 .grade-histogram li { padding-inline:5px; }
 .grade-histogram-axis { width:23px; font-size:10px; }
 .grade-histogram-count { font-size:10px; white-space:normal; }
 .grade-histogram-column b { font-size:12px; }
 .grade-histogram li>strong { font-size:18px; }
 .grade-explorer .grade-view-links { gap:22px; }
 .grade-explorer .grade-view-links a { font-size:14px; }
 .grade-explorer .grade-course-links { flex-direction:column; align-items:stretch; gap:8px; }
 .grade-explorer a.grade-button { justify-content:center; }
 .grade-recent ol { gap:8px; }
 .grade-explorer .grade-recent a { padding:10px 8px; }
 .grade-recent-bars { height:44px; gap:3px; }
 .grade-recent-values { font-size:11px; }
 .grade-trend { grid-template-columns:minmax(0,1fr); padding:16px 10px 14px; }
 .grade-trend-gutter { display:none; }
 .grade-trend ol { gap:2px; }
 .grade-trend-value { font-size:11px; }
}
@media(prefers-reduced-motion:no-preference) {
 .grade-explorer .grade-fill { transition:height .25s ease, width .25s ease; }
}
