/* Design tokens. Per-portal branding (Phase 3) overrides --gp-primary* only. */
:root {
  --gp-bg: #eef1f5;
  --gp-surface: #ffffff;
  --gp-border: #e3e5ea;
  --gp-text: #111827;
  --gp-muted: #5f6673;
  --gp-primary: #2a78d6;        /* fills: buttons, active states, chart accent */
  --gp-primary-hover: #256abf;
  --gp-primary-ink: #1c5cab;    /* text and links: 4.5:1 on white */
  --gp-primary-soft: #e3eefb;
  --gp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);

  /* Status pairs: soft fill + strong text, always alongside a word. */
  --gp-neutral-bg: #efeff0;  --gp-neutral-ink: #4b5160;
  --gp-info-bg: #e3eefb;     --gp-info-ink: #1c5cab;
  --gp-success-bg: #e3f4e3;  --gp-success-ink: #19671c;
  --gp-warning-bg: #fdf1d3;  --gp-warning-ink: #7a5200;
  --gp-danger-bg: #fbe5e5;   --gp-danger-ink: #a22a2a;

  /* One radius scale: controls, cards, pills. */
  --gp-radius-sm: .5rem;
  --gp-radius: .75rem;
  --gp-radius-lg: 1rem;

  /* Bootstrap reads these, so buttons, inputs, alerts, dropdowns and badges follow. */
  --bs-border-radius: var(--gp-radius-sm);
  --bs-border-radius-sm: .4rem;
  --bs-border-radius-lg: var(--gp-radius);
  --bs-border-radius-xl: var(--gp-radius-lg);
  --bs-border-radius-pill: 999px;
  --bs-primary: var(--gp-primary);
  --bs-primary-rgb: 42, 120, 214;
  --bs-link-color: var(--gp-primary-ink);
  --bs-link-color-rgb: 28, 92, 171;
  --bs-link-hover-color: var(--gp-primary-hover);
  --bs-border-color: var(--gp-border);
}

.btn-primary {
  --bs-btn-bg: var(--gp-primary); --bs-btn-border-color: var(--gp-primary);
  --bs-btn-hover-bg: var(--gp-primary-hover); --bs-btn-hover-border-color: var(--gp-primary-hover);
  --bs-btn-active-bg: var(--gp-primary-ink); --bs-btn-active-border-color: var(--gp-primary-ink);
  --bs-btn-disabled-bg: var(--gp-primary); --bs-btn-disabled-border-color: var(--gp-primary);
}
.btn-outline-primary {
  --bs-btn-color: var(--gp-primary-ink); --bs-btn-border-color: var(--gp-primary);
  --bs-btn-hover-bg: var(--gp-primary); --bs-btn-hover-border-color: var(--gp-primary);
  --bs-btn-active-bg: var(--gp-primary-hover); --bs-btn-active-border-color: var(--gp-primary-hover);
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--gp-primary);
  box-shadow: 0 0 0 .2rem rgba(42, 120, 214, .2);
}
.form-check-input:checked { background-color: var(--gp-primary); border-color: var(--gp-primary); }
.progress-bar { background-color: var(--gp-primary); }
.text-bg-primary, .badge.bg-primary { background-color: var(--gp-primary) !important; }

/* Rounded everywhere: cards, alerts, table shells, list groups. */
.card, .alert:not(.rounded-0), .list-group, .modal-content, .dropdown-menu { border-radius: var(--gp-radius) !important; }
.card > .table-responsive:first-child, .card > .table-responsive:last-child { border-radius: var(--gp-radius); }
.table-responsive { border-radius: var(--gp-radius); }

html, body { min-height: 100%; }
html { font-size: 15px; }
body.app-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--gp-bg);
  color: var(--gp-text);
  font-family: "Inter Tight", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

.site-shell { flex: 1 0 auto; min-width: 0; }
.site-header .navbar { background: rgba(255,255,255,.96); backdrop-filter: saturate(160%) blur(14px); }
/* A stripe of the portal's color (Portal settings) along the top of every page; a charcoal footer closes the page. */
.site-header { border-top: 4px solid var(--gp-header-stripe, var(--gp-primary)); border-bottom-color: #d5dae3 !important; }
.site-header .nav-link { color: #374151; font-weight: 500; }
.site-footer { flex-shrink: 0; background: #1f2937; color: #fff; }
.site-footer .text-muted { color: #b8c0cc !important; }
.site-footer a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: #dbe3ee; }
/* Sticky top navigation. */
.site-header { position: sticky; top: 0; z-index: 1030; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--gp-primary-ink), var(--gp-primary));
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
}
.brand-logo { width: 2rem; height: 2rem; object-fit: contain; border-radius: .45rem; }
.welcome-logo { display: block; width: auto; height: auto; max-width: min(16rem, 70vw); max-height: 6rem; object-fit: contain; }
.welcome-copy { max-width: 40rem; white-space: pre-line; }

.dashboard-sidebar-card,
.card { box-shadow: var(--gp-shadow); border-color: var(--gp-border) !important; }
.dashboard-nav-link {
  border-radius: .8rem;
  padding: .65rem .85rem;
  color: var(--gp-text);
  font-weight: 400;
}
.dashboard-nav-link:hover,
.dashboard-nav-link:focus { background: #f3f4f6; color: var(--gp-primary); }
/* Account menu: initials avatar + name, opens profile and sign out */
.account-menu {
  display: inline-flex; align-items: center; gap: .5rem; padding: .2rem .55rem .2rem .25rem;
  border: 1px solid var(--gp-border); border-radius: 999px; background: var(--gp-surface); color: var(--gp-text); font-size: .875rem;
}
.account-menu:hover, .account-menu[aria-expanded="true"] { border-color: var(--gp-primary); background: var(--gp-primary-soft); }
.account-menu:focus-visible { outline: 2px solid var(--gp-primary); outline-offset: 2px; }
.account-avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--gp-primary); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.account-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown { min-width: 15rem; }
.account-dropdown-head { padding: .35rem 1rem .25rem; }
.limit-counter-near {
  color: #a16207;
  font-weight: 500;
}
.limit-counter-close {
  color: #b45309;
  font-weight: 600;
}
.limit-counter-over {
  color: #b91c1c;
  font-weight: 600;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.page-title { font-size: clamp(1.5rem, 1.9vw, 2.05rem); font-weight: 600; margin: 0; }
.page-subtitle { color: var(--gp-muted); max-width: 64ch; }

.btn {
  font-weight: 500;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 992px) {
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
  .summary-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.summary-card {
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--gp-shadow);
  color: var(--gp-text);
}
.summary-card-span-2 {
  grid-column: span 2;
}
.summary-label { color: var(--gp-muted); font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .45rem; }
.summary-value { font-size: clamp(1.5rem, 2.1vw, 1.9rem); font-weight: 600; }
.summary-meta { color: var(--gp-muted); font-size: .82rem; margin-top: .35rem; }
.summary-value-of { font-size: .55em; font-weight: 500; color: var(--gp-muted); }

.js-sponsor-picker {
  position: relative;
}

.sponsor-picker-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  min-height: calc(1.5em + .75rem + 2px);
  padding-top: .375rem;
  padding-bottom: .375rem;
}

.sponsor-picker-input {
  border: 0;
  outline: 0;
  min-width: 8rem;
  flex: 1 1 8rem;
  padding: 0;
  background: transparent;
}

.sponsor-picker-input:focus {
  outline: none;
}

.sponsor-picker-menu {
  position: absolute;
  top: calc(100% + .25rem);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 14rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--gp-border);
  border-radius: .85rem;
  box-shadow: var(--gp-shadow);
  padding: .35rem;
}

.js-sponsor-picker.is-open .sponsor-picker-menu {
  display: grid;
  gap: .2rem;
}

.sponsor-picker-option {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: .65rem;
  padding: .5rem .65rem;
  text-align: left;
  font-size: .95rem;
}

.sponsor-picker-option:hover,
.sponsor-picker-option:focus {
  background: #f3f4f6;
  outline: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .3rem .65rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.status-badge-neutral { background: var(--gp-neutral-bg); color: var(--gp-neutral-ink); }
.status-badge-primary { background: var(--gp-info-bg); color: var(--gp-info-ink); }
.status-badge-success { background: var(--gp-success-bg); color: var(--gp-success-ink); }
.status-badge-danger { background: var(--gp-danger-bg); color: var(--gp-danger-ink); }
.status-badge-warning { background: var(--gp-warning-bg); color: var(--gp-warning-ink); }

.table > :not(caption) > * > * { padding: .85rem .9rem; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gp-muted); font-weight: 600; }

.report-matrix-shell {
  overflow-x: auto;
}

.report-matrix-table {
  min-width: max-content;
}

.report-matrix-table thead th {
  background: #f8fafc;
  vertical-align: bottom;
  white-space: nowrap;
}

.report-matrix-table tfoot th {
  background: #eff6ff;
  white-space: nowrap;
}

.report-matrix-row-header {
  font-weight: 600;
  min-width: 14rem;
}

.report-matrix-row-meta {
  min-width: 10rem;
  white-space: nowrap;
}

.report-matrix-first-column {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
}

.report-matrix-table thead .report-matrix-first-column {
  background: #f8fafc;
  z-index: 4;
}

.report-matrix-table tfoot .report-matrix-first-column {
  background: #eff6ff;
  z-index: 3;
}

.report-matrix-total-label {
  font-weight: 600;
}

.site-footer .small { line-height: 1.6; }
.flash-stack { display: grid; gap: .75rem; }
.gp-toast-container {
  z-index: 1400;
  display: grid;
  gap: .75rem;
}
.gp-toast {
  min-width: min(24rem, calc(100vw - 2rem));
  border-radius: 1rem;
  backdrop-filter: blur(10px);
}
.field { display: grid; gap: .45rem; margin-bottom: 1rem; }
.field label { font-weight: 500; }
input, select, textarea { max-width: 100%; }

@media (max-width: 991.98px) {
  .page-header { flex-direction: column; }
  .dashboard-sidebar-card { position: static; }
}


/* Pass 2C UI/permission hotfix */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
}
.page-header-actions .btn { white-space: nowrap; }

.program-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .9rem 1.25rem;
}
@media (min-width: 1200px) {
  .program-meta-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.program-meta-item {
  background: #fff;
  border: 1px solid var(--gp-border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
}
.program-meta-label {
  color: var(--gp-muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.program-meta-value {
  font-size: 1rem;
  font-weight: 500;
}
.program-section-card .card-body {
  padding: 1.25rem 1.35rem;
}
.program-controls-card .card-body {
  padding: 1rem 1.25rem;
}
.program-detail-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
}
.program-detail-cell {
  min-width: 0;
}
.program-detail-label {
  color: var(--gp-muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .3rem;
}
.program-detail-value {
  font-size: .98rem;
  font-weight: 400;
  line-height: 1.4;
}
.question-card {
  cursor: grab;
}
.question-card-dragging {
  opacity: .65;
  cursor: grabbing;
}
.question-card-insert-before {
  box-shadow: inset 0 3px 0 0 var(--gp-primary), var(--gp-shadow);
}
.question-card-insert-after {
  box-shadow: inset 0 -3px 0 0 var(--gp-primary), var(--gp-shadow);
}
.question-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  color: var(--gp-muted);
  font-weight: 600;
  letter-spacing: -.08em;
  user-select: none;
}
@media (min-width: 1400px) {
  .program-detail-table {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.report-sort-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
}
.report-sort-button::after {
  content: "";
  display: inline-block;
  margin-left: .35rem;
  border-left: .28rem solid transparent;
  border-right: .28rem solid transparent;
  border-top: .38rem solid transparent;
  opacity: .35;
  vertical-align: middle;
}
.report-sort-button.is-sorted-asc::after {
  border-top: 0;
  border-bottom: .38rem solid currentColor;
  opacity: .85;
}
.report-sort-button.is-sorted-desc::after {
  border-top-color: currentColor;
  opacity: .85;
}
.compact-table td, .compact-table th { vertical-align: middle; }

.advanced-config summary { cursor: pointer; list-style: none; }
.advanced-config summary::-webkit-details-marker { display: none; }

.filter-dropdown { position: relative; }
.filter-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: .65rem .85rem;
  border: 1px solid var(--gp-border, #e5e7eb);
  border-radius: .85rem;
  background: #fff;
  text-align: left;
}
.filter-dropdown-toggle .filter-dropdown-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-dropdown-toggle .filter-dropdown-meta {
  color: var(--gp-muted, #6b7280);
  font-size: .875rem;
}
.filter-dropdown-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + .5rem);
  z-index: 1200;
  display: none;
  border: 1px solid var(--gp-border, #e5e7eb);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}
.filter-dropdown.is-open .filter-dropdown-menu { display: block; }
.filter-dropdown-search { padding: .85rem; border-bottom: 1px solid var(--gp-border, #e5e7eb); }
.filter-dropdown-search .form-control { border-radius: .75rem; }
.filter-dropdown-options { max-height: 18rem; overflow: auto; padding: .5rem; display: grid; gap: .35rem; }
.filter-dropdown-option { display: flex; align-items: center; gap: .65rem; padding: .65rem .75rem; border-radius: .75rem; cursor: pointer; }
.filter-dropdown-option:hover, .filter-dropdown-option.is-active { background: #f3f4f6; }
.filter-dropdown-option input { margin: 0; }
.filter-dropdown-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem; border-top: 1px solid var(--gp-border, #e5e7eb); }
.filter-dropdown-empty { padding: .75rem .85rem; color: var(--gp-muted); display: none; }

.assign-review-section {
  border: 1px solid var(--gp-border, #e5e7eb);
  border-radius: 1rem;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.98));
}
.assign-preview-card {
  border: 1px solid var(--gp-border, #e5e7eb);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: #f8fafc;
}
.assign-review-bucket {
  border: 1px solid var(--gp-border, #e5e7eb);
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
  transition: opacity .18s ease, background-color .18s ease;
}
.assign-review-bucket.is-inactive {
  opacity: .72;
  background: #f8fafc;
}

.tabs-card .nav-tabs { border-bottom: 1px solid var(--gp-border); gap: .5rem; }
.tabs-card .nav-link {
  border: 0;
  border-radius: .85rem .85rem 0 0;
  color: var(--gp-muted);
  font-weight: 600;
  padding: .85rem 1rem;
}
.tabs-card .nav-link.active {
  color: var(--gp-primary);
  background: #fff;
  box-shadow: inset 0 -2px 0 var(--gp-primary);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1rem;
}
@media (min-width: 1200px) {
  .admin-stats-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
}
.admin-stats-grid .summary-card { min-height: 100%; }

.hero-application-card { max-width: 56rem; }

@media (max-width: 991.98px) {
  .program-meta-grid { grid-template-columns: 1fr; }
  .page-header-actions { width: 100%; justify-content: flex-start; }
  .program-detail-table { grid-template-columns: 1fr; }
}

/* Sign-in and registration */
.auth-shell { display: flex; justify-content: center; padding: 2rem 0 3rem; }
.auth-card {
  width: 100%;
  max-width: 28rem;
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: 1rem;
  box-shadow: var(--gp-shadow);
  padding: 2rem;
}
.auth-card-wide { max-width: 56rem; }
@media (max-width: 575.98px) { .auth-card { padding: 1.5rem; } .auth-shell { padding-top: 1rem; } }

/* Applicant "Needs your attention" list */
.attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--gp-border);
  border-left-width: 4px;
  border-radius: .6rem;
  background: var(--gp-surface);
}
.attention-item-late { border-left-color: #dc2626; }
.attention-item-draft { border-left-color: var(--gp-primary); }
.min-w-0 { min-width: 0; }
@media (max-width: 575.98px) { .attention-item { flex-direction: column; align-items: stretch; } }

/* Review form */
.score-scale { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.score-option { min-width: 2.6rem; font-variant-numeric: tabular-nums; }
.review-answer-text { white-space: pre-wrap; }
.review-answer-text.is-clamped {
  max-height: 9.5em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
          mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.review-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px));
  margin: 0 -.25rem;
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: .75rem;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}
.review-progress { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Program setup checklist */
.setup-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .5rem; }
.setup-step-link {
  display: flex; gap: .65rem; align-items: flex-start; height: 100%;
  padding: .7rem .8rem; border: 1px solid var(--gp-border); border-radius: .6rem;
  color: var(--gp-text); text-decoration: none; background: var(--gp-surface);
}
.setup-step-link:hover, .setup-step-link:focus-visible { border-color: var(--gp-primary); }
.setup-step-mark {
  flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600; background: #eef0f4; color: var(--gp-muted);
}
.setup-step.is-done .setup-step-mark { background: #dcfce7; color: #166534; }
.setup-step.is-next .setup-step-link { border-color: var(--gp-primary); box-shadow: 0 0 0 3px var(--gp-primary-soft); }
.setup-step.is-next .setup-step-mark { background: var(--gp-primary); color: #fff; }

/* Status filter chips */
.status-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.status-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--gp-border);
  background: var(--gp-surface); color: var(--gp-text); text-decoration: none; font-size: .9rem;
}
.status-chip span { color: var(--gp-muted); font-variant-numeric: tabular-nums; }
.status-chip:hover { border-color: var(--gp-primary); }
.status-chip.is-active { background: var(--gp-primary); border-color: var(--gp-primary); color: #fff; }
.status-chip.is-active span { color: rgba(255, 255, 255, .8); }

/* Reports index */
.report-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.report-link {
  display: block; padding: 1rem 1.1rem; border: 1px solid var(--gp-border); border-radius: .75rem;
  background: var(--gp-surface); color: var(--gp-text); text-decoration: none; box-shadow: var(--gp-shadow);
}
.report-link:hover, .report-link:focus-visible { border-color: var(--gp-primary); }
.report-group-title { font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gp-muted); margin-bottom: .5rem; }
.report-list { background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); box-shadow: var(--gp-shadow); overflow: hidden; }
.report-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.1rem; color: var(--gp-text); text-decoration: none; }
.report-row + .report-row { border-top: 1px solid var(--gp-border); }
.report-row:hover, .report-row:focus-visible { background: var(--gp-primary-soft); }
.report-row-title { display: block; font-weight: 600; color: var(--gp-primary-ink); }
.report-row-text { display: block; font-size: .875rem; color: var(--gp-muted); }
.report-row-chevron { color: var(--gp-muted); font-size: 1.25rem; line-height: 1; }
.queue-progress { display: inline-block; width: 5rem; height: .45rem; border-radius: 999px; background: var(--gp-neutral-bg); overflow: hidden; vertical-align: middle; }
.queue-progress > span { display: block; height: 100%; background: var(--gp-success-ink); }

/* Stacked tables on phones: each row becomes a card, each cell a "Label  value" line. */
@media (max-width: 575.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: .75rem 0; border-bottom: 1px solid var(--gp-border); }
  .table-stack td { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border: 0; text-align: right !important; }
  .table-stack td::before { content: attr(data-label); color: var(--gp-muted); font-size: .8rem; font-weight: 600; text-align: left; }
  .table-stack td:not([data-label])::before, .table-stack td[data-label=""]::before { content: none; }
  .table-stack td[data-label=""] { justify-content: flex-end; }
  .table-stack td[colspan] { text-align: left !important; }
}

/* Stat tiles that open the list they count */
a.summary-card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease; }
a.summary-card-link:hover, a.summary-card-link:focus-visible { border-color: var(--gp-primary); }
a.summary-card-link:hover .summary-label, a.summary-card-link:focus-visible .summary-label { color: var(--gp-primary); }
.summary-card-filter.is-active { border-color: var(--gp-primary); box-shadow: 0 0 0 3px var(--gp-primary-soft), var(--gp-shadow); }
.summary-card-filter.is-active .summary-label { color: var(--gp-primary-ink); }

/* Sortable column headers */
.th-sort {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
}
.th-sort:hover { color: var(--gp-text); }
.th-sort:focus-visible { outline: 2px solid var(--gp-primary); outline-offset: 2px; border-radius: .25rem; }
.th-sort-arrow { width: .6rem; display: inline-block; opacity: .35; }
.th-sort-arrow::after { content: "↕"; font-size: .75rem; }
th[aria-sort="ascending"] .th-sort-arrow, th[aria-sort="descending"] .th-sort-arrow { opacity: 1; color: var(--gp-primary-ink); }
th[aria-sort="ascending"] .th-sort-arrow::after { content: "↑"; }
th[aria-sort="descending"] .th-sort-arrow::after { content: "↓"; }

/* Application step indicator */
.app-steps-list { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 .5rem; }
.app-step { flex: 1 1 0; min-width: 0; }
.app-step > a, .app-step > .app-step-mark { text-decoration: none; }
.app-step, .app-step > a {
  display: flex; align-items: center; gap: .55rem; color: var(--gp-muted);
  padding-top: .6rem; border-top: 3px solid var(--gp-border);
}
.app-step > a { border-top: 0; padding-top: 0; }
.app-step-mark {
  flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600; background: var(--gp-neutral-bg); color: var(--gp-neutral-ink);
}
.app-step-label { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-step.is-done { border-top-color: var(--gp-primary); color: var(--gp-text); }
.app-step.is-done .app-step-mark { background: var(--gp-primary-soft); color: var(--gp-primary-ink); }
.app-step.is-done a:hover .app-step-label { text-decoration: underline; }
.app-step.is-current { border-top-color: var(--gp-primary); color: var(--gp-text); }
.app-step.is-current .app-step-mark { background: var(--gp-primary); color: #fff; }
.app-step.is-current .app-step-label { font-weight: 600; }
.app-steps-detail { font-size: .9rem; color: var(--gp-text); }
.app-steps-count { font-weight: 600; }
@media (max-width: 575.98px) {
  .app-step-label { display: none; }
  .app-step.is-current { flex: 3 1 0; }
  .app-step.is-current .app-step-label { display: inline; }
}

/* Footer actions that stay reachable on long steps */
.step-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center;
  padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px));
  background: var(--gp-surface); border-top: 1px solid var(--gp-border);
  border-radius: 0 0 var(--gp-radius) var(--gp-radius);
}
.application-save-status {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  min-height: 1.75rem;
  padding: .22rem .65rem;
  border: 1px solid var(--gp-border);
  border-radius: 999px;
  background: var(--gp-neutral-bg);
  white-space: nowrap;
}
.application-save-status.is-dirty { color: var(--gp-warning-ink) !important; background: var(--gp-warning-bg); border-color: transparent; }
.application-save-status.is-saving { color: var(--gp-primary-ink) !important; background: var(--gp-primary-soft); border-color: transparent; }
.application-save-status.is-saved { color: var(--gp-success-ink) !important; background: var(--gp-success-bg); border-color: transparent; }
.application-save-status.is-error { color: var(--gp-danger-ink) !important; background: var(--gp-danger-bg); border-color: transparent; font-weight: 600; }

/* Review step */
.review-answer-row { padding: .75rem 0; border-bottom: 1px solid var(--gp-border); }
.review-answer-row:last-child { border-bottom: 0; }
.review-answer-row.has-problem { padding-left: .85rem; border-left: 3px solid var(--gp-danger-ink); }
.review-problem { margin-top: .35rem; font-size: .9rem; font-weight: 600; color: var(--gp-danger-ink); }
.submitted-card { border-left: 4px solid var(--gp-success-ink) !important; }

/* Program setup choices */
.choice-card {
  display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; cursor: pointer;
  border: 1px solid var(--gp-border); border-radius: var(--gp-radius); background: var(--gp-surface);
}
.choice-card:has(input:checked) { border-color: var(--gp-primary); box-shadow: 0 0 0 3px var(--gp-primary-soft); }
.choice-card .form-check-input { margin-top: .2rem; flex-shrink: 0; }
.invite-list { max-height: 18rem; overflow-y: auto; padding: .5rem .75rem; border: 1px solid var(--gp-border); border-radius: var(--gp-radius-sm); }

/* Program list: one compact row per program */
.program-list { display: grid; gap: .75rem; }
.program-row {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 3fr) auto; gap: 1.25rem; align-items: center;
  padding: 1rem 1.25rem; background: var(--gp-surface); border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius); box-shadow: var(--gp-shadow);
}
.program-row-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 .2rem; }
.program-row-title a { text-decoration: none; }
.program-row-title a:hover { text-decoration: underline; }
.program-row-desc {
  margin: 0; color: var(--gp-muted); font-size: .9rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.program-row-meta {
  display: grid;
  grid-template-columns: minmax(5.5rem, .7fr) minmax(7.5rem, .9fr) minmax(10rem, 1.35fr) minmax(4.5rem, .55fr);
  gap: .5rem 1.25rem;
  margin: 0;
}
.program-row-meta > div { min-width: 0; }
.program-row-meta dt { font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gp-muted); }
.program-row-meta dd { margin: 0; font-size: .92rem; }
.program-row-action { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; text-align: right; max-width: 16rem; }
@media (max-width: 1199.98px) {
  .program-row { grid-template-columns: 1fr auto; }
  .program-row-meta { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 767.98px) {
  .program-row-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .page-header-actions { align-items: stretch; }
  .page-header-actions > .btn { flex: 1 1 auto; }
  .program-row { grid-template-columns: 1fr; gap: .75rem; padding: 1rem; }
  .program-row-action { align-items: flex-start; text-align: left; max-width: none; }
  .question-bank-apply-form { min-width: 18rem; }
}

/* Question bank row controls stay aligned instead of wrapping into overlapping button stacks. */
.question-bank-apply-form {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto;
  align-items: center;
  gap: .5rem;
  min-width: 21rem;
}
.question-bank-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  white-space: nowrap;
}
.question-bank-row-actions form { margin: 0; }

/* Date fields: muted placeholder, calendar icon, whole field opens the picker */
input[type="date"].form-control {
  cursor: pointer; padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235f6673' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='3' y='4.5' width='14' height='12.5' rx='2.5'/%3E%3Cpath d='M3 8.5h14M7 2.75v3.5M13 2.75v3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 1.1rem;
}
input[type="date"].form-control::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
input[type="date"].is-empty { color: #9aa1ad; }
input[type="date"].is-empty::-webkit-datetime-edit { color: #9aa1ad; }
input[type="date"]:focus.is-empty::-webkit-datetime-edit { color: var(--gp-muted); }

/* Currency is entered directly; browser increment controls are distracting for dollar amounts. */
input.currency-input { appearance: textfield; -moz-appearance: textfield; }
input.currency-input::-webkit-inner-spin-button,
input.currency-input::-webkit-outer-spin-button { appearance: none; -webkit-appearance: none; margin: 0; }

/* Wizard: questions step */
.setup-question-section { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gp-muted); margin: 1rem 0 .4rem; }
.setup-question-section:first-of-type { margin-top: 0; }
.setup-question-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--gp-border); border-radius: var(--gp-radius-sm); }
.setup-question-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .85rem; border-top: 1px solid var(--gp-border); }
.setup-question-list li:first-child { border-top: 0; }
.setup-question-label { min-width: 0; }
.setup-question-meta { color: var(--gp-muted); font-size: .85rem; white-space: nowrap; }
.empty-hint { padding: 1.25rem; text-align: center; color: var(--gp-muted); border: 1px dashed var(--gp-border); border-radius: var(--gp-radius); }

/* Wizard: post-award field picker */
.field-places-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .25rem 1.5rem; font-size: .85rem; }
.field-picker { border: 1px solid var(--gp-border); border-radius: var(--gp-radius); overflow: hidden; }
.field-picker-head, .field-picker-row { display: grid; grid-template-columns: minmax(10rem, 1fr) auto; gap: 1rem; align-items: center; padding: .55rem .9rem; }
.field-picker-head { background: var(--gp-bg); font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gp-muted); }
.field-picker-row { border-top: 1px solid var(--gp-border); }
.field-picker-row.is-unused .field-picker-name { color: var(--gp-muted); }
.field-picker-name { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.field-type { font-size: .75rem; color: var(--gp-muted); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--gp-bg); border: 1px solid var(--gp-border); border-radius: 999px; }
.segmented-option { padding: .3rem .8rem; font-size: .85rem; border-radius: 999px; cursor: pointer; color: var(--gp-muted); white-space: nowrap; user-select: none; }
.segmented-option:hover { color: var(--gp-text); }
.btn-check:checked + .segmented-option { background: var(--gp-surface); color: var(--gp-primary-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.btn-check:focus-visible + .segmented-option { outline: 2px solid var(--gp-primary); outline-offset: 1px; }
@media (max-width: 767.98px) {
  .field-picker-head { display: none; }
  .field-picker-row { grid-template-columns: 1fr; gap: .4rem; }
  .segmented { display: flex; flex-wrap: wrap; border-radius: var(--gp-radius-sm); }
  .segmented-option { flex: 1 1 auto; text-align: center; border-radius: .4rem; }
}

/* Charts (app/static/js/charts.js). Palette from the validated reference: one accent, an ordinal blue ramp
   for review stages, and reserved status colors that always carry an icon. */
:root {
  --chart-surface: #ffffff; --chart-ink: #111827; --chart-ink-2: #4b5160; --chart-muted: #8a909c; --chart-grid: #e6e8ec;
  --chart-accent: #2a78d6; --chart-deemph: #bfc4cc;
  --chart-ord-1: #86b6ef; --chart-ord-2: #3987e5; --chart-ord-3: #256abf; --chart-ord-4: #104281;
  --chart-good: #0ca30c; --chart-warning: #fab219; --chart-critical: #d03b3b;
}
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg text { font-family: inherit; }
.chart svg g[tabindex]:focus { outline: none; }
.chart svg g[tabindex]:focus-visible rect:first-child { stroke: var(--gp-primary); stroke-width: 2; }
.chart-tip {
  position: fixed; z-index: 1080; pointer-events: none; max-width: 300px; padding: .5rem .7rem; border-radius: var(--gp-radius-sm);
  background: #111827; color: #f3f4f6; font-size: .82rem; line-height: 1.45; opacity: 0; transition: opacity .12s;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip b { font-weight: 650; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: .85rem; color: var(--gp-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-status { width: 16px; height: 16px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; font-style: normal; }
.chart-table summary { cursor: pointer; font-size: .85rem; color: var(--gp-primary-ink); }
.chart-table table { margin-top: .5rem; }
@media (prefers-reduced-motion: reduce) { .chart-tip { transition: none; } }
.segmented-option.btn-reset { border: 0; background: transparent; font: inherit; font-size: .85rem; }
.segmented-option[aria-pressed="true"] { background: var(--gp-surface); color: var(--gp-primary-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.review-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
.review-counts dt { font-size: .78rem; font-weight: 600; color: var(--gp-muted); }
.review-counts dd { margin: 0; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-dash { width: 18px; border-top: 1.5px dashed var(--chart-ink-2); display: inline-block; }

/* Program page: sub-tabs and the stage card */
/* The bottom rule is an inset shadow, so the active tab's underline sits on it without overflowing
   the row (overflow there made browsers add a scrollbar). */
.page-tabs { display: flex; gap: .25rem; box-shadow: inset 0 -1px 0 var(--gp-border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
  padding: .55rem .9rem; border-bottom: 2px solid transparent; color: var(--gp-muted);
  text-decoration: none; font-weight: 500; white-space: nowrap;
}
.page-tab:hover { color: var(--gp-text); }
.page-tab.is-active { color: var(--gp-primary-ink); border-bottom-color: var(--gp-primary); font-weight: 600; }
.page-tab-count { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; margin-left: .2rem; border-radius: 999px; background: var(--gp-neutral-bg); color: var(--gp-neutral-ink); font-size: .75rem; text-align: center; }
.stage-card {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap;
  padding: 1.25rem 1.5rem; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); box-shadow: var(--gp-shadow);
}
.stage-main { flex: 1 1 24rem; min-width: 0; }
.stage-action { display: flex; gap: .5rem; flex-wrap: wrap; }
.stage-pill { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .03em; padding: .15rem .6rem; border-radius: 999px; background: var(--gp-neutral-bg); color: var(--gp-neutral-ink); margin-bottom: .4rem; }
.stage-open .stage-pill, .stage-upcoming .stage-pill { background: var(--gp-success-bg); color: var(--gp-success-ink); }
.stage-review .stage-pill { background: var(--gp-info-bg); color: var(--gp-info-ink); }
.stage-title { font-size: 1.2rem; font-weight: 650; margin: 0 0 .2rem; }
.stage-text { margin: 0; color: var(--gp-muted); }
.stage-steps { flex-basis: 100%; }
@media (min-width: 768px) { .review-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Question builder: outline of application pages + drawer (programs/_question_builder.html) */
.qb-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .82rem; color: var(--gp-muted); margin-bottom: .85rem; }
.qb-outline { display: grid; gap: .9rem; }
.qb-page { border: 1px solid var(--gp-border); border-radius: var(--gp-radius); overflow: hidden; background: var(--gp-surface); }
.qb-page-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding: .55rem .85rem; background: #fafbfc; border-bottom: 1px solid var(--gp-border); }
.qb-page-name { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.qb-page-name h3 { font-size: .92rem; font-weight: 650; margin: 0; }
.qb-page-no { font-size: .7rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--gp-muted); }
.qb-count { color: var(--gp-muted); font-size: .82rem; }
.qb-rename { display: flex; gap: .4rem; align-items: center; }
.qb-rename input { width: 16rem; max-width: 60vw; }
.qb-link { border: 0; background: none; padding: 0; color: var(--gp-primary-ink); font-size: .85rem; font-weight: 500; cursor: pointer; }
.qb-link:hover { text-decoration: underline; }
.qb-rows { list-style: none; margin: 0; padding: 0; }
.qb-row { display: grid; grid-template-columns: 1rem 1.6rem minmax(0, 1fr) auto; gap: .5rem; align-items: center; padding: .5rem .85rem; border-top: 1px solid var(--gp-border); }
.qb-row:first-child { border-top: 0; }
.qb-row:hover { background: #f7f9fc; }
.qb-row.is-dragging { opacity: .5; background: var(--gp-primary-soft); }
.qb-grip { color: #b9bec7; cursor: grab; letter-spacing: -2px; user-select: none; }
.qb-num { color: var(--gp-muted); font-size: .78rem; text-align: right; font-variant-numeric: tabular-nums; }
.qb-label { color: var(--gp-text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-label:hover { color: var(--gp-primary-ink); text-decoration: underline; }
.qb-req { color: var(--gp-primary-ink); font-weight: 700; margin-left: 2px; }
.qb-meta { display: flex; gap: .5rem; align-items: center; color: var(--gp-muted); font-size: .8rem; white-space: nowrap; }
.qb-tag { font-size: .72rem; color: var(--gp-muted); border: 1px solid var(--gp-border); border-radius: 999px; padding: 0 .5rem; white-space: nowrap; }
.qb-empty { padding: 2rem 1rem; text-align: center; color: var(--gp-muted); border: 1px dashed var(--gp-border); border-radius: var(--gp-radius); }
.qb-add-menu { min-width: 17rem; }
.qb-add-menu .dropdown-item { white-space: normal; }

.qb-scrim { position: fixed; inset: 0; background: rgba(17, 24, 39, .25); z-index: 1040; }
.qb-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1045; width: min(30rem, 100%);
  display: flex; flex-direction: column; background: var(--gp-surface); border-left: 1px solid var(--gp-border);
  box-shadow: -12px 0 32px rgba(15, 23, 42, .12); transform: translateX(105%); transition: transform .2s ease; visibility: hidden;
}
.qb-drawer.is-open { transform: none; visibility: visible; }
.qb-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.qb-pane[hidden] { display: none; }
.qb-drawer-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1rem; padding-top: calc(.85rem + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--gp-border); }
.qb-drawer-head b { font-size: 1rem; }
.qb-drawer-head small { display: block; color: var(--gp-muted); font-size: .8rem; }
.qb-drawer-body { flex: 1; overflow-y: auto; padding: 1rem; display: grid; gap: .9rem; align-content: start; }
.qb-drawer-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--gp-border); }
body.qb-locked { overflow: hidden; }
.qb-type-group h4 { font-size: .7rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--gp-muted); margin: 0 0 .4rem; }
.qb-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.qb-type { display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: .1rem .55rem; align-items: start; text-align: left; padding: .55rem .7rem; border: 1px solid var(--gp-border); border-radius: var(--gp-radius-sm); background: var(--gp-surface); color: var(--gp-text); }
.qb-type:hover { border-color: #b9cbe6; background: #fbfcfe; }
.qb-type:focus-visible { outline: 2px solid var(--gp-primary); outline-offset: 2px; }
.qb-type-icon { grid-row: span 2; width: 1.9rem; height: 1.9rem; border-radius: .5rem; background: var(--gp-primary-soft); color: var(--gp-primary-ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.qb-type b { font-size: .88rem; font-weight: 600; }
.qb-type small { color: var(--gp-muted); font-size: .76rem; line-height: 1.35; }
.qb-type-chip-row { display: flex; align-items: center; gap: .5rem; }
.qb-type-chip { font-size: .8rem; font-weight: 600; color: var(--gp-primary-ink); background: var(--gp-primary-soft); border-radius: 999px; padding: .1rem .65rem; }
.qb-field { display: grid; gap: .3rem; }
.qb-field label, .qb-flabel { font-size: .85rem; font-weight: 600; }
.qb-error { color: var(--gp-danger-ink); font-size: .8rem; font-weight: 600; }
.qb-grid2 { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; }
.qb-switch-field { padding-bottom: .4rem; }
.qb-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.qb-subhead { font-size: .7rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--gp-muted); }
.qb-options { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.qb-option { display: grid; grid-template-columns: .8rem minmax(0, 1fr) auto; gap: .4rem; align-items: center; }
.qb-remove { border: 0; background: none; color: var(--gp-muted); font-size: 1.1rem; line-height: 1; padding: .1rem .4rem; }
.qb-preview { border: 1px dashed var(--gp-border); border-radius: var(--gp-radius-sm); padding: .7rem .85rem; display: grid; gap: .4rem; background: var(--gp-bg); }
.qb-preview > div { display: grid; gap: .4rem; }
.qb-mock-q { font-weight: 600; font-size: .9rem; }
.qb-mock { border: 1px solid var(--gp-border); border-radius: .5rem; background: #fff; padding: .35rem .6rem; color: #9aa1ad; font-size: .85rem; min-height: 2rem; }
.qb-mock-area { min-height: 3.5rem; }
.qb-mock-short { max-width: 10rem; }
.qb-mock-choice { display: flex; align-items: center; gap: .45rem; font-size: .85rem; }
.qb-mock-choice i { width: .9rem; height: .9rem; border: 1.5px solid #9aa1ad; border-radius: 50%; display: inline-block; }
.qb-mock-choice i.is-box { border-radius: 3px; }
.qb-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.qb-chip { font-size: .78rem; border-radius: 999px; padding: .15rem .65rem; border: 1px solid var(--gp-border); background: var(--gp-surface); color: var(--gp-muted); }
.qb-chip[aria-pressed="true"] { background: var(--gp-primary-soft); color: var(--gp-primary-ink); border-color: transparent; font-weight: 600; }
.qb-bank-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--gp-border); border-radius: var(--gp-radius-sm); overflow: hidden; }
.qb-bank-list > li + li { border-top: 1px solid var(--gp-border); }
.qb-bank-item { display: grid; grid-template-columns: 1rem minmax(0, 1fr); gap: .65rem; padding: .55rem .75rem; cursor: pointer; margin: 0; }
.qb-bank-item:hover { background: #f7f9fc; }
.qb-bank-item.is-picked { background: var(--gp-primary-soft); }
.qb-bank-item.is-used { cursor: default; background: #fafbfc; color: var(--gp-muted); }
.qb-bank-item input { margin-top: .25rem; accent-color: var(--gp-primary); }
.qb-bank-label { display: block; font-size: .88rem; }
.qb-bank-meta { display: block; font-size: .76rem; color: var(--gp-muted); }
.qb-bank-empty { padding: 1rem; text-align: center; color: var(--gp-muted); }
@media (max-width: 575.98px) {
  .qb-row { grid-template-columns: .8rem minmax(0, 1fr) auto; }
  .qb-num { display: none; }
  .qb-meta > span:last-child { display: none; }
  .qb-type-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .qb-drawer { transition: none; } }
.step-default-submit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; padding: 0; }

/* Assign reviewers: applications grouped by what they need, one plain line per reviewer */
.ar { display: grid; gap: 1rem; padding-bottom: .5rem; }
.ar-group { display: grid; gap: .5rem; }
.ar-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.ar-group-title { font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--gp-muted); margin: 0; }
.ar-row {
  display: grid; grid-template-columns: 1.1rem minmax(0, 14rem) minmax(0, 1fr); gap: .5rem .9rem; align-items: start;
  padding: .7rem .9rem; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius);
}
.ar-row.is-selected { background: var(--gp-primary-soft); border-color: transparent; }
.ar-row .form-check-input { margin-top: .2rem; }
.ar-name { font-weight: 500; cursor: pointer; }
.ar-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; min-width: 0; }
.ar-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; font-size: .88rem; }
.ar-line.is-recused { color: var(--gp-muted); text-decoration: line-through; }
.ar-who { font-weight: 600; }
.ar-meta { color: var(--gp-muted); }
.ar-status { color: var(--gp-muted); font-size: .82rem; }
.ar-status.is-done::before { content: "✓ "; }
.ar-remove { border: 0; background: none; padding: 0; color: var(--gp-primary-ink); font-size: .82rem; }
.ar-remove:hover { text-decoration: underline; }
.ar-none { font-size: .88rem; font-weight: 600; color: var(--gp-warning-ink); }
.ar-bar {
  position: sticky; bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); z-index: 10;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem .9rem;
  background: #1f2937; color: #fff; border-radius: var(--gp-radius); box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
}
.ar-step { display: grid; gap: .5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.ar-step legend { font-size: .85rem; font-weight: 650; margin-bottom: .1rem; float: none; width: auto; padding: 0; }
.ar-kinds { display: inline-flex; justify-self: start; padding: 3px; gap: 2px; background: var(--gp-bg); border: 1px solid var(--gp-border); border-radius: 999px; }
.ar-kinds button { border: 0; background: transparent; color: var(--gp-muted); font-size: .82rem; padding: .25rem .8rem; border-radius: 999px; }
.ar-kinds button[aria-pressed="true"] { background: var(--gp-surface); color: var(--gp-primary-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.ar-options { display: grid; gap: .4rem; }
.ar-options[hidden] { display: none; }
.ar-option { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: .55rem; align-items: start; padding: .55rem .7rem; border: 1px solid var(--gp-border); border-radius: var(--gp-radius-sm); cursor: pointer; margin: 0; font-size: .9rem; }
.ar-option:has(input:checked) { border-color: var(--gp-primary); background: var(--gp-primary-soft); }
.ar-option .form-check-input { margin-top: .2rem; }
.ar-option small { display: block; color: var(--gp-muted); font-size: .78rem; }
.ar-questions { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem 1rem; padding: .6rem .75rem; border: 1px solid var(--gp-border); border-radius: var(--gp-radius-sm); font-size: .86rem; }
.ar-questions[hidden] { display: none; }
.ar-questions label { display: flex; gap: .45rem; align-items: center; }
.ar-foot { display: grid; gap: .5rem; }
.ar-summary { margin: 0; font-size: .9rem; }
@media (max-width: 575.98px) {
  .ar-row { grid-template-columns: 1.1rem minmax(0, 1fr); }
  .ar-row .ar-lines, .ar-row .ar-none { grid-column: 2; }
  .ar-questions { grid-template-columns: 1fr; }
}

/* Post-award recipient page */
.recipient-facts { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1.5rem; margin: .6rem 0 0; font-size: .9rem; }
.recipient-facts > div { display: flex; align-items: center; gap: .35rem; }
.recipient-facts dt { font-weight: 400; color: var(--gp-muted); }
.recipient-facts dd { margin: 0; font-weight: 500; color: var(--gp-text); }
.btn-xs { padding: .1rem .55rem; font-size: .8rem; border-radius: 999px; }
.report-status-summary { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; flex-wrap: wrap; }
.recipient-summary { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(0, 3fr); gap: 1rem; }
.recipient-summary > :only-child { grid-column: 1 / -1; }
.recipient-expended-value { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; margin: .15rem 0 .5rem; }
.recipient-meter { height: .5rem; border-radius: 999px; background: var(--gp-neutral-bg); overflow: hidden; margin-bottom: .35rem; }
.recipient-meter span { display: block; height: 100%; background: var(--gp-primary); border-radius: 999px; }
.milestone-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.milestone { position: relative; display: grid; justify-items: center; text-align: center; gap: .2rem; padding: 0 .35rem .25rem; }
.milestone::before { content: ""; position: absolute; top: .7rem; left: -50%; width: 100%; height: 2px; background: var(--gp-border); z-index: 0; }
.milestone:first-child::before { display: none; }
.milestone.is-done::before { background: var(--gp-success-ink); }
.milestone-dot {
  position: relative; z-index: 1; width: 1.45rem; height: 1.45rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--gp-surface); border: 2px solid var(--gp-border); color: #fff; font-size: .72rem; font-weight: 700;
}
.milestone.is-done .milestone-dot { background: var(--gp-success-ink); border-color: var(--gp-success-ink); }
.milestone-label { font-size: .8rem; font-weight: 600; line-height: 1.25; }
.milestone-date { font-size: .78rem; color: var(--gp-muted); }
.milestone:not(.is-done) .milestone-date { color: #9aa1ad; }
.report-actions { white-space: nowrap; }
.report-actions form + a, .report-actions a + form { margin-left: .35rem; }
.recipient-history { list-style: none; margin: 0; padding: 0; display: grid; }
.recipient-history li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--gp-border); }
.recipient-history li:first-child { border-top: 0; }
@media (max-width: 767.98px) {
  .recipient-summary { grid-template-columns: 1fr; }
  .recipient-history li { grid-template-columns: 1fr; gap: .1rem; }
}
.milestone-hit { display: grid; justify-items: center; gap: .2rem; border: 0; background: none; padding: 0 0 .25rem; width: 100%; color: inherit; border-radius: var(--gp-radius-sm); }
button.milestone-hit:hover .milestone-dot { border-color: var(--gp-primary); }
button.milestone-hit:hover .milestone-date, button.milestone-hit:focus-visible .milestone-date { color: var(--gp-primary-ink); }
.milestone-hit:focus-visible { outline: 2px solid var(--gp-primary); outline-offset: 2px; }
.milestone-hit[aria-expanded="true"] .milestone-dot { border-color: var(--gp-primary); box-shadow: 0 0 0 3px var(--gp-primary-soft); }
.milestone-pop {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); z-index: 20; width: 14rem; margin-top: .35rem;
  padding: .75rem; text-align: left; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); box-shadow: var(--gp-shadow);
}
.milestone-pop[hidden] { display: none; }
.milestone-pop-actions { display: flex; justify-content: flex-end; align-items: center; gap: .4rem; margin-top: .5rem; }
.milestone-pop-actions .js-milestone-clear { margin-right: auto; }
.milestone-bar { padding-bottom: .25rem; }
.recipient-milestones, .recipient-milestones .card-body { overflow: visible; }
@media (max-width: 767.98px) {
  /* Phones: milestones stack as a vertical checklist, the line running down the left. */
  .milestone-bar { grid-auto-flow: row; gap: .1rem; }
  .milestone { display: block; padding: .3rem 0; }
  .milestone::before { display: none; }
  .milestone-hit { grid-template-columns: 1.45rem minmax(0, 1fr) auto; justify-items: start; text-align: left; align-items: center; column-gap: .6rem; padding: 0; }
  .milestone-pop { left: 0; transform: none; }
}

/* Post-award fields: milestone type and the program's milestone order */
.field-type.is-milestone { color: var(--gp-success-ink); font-weight: 600; }
.milestone-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-width: 32rem; }
.milestone-order-item {
  display: grid; grid-template-columns: 1rem 1.5rem minmax(0, 1fr) auto auto; gap: .4rem; align-items: center;
  padding: .35rem .5rem .35rem .7rem; border: 1px solid var(--gp-border); border-radius: var(--gp-radius-sm); background: var(--gp-surface);
}
.milestone-order-item.is-dragging { opacity: .5; background: var(--gp-primary-soft); }
.milestone-order-grip { color: #b9bec7; cursor: grab; letter-spacing: -2px; }
.milestone-order-num { color: var(--gp-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.milestone-order-item .btn-link { text-decoration: none; padding: .1rem .4rem; }

/* Setup -> Post-award fields */
.pa-types { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .4rem 1.5rem; font-size: .88rem; color: var(--gp-muted); }
.pa-types b { color: var(--gp-text); margin-right: .25rem; }
.pa-add { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.pa-add-name { flex: 1 1 18rem; }
.pa-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--gp-border); border-radius: var(--gp-radius); overflow: hidden; }
.pa-row { border-top: 1px solid var(--gp-border); background: var(--gp-surface); }
.pa-row:first-child { border-top: 0; }
.pa-row.is-dragging { opacity: .5; background: var(--gp-primary-soft); }
.pa-view { display: grid; grid-template-columns: 1rem minmax(0, 1fr) 7rem 10rem auto; gap: .75rem; align-items: center; padding: .55rem .85rem; }
.pa-view[hidden], .pa-edit[hidden] { display: none; }
.pa-grip { color: #b9bec7; cursor: grab; letter-spacing: -2px; user-select: none; }
.pa-name { font-weight: 500; }
.pa-type { font-size: .82rem; color: var(--gp-muted); }
.pa-type.is-milestone { color: var(--gp-success-ink); font-weight: 600; }
.pa-actions { display: flex; gap: .15rem; align-items: center; }
.pa-actions .btn-link { text-decoration: none; padding: .15rem .45rem; }
.pa-edit { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .55rem .85rem; background: var(--gp-primary-soft); }
.pa-edit input { flex: 1 1 14rem; }
.pa-edit select { width: auto; }
.pa-archived { list-style: none; margin: 0; padding: 0; display: grid; }
.pa-archived li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .35rem 0; border-top: 1px solid var(--gp-border); }
.pa-archived li:first-child { border-top: 0; }
@media (max-width: 767.98px) {
  .pa-view { grid-template-columns: 1rem minmax(0, 1fr) auto; }
  .pa-type, .pa-usage { grid-column: 2; }
  .pa-actions { grid-column: 3; grid-row: 1 / span 3; }
}
.mentor-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--gp-border); border-radius: var(--gp-radius-sm); }
.mentor-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .35rem .4rem .35rem .75rem; border-top: 1px solid var(--gp-border); }
.mentor-list li:first-child { border-top: 0; }
.mentor-add { max-width: 26rem; }

/* Top menu: current section. Section tabs sit under it on landing pages. */
.site-header .nav-link.active { color: var(--gp-primary-ink); background: var(--gp-primary-soft); border-radius: .4rem; font-weight: 600; }
.section-tabs { background: #f1f5fb; border-top: 1px solid #dfe6f1; }
.section-tabs .page-tabs { box-shadow: none; }
.page-tab-count.is-alert { background: var(--gp-danger-bg); color: var(--gp-danger-ink); }

/* Setup: side navigation beside each page */
.setup-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.setup-nav { display: grid; gap: .1rem; }
.setup-nav-group { margin: .9rem 0 .2rem; padding: 0 .6rem; color: var(--gp-muted); font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.setup-nav-group:first-child { margin-top: 0; }
.setup-nav-link { padding: .35rem .6rem; border-radius: .4rem; color: var(--gp-text); text-decoration: none; }
.setup-nav-link:hover { background: var(--gp-neutral-bg); color: var(--gp-text); }
.setup-nav-link.is-active { background: var(--gp-primary-soft); color: var(--gp-primary-ink); font-weight: 600; }
@media (max-width: 991.98px) {
  .setup-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .setup-nav { display: flex; overflow-x: auto; gap: .25rem; padding-bottom: .25rem; scrollbar-width: none; }
  .setup-nav-group { display: none; }
  .setup-nav-link { white-space: nowrap; }
}

/* Dashboard status line under Needs your attention */
.status-line { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--gp-muted); font-size: .9rem; }
.status-line a { color: inherit; }
.status-line b { color: var(--gp-text); font-weight: 600; }

/* Breadcrumb above the page title */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; color: var(--gp-muted); font-size: .85rem; }
.breadcrumbs a { color: var(--gp-primary-ink); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.nav-search { width: 16rem; }
.error-page { padding: 3rem 0; }
@media (max-width: 991.98px) { .nav-search { width: 100%; margin: .5rem 0; } }

/* Compact row of figures, for pages where the table below is the main content */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr)); gap: .9rem 1rem; padding: 1rem 1.25rem; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); }
.stat-label { color: var(--gp-muted); font-size: .75rem; font-weight: 600; }
.stat-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-value .summary-value-of { font-size: .85rem; }
.stat-meta { color: var(--gp-muted); font-size: .75rem; }

/* Setup > Notifications */
.notif-filter { display: flex; flex-wrap: wrap; gap: .35rem; }
.notif-table th:first-child, .notif-switch { width: 3.5rem; }
.notif-days { width: 5rem; }
.email-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.email-preview-subject { padding: .5rem .75rem; background: var(--gp-surface); border: 1px solid var(--gp-border); border-bottom: 0; border-radius: var(--gp-radius-sm) var(--gp-radius-sm) 0 0; font-size: .9rem; }
.email-preview { display: block; width: 100%; height: 34rem; border: 1px solid var(--gp-border); border-radius: 0 0 var(--gp-radius-sm) var(--gp-radius-sm); background: #f4f5f8; }
@media (max-width: 1199.98px) { .email-editor { grid-template-columns: minmax(0, 1fr); } }
.notif-switch .form-check { padding-left: 0; margin: 0; min-height: 0; }
.notif-switch .form-check-input { float: none; flex: none; width: 2.25rem; min-width: 2.25rem; height: 1.25rem; margin: 0; }

/* Bootstrap's d-flex would otherwise keep filtered-out rows visible. */
[data-filter-text][hidden] { display: none !important; }

/* Recent drawer */
.recent-button { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; flex: none; border: 1px solid var(--gp-border); border-radius: 50%; background: var(--gp-surface); color: var(--gp-muted); }
.recent-button:hover { color: var(--gp-primary-ink); background: var(--gp-primary-soft); }
.recent-drawer { --bs-offcanvas-width: 22rem; }
.recent-group { margin: .9rem 0 .25rem; color: var(--gp-muted); font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.recent-group:first-child { margin-top: 0; }
.recent-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .6rem; padding: .4rem .5rem; border-radius: .4rem; color: var(--gp-text); text-decoration: none; }
.recent-item:hover { background: var(--gp-neutral-bg); color: var(--gp-text); }
.recent-title { font-weight: 600; overflow-wrap: anywhere; }
.recent-type { color: var(--gp-muted); font-size: .75rem; }
.recent-detail { grid-column: 1 / -1; color: var(--gp-muted); font-size: .8rem; }
@media (max-width: 575.98px) { .recent-drawer { --bs-offcanvas-width: 100%; } }

/* Table rows that open a record when clicked anywhere. */
tr.row-link { cursor: pointer; }
tr.row-link:hover > td { background: var(--gp-primary-soft); }
.row-link-main { display: block; color: inherit; text-decoration: none; }
.row-link-main .small { color: var(--gp-primary-ink); }
.row-link-main:hover .small { text-decoration: underline; }

/* A scrollable list of people or questions to tick. */
.people-pick { max-height: 14rem; overflow-y: auto; }

/* Help with this page: floating button bottom right, and its drawer. */
.help-fab {
  --help-lift: 0px;
  position: fixed; right: 1rem; bottom: calc(1rem + var(--help-lift) + env(safe-area-inset-bottom, 0px)); z-index: 1035;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .8rem .35rem .35rem; border: 1px solid var(--gp-border); border-radius: 999px;
  background: var(--gp-surface); color: var(--gp-text); font-weight: 600; font-size: .9rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .14); transition: bottom .15s ease, opacity .15s ease;
}
.help-fab:hover, .help-fab:focus-visible { border-color: var(--gp-primary); }
.help-fab-mark {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--gp-primary); color: #fff; font-size: .95rem; font-weight: 700;
}
.help-fab.is-open { opacity: 0; pointer-events: none; }
@media (max-width: 767.98px) {
  .help-fab { padding: .35rem; right: .75rem; }
  .help-fab-label { display: none; }
}
@media print { .help-fab, .help-drawer { display: none !important; } }
.help-drawer { --bs-offcanvas-width: min(26rem, 100%); }
.help-role {
  display: inline-block; margin-top: .25rem; padding: .05rem .45rem; border-radius: .3rem;
  background: var(--gp-primary-soft); color: var(--gp-primary-ink); font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.help-body { margin-top: .75rem; font-size: .93rem; }
.help-body h2, .help-body h3 { font-size: .95rem; font-weight: 700; margin: 1rem 0 .35rem; }
.help-body ul, .help-body ol { padding-left: 1.2rem; margin-bottom: .6rem; }
.help-body li { margin: .15rem 0; }
.help-body p { margin-bottom: .6rem; }
.help-guide h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.help-guide-link { display: inline-block; margin-top: .5rem; font-weight: 600; }
.help-kbd { font-size: .7rem; padding: .05rem .35rem; color: var(--gp-muted); background: var(--gp-neutral-bg); border: 1px solid var(--gp-border); }

/* Search answers (questions typed in the search box). */
.ask-card { border-left: 4px solid var(--gp-primary) !important; }
.ask-badge { font-size: .7rem; font-weight: 700; letter-spacing: .05em; padding: .05rem .45rem; border-radius: .3rem; background: var(--gp-primary-soft); color: var(--gp-primary-ink); }
.ask-answer { font-size: 1.05rem; line-height: 1.55; }
.ask-rows summary { cursor: pointer; color: var(--gp-primary-ink); }

/* Guided demo panel (staging and local only), docked on the left. */
:root { --demo-w: 330px; --demo-tab: 44px; --demo-bg: #14213d; --demo-raised: #1c2c4f; --demo-line: #2a3a5e; --demo-ink: #e8eef8; --demo-muted: #9fb1cd; --demo-accent: #6fa0ff; }
.demo-panel { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1036; width: var(--demo-w); display: flex; background: var(--demo-bg); color: var(--demo-ink); font-size: .875rem; box-shadow: 2px 0 16px rgba(10, 20, 40, .18); padding-top: env(safe-area-inset-top, 0px); }
.demo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.demo-tab { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 10px; z-index: 1; width: 28px; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--demo-muted); }
.demo-tab:hover, .demo-tab:focus-visible { color: var(--demo-ink); background: var(--demo-raised); }
.demo-tab-count { display: none; }
.demo-title { padding-right: 32px; }
.demo-tab-label { display: none; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .75rem; font-weight: 600; letter-spacing: .06em; }
.demo-tab-count { font-size: .7rem; font-weight: 700; padding: 0 .4rem; border-radius: 999px; background: var(--demo-accent); color: var(--demo-bg); }
.demo-head { padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--demo-line); display: grid; gap: .65rem; }
.demo-title { display: flex; align-items: center; gap: .5rem; }
.demo-tag { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: #f0c860; color: #14213d; }
.demo-small { font-size: .75rem; color: var(--demo-muted); }
.demo-progress { display: grid; gap: .3rem; }
.demo-bar { height: 6px; border-radius: 3px; background: var(--demo-line); overflow: hidden; }
.demo-bar i { display: block; height: 100%; background: var(--demo-accent); }
.demo-actors { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.demo-actor { width: 100%; display: grid; justify-items: center; gap: 3px; padding: .45rem .2rem; border: 1px solid var(--demo-line); border-radius: 8px; background: transparent; color: var(--demo-muted); font-size: .68rem; }
.demo-actor:hover, .demo-actor:focus-visible { border-color: var(--demo-accent); color: var(--demo-ink); }
.demo-actor.is-on { border-color: var(--demo-accent); background: var(--demo-raised); color: var(--demo-ink); }
.demo-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .68rem; font-weight: 700; color: #fff; }
.demo-av-admin { background: #2a6fd1; } .demo-av-applicant { background: #1d7a46; } .demo-av-reviewer { background: #8a5cd0; } .demo-av-mentor { background: #c06a1a; }
.demo-steps { list-style: none; margin: 0; padding: .6rem .6rem 1rem; display: grid; gap: .2rem; }
.demo-step { display: grid; grid-template-columns: 24px 1fr; gap: .5rem; padding: .5rem; border-radius: 8px; }
.demo-n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--demo-line); display: grid; place-items: center; font-size: .68rem; color: var(--demo-muted); }
.demo-step.is-done .demo-n { background: #1d7a46; border-color: #1d7a46; color: #fff; }
.demo-step.is-done .demo-step-title { color: var(--demo-muted); text-decoration: line-through; text-decoration-color: var(--demo-line); }
.demo-step.is-now { background: var(--demo-raised); outline: 1px solid var(--demo-accent); padding: .75rem .6rem; }
.demo-step.is-now .demo-n { border-color: var(--demo-accent); color: var(--demo-ink); }
.demo-step.is-now .demo-step-title { font-weight: 600; }
.demo-step-main { min-width: 0; display: grid; gap: .45rem; }
.demo-step-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.demo-who { flex: none; font-size: .62rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; color: #fff; }
.demo-hint { margin: 0; font-size: .8rem; color: var(--demo-ink); }
.demo-btns { display: flex; flex-wrap: wrap; gap: .35rem; }
.demo-btn { display: inline-block; font-size: .78rem; font-weight: 600; padding: .35rem .65rem; border-radius: 6px; border: 1px solid var(--demo-line); background: transparent; color: var(--demo-ink); text-decoration: none; }
.demo-btn:hover { color: var(--demo-ink); border-color: var(--demo-accent); }
.demo-btn-primary { background: var(--demo-accent); border-color: var(--demo-accent); color: var(--demo-bg); }
.demo-btn-primary:hover { color: var(--demo-bg); filter: brightness(1.08); }
.demo-start, .demo-use-program, .demo-fill { padding: 1rem; display: grid; gap: .6rem; }
.demo-start p { margin: 0; color: var(--demo-muted); font-size: .82rem; }
.demo-finished { margin: 0 1rem .75rem; padding: .6rem .75rem; border-radius: 8px; background: #1d7a46; color: #fff; font-weight: 600; }
.demo-foot { margin-top: auto; padding: .6rem 1rem; border-top: 1px solid var(--demo-line); display: flex; justify-content: space-between; }
.demo-link { border: 0; background: transparent; padding: 0; font-size: .78rem; color: var(--demo-muted); text-decoration: underline; }
.demo-link:hover { color: var(--demo-ink); }
/* Open: the page moves over on wide screens; closed: only the tab shows. */
@media (min-width: 1200px) { body.has-demo-panel:not(.demo-closed) { padding-left: var(--demo-w); } }
body.demo-closed .demo-panel { width: 0; box-shadow: none; }
body.demo-closed .demo-body { display: none; }
body.demo-closed .demo-tab { top: 96px; right: -34px; width: 34px; padding: 10px 0; border-radius: 0 8px 8px 0; background: var(--demo-bg); color: var(--demo-ink); box-shadow: 2px 0 10px rgba(10, 20, 40, .18); }
body.demo-closed .demo-tab-count, body.demo-closed .demo-tab-label { display: block; }
body.demo-closed .demo-tab-arrow { transform: rotate(180deg); }
@media print { .demo-panel { display: none !important; } body.has-demo-panel { padding-left: 0 !important; } }

/* Home pages: a navy welcome banner, then the work (left) and dates and people (right). */
.home-hero { background: #1c5cab; color: #fff; border-radius: 20px; padding: 2rem; display: flex; flex-wrap: wrap; gap: 1.75rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.home-hero-text { flex: 1 1 22rem; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.home-hero-kicker { margin: 0; color: #dce6f5; font-size: .93rem; font-weight: 500; }
.home-hero h1 { margin: 0; font-size: 2.15rem; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.home-hero-lede { margin: 0; color: #eef3fa; font-size: 1.1rem; }
.home-hero a:not(.home-btn):not(.home-stat) { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.home-stats { flex: 1 1 28rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .75rem; }
.home-stat { display: block; background: rgba(255,255,255,.08); border-radius: 14px; padding: .9rem 1rem; color: #fff; }
a.home-stat:hover { background: rgba(255,255,255,.14); color: #fff; }
.home-stat-value { font-size: 1.85rem; font-weight: 700; line-height: 1.2; }
.home-stat-label { color: #e2eaf6; font-size: .87rem; }
.home-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: 0 1.4rem; border-radius: .5rem; background: #fff; color: #14213d; font-weight: 600; white-space: nowrap; }
.home-btn:hover { background: #e3eefb; color: #14213d; }
.home-next { flex: 0 1 20rem; background: rgba(255,255,255,.08); border-radius: 16px; padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.home-next-label { color: #c3cee0; font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.home-next-title { font-size: 1.25rem; font-weight: 700; }
.home-next.is-late { background: rgba(232, 93, 93, .22); }
.home-meter { height: .75rem; border-radius: 999px; background: rgba(255,255,255,.14); overflow: hidden; display: flex; gap: 2px; }
.home-meter i { display: block; height: 100%; }
.home-steps { display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; border-top: 1px solid rgba(255,255,255,.14); padding-top: 1.1rem; width: 100%; }

.home-layout { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.home-main { flex: 999 1 35rem; min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.home-side { flex: 1 1 19rem; min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.home-card { background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius-lg); box-shadow: var(--gp-shadow); padding: 1.5rem; display: flex; flex-direction: column; gap: .9rem; }
.home-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.home-card h2 { margin: 0; font-size: 1.3rem; font-weight: 600; }
.home-card-link { font-weight: 600; font-size: .93rem; }
.home-empty { margin: 0; color: var(--gp-muted); }

.home-task { display: flex; align-items: center; gap: 1rem; padding: .9rem; border: 1px solid var(--gp-border); border-radius: .75rem; flex-wrap: wrap; }
.home-task-text { flex: 1; min-width: 12rem; }
.home-task-title { font-weight: 600; }
.home-task-detail { color: var(--gp-muted); font-size: .93rem; }
.home-icon { width: 2.9rem; height: 2.9rem; flex: none; border-radius: .75rem; display: grid; place-items: center; }
.home-icon-late { background: var(--gp-danger-bg); color: var(--gp-danger-ink); }
.home-icon-draft { background: var(--gp-warning-bg); color: var(--gp-warning-ink); }
.home-icon-info { background: var(--gp-info-bg); color: var(--gp-info-ink); }

.home-chip { display: inline-flex; align-items: center; padding: .1rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.home-chip-success { background: var(--gp-success-bg); color: var(--gp-success-ink); }
.home-chip-info { background: var(--gp-info-bg); color: var(--gp-info-ink); }
.home-chip-warning { background: var(--gp-warning-bg); color: var(--gp-warning-ink); }
.home-chip-danger { background: var(--gp-danger-bg); color: var(--gp-danger-ink); }
.home-chip-neutral { background: var(--gp-neutral-bg); color: var(--gp-neutral-ink); }

.home-program { display: flex; flex-direction: column; gap: .4rem; }
.home-program + .home-program { padding-top: .9rem; border-top: 1px solid #eef1f5; }
.home-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.home-row-title { font-weight: 600; color: var(--gp-text); }
.home-small { color: var(--gp-muted); font-size: .87rem; }
.home-stage { display: flex; height: .65rem; border-radius: 999px; overflow: hidden; gap: 2px; background: #eef1f5; }
.home-stage i { display: block; height: 100%; }
.home-stage-draft { background: #9cc3f0; } .home-stage-waiting { background: #5c9be3; } .home-stage-underway { background: #2a78d6; }
.home-stage-done { background: #1c4f8f; } .home-stage-awarded { background: #14213d; }
.home-progress { height: .5rem; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.home-progress i { display: block; height: 100%; background: var(--gp-primary); }

.home-date { display: flex; gap: .9rem; align-items: center; color: var(--gp-text); }
.home-date:hover { color: var(--gp-text); }
.home-date-tile { width: 3.3rem; flex: none; text-align: center; border-radius: .65rem; background: var(--gp-info-bg); color: var(--gp-info-ink); padding: .35rem 0; line-height: 1.1; }
.home-date-tile b { display: block; font-size: 1.25rem; }
.home-date-tile span { font-size: .75rem; font-weight: 600; text-transform: uppercase; }
.home-activity { margin: 0; font-size: .93rem; }

.home-avatar { width: 2.9rem; height: 2.9rem; flex: none; border-radius: 50%; background: var(--gp-info-bg); color: var(--gp-info-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.home-avatar.is-hidden { background: var(--gp-neutral-bg); color: var(--gp-neutral-ink); font-size: .8rem; }
.home-ring { flex: none; }

.home-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.home-person { padding: 1.25rem; gap: .8rem; }
.home-months { display: flex; gap: .4rem; }
.home-dot { width: 1.45rem; height: 1.45rem; border-radius: .4rem; display: grid; place-items: center; font-size: .65rem; font-weight: 700; box-sizing: border-box; }
.home-dot-ok { background: #2a78d6; color: #fff; }
.home-dot-late { background: #e8a33d; color: #3d2600; }
.home-dot-miss { border: 2px solid #a22a2a; color: #a22a2a; }
.home-dot-due { border: 2px dashed #9aa3b2; color: #4b5160; }
.home-legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .85rem; color: var(--gp-neutral-ink); }
.home-legend span { display: inline-flex; gap: .35rem; align-items: center; }
.home-legend .home-dot { width: .9rem; height: .9rem; }
.home-bubble { background: #f4f6f9; border-radius: .75rem; padding: .75rem .9rem; font-size: .93rem; }
.home-bubble.is-mine { background: var(--gp-info-bg); }
.home-bubble p { margin: .25rem 0 0; color: #374151; white-space: pre-line; }

.home-track { border: 1px solid var(--gp-border); border-radius: .75rem; padding: 1rem; display: flex; flex-direction: column; gap: .85rem; }
.home-track-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; list-style: none; padding: 0; margin: 0; }
.home-track-steps li i { display: block; height: .4rem; border-radius: 999px; background: var(--gp-border); }
.home-track-steps li.is-done i { background: var(--gp-primary); }
.home-track-steps li span { display: block; font-size: .85rem; margin-top: .4rem; color: var(--gp-muted); }
.home-track-steps li.is-current span { color: var(--gp-text); font-weight: 600; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.home-month-strip { display: flex; gap: .5rem; flex-wrap: wrap; }
.home-month { flex: 1; min-width: 4.2rem; border-radius: .65rem; padding: .6rem .5rem; text-align: center; font-size: .85rem; box-sizing: border-box; color: var(--gp-text); }
.home-month b { display: block; font-size: .95rem; }
.home-month-ok { background: var(--gp-info-bg); color: var(--gp-info-ink); }
.home-month-late { background: var(--gp-warning-bg); color: var(--gp-warning-ink); }
.home-month-miss { background: var(--gp-danger-bg); color: var(--gp-danger-ink); }
.home-month-due { border: 2px dashed #9aa3b2; color: #374151; }
.home-list-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 0; flex-wrap: wrap; }
.home-list-row + .home-list-row { border-top: 1px solid #eef1f5; }
.home-check { display: flex; gap: .6rem; align-items: center; }
.home-check-mark { width: 1.5rem; height: 1.5rem; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; box-sizing: border-box; }
.home-check-mark.is-done { background: var(--gp-primary); color: #fff; }
.home-check-mark.is-todo { border: 2px solid #9aa3b2; }
@media (max-width: 575.98px) {
  .home-hero { padding: 1.5rem; }
  .home-hero h1 { font-size: 1.7rem; }
}
/* Guided demo: choosing a demo. */
.demo-actors-1 { grid-template-columns: minmax(0, 8rem); }
.demo-actors-2 { grid-template-columns: repeat(2, 1fr); }
.demo-path { display: flex; flex-direction: column; gap: .3rem; padding: .75rem .85rem; border: 1px solid var(--demo-line); border-radius: .75rem; background: var(--demo-raised); cursor: pointer; position: relative; }
.demo-path input { position: absolute; opacity: 0; pointer-events: none; }
.demo-path:has(input:checked) { border: 2px solid var(--demo-accent); }
.demo-path:has(input:focus-visible) { outline: 2px solid var(--demo-accent); outline-offset: 2px; }
.demo-path.is-off { cursor: not-allowed; opacity: .8; }
.demo-path-head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.demo-path-text { font-size: .87rem; color: #c3cee0; }
.demo-path-warn { font-size: .82rem; color: #f5c542; }
