:root {
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0f766e;
  --sky: #0284c7;
  --rose: #e11d48;
  --emerald: #059669;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button, input, select { font: inherit; }

.ambient {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.52;
}

.ambient-a { width: 45vw; height: 45vw; left: -18vw; top: -18vw; background: #ccfbf1; }
.ambient-b { width: 40vw; height: 40vw; right: -16vw; top: 8vh; background: #bae6fd; }
.ambient-c { width: 34vw; height: 34vw; left: 28vw; bottom: -20vw; background: #ffe4e6; }

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.top-actions {
  position: absolute;
  top: 16px;
  right: 0;
  display: flex;
  justify-content: flex-end;
}

.pdf-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #334155;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, opacity 180ms ease;
}

.pdf-download::before {
  content: "↓";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
}

.pdf-download small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 850;
}

.pdf-download:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #bae6fd;
  color: #0f172a;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.pdf-download:disabled {
  cursor: wait;
  opacity: 0.72;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 4vh auto 34px;
  transition: margin 420ms ease, transform 420ms ease;
}

.hero.compact { margin-top: 0; transform: scale(0.96); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 22px;
  background: var(--surface-solid);
  border: 1px solid #e0f2fe;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.source-mark {
  position: relative;
  width: 13px;
  height: 15px;
  border-radius: 3px;
  background: #0f766e;
  box-shadow: inset -4px 0 0 rgba(255, 255, 255, 0.24);
}

.source-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: -3px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: #bae6fd;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.04;
  font-weight: 900;
}

.hero p {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}

.input-card {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 34px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.input-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: -1;
  border-radius: 26px;
  border: 1px solid rgba(14, 165, 233, 0.10);
}

.decor-chart {
  position: absolute;
  right: -52px;
  top: -74px;
  width: 172px;
  opacity: 0.84;
}

.segmented {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  width: min(390px, 100%);
  margin: 0 auto 28px;
  padding: 6px;
  background: rgba(241, 245, 249, 0.9);
  border-radius: 18px;
  overflow: hidden;
  --active-index: 0;
}

.segmented::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 6px;
  top: 6px;
  width: calc((100% - 18px) / 2);
  height: calc(100% - 12px);
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  transform: translateX(calc(var(--active-index) * (100% + 6px)));
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.segmented button {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 13px;
  padding: 13px 16px;
  background: transparent;
  color: #64748b;
  font-weight: 850;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease;
}

.segmented button:hover {
  transform: translateY(-1px);
}

.segmented button.active {
  color: var(--accent);
}

.input-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(390px, 100%);
  margin: -8px auto 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.input-intro span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.input-intro strong {
  color: #0f172a;
}

.score-box {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(390px, 100%);
  margin: 0 auto 22px;
  padding: 18px 22px;
  background: #ffffff;
  border: 2px solid #e0f2fe;
  border-radius: 26px;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.score-box:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.14);
}

.score-box span {
  color: #94a3b8;
  font-weight: 750;
}

.score-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  text-align: center;
  color: #1e293b;
  font-size: 52px;
  line-height: 1;
  font-weight: 950;
  background: transparent;
  appearance: textfield;
  -moz-appearance: textfield;
  overflow: hidden;
}

.score-box input::-webkit-outer-spin-button,
.score-box input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-box input::placeholder {
  color: #cbd5e1;
  font-size: 30px;
  font-weight: 600;
}

.score-unit {
  min-width: 18px;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 24px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.form-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: #1e293b;
  padding: 13px 14px;
  outline: 0;
  font-size: 14px;
  font-weight: 750;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.form-grid select:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.form-grid select:hover {
  transform: translateY(-1px);
}

.primary-action, .ghost-action {
  border: 0;
  cursor: pointer;
  font-weight: 850;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

.primary-action {
  display: block;
  width: min(390px, 100%);
  margin: 0 auto;
  padding: 18px 22px;
  border-radius: 20px;
  background: #0f172a;
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 18px 36px rgba(14, 165, 233, 0.16);
}

.primary-action:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--accent);
  box-shadow: 0 20px 44px rgba(14, 165, 233, 0.24);
}

.primary-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cta-note {
  width: min(390px, 100%);
  margin: 10px auto 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.hidden { display: none !important; }

.results {
  animation: rise 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes revealDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  gap: 18px;
  margin-bottom: 18px;
}

.summary-card {
  min-height: 198px;
  padding: 26px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 14px 48px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.card-label {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 10px;
  background: #e0f2fe;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
}

.metric span {
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: 0;
}

.metric small {
  color: #64748b;
  font-size: 18px;
  font-weight: 800;
}

.summary-card p, .policy-card p {
  margin: 16px 0 0;
  color: #64748b;
  line-height: 1.7;
  font-size: 14px;
}

.equivalent-card {
  color: #ffffff;
  background: #0f172a;
  border-color: #1e293b;
}

.equivalent-card .card-label {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.equivalent-card p, .equivalent-card small { color: #cbd5e1; }

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.mini-badge {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.policy-card h3 {
  margin: 18px 0 0;
  line-height: 1.35;
  font-size: 24px;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 2px 18px;
}

.results-head h2 {
  margin: 0;
  font-size: 28px;
}

.results-head p {
  margin: 8px 0 0;
  color: #64748b;
}

.ghost-action {
  padding: 11px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  border: 1px solid var(--line);
}

.ghost-action:hover { color: #0f172a; transform: translateY(-1px); }

.result-tabs {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  width: min(440px, 100%);
  margin: 0 auto 22px;
  padding: 6px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 38px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  --active-index: 0;
}

.result-tabs::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 6px;
  top: 6px;
  width: calc((100% - 18px) / 2);
  height: calc(100% - 12px);
  border-radius: 13px;
  background: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateX(calc(var(--active-index) * (100% + 6px)));
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-tabs button {
  position: relative;
  z-index: 1;
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-weight: 900;
  transition: color 180ms ease, transform 180ms ease;
}

.result-tabs button:hover {
  transform: translateY(-1px);
}

.result-tabs button.active {
  color: #ffffff;
}

.result-panel {
  animation: rise 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tier {
  padding: 12px;
  border-radius: 26px;
  border: 1px solid;
  min-width: 0;
}

.tier-reach { background: rgba(255, 241, 242, 0.72); border-color: #ffe4e6; }
.tier-match { background: rgba(240, 249, 255, 0.76); border-color: #bae6fd; }
.tier-safe { background: rgba(236, 253, 245, 0.76); border-color: #bbf7d0; }

.tier-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 16px;
}

.tier-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #ffffff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.tier-reach .tier-icon { color: var(--rose); }
.tier-match .tier-icon { color: var(--sky); }
.tier-safe .tier-icon { color: var(--emerald); }

.tier-title h3 {
  margin: 0;
  font-size: 18px;
}

.tier-title p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.catalog-panel {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid #dbeafe;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 48px rgba(15, 23, 42, 0.05);
}

.catalog-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.section-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.catalog-head h2 {
  margin: 0;
  font-size: 24px;
}

.catalog-head p {
  margin: 7px 0 0;
  color: #64748b;
  line-height: 1.55;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(280px, 1fr);
  gap: 12px;
  align-items: end;
  width: 100%;
}

.catalog-filter {
  display: grid;
  gap: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.catalog-filter-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.catalog-filter-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 9px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.catalog-filter-tabs button:hover {
  transform: translateY(-1px);
}

.catalog-filter-tabs button.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.catalog-search {
  display: grid;
  gap: 7px;
  width: 100%;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.catalog-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: #ffffff;
  color: #0f172a;
  outline: 0;
  font-size: 14px;
  font-weight: 700;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.catalog-search input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.catalog-search input:hover {
  transform: translateY(-1px);
}

.catalog-list {
  display: grid;
  gap: 9px;
}

.catalog-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
  animation: cardIn 360ms cubic-bezier(0.16, 1, 0.3, 1);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.catalog-card:hover {
  transform: translateY(-1px);
  border-color: #bae6fd;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.catalog-card summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 14px 46px 14px 16px;
  cursor: pointer;
  list-style: none;
}

.catalog-card summary::-webkit-details-marker { display: none; }

.catalog-card summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  transition: transform 200ms ease;
}

.catalog-card[open] summary {
  border-bottom: 1px solid #eef2f7;
}

.catalog-card[open] summary::after {
  content: "-";
  transform: translateY(-50%) rotate(180deg);
}

.catalog-school,
.catalog-score {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.catalog-school strong {
  color: #0f172a;
  font-size: 16px;
  line-height: 1.35;
}

.catalog-school span,
.catalog-score span,
.catalog-score em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.catalog-score {
  justify-items: end;
}

.catalog-score strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1;
}

.catalog-flags {
  display: flex;
  justify-content: flex-end;
}

.reach-ratio {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid;
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.reach-ratio.ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.reach-ratio.low {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.catalog-detail {
  padding: 13px 16px 16px;
  background: #fbfdff;
  animation: revealDown 240ms ease;
  transform-origin: top;
}

.catalog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.year-block {
  display: grid;
  gap: 8px;
}

.catalog-year-block + .catalog-year-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.tier-year-groups {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
}

.tier-year-block {
  padding: 9px;
  border-radius: 14px;
  border: 1px solid #eef2f7;
  background: #fbfdff;
}

.tier-year-block + .tier-year-block {
  margin-top: 0;
}

.tier-year-block .group-lines {
  margin: 8px 0 0;
}

.catalog-year-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.catalog-year-head strong {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #075985;
}

.catalog-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.catalog-pager button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-weight: 850;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.catalog-pager button:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: #bae6fd;
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.catalog-pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.school-list {
  display: grid;
  gap: 10px;
}

.school-card {
  padding: 16px;
  background: #ffffff;
  border: 1px solid #eef2f7;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  animation: cardIn 360ms cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.school-card:hover {
  transform: translateY(-1px);
  border-color: #dbeafe;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.school-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.school-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.school-card h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.school-card .subline {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 14px;
}

.tag {
  padding: 4px 7px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.tag.national { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.tag.local { color: #047857; background: #ecfdf5; border-color: #bbf7d0; }
.tag.risk { color: #be123c; background: #fff1f2; border-color: #fecdd3; }
.tag.safe-tag { color: #047857; background: #ecfdf5; border-color: #bbf7d0; }

.ownership-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.ownership-badge.public {
  color: #075985;
  background: #e0f2fe;
  border-color: #bae6fd;
}

.ownership-badge.private {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.ownership-badge.cooperative {
  color: #7c2d12;
  background: #ffedd5;
  border-color: #fed7aa;
}

.ownership-badge.pending {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.rank-range {
  margin: 12px 0 14px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.range-copy {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 750;
}

.range-copy strong {
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

.range-copy span:last-child { text-align: right; }

.range-track {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.range-track::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #38bdf8, #fb7185);
  opacity: 0.42;
}

.range-track span {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #0f172a;
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.2);
}

.rank-range.ahead .range-track span { background: #059669; }
.rank-range.blocked .range-track span { background: #e11d48; }

.group-lines {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
}

.more-groups {
  display: grid;
  gap: 8px;
}

.more-groups summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.more-groups summary:hover {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: #94a3b8;
}

.more-groups summary::-webkit-details-marker {
  display: none;
}

.more-groups summary::after {
  content: "+";
  margin-left: 6px;
  color: #0f766e;
}

.more-groups[open] summary::after {
  content: "-";
}

.more-group-lines {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  animation: revealDown 220ms ease;
  transform-origin: top;
}

.school-groups-toggle {
  margin: 12px 0 14px;
}

.school-groups-toggle > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 13px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.school-groups-toggle > summary:hover {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: #94a3b8;
}

.school-groups-toggle > summary::-webkit-details-marker {
  display: none;
}

.school-groups-toggle > summary::after {
  content: "+";
  margin-left: 6px;
  color: var(--accent);
}

.school-groups-toggle[open] > summary::after {
  content: "-";
}

.school-groups-toggle[open] .tier-year-groups,
.school-groups-toggle[open] .group-lines {
  animation: revealDown 220ms ease;
  transform-origin: top;
}

.group-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.group-line:hover {
  transform: translateX(2px);
}

.group-line.blocked {
  border-color: #fecdd3;
  background: #fff1f2;
}

.group-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.group-main strong {
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
}

.group-main span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.group-line.blocked .group-main strong,
.group-line.blocked .group-score,
.group-line.blocked .group-score strong {
  color: #be123c;
}

.group-score {
  display: grid;
  gap: 2px;
  justify-items: end;
  color: #334155;
  font-size: 11px;
  white-space: nowrap;
}

.group-score strong { font-size: 13px; }

.group-score em {
  color: inherit;
  font-style: normal;
  font-weight: 850;
}

.rank-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.rank-line span {
  color: #64748b;
  font-size: 12px;
}

.rank-line strong {
  color: #0f172a;
  font-size: 13px;
}

.empty {
  padding: 28px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: #94a3b8;
  text-align: center;
  font-size: 13px;
  font-weight: 750;
}

.data-panel {
  margin-top: 28px;
  padding: 24px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e2e8f0;
}

.data-panel h3 { margin: 0 0 10px; }
.data-panel p {
  color: #64748b;
  line-height: 1.75;
  font-size: 14px;
}

.support-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.support-footer button {
  border: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 180ms ease, transform 180ms ease;
}

.support-footer button:hover {
  color: #0f172a;
  transform: translateY(-1px);
}

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: modalFade 180ms ease;
}

.support-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(8px);
  animation: modalFade 180ms ease;
}

.support-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.22);
  animation: modalPop 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.support-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: transform 180ms ease, color 180ms ease, border-color 180ms ease;
}

.support-close:hover {
  transform: rotate(90deg);
  color: #0f172a;
  border-color: #cbd5e1;
}

.support-dialog h2 {
  margin: 0;
  font-size: 24px;
}

.support-dialog p {
  margin: 8px 0 14px;
  color: #64748b;
  line-height: 1.65;
  font-size: 14px;
}

.payment-tabs {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 16px 0 14px;
  padding: 5px;
  border-radius: 14px;
  background: #f1f5f9;
  overflow: hidden;
  --active-index: 0;
}

.payment-tabs::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 5px;
  top: 5px;
  width: calc((100% - 16px) / 2);
  height: calc(100% - 10px);
  border-radius: 10px;
  background: #0f172a;
  transform: translateX(calc(var(--active-index) * (100% + 6px)));
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.payment-tabs button {
  position: relative;
  z-index: 1;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: color 180ms ease, transform 180ms ease;
}

.payment-tabs button:hover {
  transform: translateY(-1px);
}

.payment-tabs button.active {
  color: #ffffff;
}

.payment-qr-wrap {
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #f8fafc;
}

.payment-qr-wrap img {
  display: block;
  width: min(100%, 300px);
  max-height: 52vh;
  border-radius: 12px;
  object-fit: contain;
  transition: transform 220ms ease, opacity 180ms ease;
}

.payment-qr-wrap:hover img {
  transform: scale(1.01);
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 920px) {
  .summary-grid, .tier-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .decor-chart { right: -42px; width: 132px; }
  .catalog-tools { grid-template-columns: 1fr; }
  .catalog-search { width: 100%; }
  .catalog-card summary { grid-template-columns: minmax(0, 1fr) auto; }
  .catalog-score { justify-items: start; }
  .catalog-flags { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1120px); padding-top: 28px; }
  .top-actions {
    position: static;
    margin-bottom: 18px;
  }
  .pdf-download {
    margin-left: auto;
  }
  .decor-chart {
    right: -10px;
    top: -58px;
    width: 118px;
  }
  .input-card { padding: 24px 16px; border-radius: 26px; }
  .input-intro { justify-content: flex-start; }
  .score-box input { font-size: 44px; }
  .results-head { align-items: flex-start; flex-direction: column; }
  .result-tabs { margin-bottom: 18px; }
  .summary-card { min-height: auto; }
  .range-copy { grid-template-columns: 1fr; }
  .range-copy span:last-child { text-align: left; }
  .group-line { grid-template-columns: 1fr; }
  .group-score { justify-items: start; }
  .catalog-panel { padding: 14px; border-radius: 20px; }
  .catalog-card summary { grid-template-columns: 1fr; gap: 10px; }
  .catalog-pager { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
