/* Public catalog styles. Brand colors arrive as CSS variables from the page head. */
:root {
  --brand: #0f4c81; --brand-ink: #0b3a63; --brand-soft: #e8f0f8; --accent: #e8a33d; --accent-ink: #111;
  --bg: #f6f7f9; --card: #fff; --ink: #1c2430; --muted: #566273; --line: #e2e6eb;
  --ok: #1f7a46; --warn: #8a5a12; --bad: #b42318;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.serif { font-family: var(--serif); font-weight: 700; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-ink); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.pad { padding-top: 24px; padding-bottom: 40px; }
.tight-top { padding-top: 0; }
.narrow { max-width: 900px; }
.meta { color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); padding: 24px 0; }
.lede { font-size: 1.12rem; max-width: 760px; }

/* Header */
.ed-banner { background: #fff4e0; color: #5c3b06; padding: 8px 16px; text-align: center; font-size: .92rem; border-bottom: 1px solid #f1d7a8; }
.ed-banner.draft { background: #fdecea; color: #7a1d14; border-color: #f4c7c1; }
.topbar { background: var(--brand-ink); color: #dbe7f3; font-size: .82rem; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }
header.site { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
header.site .wrap { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.08rem; color: #fff; text-decoration: none; min-width: 0; }
.logo:hover { color: #fff; }
.logo .mark { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.logo-img { max-height: 44px; width: auto; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
nav.main a { color: #e7f0f8; text-decoration: none; padding: 7px 11px; border-radius: 8px; font-size: .95rem; }
nav.main a:hover, nav.main a[aria-current="page"] { background: rgba(255,255,255,.16); color: #fff; }
.hsearch { display: flex; background: rgba(255,255,255,.14); border-radius: 8px; position: relative; }
.hsearch input { background: transparent; border: 0; color: #fff; padding: 7px 10px; width: 190px; font: inherit; font-size: .92rem; }
.hsearch input::placeholder { color: #d5e2ef; }
.hsearch button { background: none; border: 0; color: #fff; font-size: 1.1rem; padding: 0 10px; cursor: pointer; }
.topbar-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topbar .mycat { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; font-weight: 650; margin-left: 10px; white-space: nowrap; }
.topbar .mycat:hover { color: var(--accent-ink); text-decoration: none; filter: brightness(1.05); }
.menu-btn { display: none; margin-left: auto; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font: inherit; cursor: pointer; }

/* Hero and home */
.hero { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%); color: #fff; padding: 52px 0 76px; }
.hero h1 { max-width: 820px; margin-top: 12px; }
.hero p { max-width: 680px; opacity: .92; font-size: 1.08rem; }
.bigsearch { margin-top: 22px; max-width: 720px; display: flex; background: #fff; border-radius: 14px; box-shadow: var(--shadow); position: relative; }
.bigsearch input { flex: 1; border: 0; padding: 16px 18px; font: inherit; font-size: 1.05rem; min-width: 0; border-radius: 14px 0 0 14px; color: var(--ink); }
.bigsearch input:focus { outline: none; }
.bigsearch:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.bigsearch button { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 0 24px; font: inherit; font-weight: 700; border-radius: 0 14px 14px 0; cursor: pointer; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { background: rgba(255,255,255,.16); color: #fff; border-radius: 999px; padding: 4px 13px; font-size: .88rem; text-decoration: none; }
.chip:hover { background: rgba(255,255,255,.28); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: -44px; position: relative; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,.12); color: var(--ink); }
.tile .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.25rem; margin-bottom: 10px; }
.tile b { display: block; font-size: 1.05rem; }
.tile span { color: var(--muted); font-size: .9rem; }
.welcome { margin-top: 28px; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 36px 0 14px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.datelist, .linklist { list-style: none; padding: 0; margin: 0; }
.datelist li { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.datelist b { min-width: 150px; }
.linklist li { padding: 7px 0; border-bottom: 1px solid var(--line); }

/* Cards and grids */
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.prog-card h3 { margin-top: 8px; font-size: 1.12rem; }
.prog-card h3 a { text-decoration: none; }
.prog-card h3 a:hover { text-decoration: underline; }
.prog-card p { margin: .35rem 0 0; }
.linkcard { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.linkcard:hover { border-color: var(--brand); color: var(--ink); }
.linkcard b { color: var(--brand); }
.badge { display: inline-block; font-size: .74rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); vertical-align: middle; }
.badge.gold { background: #fdf1dc; color: #7a4d0b; }
.badge.green { background: #e3f4ea; color: var(--ok); }
.badge.gray { background: #eef0f3; color: var(--muted); }
.badge.red { background: #fbe6e3; color: var(--bad); }
.group-h { margin: 32px 0 12px; font-size: 1.3rem; }
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.chiprow.small .chip2 { font-size: .84rem; padding: 3px 11px; }
.chip2 { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 14px; text-decoration: none; color: var(--ink); font-size: .92rem; }
.chip2.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; font-size: .92rem; color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-ink); color: #fff; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.save.saved { background: #fdf1dc; border-color: #f1d7a8; color: #7a4d0b; }

/* Program and course pages */
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.prog-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.prog-head h1 { margin-top: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.fact { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fact small { color: var(--muted); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.fact b { font-size: 1.05rem; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; margin-top: 8px; }
.toc { position: sticky; top: 84px; align-self: start; font-size: .92rem; }
.toc-h { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px 12px; }
.toc a { display: block; padding: 6px 12px; border-left: 2px solid var(--line); text-decoration: none; color: var(--muted); }
.toc a:hover, .toc a[aria-current="page"] { border-color: var(--brand); color: var(--brand); }
.toc a[aria-current="page"] { font-weight: 650; }
.prose { max-width: 780px; }
.prose section { margin-bottom: 28px; scroll-margin-top: 90px; }
.prose h2 { margin-top: 1.6rem; font-size: 1.35rem; }
.prose h3 { margin-top: 1.2rem; font-size: 1.1rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; background: #fff; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: #f1f5f9; }
.prose blockquote { border-left: 4px solid var(--brand-soft); margin: 1rem 0; padding: .2rem 1rem; color: var(--muted); }
.prose.small { font-size: .94rem; }
mark.needs { background: #fff3cd; }
ul.check { list-style: none; padding-left: 0; }
ul.check li { padding-left: 26px; position: relative; margin: 6px 0; }
ul.check li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.req { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; background: #fff; }
.req header { display: flex; justify-content: space-between; background: #f1f5f9; padding: 10px 14px; font-weight: 650; flex-wrap: wrap; gap: 6px; }
.req table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 0; }
.req td { padding: 9px 14px; border: 0; border-top: 1px solid var(--line); }
.req td:last-child { text-align: right; color: var(--muted); white-space: nowrap; }
.req-notes { padding: 8px 14px 0; font-size: .92rem; }
.code { font-weight: 650; }
a.course-link { text-decoration-style: dotted; text-decoration-thickness: 1.5px; }
.total { text-align: right; font-weight: 700; padding: 8px 2px; }
.reviewed { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 10px; }
.jump { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.jump a { font-size: .9rem; }
.person h2 { font-size: 1.12rem; margin-bottom: 2px; }
.caltable { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.caltable td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.caltable .when { width: 190px; white-space: nowrap; font-weight: 650; }

/* Course popover */
.pop { position: absolute; z-index: 60; width: 360px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16,24,40,.2); padding: 16px; }
.pop h3 { margin: 6px 0 4px; font-size: 1.08rem; }
.pop .row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.pop p { margin: .4rem 0; font-size: .93rem; }
.pop .pop-actions { display: flex; gap: 8px; margin-top: 10px; }
.pop-close { float: right; background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--muted); padding: 0 4px; }

/* Search and lists */
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.searchbar input { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 1rem; background: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 6px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-size: .94rem; }
.tabs a.cur, .tabs a[aria-current] { color: var(--brand); border-color: var(--brand); font-weight: 650; }
.results { list-style: none; padding: 0; margin: 0; }
.result { padding: 14px 0; border-bottom: 1px solid var(--line); }
.result h3 { font-size: 1.04rem; margin: 4px 0 2px; }
.result p { margin: .3rem 0 0; }
.result .save { float: right; padding: 3px 9px; font-size: .8rem; }
.results mark, .meta mark { background: #fdf1dc; padding: 0 2px; border-radius: 3px; }
.filterbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0; }
.fl { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; color: var(--muted); }
.fl.grow { flex: 1; min-width: 200px; }
.fl input, .fl select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: .95rem; background: #fff; color: var(--ink); }
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 20px; }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.18); list-style: none; margin: 0; padding: 6px; z-index: 70; min-width: 280px; }
.suggest li a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.suggest li a:hover, .suggest li a.on { background: var(--brand-soft); }
.suggest small { color: var(--muted); white-space: nowrap; }
.flash { margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; background: #e3f4ea; color: var(--ok); }
.flash.warn { background: #fff4e0; color: var(--warn); }
.flash.bad { background: #fbe6e3; color: var(--bad); }
.tip { background: #eef6ff; border-color: #cfe2f7; margin-bottom: 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cdesc { margin: 0 0 14px; }

/* Footer */
footer.site { background: #0b1d30; color: #b9c6d3; margin-top: 56px; font-size: .9rem; }
footer.site .wrap { padding-top: 32px; padding-bottom: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
footer.site b { color: #fff; }
footer.site a { color: #fff; }
.foot-note { grid-column: 1 / -1; font-size: .84rem; opacity: .85; }

@media (max-width: 900px) {
  .layout, .two-col { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .toc a { border-left: 0; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
  .toc-h { width: 100%; margin-left: 0; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-block; }
  nav.main { display: none; width: 100%; flex-direction: column; margin-left: 0; }
  nav.main.open { display: flex; }
  .hsearch { order: 5; width: 100%; }
  .hsearch input { width: 100%; }
  header.site { position: static; }
  .datelist li { flex-direction: column; gap: 2px; }
  .caltable .when { width: auto; white-space: normal; }
  .hero { padding: 36px 0 64px; }
  .bigsearch button { padding: 0 14px; }
}
@media print {
  .topbar, header.site, footer.site, .actions, .noprint, .toc, .ed-banner, .pop, .skip, .flash, .tip, .pager, .filterbar, .tabs { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .card, .fact, .req { box-shadow: none; }
  .layout { display: block; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .pb { page-break-before: always; }
  .avoid { page-break-inside: avoid; }
  .cover { text-align: center; padding-top: 30vh; }
  .hero { background: none; color: #000; padding: 0; }
}
