:root {
  color-scheme: light;
  --ink: #2c2c2a;
  --ink-soft: #3a3a36;
  --muted: #4a4a4a;
  --quiet: #7d7468;
  --hairline: rgba(0, 0, 0, 0.08);
  --hairline-strong: rgba(26, 58, 92, 0.28);
  --surface: #ffffff;
  --surface-soft: #f8f6f1;
  --surface-muted: #f1eadf;
  --glass: rgba(255, 255, 255, 0.94);
  --glass-strong: rgba(255, 255, 255, 0.98);
  --wash: #f8f6f1;
  --blue: #1a3a5c;
  --blue-dark: #15314d;
  --teal: #1d9e75;
  --violet: #4a5064;
  --amber: #b8860b;
  --warning: #ef9f27;
  --rose: #a65a45;
  --blue-soft: rgba(26, 58, 92, 0.08);
  --teal-soft: rgba(29, 158, 117, 0.1);
  --violet-soft: rgba(74, 80, 100, 0.08);
  --amber-soft: rgba(184, 134, 11, 0.12);
  --rose-soft: rgba(239, 159, 39, 0.12);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.045);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--wash);
  color: var(--ink);
  font-family: "Noto Sans SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "SF Pro Text", Arial, "PingFang HK", "PingFang TC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

body::before {
  content: none;
}

button,
input,
select {
  font: inherit;
}

button {
  height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(26, 58, 92, 0.16);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.22;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.38;
}

h3 {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.46;
}

.app-shell {
  min-height: 100vh;
  padding: 40px;
}

.workspace {
  max-width: 1100px;
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 372px);
  gap: 32px;
  align-items: start;
  margin-bottom: 48px;
}

.brand-kicker-row {
  display: block;
  max-width: 820px;
}

.topbar-side {
  display: grid;
  justify-items: end;
  gap: 20px;
  width: 100%;
}

.eyebrow,
.kicker,
.rank-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 500;
}

.eyebrow::before,
.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.12);
}

.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 168px;
  height: 36px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--shadow-light);
}

.language-switch::before {
  content: none;
}

.language-option {
  position: relative;
  height: 28px;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--quiet);
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.language-option[aria-pressed="true"] {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(26, 58, 92, 0.18);
}

.language-option:hover {
  color: var(--ink);
}

.language-option[aria-pressed="true"]:hover {
  color: #ffffff;
}

.intro {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.top-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.source-badge {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-light);
}

.source-badge strong {
  display: block;
  color: var(--blue);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.05;
}

.source-badge span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.layout {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel,
.report-panel,
.shortlist-panel,
.database-panel {
  padding: 24px;
}

.input-panel {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

#dataFreshness,
#filterSummary {
  min-height: 28px;
  padding: 6px 11px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.field-grid,
.score-row,
.slider-grid {
  display: grid;
  gap: 14px;
}

.field-grid {
  grid-template-columns: 1fr 1fr;
}

.score-row {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
}

.slider-grid {
  margin-top: 12px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--quiet) 50%),
    linear-gradient(135deg, var(--quiet) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input:hover,
select:hover {
  border-color: var(--hairline-strong);
  background: #ffffff;
}

input:focus,
select:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.1);
}

input[type="range"] {
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--blue);
}

.wide-field {
  margin-top: 12px;
}

.button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 12px;
  margin-top: 24px;
}

.primary-button {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(26, 58, 92, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button:hover {
  background: var(--blue-dark);
  box-shadow: 0 10px 22px rgba(26, 58, 92, 0.22);
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button {
  background: var(--surface);
  border-color: var(--hairline);
  color: var(--ink-soft);
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.secondary-button:hover,
.ghost-button:hover {
  background: #ffffff;
  border-color: var(--hairline-strong);
  color: var(--blue);
}

.ghost-button {
  height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.form-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(29, 158, 117, 0.18);
  border-radius: var(--radius);
  background: rgba(29, 158, 117, 0.06);
  color: #315d51;
  font-size: 12px;
  line-height: 1.72;
}

.result-stack {
  display: grid;
  gap: 24px;
}

.empty-state {
  min-height: 208px;
  display: grid;
  align-content: center;
  color: var(--muted);
  padding: 4px;
}

.empty-state.compact {
  min-height: 72px;
}

.empty-state h2 {
  font-size: 23px;
  font-weight: 500;
}

.empty-state p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

.database-overview {
  display: grid;
  gap: 16px;
}

.database-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.database-kpis div {
  min-height: 104px;
  padding: 16px;
  border-right: 1px solid var(--hairline);
  background: #ffffff;
}

.database-kpis div:last-child {
  border-right: 0;
}

.database-kpis span,
.metric span,
.readiness-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.database-kpis strong,
.metric strong,
.readiness-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.05;
}

.database-kpis p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.coverage-board {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.coverage-title {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.coverage-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.coverage-row + .coverage-row {
  border-top: 1px solid var(--hairline);
}

.coverage-row span {
  padding: 12px 14px;
  border-right: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.coverage-row span:last-child {
  border-right: 0;
}

.coverage-row b,
.coverage-row em {
  display: block;
}

.coverage-row b {
  margin-top: 3px;
  color: var(--blue);
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
}

.coverage-row em {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
  font-style: normal;
}

.compliance-note {
  padding: 14px;
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: var(--radius);
  background: rgba(184, 134, 11, 0.08);
}

.compliance-note strong {
  display: block;
  color: var(--amber);
  font-size: 13px;
  font-weight: 500;
}

.compliance-note p {
  margin: 6px 0 0;
  color: #72591a;
  font-size: 12px;
  line-height: 1.65;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 16px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-light);
}

.report-hero h2 {
  margin-bottom: 9px;
  font-size: 26px;
  font-weight: 500;
}

.report-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.readiness-card {
  display: grid;
  align-content: center;
  min-height: 138px;
  padding: 16px;
  border-left: 1px solid var(--hairline);
  background: var(--surface-soft);
}

.readiness-card strong {
  font-size: 37px;
  color: var(--blue);
}

.meter {
  height: 7px;
  margin-top: 13px;
  border-radius: 999px;
  background: rgba(26, 58, 92, 0.1);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 16px 0 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.metric {
  min-height: 86px;
  padding: 14px;
  border-right: 1px solid var(--hairline);
  background: #ffffff;
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  color: var(--blue);
}

.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.report-block {
  border-top: 1px solid var(--hairline);
  padding-top: 18px;
  margin-top: 18px;
}

.insight-grid .report-block {
  margin-top: 0;
  border-top: 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.report-block p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 0;
}

.question-plan {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.question-item {
  min-height: 122px;
  padding: 14px;
  border: 1px solid rgba(29, 158, 117, 0.16);
  border-radius: var(--radius);
  background: rgba(29, 158, 117, 0.06);
}

.question-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-weight: 500;
}

.question-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.question-item p {
  margin-top: 8px;
  color: #355f54;
  font-size: 12px;
  line-height: 1.7;
}

.step-list {
  display: grid;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.step-list p {
  margin: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
}

.step-list p:last-child {
  border-bottom: 0;
}

.test-pack-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(26, 58, 92, 0.16);
  border-radius: var(--radius);
  background: rgba(26, 58, 92, 0.06);
}

.test-pack-callout p {
  margin: 0;
}

.client-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(184, 134, 11, 0.18);
  border-radius: var(--radius);
  background: rgba(184, 134, 11, 0.07);
}

.client-actions h3 {
  margin-bottom: 5px;
  color: var(--ink);
}

.client-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.primary-button.copied {
  border-color: var(--teal);
  background: var(--teal);
}

.assessment-panel {
  padding: 24px;
}

.assessment-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.assessment-actions p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.assessment-paper {
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-light);
}

.paper-cover {
  padding-bottom: 18px;
  border-bottom: 2px solid var(--blue);
}

.paper-cover p {
  margin-bottom: 6px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 500;
}

.paper-cover h2 {
  font-size: 30px;
  font-weight: 500;
}

.paper-meta,
.paper-student-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.paper-meta span,
.paper-student-info span {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.paper-student-info {
  margin: 16px 0 24px;
}

.paper-instructions,
.paper-source-note {
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.paper-instructions p,
.paper-source-note p,
.paper-source-note li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.paper-subject {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline-strong);
}

.paper-subject-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.paper-subject-head h3 {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 500;
}

.paper-subject-head span {
  color: var(--amber);
  font-size: 13px;
  font-weight: 500;
}

.paper-block {
  margin-top: 16px;
}

.paper-block h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.paper-passage {
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

.paper-block ol {
  margin: 0;
  padding-left: 20px;
}

.paper-block li {
  margin: 10px 0 14px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.answer-lines {
  height: 54px;
  margin-top: 8px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 25px, rgba(26, 58, 92, 0.2) 26px);
}

.interview-paper .answer-lines {
  height: 34px;
}

.paper-source-note {
  margin-top: 18px;
}

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

.tier-section {
  display: grid;
  gap: 12px;
}

.tier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  border-left: 3px solid var(--amber);
  background: #ffffff;
  box-shadow: var(--shadow-light);
}

.tier-head h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.tier-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tier-head span {
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.school-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.school-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--amber);
}

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

.rank-label {
  margin-bottom: 6px;
  color: var(--amber);
}

.rank-label::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}

.school-card h3 {
  margin-bottom: 5px;
  font-size: 19px;
  font-weight: 500;
}

.school-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.score-pill {
  min-width: 82px;
  padding: 9px 10px;
  border: 1px solid rgba(26, 58, 92, 0.16);
  border-radius: var(--radius);
  text-align: center;
  background: rgba(26, 58, 92, 0.06);
  color: var(--blue);
}

.score-pill strong,
.score-pill span {
  display: block;
}

.score-pill strong {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.05;
}

.score-pill span {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tag {
  border: 1px solid rgba(26, 58, 92, 0.12);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(26, 58, 92, 0.06);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.tag.warning,
.tier-tag {
  border-color: rgba(177, 106, 16, 0.18);
  background: var(--amber-soft);
  color: var(--amber);
}

.tier-tag-0 {
  border-color: rgba(29, 158, 117, 0.18);
  background: var(--teal-soft);
  color: var(--teal);
}

.tier-tag-1 {
  border-color: rgba(26, 58, 92, 0.16);
  background: var(--blue-soft);
  color: var(--blue);
}

.tier-tag-2 {
  border-color: rgba(239, 159, 39, 0.2);
  background: var(--rose-soft);
  color: #9b6416;
}

.school-evidence {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  gap: 12px;
  margin-top: 12px;
}

.school-evidence > div {
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.school-evidence strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

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

.school-evidence p:last-child {
  margin-bottom: 0;
}

.score-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.score-line b {
  height: 7px;
  border-radius: 999px;
  background: rgba(26, 58, 92, 0.1);
  overflow: hidden;
}

.score-line i {
  display: block;
  height: 100%;
  background: var(--blue);
}

.score-line em {
  color: var(--ink-soft);
  font-style: normal;
  text-align: right;
}

.reason-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.reason-grid div {
  padding: 12px 13px;
  border: 1px solid rgba(29, 158, 117, 0.16);
  border-radius: var(--radius);
  background: rgba(29, 158, 117, 0.06);
  color: #315d51;
  font-size: 13px;
  line-height: 1.7;
}

.reason-grid div:last-child {
  border-color: rgba(184, 134, 11, 0.18);
  background: rgba(184, 134, 11, 0.08);
  color: #72571f;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 48px 0 0;
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  box-shadow: var(--shadow-light);
}

.site-footer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.site-footer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .app-shell {
    padding: 32px 24px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
  }

  .topbar-side {
    justify-items: start;
    gap: 16px;
  }

  .top-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .database-kpis div:nth-child(2) {
    border-right: 0;
  }

  .database-kpis div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--hairline);
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.22;
    margin-bottom: 12px;
  }

  .topbar {
    gap: 18px;
    margin-bottom: 24px;
  }

  .brand-kicker-row {
    display: block;
  }

  .language-switch {
    width: 168px;
    height: 36px;
  }

  .language-option {
    height: 28px;
  }

  .intro {
    font-size: 14px;
    line-height: 1.75;
  }

  .top-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .source-badge {
    min-height: 66px;
    padding: 10px 8px;
  }

  .source-badge strong {
    font-size: 18px;
  }

  .source-badge span {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.35;
  }

  .input-panel,
  .report-panel,
  .shortlist-panel,
  .database-panel,
  .assessment-panel {
    padding: 16px;
  }

  .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 16px;
  }

  .panel-head p {
    font-size: 13px;
    line-height: 1.65;
  }

  .field-grid,
  .score-row,
  .report-summary,
  .database-kpis,
  .insight-grid,
  .question-plan,
  .school-evidence,
  .reason-grid {
    grid-template-columns: 1fr;
  }

  .test-pack-callout,
  .client-actions,
  .paper-meta,
  .paper-student-info {
    grid-template-columns: 1fr;
  }

  .assessment-actions {
    display: grid;
  }

  .database-kpis div,
  .database-kpis div:nth-child(2),
  .database-kpis div:nth-child(-n + 2),
  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .database-kpis div:last-child,
  .metric:last-child {
    border-bottom: 0;
  }

  .coverage-row {
    grid-template-columns: 1fr;
  }

  .coverage-row span {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

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

  .report-hero {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .report-hero h2 {
    font-size: 24px;
  }

  .readiness-card {
    min-height: 102px;
    border-left: 0;
    border-top: 1px solid var(--hairline);
  }

  .button-row {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .ghost-button {
    width: auto;
  }

  .secondary-button {
    width: 100%;
  }

  .test-pack-callout .primary-button,
  .client-actions .primary-button,
  .assessment-actions .primary-button {
    width: 100%;
  }

  .school-card header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: start;
    gap: 12px;
  }

  .score-pill {
    min-width: 76px;
    padding: 8px 7px;
  }

  .school-card h3 {
    font-size: 17px;
    line-height: 1.35;
  }

  .school-meta {
    font-size: 12px;
    line-height: 1.65;
  }

  .paper-cover h2 {
    font-size: 24px;
  }

  .paper-subject-head {
    display: grid;
    gap: 4px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 16px;
    margin-top: 24px;
  }
}

@media (max-width: 430px) {
  .top-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .source-badge {
    min-height: 62px;
    padding: 9px 6px;
  }

  .source-badge strong {
    font-size: 16px;
  }

  .source-badge span {
    font-size: 10px;
  }

  .panel-head {
    grid-template-columns: 1fr;
  }

  .ghost-button {
    width: 100%;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  body::before,
  .topbar,
  .input-panel,
  .database-panel,
  .report-panel,
  .shortlist-panel,
  .assessment-actions,
  .site-footer {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .layout,
  .result-stack {
    display: block;
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .assessment-panel {
    display: block !important;
    border: 0;
    box-shadow: none;
    background: #ffffff;
    padding: 0;
  }

  .assessment-paper {
    border: 0;
    border-radius: 0;
    background: #ffffff;
    padding: 0;
  }

  .paper-subject,
  .paper-source-note {
    break-inside: avoid;
  }

  .paper-cover h2 {
    font-size: 24pt;
  }

  .paper-block li,
  .paper-passage,
  .paper-instructions p {
    font-size: 11pt;
  }
}
