
    :root {
      --ink: #1b2421;
      --muted: #5c675f;
      --line: #ddd4c6;
      --paper: #f6f1e8;
      --card: #fffdf9;
      --green: #0e6b4f;
      --green-deep: #12382c;
      --gold: #9a5b12;
      --closed: #9f1239;
      --closed-bg: #fff1f2;
      --limited: #8a5a00;
      --limited-bg: #fff7e8;
      --listed: #0f5c4c;
      --listed-bg: #e7f6f0;
      --shadow: 0 16px 40px rgba(40, 32, 18, 0.06);
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      color: var(--ink);
      background:
        radial-gradient(1200px 400px at 10% -10%, #efe4cf 0%, transparent 55%),
        var(--paper);
      font-family: "Avenir Next", "Segoe UI", sans-serif;
      line-height: 1.45;
    }

    .wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

    header.hero {
      padding: 36px 0 18px;
    }
    .eyebrow {
      margin: 0 0 8px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      font-size: 12px;
      color: var(--green);
      font-weight: 700;
    }
    h1 {
      margin: 0;
      font-family: "Iowan Old Style", Palatino, Georgia, serif;
      font-size: clamp(32px, 5vw, 52px);
      font-weight: 600;
      letter-spacing: -0.03em;
      line-height: 1.05;
      color: var(--green-deep);
    }
    .lede {
      max-width: 68ch;
      margin: 14px 0 0;
      color: var(--muted);
      font-size: 16.5px;
    }

    .legend {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-top: 22px;
    }
    .legend article {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 12px 14px;
      box-shadow: var(--shadow);
    }
    .legend strong { display: block; font-size: 14px; margin-bottom: 4px; }
    .legend p { margin: 0; color: var(--muted); font-size: 13px; }

    .stats {
      display: flex;
      flex-wrap: wrap;
      gap: 18px 28px;
      margin: 18px 0 8px;
      color: var(--green-deep);
    }
    .stats b { font-variant-numeric: tabular-nums; font-size: 22px; }
    .stats span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.02em; }

    .panel {
      position: sticky;
      top: 0;
      z-index: 5;
      background: rgba(246, 241, 232, 0.92);
      backdrop-filter: blur(10px);
      padding: 12px 0 14px;
      border-bottom: 1px solid transparent;
    }
    .controls {
      display: grid;
      grid-template-columns: 1.4fr repeat(4, 1fr);
      gap: 8px;
    }
    label.field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
    input, select {
      appearance: none;
      border: 1px solid var(--line);
      background: var(--card);
      color: var(--ink);
      border-radius: 10px;
      padding: 10px 12px;
      font: inherit;
      font-size: 14px;
      text-transform: none;
      letter-spacing: 0;
      font-weight: 500;
    }
    input:focus, select:focus { outline: 2px solid #b7d7cb; border-color: var(--green); }
    .toggles { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
    .toggles button {
      border: 1px solid var(--line);
      background: var(--card);
      border-radius: 999px;
      padding: 7px 12px;
      font: inherit;
      font-size: 13px;
      cursor: pointer;
      color: var(--ink);
    }
    .toggles button[aria-pressed="true"] {
      background: var(--green-deep);
      color: #f6f1e8;
      border-color: var(--green-deep);
    }
    .countline { margin-left: auto; color: var(--muted); font-size: 13px; }

    .table-card {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 18px;
      overflow: hidden;
      box-shadow: var(--shadow);
      margin-bottom: 28px;
    }
    table { width: 100%; border-collapse: collapse; }
    th {
      text-align: left;
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
      font-weight: 700;
      padding: 14px 14px 10px;
      border-bottom: 1px solid var(--line);
      background: #fbf8f3;
    }
    td {
      padding: 14px;
      vertical-align: top;
      border-bottom: 1px solid #eee6da;
    }
    tr:last-child td { border-bottom: 0; }
    tbody tr:hover td { background: #fbf8f2; }
    tr.closed td { background: #fff8f8; }
    .inst { font-weight: 700; font-size: 16px; }
    .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
    .stars { color: var(--gold); letter-spacing: 2px; font-size: 16px; font-weight: 700; }
    .stars small { display: block; letter-spacing: 0; color: var(--muted); font-weight: 600; font-size: 12px; margin-top: 2px; }
    .eng {
      font-variant-numeric: tabular-nums;
      font-size: 28px;
      font-weight: 750;
      line-height: 1;
      color: var(--green);
    }
    .eng.dash { color: #8d867a; font-size: 22px; }
    .eng.fac { font-size: 18px; letter-spacing: 0.02em; }
    .eng-label { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
    .quota { font-size: 28px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; color: var(--green-deep); }
    .quota.dash { color: #8d867a; font-size: 22px; }
    .notes { margin: 0; padding-left: 18px; }
    .notes li { margin: 0 0 4px; }
    .notes li:last-child { margin-bottom: 0; }
    .empty-note { color: var(--muted); font-size: 14px; }
    .pill {
      display: inline-block;
      margin-top: 6px;
      margin-right: 6px;
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 12px;
      font-weight: 700;
    }
    .pill.closed { color: var(--closed); background: var(--closed-bg); }
    .pill.limited { color: var(--limited); background: var(--limited-bg); }
    .pill.listed { color: var(--listed); background: var(--listed-bg); }
    .pill.faculty { color: #12382c; background: #d7efe4; }
    .date {
      display: inline-block;
      margin-left: 8px;
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 11px;
      font-weight: 700;
      vertical-align: 2px;
    }
    .date.old { color: #5c675f; background: #efe8dc; }
    .date.new { color: #7a3e00; background: #ffe7c2; }
    .date.fac { color: #12382c; background: #d7efe4; }
    tr.added td:first-child { box-shadow: inset 3px 0 0 #e0a15a; }
    .empty {
      padding: 36px 18px;
      text-align: center;
      color: var(--muted);
    }
    footer {
      color: var(--muted);
      font-size: 13px;
      padding: 0 0 40px;
      max-width: 80ch;
    }

    @media (max-width: 980px) {
      .controls { grid-template-columns: 1fr 1fr; }
      .legend { grid-template-columns: 1fr; }
    }
    @media (max-width: 760px) {
      .controls { grid-template-columns: 1fr; }
      thead { display: none; }
      table, tbody, tr, td { display: block; width: 100%; }
      tbody tr { border-bottom: 8px solid var(--paper); }
      td { border-bottom: 0; padding: 8px 14px; }
      td:first-child { padding-top: 14px; }
      td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--muted);
        font-weight: 700;
        margin-bottom: 2px;
      }
    }
  
    .nav-link {
      display: inline-flex;
      align-items: center;
      text-decoration: none;
      border: 1px solid var(--green-deep);
      background: var(--green-deep);
      color: #f6f1e8;
      border-radius: 999px;
      padding: 7px 12px;
      font-size: 13px;
      font-weight: 700;
    }
    .nav-link.quiet {
      background: var(--card);
      color: var(--ink);
      border-color: var(--line);
    }
    .fav {
      display: inline-flex;
      margin-top: 8px;
      border: 1px solid #9f1239;
      background: #fff;
      color: #9f1239;
      border-radius: 999px;
      padding: 6px 11px;
      font: inherit;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
    }
    .fav.on {
      background: #9f1239;
      color: #fff;
    }
