@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --ink: #22231f;
  --ink-soft: #41423d;
  --ink-mute: #73736c;
  --ink-faint: #9b9a92;
  --canvas: #fbfaf7;
  --paper: #f1efe9;
  --parchment: #f1efe9;
  --pearl: #f7f5f0;
  --acid: #dfe5d2;
  --blue: #7185a7;
  --orange: #d39a74;
  --red: #c76a61;
  --yellow: #d6c487;
  --green: #7f9d8b;
  /* Primary accent - deepened/more saturated so it reads clearly against
     the pale paper background instead of blending into a pastel wash. */
  --magenta: #2f5c85;
  --magenta-bright: #3f7099;
  --magenta-deep: #1f3f5c;
  --magenta-on-dark: #8fb3d4;
  --black: #22231f;
  --on-dark: #ffffff;
  --on-dark-mute: #c8c8c8;
  --on-dark-faint: #8f8f8f;
  --divider: #dfdcd4;
  --hairline: #cbc7bd;
  --hairline-dark: #4b4e55;

  /* Semantic state colors - one consistent trio (pale bg / readable text /
     saturated accent) reused everywhere instead of one-off near-duplicate
     hex values. Keeps "good vs. bad" instantly readable at a glance. */
  --pos-bg: #d2e7da;
  --pos-text: #1f6b43;
  --pos-strong: #2f8a5a;
  --watch-bg: #ecdfae;
  --watch-text: #7a5e14;
  --watch-strong: #c99a1f;
  --risk-bg: #eccba0;
  --risk-text: #7a4a1f;
  --neg-bg: #e7b696;
  --neg-text: #7a3814;
  --neg-strong: #c0532f;
  --font-display: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --max-width: 1240px;
  --page-pad: clamp(20px, 4vw, 56px);
  --section-pad: clamp(72px, 9vw, 128px);
  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

.profile-page section[id] { scroll-margin-top: 146px; }

body {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
::selection { background: var(--acid); color: var(--ink); }

.mono {
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.05em;
}

/* Navigation */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 74px;
  border-bottom: 1px solid var(--divider);
  background: rgba(251, 250, 247, .96);
  color: var(--ink);
}

.gn-inner,
.sn-inner,
.tile-inner,
.footer-inner {
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.gn-inner {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 24px;
}

.global-nav .gn-inner { width: min(100%, 1440px); }

.gn-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.gn-brand img {
  width: 72px;
  height: auto;
  filter: none;
}

.brand-edition {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--divider);
  padding-left: 15px;
  line-height: 1.1;
}

.brand-edition strong { font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.brand-edition small { color: var(--ink-faint); font-size: 12px; font-weight: 750; letter-spacing: .03em; }

.gn-links {
  height: 42px;
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 0;
  border: 1px solid var(--divider);
  background: var(--paper);
  padding: 3px;
  font-size: 13px;
  font-weight: 700;
}

.gn-links a {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: var(--ink-mute);
  transition: background-color .18s ease, color .18s ease;
}

.gn-links a small { color: var(--ink-faint); font-size: 12px; font-weight: 850; letter-spacing: .02em; }

.gn-links a:hover,
.gn-links a:focus-visible,
.gn-links a.is-current { background: var(--canvas); color: var(--ink); }

.gn-links a.is-current small { color: var(--magenta); }

.gn-action {
  width: 138px;
  height: 44px;
  justify-self: end;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background: #343740;
  color: #fff;
  padding: 0 15px;
  line-height: 1.1;
}

.gn-action small { margin-bottom: 3px; color: #c0c2c6; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.gn-action strong { font-size: 12px; font-weight: 900; letter-spacing: .05em; }
.gn-action:hover, .gn-action:focus-visible { background: var(--magenta-deep); }

.profile-bar {
  position: sticky;
  top: 74px;
  z-index: 90;
  border-bottom: 1px solid var(--divider);
  background: var(--canvas);
}

.profile-bar .sn-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px var(--page-pad);
}

.sn-title { font-size: 18px; font-weight: 850; }
.sn-actions { display: flex; align-items: center; gap: 20px; font-size: 12px; font-weight: 700; }
.sn-actions a { border-bottom: 1px solid var(--ink); }
.test-caption { color: var(--ink-mute); }

.admin-switcher { align-items: center; gap: 8px; }
.admin-switcher label { font-size: 12px; font-weight: 800; }
.admin-switcher select {
  height: 34px;
  min-width: 112px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--acid);
  padding: 0 28px 0 10px;
  font-weight: 800;
}

/* Core layout */
.tile { padding: var(--section-pad) var(--page-pad); }
.tile-light { background: var(--canvas); }
.tile-grid-section {
  background-color: var(--paper);
  background-image: none;
}

.section-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: start;
  gap: 22px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-index {
  width: 58px;
  height: auto;
  display: block;
  border: 0;
  border-top: 2px solid var(--ink);
  background: transparent;
  padding-top: 8px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--magenta);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.section-head h2,
.access-copy h2 {
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

/* Main hero */
.report-hero {
  min-height: calc(100svh - 74px);
  display: flex;
  align-items: center;
  padding: clamp(56px, 8vw, 104px) var(--page-pad);
  border-bottom: 1px solid var(--divider);
  background: #ecefe8;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(500px, 1.1fr);
  align-items: stretch;
  gap: clamp(44px, 7vw, 96px);
}

.hero-copy { display: flex; flex-direction: column; justify-content: space-between; min-height: 530px; }

.report-code {
  display: flex;
  align-items: center;
  width: max-content;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.report-code span { padding: 8px 12px; border-right: 1px solid var(--hairline); }
.report-code span:last-child { border-right: 0; }
.report-code span:first-child { background: var(--magenta); color: #fff; }

.hero-copy h1 {
  font-size: clamp(62px, 7vw, 92px);
  font-weight: 950;
  line-height: 0.83;
  letter-spacing: -0.085em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.hero-meta span { border: 1px solid var(--hairline); background: rgba(255,255,255,.48); padding: 7px 10px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 0;
}

.stat {
  min-height: 265px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--hairline);
  padding: clamp(22px, 3vw, 36px);
}

.stat-primary { background: #292c32; color: #fff; }
.stat-blue { background: #d3e0ef; color: var(--ink); }
.stat-green { background: var(--pos-bg); }
.stat-orange { background: #ecd4bb; }
.stat-label { font-size: 14px; font-weight: 850; letter-spacing: 0.04em; }
.stat-value { white-space: nowrap; font-size: clamp(48px, 5vw, 68px); font-weight: 950; line-height: .95; }
.stat-foot { min-height: 20px; font-size: 13px; font-weight: 700; opacity: .78; letter-spacing: 0; }

/* Cards and charts */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

#chart-grade1-trend,
#chart-distribution,
#chart-grades,
#chart-go2-trend,
#chart-class-position,
#chart-national,
#chart-trend { overflow-x: auto; }

.chart-card {
  min-width: 0;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--canvas);
  padding: clamp(22px, 3.5vw, 40px);
  box-shadow: none;
}

.track-card + .track-card { margin-top: 24px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.chart-kicker {
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .14em;
}

.chart-title { font-size: clamp(23px, 2.2vw, 29px); font-weight: 900; line-height: 1.15; letter-spacing: -.035em; }
.chart-sub, .lead, .help { color: var(--ink-mute); }
.chart-caption, .fine {
  margin-top: 18px;
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}

.source-chip,
.result-chip,
.legend-line {
  flex: 0 0 auto;
  border: 1px solid var(--hairline);
  background: var(--pearl);
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.result-chip { max-width: 58%; background: var(--pos-bg); color: var(--pos-text); font-weight: 700; line-height: 1.2; text-align: right; }
.legend-line { border-style: dashed; background: transparent; }

.exam-chart-card { border-color: var(--hairline); background: var(--canvas); color: var(--ink); }
.exam-chart-card .chart-kicker { color: var(--magenta); }
.exam-chart-card .source-chip { border-color: var(--hairline); background: var(--pearl); color: var(--ink); }
.exam-chart-card .chart-caption { color: var(--ink-mute); }
.exam-chart-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  border: 1px solid #fff;
  background: var(--ink);
  color: #fff;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 750;
  opacity: 0;
  visibility: hidden;
}

.exam-chart-tooltip.show {
  opacity: 1;
  visibility: visible;
}

#grade-table { margin-top: 24px; overflow-x: auto; }
#grade-table table { min-width: 520px; }
#grade-table th, #grade-table td { white-space: nowrap; }

/* Round cells */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.compare-col {
  min-width: 0;
  border-top: 1px solid var(--hairline);
  padding-top: 15px;
}

.compare-col-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  min-height: 42px;
  font-size: 15px;
  font-weight: 900;
}

.fmt-tag {
  background: var(--watch-bg);
  color: var(--watch-text);
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.round-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 118px;
  gap: 8px;
}

.compare-col .round-grid { grid-template-columns: repeat(5, minmax(70px, 1fr)); }
.compact-rounds { margin-top: 28px; grid-template-columns: repeat(6, minmax(90px, 1fr)); }
.listening-row { grid-template-columns: repeat(17, minmax(0, 1fr)); grid-auto-rows: 64px; gap: 4px; }
.listening-row .round-cell { padding: 6px 4px; align-items: center; text-align: center; }
.listening-row .rc-label { min-height: 0; font-size: 11px; }
.listening-row .rc-value { font-size: 13px; letter-spacing: -.03em; }

.round-cell {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--hairline) !important;
  background: var(--pearl);
  padding: 12px;
}

.round-cell.miss { background: var(--neg-bg); }
.round-cell.final-test { border: 2px solid var(--ink) !important; }
.round-cell.hm-good { background: var(--pos-bg); }
.round-cell.hm-watch { background: var(--watch-bg); }
.round-cell.hm-risk { background: var(--risk-bg); }
.round-cell.hm-danger { background: var(--neg-bg); }
.round-cell.hm-empty { background: var(--pearl); }
.round-cell.is-correct { background: var(--pos-bg); }
.round-cell.is-correct .rc-value { color: var(--pos-text); }
.round-cell.is-wrong { background: var(--neg-bg); }
.round-cell.is-wrong .rc-label { color: var(--neg-text); }
.round-cell.is-wrong .rc-value { color: var(--neg-text); }
.rc-label { min-height: 30px; font-size: 12px; font-weight: 850; line-height: 1.3; color: var(--ink-soft); }
.rc-value { font-size: 27px; font-weight: 950; line-height: 1; letter-spacing: -.06em; }
.rc-detail { overflow: hidden; color: var(--ink-mute); font-size: 12px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }

.reading-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 24px;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}

.reading-summary > div {
  min-width: 0;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--pearl);
  padding: 18px;
}

.reading-summary > div:last-child { background: var(--pos-bg); }
.caption { color: var(--ink-mute); font-size: 12px; font-weight: 850; letter-spacing: .03em; }
.reading-summary-value { margin-top: 7px; font-size: clamp(25px, 3vw, 38px); font-weight: 950; line-height: 1; }
.reading-summary-value.accent { color: var(--ink) !important; }

.content-block { margin-top: clamp(48px, 8vw, 88px); }
.content-title {
  margin-bottom: 22px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: -.045em;
}

/* Heatmaps */
.hm-type-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  margin-bottom: 22px;
}

.hm-type-chip {
  min-height: 90px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--hairline);
  background: var(--pearl);
  padding: 11px;
}

.hm-type-chip.weak { background: var(--neg-bg); }
.hm-type-chip span { font-size: 12px; font-weight: 850; }
.hm-type-chip strong { font-size: 25px; line-height: 1; letter-spacing: -.05em; }
.hm-type-chip small { color: var(--ink-mute); font-size: 12px; }

.hm-scroll { overflow-x: auto; border: 1px solid var(--hairline); background: #fff; }
.hm-table { width: 100%; min-width: 1120px; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.hm-table th, .hm-table td { height: 54px; border-right: 1px solid var(--divider); border-bottom: 1px solid var(--divider); text-align: center; }
.hm-table th { padding: 8px; }
.hm-table td { overflow: hidden; padding: 0; }
.hm-table thead th { position: sticky; top: 0; z-index: 2; background: #e8e5de; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .01em; }
.hm-table thead th small { display: block; margin-top: 2px; color: var(--ink-mute); font-size: 12px; }
.hm-table tbody th { background: var(--pearl); font-weight: 900; }
.hm-sticky-col { position: sticky; left: 0; z-index: 3; min-width: 70px; }
.hm-table thead .hm-sticky-col { z-index: 4; }
.hm-q small { display: block; color: var(--magenta); font-size: 12px; }
.hm-type { min-width: 100px; background: #f7f7f2; font-size: 12px; }
.hm-type.weak { background: var(--neg-bg); }
.hm-term-col, .tt-main-col { background-color: #edf0e6 !important; }
.hm-table thead .hm-term-col,
.hm-table thead .tt-main-col {
  border: 2px solid var(--ink);
  background: var(--ink) !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 950;
}
.hm-table thead .hm-term-col small,
.hm-table thead .tt-main-col small { color: #d7d7d2; font-size: 13px; font-weight: 800; }
.hm-table tbody td.hm-term-col,
.hm-table tbody td.tt-main-col {
  border-right: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}
.hm-table tbody tr:last-child td.hm-term-col,
.hm-table tbody tr:last-child td.tt-main-col { border-bottom: 2px solid var(--ink); }
.hm-table tbody td.hm-term-col .hm-cell,
.hm-table tbody td.tt-main-col .hm-cell {
  font-size: 14px;
  font-weight: 950;
}
.hm-total-col { min-width: 90px; background: #efede7 !important; color: var(--ink) !important; font-weight: 900; }

.hm-cell,
.hm-rate {
  width: 100%;
  min-width: 48px;
  height: 100%;
  min-height: 54px;
  display: inline-grid;
  place-items: center;
  border: 0;
  font-size: 12px;
  font-weight: 900;
}

.hm-good, .hm-correct { background: var(--pos-bg); color: var(--pos-text); }
.hm-watch { background: var(--watch-bg); color: var(--watch-text); }
.hm-risk { background: var(--risk-bg); color: var(--risk-text); }
.hm-danger, .hm-wrong-strong { background: var(--neg-bg); color: var(--neg-text); }
.hm-wrong-mid { background: var(--risk-bg); color: var(--risk-text); }
.hm-wrong-soft { background: var(--watch-bg); color: var(--watch-text); }
.hm-empty, .hm-missing { background: #ededeb; color: #929292; }

/* Question cards */
.hard-question-grid,
.q-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 760px) {
  .hard-question-grid,
  .q-grid { grid-template-columns: minmax(0, 1fr); }
}
.q-card {
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--canvas);
}

.q-summary,
.q-header {
  border-bottom: 1px solid var(--hairline);
  background: #e7eadf;
  padding: 20px;
}

.q-summary-grid { display: grid; grid-template-columns: .7fr 1fr 1fr 1fr; gap: 16px; align-items: end; }
.q-summary-compact { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); align-items: center; gap: 36px; padding: 16px 20px; }
.q-summary-compact .q-summary-grid > div:first-child { font-size: 34px !important; }
.q-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.q-num { font-size: 20px; font-weight: 950; }
.q-points, .tag { border: 1px solid var(--hairline); background: #fff; padding: 5px 8px; font-size: 12px; font-weight: 850; }
.q-tag-row { padding: 10px 20px 0; }

.q-passage {
  max-height: 560px;
  overflow: auto;
  border-top: 1px solid var(--divider);
  background: #fbfbf7;
  padding: clamp(20px, 3vw, 32px);
  font-size: 16px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: keep-all;
}

.q-script { border-left: 5px solid var(--blue); }
.q-highlight { background: #e9dfb8; color: inherit; padding: 0 2px; }
.q-underline { text-decoration-color: var(--magenta); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.q-correction { margin: 0 .14em; color: var(--neg-text); font-weight: 800; ruby-position: over; }
.q-correction del { text-decoration-color: var(--neg-strong); text-decoration-thickness: 2px; }
.q-correction rt { color: var(--pos-text); font-size: .7em; font-weight: 900; letter-spacing: 0; }
.q-insert-sentence { margin: 20px 20px 0; border: 1px solid var(--hairline); background: #edf0f5; padding: 14px; }
.qi-label { margin-bottom: 5px; color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .06em; }
.q-insert-sentence p { font-size: 15px; line-height: 1.65; }

.q-choices { list-style: none; border-top: 1px solid var(--divider); }
.q-choices li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; border-bottom: 1px solid var(--divider); padding: 14px clamp(20px, 3vw, 32px); font-size: 15px; line-height: 1.6; }
.q-choices li.is-correct { background: var(--pos-bg); font-weight: 750; }
.q-choices li.is-mine { background: var(--neg-bg); box-shadow: inset 5px 0 var(--neg-strong); }
.qc-num { font-weight: 900; }

/* 반 응답 분포를 선택지 목록에 바로 표시 (별도 그래프 없이) */
.q-choices li:has(.qc-count) { position: relative; grid-template-columns: 28px 1fr auto; overflow: hidden; }
.q-choices li:has(.qc-count)::before {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--qc-pct, 0%);
  background: rgba(47, 92, 133, 0.14);
  z-index: 0;
}
.q-choices li.is-correct::before { background: rgba(47, 138, 90, 0.24); }
.q-choices li.was-picked::before { background: rgba(192, 83, 47, 0.28); }
.q-choices li:has(.qc-count) > * { position: relative; z-index: 1; }
.qc-count { color: var(--ink-mute); font-size: 13px; font-weight: 700; white-space: nowrap; }

/* Access */
.access-section {
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: #e4e8dc;
  padding: var(--section-pad) var(--page-pad);
}

.access-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(48px, 8vw, 120px); }
.access-copy .eyebrow { color: var(--ink); }
.access-copy h2 { font-size: clamp(48px, 6vw, 72px); }
.login-card { border: 1px solid var(--hairline); background: #fff; padding: clamp(24px, 4vw, 42px); }
.form-field + .form-field { margin-top: 20px; }
.form-field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 900; letter-spacing: .02em; }
.form-field input {
  width: 100%;
  height: 56px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  outline: 0;
  background: var(--pearl);
  padding: 0 15px;
  font-size: 16px;
  font-weight: 700;
}
.form-field input:focus { background: #eef1e7; border-color: var(--blue); }
.form-error { display: none; margin-top: 14px; color: #d1241b; font-size: 12px; font-weight: 800; }
.form-error.show { display: block; }
.btn-pill {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 900;
}
.login-card .btn-pill { width: 100%; margin-top: 24px; }
.btn-pill:hover { background: var(--blue); }
.btn-pill:disabled { cursor: wait; opacity: .5; }
.demo-help { margin-top: 14px; }

/* Profile */
.profile-hero-section { padding: clamp(48px, 7vw, 88px) var(--page-pad); border-bottom: 1px solid var(--divider); background: #292c32; color: #fff; }
.profile-hero { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); gap: clamp(40px, 7vw, 96px); }
.student-title-block { min-height: 400px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.student-label { color: var(--acid); font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.student-name { font-size: clamp(58px, 7vw, 84px); font-weight: 950; line-height: .92; letter-spacing: -.065em; word-break: keep-all; }
.grade-badge { border: 1px solid rgba(255,255,255,.7); background: var(--magenta); color: #fff; padding: 9px 14px; font-size: 14px; font-weight: 950; }
.student-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.meta-item { min-height: 200px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(255,255,255,.22); padding: clamp(22px, 3vw, 34px); color: var(--ink); }
.meta-total { grid-column: 1 / -1; background: var(--pos-bg); }
.meta-reading { background: #d3e0ef; }
.meta-listening { background: #ecd4bb; }
.meta-label { font-size: 12px; font-weight: 950; letter-spacing: .08em; }
.meta-value { font-size: clamp(50px, 6vw, 72px); font-weight: 950; line-height: .9; }
.meta-value .unit { margin-left: 6px; font-size: 14px; font-weight: 850; letter-spacing: 0; }
.profile-position-grid { grid-template-columns: 1fr; }
.listening-summary { margin-top: 32px; }
.teacher-section { border-bottom: 1px solid var(--divider); background: #e8ecf2; padding: clamp(40px, 6vw, 72px) var(--page-pad); }
.term-comment-card { display: grid; grid-template-columns: minmax(180px, .35fr) minmax(0, 1fr); border: 1px solid var(--hairline); background: var(--canvas); }
.term-comment-title { display: flex; flex-direction: column; justify-content: space-between; gap: 30px; border-right: 1px solid var(--hairline); background: #e0e6ef; padding: clamp(22px, 3vw, 36px); }
.term-comment-title span { font-size: 12px; font-weight: 950; letter-spacing: .08em; }
.term-comment-title strong { font-size: clamp(28px, 4vw, 46px); font-weight: 950; line-height: .95; letter-spacing: -.06em; }
.term-comment-grid { display: grid; grid-template-columns: 1fr 1fr; }
.term-comment-item { min-width: 0; padding: clamp(24px, 3vw, 38px); }
.term-comment-item + .term-comment-item { border-left: 1px solid var(--hairline); }
.term-comment-label { display: inline-block; margin-bottom: 18px; background: #e3e6ea; padding: 6px 9px; font-size: 12px; font-weight: 900; }
.term-comment-item p { font-size: 15px; font-weight: 600; line-height: 1.72; word-break: keep-all; }
.term-comment-item.pending { color: var(--ink-mute); background: var(--pearl); }
.auth-section { min-height: calc(100svh - 74px); display: grid; align-items: center; background: var(--acid); padding: var(--section-pad) var(--page-pad); }
.auth-section h1 { margin-bottom: 34px; font-size: clamp(44px, 7vw, 92px); font-weight: 950; letter-spacing: -.07em; }

/* Footer and utility */
.footer { background: #292c32; color: #fff; padding: 34px var(--page-pad); }
.footer-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.footer-brand img { width: 84px; filter: grayscale(1) brightness(0) invert(1); }
.footer-text { color: #bdbdbd; font-size: 12px; font-weight: 850; letter-spacing: .05em; text-align: center; }
.archive-link { justify-self: end; border-bottom: 1px solid #fff; font-size: 12px; font-weight: 850; letter-spacing: .03em; }
.floating-top-button { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 46px; height: 46px; border: 1px solid var(--hairline); border-radius: 0; background: #f3f1eb; font-size: 20px; font-weight: 900; }

.reveal { animation: reveal-in .45s ease-out both; }
.reveal-1 { animation-delay: .06s; }
.reveal-2 { animation-delay: .12s; }
.reveal-3 { animation-delay: .18s; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { min-height: 410px; }
  .stat { min-height: 220px; }
  .dashboard-grid, .profile-position-grid { grid-template-columns: 1fr; }
  .compare-col .round-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .compact-rounds { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .profile-hero { grid-template-columns: 1fr; }
  .student-title-block { min-height: 330px; }
  .term-comment-card { grid-template-columns: 1fr; }
  .term-comment-title { border-right: 0; border-bottom: 1px solid var(--hairline); }
}

@media (max-width: 760px) {
  :root { --page-pad: 18px; }
  html { scroll-padding-top: 116px; }
  .profile-page section[id] { scroll-margin-top: 174px; }
  .global-nav { height: 108px; }
  .gn-inner {
    grid-template-columns: 1fr 112px;
    grid-template-rows: 63px 45px;
    gap: 0;
    padding: 0;
  }
  .gn-brand { grid-column: 1; grid-row: 1; min-width: 0; padding: 0 16px; }
  .gn-brand img { width: 64px; }
  .brand-edition { display: flex; padding-left: 12px; }
  .brand-edition small { display: none; }
  .gn-action { grid-column: 2; grid-row: 1; width: 112px; height: 100%; justify-self: stretch; padding: 0 12px; }
  .gn-links {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 45px;
    justify-self: stretch;
    justify-content: flex-start;
    overflow-x: auto;
    border: 0;
    border-top: 1px solid var(--divider);
    background: var(--canvas);
    padding: 5px 10px;
    scrollbar-width: none;
  }
  .gn-links::-webkit-scrollbar { display: none; }
  .gn-links a { display: inline-flex; flex: 0 0 auto; height: 34px; padding: 0 12px; font-size: 12px; }
  .profile-bar { top: 108px; }
  .profile-bar .sn-inner { min-height: 52px; padding: 8px 14px; }
  .sn-title { font-size: 15px; }
  .test-caption { display: none; }
  .sn-actions { gap: 10px; font-size: 12px; }
  .report-hero { min-height: auto; padding-top: 48px; }
  .hero-copy { min-height: 345px; }
  .hero-copy h1 { font-size: clamp(56px, 16vw, 76px); }
  .stat { min-height: 180px; padding: 18px; }
  .stat-value { font-size: clamp(44px, 11vw, 58px); }
  .stat-foot { font-size: 12px; }
  .section-head { grid-template-columns: 46px 1fr; gap: 15px; }
  .section-index { width: 46px; height: 46px; font-size: 12px; }
  .section-head h2 { font-size: 38px; }
  .chart-card { padding: 20px; }
  .card-head { margin-bottom: 24px; }
  .chart-title { font-size: 22px; }
  #chart-grade1-trend svg,
  #chart-distribution svg,
  #chart-grades svg,
  #chart-go2-trend svg,
  #chart-class-position svg,
  #chart-national svg,
  #chart-trend svg { min-width: 720px; }
  .source-chip, .result-chip { padding: 6px 8px; font-size: 12px; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-col .round-grid { grid-template-columns: repeat(5, minmax(62px, 1fr)); }
  .round-grid, .compact-rounds { grid-template-columns: repeat(3, minmax(76px, 1fr)); }
  .round-grid, .compact-rounds { grid-auto-rows: 112px; }
  .round-cell { min-height: 0; padding: 10px; }
  .rc-value { font-size: 23px; }
  .access-grid { grid-template-columns: 1fr; }
  .access-copy h2 { font-size: 64px; }
  .profile-hero-section { padding-top: 44px; }
  .student-title-block { min-height: 280px; }
  .student-name { font-size: 66px; }
  .meta-item { min-height: 155px; }
  .term-comment-grid { grid-template-columns: 1fr; }
  .term-comment-item + .term-comment-item { border-left: 0; border-top: 1px solid var(--hairline); }
  .q-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .q-summary-compact { grid-template-columns: 1fr; gap: 18px; }
  .footer-inner { grid-template-columns: 1fr auto; }
  .footer-text { display: none; }
}

@media (max-width: 520px) {
  .hero-copy { min-height: 310px; }
  .report-code span { padding: 7px 8px; font-size: 12px; }
  .hero-meta span:nth-child(2) { width: 100%; }
  .stat-row { grid-template-columns: 1fr; }
  .stat { min-height: 155px; }
  .stat-value { font-size: 58px; }
  .card-head { flex-direction: column; gap: 12px; }
  .result-chip { max-width: 100%; text-align: left; }
  .compare-col .round-grid { grid-template-columns: repeat(3, minmax(70px, 1fr)); }
  .reading-summary { grid-template-columns: 1fr; }
  .access-copy h2 { font-size: 54px; }
  .student-meta { grid-template-columns: 1fr; }
  .meta-total { grid-column: auto; }
  .meta-item { min-height: 140px; }
  .q-header { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { animation: none; }
}
