:root {
  --ink: #13231f;
  --muted: #60706a;
  --paper: #f4f6ef;
  --card: #ffffff;
  --line: #dce3da;
  --green: #155c4a;
  --green-dark: #0d4437;
  --lime: #dce86a;
  --risk: #bd4a36;
  --risk-bg: #fff0eb;
  --steady: #b77916;
  --steady-bg: #fff6dc;
  --safe: #20795e;
  --safe-bg: #e9f7f1;
  --shadow: 0 20px 55px rgba(21, 55, 44, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(220, 232, 106, 0.22), transparent 24rem),
    var(--paper);
  font-family:
    "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(19, 35, 31, 0.08);
  background: rgba(244, 246, 239, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: var(--green);
  font-size: 20px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

nav {
  display: flex;
  gap: 28px;
}

nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

main {
  width: min(1180px, 90vw);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 72px;
  align-items: center;
  min-height: 660px;
  padding: 72px 0;
}

.hero-kicker,
.eyebrow,
.section-heading > span,
.results-toolbar > div > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0 22px;
  font-family: "STZhongsong", "SimSun", serif;
  font-size: clamp(46px, 6vw, 78px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.hero h1 em {
  color: var(--green);
  font-style: normal;
}

.hero-copy > p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.policy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.policy-chips span {
  padding: 9px 14px;
  border: 1px solid #ced8ce;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 700;
}

.score-panel {
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}

.panel-heading span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.panel-heading strong {
  color: var(--muted);
  font-size: 12px;
}

form label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
}

.score-input-wrap {
  display: flex;
  align-items: baseline;
  border-bottom: 2px solid var(--ink);
}

.score-input-wrap input {
  min-width: 0;
  width: 100%;
  padding: 8px 0 12px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 56px;
  font-weight: 800;
}

.score-input-wrap input::placeholder {
  color: #c8cfca;
}

.score-input-wrap span {
  font-weight: 800;
}

.form-error {
  min-height: 22px;
  margin: 8px 0;
  color: var(--risk);
  font-size: 12px;
}

form > button {
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(21, 92, 74, 0.2);
  cursor: pointer;
  font-weight: 800;
}

form > button:hover {
  background: var(--green-dark);
}

.example-scores {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
}

.example-scores > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 11px;
}

.example-scores button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: #f8faf6;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.panel-note {
  margin: 18px 0 0;
  color: #86938d;
  font-size: 11px;
  text-align: center;
}

.results-section {
  scroll-margin-top: 90px;
  padding: 54px 0 30px;
}

.results-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.results-toolbar h2,
.section-heading h2,
.policy-section h2 {
  margin: 7px 0 0;
  font-family: "STZhongsong", "SimSun", serif;
  font-size: clamp(30px, 4vw, 46px);
}

.results-toolbar > div:last-child {
  display: flex;
  gap: 10px;
}

.results-toolbar button {
  padding: 10px 15px;
  border: 1px solid var(--green);
  border-radius: 10px;
  color: white;
  background: var(--green);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.results-toolbar button.secondary {
  color: var(--green);
  background: transparent;
}

.results-toolbar button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.summary-grid article {
  padding: 24px;
  border-right: 1px solid var(--line);
}

.summary-grid article:last-child {
  border-right: 0;
}

.summary-grid span,
.summary-grid small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.summary-grid strong {
  display: block;
  min-height: 54px;
  margin: 8px 0 3px;
  font-size: clamp(19px, 2.2vw, 28px);
  line-height: 1.25;
}

.warning-stack {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.warning-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid #ebd9ad;
  border-radius: 12px;
  background: #fff9e8;
}

.warning-item > span {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--steady);
  font-size: 12px;
  font-weight: 900;
}

.warning-item p {
  margin: 0;
  color: #77581d;
  font-size: 12px;
  line-height: 1.6;
}

.method-strip {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 28px;
  padding: 17px 20px;
  border-radius: 14px;
  color: white;
  background: var(--green-dark);
}

.method-strip span {
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
}

.method-strip p {
  max-width: 850px;
  margin: 5px 0 0;
  color: #d4e2dc;
  font-size: 12px;
  line-height: 1.65;
}

.method-badge {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.batch-card {
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.optional-batch {
  border-color: #c7d7ce;
  background: #fbfdfb;
}

.batch-heading .optional-guidance {
  margin-top: 9px;
  color: #3d5e50;
  font-size: 12px;
  font-weight: 700;
}

.batch-heading .quota-target {
  margin-top: 8px;
  color: #315b49;
  font-size: 12px;
  font-weight: 900;
}

.quota-alert {
  padding: 11px 26px;
  color: #5f4b16;
  background: #fff7d8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.65;
}

.screenshot-mode {
  color: var(--ink);
}

.screenshot-mode .results-toolbar {
  align-items: flex-end;
}

.empty-batch {
  padding: 28px 26px;
  color: #53655d;
  background: #f6f9f6;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.batch-heading {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.batch-heading h3 {
  margin: 5px 0 6px;
  font-size: 21px;
}

.batch-heading p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.distribution {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.distribution span,
.strategy-tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.risk {
  color: var(--risk);
  background: var(--risk-bg);
}

.steady {
  color: var(--steady);
  background: var(--steady-bg);
}

.safe {
  color: var(--safe);
  background: var(--safe-bg);
}

.coverage-alert {
  padding: 11px 26px;
  color: #8a3325;
  background: #fff1ed;
  font-size: 12px;
  font-weight: 700;
}

.school-row {
  display: grid;
  grid-template-columns: 44px 1fr 230px;
  gap: 18px;
  align-items: center;
  padding: 18px 26px;
  border-bottom: 1px solid #edf0ec;
}

.school-row:last-child {
  border-bottom: 0;
}

.school-order {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--green);
  background: #f8faf6;
  font-size: 12px;
  font-weight: 900;
}

.school-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.school-title-line h4 {
  margin: 0 4px 0 0;
  font-size: 16px;
}

.micro-tag {
  padding: 4px 7px;
  border-radius: 6px;
  color: #4e5c56;
  background: #edf1ed;
  font-size: 9px;
  font-weight: 800;
}

.micro-tag.danger {
  color: var(--risk);
  background: var(--risk-bg);
}

.micro-tag.new {
  color: #385700;
  background: #eff6c8;
}

.school-main > p {
  margin: 7px 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.school-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  color: #87918d;
  font-size: 10px;
}

.school-rank {
  text-align: right;
}

.school-rank span,
.school-rank small,
.school-rank em {
  display: block;
}

.school-rank span {
  color: var(--muted);
  font-size: 10px;
}

.school-rank strong {
  display: block;
  margin: 3px 0;
  font-size: 18px;
}

.school-rank small {
  color: #7b8983;
  font-size: 10px;
}

.scenario-ranks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 6px;
}

.scenario-ranks small {
  padding: 5px 3px;
  border: 1px solid #e6ebe7;
  border-radius: 7px;
  background: #f7f9f7;
  text-align: center;
}

.scenario-ranks i,
.scenario-ranks b {
  display: block;
  font-style: normal;
}

.scenario-ranks b {
  margin-top: 2px;
  color: #3b4843;
  font-size: 11px;
}

.scenario-ranks .scenario-score {
  margin-top: 3px;
  color: #52635c;
  font-size: 10px;
  font-weight: 800;
}

.scenario-ranks .neutral {
  border-color: #a9c5b7;
  background: #eaf3ed;
}

.scenario-ranks .neutral i,
.scenario-ranks .neutral b,
.scenario-ranks .neutral .scenario-score {
  color: var(--green);
  font-weight: 900;
}

.school-rank em {
  margin-top: 6px;
  color: var(--green);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.qualification-card,
.ineligible-card {
  margin-top: 24px;
  padding: 26px;
  border-radius: 20px;
  background: #e7ede7;
}

.qualification-card h3,
.ineligible-card h2 {
  margin: 0 0 14px;
}

.qualification-card p,
.ineligible-card p {
  margin: 7px 0;
  color: #4f625a;
  font-size: 12px;
  line-height: 1.7;
}

.ineligible-card {
  padding: 40px;
  text-align: center;
}

.ineligible-card > span {
  color: var(--risk);
  font-size: 12px;
  font-weight: 800;
}

.ineligible-card h2 {
  margin-top: 10px;
  font-size: 30px;
}

.explain-section,
.policy-section,
.sources-section {
  padding: 90px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 34px;
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.logic-grid article {
  min-height: 245px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.logic-grid b {
  color: var(--green);
  font-size: 13px;
}

.logic-grid h3 {
  margin: 55px 0 12px;
  font-size: 17px;
}

.logic-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.policy-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 70px;
  align-items: center;
  margin: 20px 0;
  padding-right: 50px;
  padding-left: 50px;
  border-radius: 28px;
  color: white;
  background: var(--green-dark);
}

.policy-section > div > p {
  color: #c4d5ce;
  font-size: 13px;
  line-height: 1.9;
}

.policy-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.policy-section li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.policy-section li:last-child {
  border-bottom: 0;
}

.policy-section li strong {
  color: var(--lime);
  font-size: 12px;
}

.policy-section li span {
  color: #d6e1dc;
  font-size: 12px;
  line-height: 1.6;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.source-list a,
.source-list span {
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.sources-section > p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, 90vw);
  margin: 0 auto;
  padding: 26px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.student-position-card {
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid #cfdcd4;
  border-radius: 22px;
  background: linear-gradient(135deg, #0d4437, #17604e);
  box-shadow: var(--shadow);
  color: white;
}

.student-position-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 18px;
}

.student-position-heading span {
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.student-position-heading h2 {
  margin: 0;
  font-family: "STZhongsong", "SimSun", serif;
  font-size: 30px;
}

.student-position-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.student-position-grid article {
  min-width: 0;
  padding: 20px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.13);
}

.student-position-grid article:nth-child(3) {
  border-right: 0;
}

.student-position-grid article.strategy {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  border-right: 0;
  background: rgba(255, 255, 255, 0.06);
}

.student-position-grid span,
.student-position-grid strong {
  display: block;
}

.student-position-grid span {
  color: #c9dbd4;
  font-size: 11px;
}

.student-position-grid strong {
  margin-top: 7px;
  font-size: 20px;
  line-height: 1.5;
}

.student-position-grid .strategy strong {
  color: #f1f6d1;
  font-size: 15px;
}

.result-method-details {
  margin: 14px 0 26px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.result-method-details summary,
.school-evidence summary {
  color: var(--green);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.result-method-details p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.recommendation-groups {
  display: grid;
  gap: 24px;
}

.recommendation-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.recommendation-group.group-risk {
  border-top: 4px solid var(--risk);
}

.recommendation-group.group-steady {
  border-top: 4px solid var(--steady);
}

.recommendation-group.group-safe {
  border-top: 4px solid var(--safe);
}

.recommendation-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.recommendation-group-heading h3 {
  margin: 4px 0 6px;
  font-size: 23px;
}

.recommendation-group-heading p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.group-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.group-risk .group-kicker,
.group-risk .recommendation-group-heading > strong {
  color: var(--risk);
}

.group-steady .group-kicker,
.group-steady .recommendation-group-heading > strong {
  color: var(--steady);
}

.group-safe .group-kicker,
.group-safe .recommendation-group-heading > strong {
  color: var(--safe);
}

.recommendation-group-heading > strong {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f1f4ef;
  font-size: 12px;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.recommendation-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid #e1e7e1;
  border-radius: 16px;
  background: white;
}

.recommendation-card.risk {
  box-shadow: inset 3px 0 0 var(--risk);
}

.recommendation-card.steady {
  box-shadow: inset 3px 0 0 var(--steady);
}

.recommendation-card.safe {
  box-shadow: inset 3px 0 0 var(--safe);
}

.recommendation-card.data-insufficient {
  border-style: dashed;
  background: #fafafa;
  opacity: 0.82;
}

.recommendation-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.recommendation-card-header > div {
  min-width: 0;
}

.school-sequence {
  display: inline-grid;
  width: 25px;
  height: 25px;
  margin-right: 7px;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: #edf3ee;
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}

.recommendation-card-header h4 {
  display: inline;
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.recommendation-card-header p {
  margin: 7px 0 0 34px;
  color: var(--muted);
  font-size: 11px;
}

.recommendation-type {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.school-estimate {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 14px;
}

.school-estimate > div {
  min-width: 0;
  padding: 13px 14px;
  border-radius: 12px;
  background: #f3f6f2;
}

.school-estimate small,
.school-estimate strong {
  display: block;
}

.school-estimate small {
  color: var(--muted);
  font-size: 10px;
}

.school-estimate strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.estimated-score {
  border: 1px solid #c9dbd2;
  background: #eaf3ed !important;
}

.estimated-score strong {
  color: var(--green);
  font-size: 21px;
}

.recommendation-reason {
  margin: 0;
  color: #52635c;
  font-size: 12px;
  line-height: 1.75;
}

.recommendation-reason strong {
  color: var(--ink);
}

.school-evidence {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf0ec;
}

.school-evidence-content {
  padding-top: 12px;
}

.evidence-scenarios {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.evidence-scenario {
  min-width: 0;
  padding: 8px 5px;
  border: 1px solid #e3e8e3;
  border-radius: 9px;
  background: #f8faf7;
  text-align: center;
}

.evidence-scenario.neutral {
  border-color: #a9c5b7;
  background: #eaf3ed;
}

.evidence-scenario span,
.evidence-scenario strong,
.evidence-scenario small {
  display: block;
}

.evidence-scenario span {
  color: var(--muted);
  font-size: 9px;
}

.evidence-scenario strong {
  margin-top: 4px;
  color: var(--green);
  font-size: 11px;
  white-space: nowrap;
}

.evidence-scenario small {
  margin-top: 3px;
  color: #6d7c76;
  font-size: 9px;
  white-space: nowrap;
}

.school-evidence-content > p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 9px;
  color: #7a8983;
  font-size: 9px;
}

.empty-recommendation {
  grid-column: 1 / -1;
  padding: 26px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}
@media (max-width: 900px) {
  nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    min-height: auto;
    padding: 55px 0;
  }

  .summary-grid,
  .logic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-grid article:nth-child(2) {
    border-right: 0;
  }

  .summary-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .policy-section {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 50px 34px;
  }

  .school-row {
    grid-template-columns: 38px 1fr;
  }

  .school-rank {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 600px) {
  main {
    width: calc(100% - 24px);
  }

  .site-header {
    min-height: 64px;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 18px;
  }

  .hero {
    gap: 28px;
    padding: 24px 0 46px;
  }

  .score-panel {
    order: -1;
    padding: 24px 18px;
    border-radius: 20px;
  }

  .panel-heading {
    gap: 10px;
    margin-bottom: 24px;
  }

  .hero h1 {
    margin: 14px 0 18px;
    font-size: clamp(36px, 12vw, 46px);
  }

  .hero-copy > p {
    font-size: 15px;
    line-height: 1.75;
  }

  .policy-chips {
    gap: 7px;
    margin-top: 22px;
  }

  .policy-chips span {
    padding: 7px 10px;
    font-size: 11px;
  }

  .score-input-wrap input {
    font-size: 48px;
  }

  form > button {
    min-height: 52px;
  }

  .example-scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
  }

  .example-scores > span {
    grid-column: 1 / -1;
    margin-right: 0;
  }

  .example-scores button {
    min-height: 44px;
    padding: 8px 4px;
  }

  .results-section {
    padding: 40px 0 20px;
  }

  .results-toolbar,
  .batch-heading,
  .method-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .results-toolbar {
    gap: 18px;
    margin-bottom: 22px;
  }

  .results-toolbar > div:last-child {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .results-toolbar button {
    min-height: 44px;
    padding: 9px 7px;
  }

  .results-toolbar button:last-child {
    grid-column: 1 / -1;
  }

  .logic-grid,
  .source-list {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid article {
    padding: 18px 16px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .summary-grid article:nth-child(even) {
    border-right: 0;
  }

  .summary-grid article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .summary-grid strong {
    min-height: 48px;
  }

  .method-strip {
    gap: 14px;
    margin: 16px 0 22px;
    padding: 16px;
  }

  .method-badge {
    width: 100%;
    text-align: center;
  }

  .batch-card {
    border-radius: 16px;
  }

  .batch-heading {
    gap: 14px;
    padding: 20px 16px;
  }

  .distribution {
    flex-wrap: wrap;
  }

  .quota-alert,
  .coverage-alert {
    padding: 11px 16px;
  }

  .school-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 16px 12px;
  }

  .school-order {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .school-title-line h4 {
    font-size: 15px;
  }

  .school-meta {
    gap: 8px 12px;
  }

  .school-rank {
    width: 100%;
    margin-top: 3px;
  }

  .scenario-ranks {
    gap: 4px;
  }

  .scenario-ranks small {
    min-width: 0;
    padding: 7px 2px;
  }

  .scenario-ranks b,
  .scenario-ranks .scenario-score {
    white-space: nowrap;
  }

  .qualification-card,
  .ineligible-card {
    padding: 22px 18px;
  }

  .explain-section,
  .sources-section {
    padding: 58px 0;
  }

  .section-heading {
    margin-bottom: 24px;
  }

  .logic-grid article {
    min-height: 0;
    padding: 20px;
  }

  .logic-grid h3 {
    margin: 22px 0 10px;
  }

  .policy-section {
    padding: 38px 24px;
  }

  .policy-section li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  footer {
    width: calc(100% - 24px);
    gap: 8px;
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-grid article:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .summary-grid article:last-child {
    border-bottom: 0;
  }

  .scenario-ranks b {
    font-size: 10px;
  }
}
@media (max-width: 900px) {
  .recommendation-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .student-position-heading {
    display: block;
    padding: 20px 18px 14px;
  }

  .student-position-heading h2 {
    margin-top: 6px;
    font-size: 25px;
  }

  .student-position-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-position-grid article {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  }

  .student-position-grid article:nth-child(2) {
    border-right: 0;
  }

  .student-position-grid article:nth-child(3) {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .student-position-grid strong {
    font-size: 17px;
  }

  .student-position-grid .strategy strong {
    font-size: 14px;
  }

  .recommendation-group {
    border-radius: 16px;
  }

  .recommendation-group-heading {
    align-items: flex-start;
    padding: 18px 16px;
  }

  .recommendation-group-heading h3 {
    font-size: 20px;
  }

  .recommendation-grid {
    gap: 10px;
    padding: 10px;
  }

  .recommendation-card {
    padding: 16px 14px;
    border-radius: 13px;
  }

  .recommendation-card-header {
    display: block;
  }

  .recommendation-type {
    display: inline-block;
    margin: 10px 0 0 34px;
  }

  .school-estimate {
    margin-top: 15px;
  }

  .school-estimate > div {
    padding: 12px 10px;
  }

  .estimated-score strong {
    font-size: 18px;
  }

  .estimated-rank strong {
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  .school-estimate {
    grid-template-columns: 1fr;
  }
}
@media print {
  .site-header,
  .hero,
  .results-toolbar button,
  .explain-section,
  .policy-section,
  .sources-section,
  footer {
    display: none !important;
  }

  body,
  .batch-card,
  .summary-grid {
    background: white;
  }

  main {
    width: 100%;
  }

  .results-section {
    padding: 0;
  }

  .school-row {
    break-inside: avoid;
  }
}
