/* RateMyResearchYear — "Clinical" theme
   Teal/green accent, system serif headings, flat and calm.
   No external fonts, icon fonts, or CDN requests (CSP + privacy).
   Re-skins the whole site through shared class names. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --surface: #f4f9f7;        /* light teal tint for panels */
  --surface-2: #eef5f2;
  --ink: #21302c;            /* body text */
  --ink-strong: #11342b;     /* headings */
  --muted: #5f7a72;
  --muted-2: #6b7a75;
  --accent: #0f6e56;         /* primary teal */
  --accent-dark: #0b5644;
  --accent-tint: #e1f5ee;    /* teal 50 */
  --on-accent: #ffffff;
  --on-accent-muted: #9fe1cb;
  --border: rgba(15, 110, 86, 0.16);
  --border-strong: rgba(15, 110, 86, 0.30);
  --warn-bg: #fdf6e3;
  --warn-border: #e7c66b;
  --warn-text: #6b4e0a;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --max-width: 1140px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink-strong);
  line-height: 1.25;
  margin-top: 0;
  font-weight: 600;
}
h1 { font-size: 2rem; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.125rem; }
p { margin-top: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---- Layout ---- */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header__inner,
main,
.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
main { padding-top: 2.5rem; padding-bottom: 3rem; min-height: 60vh; }

/* ---- Header / nav ---- */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}
.brand:hover { text-decoration: none; color: var(--accent-dark); }
.site-nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); font-size: 0.95rem; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); text-decoration: none; }
.btn--nav { padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: var(--accent-tint); color: var(--accent-dark); }

/* ---- Skip link / sr-only ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 0.5rem 1rem; background: var(--ink-strong); color: #fff; text-decoration: none;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Home hero band ---- */
.hero-band {
  background: var(--accent-dark);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: -2.5rem;
  padding: 3rem 1.25rem 2.75rem;
}
.hero-band__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}
.hero__title { font-size: 2.4rem; max-width: 18ch; margin: 0 auto; }
.hero-band .hero__title { color: #ffffff; }
.hero__lead {
  font-size: 1.125rem; color: var(--muted);
  max-width: 52ch; margin: 1rem auto 0; line-height: 1.6;
}
.hero-band .hero__lead { color: var(--on-accent-muted); }
.hero-search {
  display: flex; gap: 0; max-width: 480px; margin: 1.75rem auto 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: #fff;
}
.hero-band .hero-search { border-color: rgba(255, 255, 255, 0.25); }
.hero-search .search-input { flex: 1; border: none; border-radius: 0; }
.hero-search .search-input:focus { outline: none; }
.hero-search .btn { border-radius: 0; }
.trust-row {
  list-style: none; padding: 0; margin: 1.4rem 0 0;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  font-size: 0.875rem; color: var(--muted);
}
.hero-band .trust-row { color: #cdeee3; }
.trust-row li { display: inline-flex; align-items: center; gap: 0.4rem; }
.trust-check { color: var(--accent); font-weight: 700; }
.hero-band .trust-check { color: #ffffff; }

/* ---- Home sections ---- */
.home-section { margin-top: 3rem; }
.section-title { font-size: 1.4rem; margin-bottom: 1.25rem; }

.specialty-cards {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem;
}
.specialty-card { margin: 0; }
.specialty-card__link {
  display: flex; flex-direction: row; align-items: center; gap: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem; background: var(--bg); height: 100%;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.specialty-card__link:hover { border-color: var(--accent); background: var(--surface); text-decoration: none; }
.specialty-card__text { display: flex; flex-direction: column; gap: 0.2rem; }
.specialty-card__name { font-family: var(--font-serif); font-size: 1.15rem; color: var(--ink-strong); }
.specialty-card__cta { font-size: 0.85rem; color: var(--muted); }
.specialty-card__link:hover .specialty-card__cta { color: var(--accent); }

/* ---- Specialty initial badges ---- */
.specialty-badge {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 0.9rem;
}
.specialty-badge--c1 { background: #E1F5EE; color: #085041; }
.specialty-badge--c2 { background: #E6F1FB; color: #0C447C; }
.specialty-badge--c3 { background: #FBEAF0; color: #993556; }
.specialty-badge--c4 { background: #FAEEDA; color: #854F0B; }
.specialty-badge--c5 { background: #ECE7FA; color: #563091; }

/* steps */
.home-steps { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.step { display: flex; gap: 0.85rem; align-items: flex-start; }
.step__num {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem; font-weight: 600;
}
.step__num--c1 { background: #E1F5EE; color: #085041; }
.step__num--c2 { background: #E6F1FB; color: #0C447C; }
.step__num--c3 { background: #FBEAF0; color: #993556; }
.step__num--c4 { background: #FAEEDA; color: #854F0B; }
.step__num--c5 { background: #ECE7FA; color: #563091; }
.step__body { display: flex; flex-direction: column; gap: 0.2rem; }
.step__title { font-weight: 600; color: var(--ink-strong); }
.step__text { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

/* ---- Legacy specialty pill list (fallback) ---- */
.specialty-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.specialty-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 1rem; }
.specialty-list a { font-weight: 600; }

/* ---- Lead paragraph ---- */
.lead { font-size: 1.125rem; line-height: 1.7; color: var(--muted); }

/* ---- Forms / inputs ---- */
input[type="text"], input[type="search"], input[type="email"], input[type="number"],
select, textarea {
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  padding: 0.6rem 0.75rem; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: #fff; width: 100%;
}
textarea { resize: vertical; min-height: 7rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
label { font-weight: 600; color: var(--ink-strong); font-size: 0.95rem; }

.search-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.search-input { flex: 1 1 260px; }

/* form layout for the review/report forms */
.form-field { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; }
.form-help { font-size: 0.8125rem; color: var(--muted); }
.form-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---- Filter form ---- */
.filter-form { margin-bottom: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-group label { font-size: 0.8125rem; color: var(--muted); }
.filter-group select { padding: 0.45rem 0.6rem; font-size: 0.9375rem; width: auto; }

/* ---- PI list / cards ---- */
.pi-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.pi-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.4rem; background: var(--bg); transition: border-color 0.12s ease; }
.pi-card:hover { border-color: var(--accent); }
.pi-card__header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; }
.pi-card__name { font-size: 1.2rem; margin: 0; font-family: var(--font-serif); }
.pi-card__name a { font-weight: 600; color: var(--ink-strong); }
.pi-card__name a:hover { color: var(--accent); }
.pi-card__institution, .pi-card__specialty { font-size: 0.875rem; color: var(--muted); }
.pi-card__meta { margin-top: 0.6rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.pi-card__link { display: inline-block; margin-top: 0.75rem; font-size: 0.9rem; font-weight: 600; }

/* ---- Rating badge ---- */
.rating-badge { display: inline-block; background: var(--accent-tint); color: var(--accent-dark); border-radius: var(--radius); padding: 0.2rem 0.6rem; font-size: 0.875rem; font-weight: 600; }
.rating-badge--none { background: var(--surface); color: var(--muted); font-weight: 400; }
.review-count { font-size: 0.875rem; color: var(--muted); }

/* ---- PI profile ---- */
.pi-header { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.pi-header h1 { margin-bottom: 0.25rem; }
.pi-header__specialty, .pi-header__institution, .pi-header__years { margin: 0.25rem 0; color: var(--muted); }

.agg-section { position: relative; margin-bottom: 2rem; padding: 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.agg-count { font-size: 0.875rem; color: var(--muted); margin-bottom: 1rem; }
.rating-grid { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.rating-row { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; }
.rating-row dt { font-size: 0.875rem; color: var(--muted); }
.rating-value { font-weight: 600; font-size: 0.95rem; color: var(--ink-strong); }

.alumni-section { margin-bottom: 2rem; padding: 1.4rem; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.alumni-note { font-size: 0.8125rem; color: var(--muted); font-style: italic; }
.alumni-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0.75rem 0; }
.alumni-stat dt { font-size: 0.8125rem; color: var(--muted); }
.alumni-stat dd { font-size: 1.4rem; font-weight: 600; margin: 0; font-family: var(--font-serif); color: var(--ink-strong); }
.alumni-breakdown { font-size: 0.875rem; color: var(--muted); }

/* ---- Review cards ---- */
.review-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.review-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; background: var(--bg); }
.review-card__header { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; color: var(--muted); }
.review-card__institution { font-weight: 600; color: var(--ink-strong); }
.review-ratings { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0 0 1rem; }
.review-ratings .rating-row { gap: 0.5rem; }
.review-meta { margin: 0 0 1rem; font-size: 0.875rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; }
.review-meta dt { font-weight: 600; color: var(--muted); font-size: 0.8125rem; }
.review-meta dd { margin: 0; }
.review-text h3, .review-advice h3, .review-flags h3 { font-size: 0.95rem; margin-bottom: 0.25rem; color: var(--muted); font-family: var(--font-sans); font-weight: 600; }
.review-card__footer { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); font-size: 0.8125rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; }

/* ---- Vote / report controls ---- */
.vote-controls { display: flex; align-items: center; gap: 0.4rem; }
.vote-btn { background: none; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0.2rem 0.5rem; cursor: pointer; font-size: 0.8rem; color: var(--muted); line-height: 1; width: auto; }
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote-score { font-size: 0.875rem; font-weight: 600; min-width: 1.5rem; text-align: center; }
.vote-login-link, .report-login-link { font-size: 0.8125rem; color: var(--muted); }
.report-controls { display: inline-flex; align-items: flex-start; flex-direction: column; gap: 0.4rem; }
.report-btn { background: none; border: none; padding: 0; font-size: 0.8125rem; color: var(--muted); cursor: pointer; text-decoration: underline; width: auto; }
.report-btn:hover { color: var(--ink); }
.report-form__label { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.report-form__textarea { max-width: 420px; font-size: 0.875rem; min-height: 4rem; }
.report-submit-btn { padding: 0.4rem 1rem; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font-size: 0.875rem; cursor: pointer; width: auto; }
.report-submit-btn:hover { background: var(--accent-dark); }
.report-confirmed-msg { font-size: 0.875rem; color: var(--muted); font-style: italic; margin: 0; }

/* ---- Reading measure cap (prose blocks at 1140px layout) ---- */
.review-text,
.review-advice,
.review-flags { max-width: 70ch; }

.legal-page p { max-width: 70ch; }

/* ---- Legal pages ---- */
.legal-banner { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 0.85rem 1.1rem; margin-bottom: 1.5rem; font-size: 0.9375rem; color: var(--warn-text); }
.legal-page h2 { margin-top: 2rem; font-size: 1.25rem; }
.legal-page ol, .legal-page ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-page li { margin-bottom: 0.4rem; }

/* ---- Cookie notice ---- */
.cookie-notice {
  max-width: var(--max-width); margin: 0 auto 1rem; padding: 0.85rem 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.875rem; color: var(--muted);
}
.cookie-notice p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.cookie-notice__dismiss { margin-left: auto; padding: 0.35rem 0.9rem; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font-size: 0.8125rem; cursor: pointer; width: auto; }
.cookie-notice__dismiss:hover { background: var(--accent-dark); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 3rem; }
.site-footer__inner { padding-top: 1.5rem; padding-bottom: 2rem; font-size: 0.875rem; color: var(--muted); }
.footer-links { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; }

/* ---- Fieldset groups (review form) ---- */
fieldset { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin: 0 0 1.5rem; min-width: 0; }
legend { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; color: var(--ink-strong); padding: 0 0.5rem; }

/* ---- Notices / banners (signup, login, submit) ---- */
.notice { padding: 0.85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.9375rem; }
.notice--warning { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.notice--error { background: #fdf2f2; border: 1px solid #e7a0a0; color: #6b0a0a; }

/* ---- Form field errors ---- */
.form-field--error input,
.form-field--error select,
.form-field--error textarea { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12); }
.field-error { font-size: 0.8125rem; color: #c0392b; }

/* ---- Donate page ---- */
.kofi-iframe { border: none; width: 100%; }
.donate-note { font-size: 0.9375rem; color: var(--muted); margin-bottom: 1rem; }
.dev-placeholder-notice { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem 0; font-size: 0.9rem; color: var(--warn-text); }

/* ---- Stars (partial-fill, pure CSS, no JS) ---- */
.stars { position: relative; display: inline-block; line-height: 1; letter-spacing: 2px; }
.stars__empty { color: var(--muted); }
.stars__fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--accent); }

/* ---- Rating hero (aggregate section) ---- */
.rating-hero { margin-bottom: 1.5rem; }
.rating-hero__score { display: flex; justify-content: center; align-items: baseline; gap: 0.1rem; margin-bottom: 0.3rem; }
.rating-hero__number { font-family: var(--font-serif); font-size: 3rem; font-weight: 700; color: var(--ink-strong); line-height: 1; }
.rating-hero__denom { font-size: 1.25rem; color: var(--muted); }
.rating-hero__sub { font-size: 0.875rem; color: var(--muted); margin: 0.5rem 0 0; }
.rating-hero__label { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin: 0.4rem 0 0; }

/* ---- Aggregate hero: twin stats + paid / match badges ---- */
.agg-stats { display: flex; justify-content: center; align-items: flex-start; gap: 2.5rem; text-align: center; padding: 0.75rem 0 0.5rem; flex-wrap: wrap; }
.agg-stat .stars { display: inline-block; margin: 0.5rem 0 0.1rem; }
.agg-stat-divider { width: 1px; align-self: stretch; min-height: 92px; background: var(--border-strong); }
.paid-badge { display: inline-block; border-radius: var(--radius-pill); padding: 0.3rem 0.85rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.01em; }
.paid-badge--paid { background: var(--accent); color: var(--on-accent); }
.paid-badge--unpaid { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.paid-badge--mixed { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.paid-corner { position: absolute; top: 1.1rem; right: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.paid-corner__label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.match-badge { display: inline-block; background: var(--accent-tint); color: var(--accent-dark); border-radius: var(--radius); padding: 0.2rem 0.6rem; font-size: 0.875rem; font-weight: 600; }
@media (max-width: 640px) {
  .agg-stats { gap: 1.5rem; }
  .agg-stat-divider { display: none; }
}

/* ---- Rating bars ---- */
.rating-bars--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem 2rem; margin-top: 1.5rem; }
.rating-bar { display: flex; align-items: center; gap: 0.6rem; }
.rating-bar__label { font-size: 0.8125rem; color: var(--muted); min-width: 9.5rem; flex-shrink: 0; }
.rating-bar__track { flex: 1; height: 6px; background: #e5e7eb; border-radius: var(--radius-pill); overflow: hidden; }
.rating-bar__fill { height: 100%; background: var(--accent); border-radius: var(--radius-pill); }
.rating-bar__value { font-size: 0.8125rem; font-weight: 600; color: var(--ink-strong); min-width: 1.75rem; text-align: right; }

/* Smaller variant reused in per-review rating rows */
.rating-bar--sm .rating-bar__label { font-size: 0.75rem; min-width: 7.5rem; }
.rating-bar--sm .rating-bar__track { height: 4px; }
.review-ratings--bars { display: flex; flex-direction: column; gap: 0.35rem; margin: 0 0 1rem; }

/* ---- Segmented rating buttons (review form) ---- */
.ratings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1.75rem; }
.rating-buttons { display: flex; position: relative; }
.rating-buttons input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.rating-buttons label {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 0.9rem; font-weight: 600; color: var(--ink);
  cursor: pointer;
  position: relative;
  margin-left: -1px;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.rating-buttons label:first-of-type { margin-left: 0; border-radius: var(--radius) 0 0 var(--radius); }
.rating-buttons label:last-of-type { border-radius: 0 var(--radius) var(--radius) 0; }
.rating-buttons input[type="radio"]:checked + label { background: var(--accent); color: var(--on-accent); border-color: var(--accent); z-index: 1; }
.rating-buttons input[type="radio"]:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 2; }

/* ---- Yes/No radio buttons (would_do_it_again) ---- */
.yesno-buttons { display: flex; position: relative; }
.yesno-buttons input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.yesno-buttons label {
  display: flex; align-items: center; justify-content: center;
  min-width: 60px; height: 36px; padding: 0 1rem;
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); margin-left: -1px;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.yesno-buttons label:first-of-type { margin-left: 0; border-radius: var(--radius) 0 0 var(--radius); }
.yesno-buttons label:last-of-type { border-radius: 0 var(--radius) var(--radius) 0; }
.yesno-buttons input[type="radio"]:checked + label { background: var(--accent); color: var(--on-accent); border-color: var(--accent); z-index: 1; }
.yesno-buttons input[type="radio"]:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 2; }

/* ---- Match-tracking progressive disclosure (CSS-only, no JS) ---- */
/* Inputs are direct children of .match-reveal-container, before the reveal divs. */
.match-reveal-container { position: relative; }
.match-reveal-container > input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0; pointer-events: none;
}
/* Hide the reveal sections by default. */
.match-reveal { display: none; margin-top: 1rem; }
/* Show the matched block when "Yes" (index 0) is checked. */
#id_has_applied_0:checked ~ .match-reveal--matched { display: block; }
/* Show the cycle block when "No" (index 1) is checked. */
#id_has_applied_1:checked ~ .match-reveal--cycle { display: block; }
/* Style the active yes/no label for has_applied (inputs live outside .yesno-buttons here). */
#id_has_applied_0:checked ~ .form-field .yesno-buttons label[for="id_has_applied_0"],
#id_has_applied_1:checked ~ .form-field .yesno-buttons label[for="id_has_applied_1"] {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}
/* Focus ring for has_applied — the radio inputs live outside .yesno-buttons so
   the standard input:focus-visible + label rule cannot reach them. */
#id_has_applied_0:focus-visible ~ .form-field .yesno-buttons label[for="id_has_applied_0"],
#id_has_applied_1:focus-visible ~ .form-field .yesno-buttons label[for="id_has_applied_1"] {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---- Inline checkbox (paid, show_exact_year) ---- */
.checkbox-inline { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }
.checkbox-inline input[type="checkbox"] { width: auto; flex-shrink: 0; margin: 0; }

/* ---- Nav logout (quiet link style) ---- */
.nav-logout { background: none; border: none; padding: 0; cursor: pointer; font: inherit; font-size: 0.95rem; color: var(--ink); text-decoration: none; }
.nav-logout:hover { color: var(--accent); text-decoration: none; }

/* ---- Auth gateway (two-column login/signup page) ---- */
.auth-gateway { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.auth-col { padding: 1.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.auth-col h1, .auth-col h2 { margin-bottom: 1.25rem; }
@media (max-width: 700px) {
  .auth-gateway { grid-template-columns: 1fr; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  h1 { font-size: 1.7rem; }
  .hero__title { font-size: 1.85rem; }
  .hero-band { padding: 2rem 1rem 1.75rem; }
  .hero-search { flex-wrap: nowrap; }
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .rating-grid, .review-meta { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .alumni-stats { flex-direction: column; gap: 0.75rem; }
  .ratings-grid { grid-template-columns: 1fr; }
  .rating-bars--grid { grid-template-columns: 1fr; }
  .rating-bar__label { min-width: 7rem; }
}
