/* Approved MVP3 shell palette, navigation and panel treatment, adapted from
   the isolated preview. Production owns this stylesheet; no test asset loads.
   Keep the existing filter rail, controls and scroll containers authoritative. */
:root {
  --bg: #f7f9f8;
  --surface: #ffffff;
  --surface2: #f0f5f2;
  --outline: #dce4e8;
  --navy: #f0f5f2;
  --text: #17212b;
  --muted: #52647a;
  --dim: #607087;
  --accent: #125b47;
  --accent-bright: #0d4c3a;
  --green: #125b47;
  --amber: #80520d;
  --red: #943b32;
  --blue: #305b80;
  --accent-tint: #edf6f1;
  --green-tint: #edf6f1;
  --amber-tint: #fff8e9;
  --red-tint: #fff0ed;
  --blue-tint: #edf3fa;
}
body { line-height: 1.45; }
button, input, select, textarea, a { outline-offset: 4px; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--accent); }
.topbar-logo { font-size: 20px; letter-spacing: -.4px; }
.topbar-nav a { font-size: 15px; border-radius: 7px; }
.topbar-nav a.active { background: var(--accent); color: white; }
.topbar-nav a:hover { background: #dcebe3; color: var(--accent); }
.topbar-nav a.active:hover { background: var(--accent-bright); color: white; }
.programs-heading { flex: none; padding: 26px 24px 20px; }
.programs-heading .eyebrow { font-size: 12px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.programs-heading h1 { font-size: 34px; letter-spacing: -1px; margin: 12px 0 8px; line-height: 1.15; }
.programs-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.search-rail { background: var(--surface); padding: 22px 18px; }
.search-rail__search-input { height: 44px; border-color: var(--accent); font-size: 14px; }
.search-rail__option { min-height: 28px; }
.search-rail__option-count { font-size: 12px; }
.search-rail__box { width: 16px; height: 16px; }
.search-rail select { border: 1px solid var(--outline); border-radius: 5px; }
.search-results__header { padding: 15px 24px; background: var(--surface); }
.search-results__count { font-size: 18px; font-weight: 600; }
.search-results__list { padding: 18px 24px; }
.program-layouts { padding: 12px 24px; }
.program-table { min-width: 1080px; }
.program-table caption { padding: 14px 18px; font-size: 13px; }
.program-table th { font-weight: 500; font-size: 12px; padding: 14px 18px; background: #fbfcfc; }
.program-table td { font-size: 14px; padding: 18px; line-height: 1.55; vertical-align: top; }
.program-table td:first-child { min-width: 210px; }
.program-table td:last-child { min-width: 180px; }
.program-table button { font-weight: 600; color: var(--accent); text-decoration: none; }
.program-table button:hover { text-decoration: underline; }
.program-table tbody tr:hover { background: #f3f8f5; }
.program-table-scroll { border-radius: 9px; }
.crud-panel { background: var(--surface); }
.search-view { --sv-purple: #69509a; }
.sv-btn--primary { color: white; }
@media (min-width: 1100px) {
  .topbar { position: fixed; inset: 0 auto 0 0; width: 234px; height: 100vh; padding: 30px 14px; flex-direction: column; align-items: stretch; gap: 32px; border-right: 1px solid var(--outline); border-bottom: 0; }
  .topbar-logo { padding: 0 10px; white-space: normal; }
  .topbar-nav { display: grid; gap: 6px; margin: 0; }
  .topbar-nav a { padding: 15px 14px; }
  .topbar-auth { margin: auto 0 0; padding: 12px; justify-content: flex-start; }
  main#view { margin-left: 234px; }
  .search-view { min-height: 100vh; max-height: 100vh; }
  .search-view--grid { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .topbar-logo { font-size: 17px; }
  .topbar { gap: 10px; }
  .programs-heading { padding: 20px 16px 16px; }
  .programs-heading h1 { font-size: 28px; }
  .search-results__list { padding: 12px; }
  .search-results__header, .program-layouts { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 1400px) {
  .programs-heading h1 { font-size: 42px; }
  .program-table { min-width: 0; table-layout: fixed; }
  .program-table th, .program-table td { padding: 16px 10px; overflow-wrap: anywhere; white-space: normal; }
  .program-table td:first-child, .program-table td:last-child { min-width: 0; }
  .program-table th:nth-child(1) { width: 17%; }
  .program-table th:nth-child(2) { width: 12%; }
  .program-table th:nth-child(3) { width: 8%; }
  .program-table th:nth-child(4) { width: 9%; }
  .program-table th:nth-child(5) { width: 8%; }
  .program-table th:nth-child(6) { width: 13%; }
  .program-table th:nth-child(7) { width: 15%; }
  .program-table th:nth-child(8) { width: 18%; }
}
@media (min-width: 1100px) {
  .auth-dropdown { top: auto; bottom: calc(100% + .5rem); left: 0; right: auto; }
}
.abbreviation-help { font-size: 12px; color: var(--muted); }
.abbreviation-help summary { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.abbreviation-help summary:focus-visible { outline: 2px solid var(--accent); }
.abbreviation-help p { margin: 8px 0 0; line-height: 1.6; }

.program-table td:nth-child(3) { white-space: nowrap; }

/* Program detail: the same restrained cards as the approved preview. */
.search-detail-page { padding: 24px 32px 48px; }
.search-detail-page__inner, .detail-page-heading { width: 100%; max-width: 1180px; }
.detail-page-heading { margin: 4px 0 20px; }
.detail-page-heading .eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; font-size: 12px; font-weight: 700; }
.detail-page-heading h1 { margin: 12px 0 8px; font-size: 38px; letter-spacing: -1px; line-height: 1.15; }
.detail-page-heading p { margin: 0; color: var(--muted); }
.search-detail-page__inner .search-detail { background: transparent; border: 0; }
.search-detail-page__inner .search-detail__header { border: 1px solid var(--outline); background: var(--surface); border-radius: 9px; padding: 22px; }
.search-detail__title { font-size: 26px; letter-spacing: -.5px; }
.detail-edit-stamp, .detail-source { color: var(--muted); font-size: 12px; }
.detail-edit-stamp { margin: 16px 0 0; }
.search-detail-page__inner .search-detail__body { padding: 14px 0 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.search-detail__body > * { grid-column: 1/-1; min-width: 0; }
.search-detail__body > .detail-editors { display: contents; }
.detail-editors .crud-panel { grid-column: 1/-1; margin: 0; padding: 16px 22px; }
.detail-editors .crud-retire { order: 9; }
.search-detail__body > .review-panel, .search-detail__body > .application-card { grid-column: auto; order: 2; align-self: start; }
.search-detail__body > .search-detail__grid { order: 3; }
.search-detail__body > .search-detail__comments { order: 5; }
.search-detail__card { margin: 0; padding: 20px 22px; border-radius: 9px; }
.search-detail__card-title, .review-panel h3 { color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -.3px; text-transform: none; margin: 0 0 12px; }
.review-panel p, .detail-fact p { margin: 8px 0; }
.detail-fact { border-bottom: 1px solid var(--outline); padding: 10px 0; overflow-wrap: anywhere; }
.detail-fact:last-child { border: 0; }
.detail-fact blockquote { margin: 8px 0; padding-left: 12px; border-left: 2px solid var(--outline); color: var(--muted); }
.review-panel mark { background: var(--accent-tint); color: var(--accent); }
.review-panel article { padding: 10px 0; }
.search-detail__grid { gap: 14px; }
.search-detail__comment-input { min-height: 48px; }
@media (max-width: 800px) {
  .search-detail-page { padding: 18px 16px 36px; }
  .detail-page-heading h1 { font-size: 30px; }
  .search-detail-page__inner .search-detail__body { grid-template-columns: minmax(0,1fr); }
  .search-detail__card, .search-detail-page__inner .search-detail__header { padding: 18px; }
  .search-detail__title { font-size: 23px; }
}
.search-detail__header > .search-detail__card { border: 0; padding: 0; margin: 14px 0; background: transparent; }
.search-detail__header > .detail-overview .search-detail__card-title { display: none; }
.search-detail__header > .search-detail__card .search-detail__text { padding: 0; font-size: 14px; }
.search-detail__header > .search-detail__card .search-detail__text p { margin: 0; }
.search-detail__header > .search-detail__card .search-detail__card-title { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.search-detail__body > .detail-eligibility { order: 4; }
@media (max-width: 800px) {
  .search-detail__top { flex-direction: column; }
  .search-detail__actions { margin-left: 0; justify-content: flex-start; }
  .search-detail__title-wrap { width: 100%; }
}
.detail-funding { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 12px 0; font-size: 14px; }
.detail-funding__label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.detail-official-guide { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--outline); padding-top: 12px; color: var(--muted); font-size: 13px; }
.detail-url-help { align-self: stretch; margin: -8px 0 16px; }
.review-panel p:empty { display: none; }
