:root {
  --ink: #171a2b;
  --ink-2: #2b2f45;
  --muted: #6b7189;
  --muted-2: #8b90a6;
  --line: #e5e7f2;
  --line-2: #eef0f8;
  --brand: #5a5bd6;
  --brand-2: #7c5cfc;
  --brand-3: #22d3ee;
  --mint: #10b981;
  --amber: #f59e0b;
  --rose: #ef4444;
  --sky: #0ea5e9;
  --bg: #f5f6fb;
  --card: #ffffff;
  --shadow: 0 24px 70px rgba(30, 35, 80, .10);
  --shadow-sm: 0 10px 30px rgba(30, 35, 80, .07);
  --radius: 26px;
  --font-head: "Manrope", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { max-width: 100%; }
::selection { background: rgba(90, 91, 214, .18); }

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  animation: blobFloat 18s ease-in-out infinite alternate;
}
.blob-1 { width: 520px; height: 520px; left: -160px; top: -120px; background: #c7c9ff; }
.blob-2 { width: 460px; height: 460px; right: -140px; top: 80px; background: #b8f1ff; animation-delay: -6s; }
.blob-3 { width: 520px; height: 520px; left: 35%; bottom: -260px; background: #ffd9e7; animation-delay: -11s; }
.grid-glow {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(90, 91, 214, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(90, 91, 214, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 68%);
}

@keyframes blobFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(30px, 40px, 0) scale(1.08); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 246, 251, .78);
  border-bottom: 1px solid rgba(229, 231, 242, .8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 74px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
  color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 19px;
  box-shadow: 0 10px 24px rgba(90, 91, 214, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-head); font-size: 16px; letter-spacing: -.2px; }
.brand-text small { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.header-progress { flex: 1 1 auto; max-width: 360px; margin-left: auto; }
.header-progress-text { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.header-progress-track { height: 8px; background: #e7e9f4; border-radius: 999px; overflow: hidden; }
.header-progress-track span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3)); transition: width .35s ease; }
.header-actions { display: flex; gap: 8px; margin-left: auto; }

.app-shell { max-width: 1240px; margin: 0 auto; padding: 32px 24px 90px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 14px;
  padding: 11px 18px; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  background: #fff; color: var(--ink);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(90, 91, 214, .28); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 60%, #6d5efc);
  color: #fff;
  box-shadow: 0 14px 30px rgba(90, 91, 214, .28);
}
.btn-primary:hover { box-shadow: 0 18px 38px rgba(90, 91, 214, .34); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #c9cce0; background: rgba(255, 255, 255, .7); }
.btn-soft { background: #eef0ff; color: var(--brand); border-color: #e0e2ff; }
.btn-soft:hover { background: #e5e7ff; }
.btn-danger-soft { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.btn-large { padding: 16px 26px; font-size: 16px; border-radius: 16px; }
.btn-small { padding: 8px 13px; font-size: 12.5px; border-radius: 11px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

.start-view { animation: fadeUp .45s ease both; }
.start-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 42px; align-items: center; padding: 18px 0 8px; min-width: 0; }
.start-copy { max-width: 640px; min-width: 0; }
.badge, .eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(90, 91, 214, .09); color: var(--brand);
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(16, 185, 129, .14); }
.start-title {
  font-family: var(--font-head); font-size: clamp(2.2rem, 4.6vw, 3.7rem);
  line-height: 1.05; letter-spacing: -.045em; margin: 18px 0 16px;
}
.start-title .grad { background: linear-gradient(120deg, var(--brand), var(--brand-2) 45%, var(--sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.start-lead { font-size: 17.5px; color: var(--muted); max-width: 560px; line-height: 1.65; }
.start-stats { display: flex; flex-wrap: wrap; gap: 9px; margin: 22px 0 26px; }
.stat-pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); padding: 8px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); box-shadow: 0 4px 12px rgba(30, 35, 80, .04); }
.stat-pill svg { width: 16px; height: 16px; color: var(--brand); }
.start-panel {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  margin-top: 20px;
}
.start-panel h3 { font-family: var(--font-head); font-size: 20px; letter-spacing: -.3px; }
.start-panel p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.name-field { margin: 18px 0 14px; }
.name-field label { display: block; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 7px; }
.name-field input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); font-size: 15px; outline: none; transition: border-color .18s, box-shadow .18s;
}
.name-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(90, 91, 214, .1); }
.start-panel .btn { width: 100%; }
.start-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; font-size: 12px; color: var(--muted-2); line-height: 1.45; }
.start-note svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; color: var(--mint); }
.resume-note { margin-top: 10px; font-size: 12.5px; color: var(--brand); font-weight: 600; text-align: center; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.hero-art { position: relative; min-width: 0; }
.hero-art .ill-svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(30, 35, 80, .18)); animation: heroFloat 7s ease-in-out infinite; }
@keyframes heroFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; }
.feature-card { background: rgba(255, 255, 255, .78); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 6px 20px rgba(30, 35, 80, .04); }
.feature-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #eef0ff; color: var(--brand); margin-bottom: 10px; }
.feature-icon svg { width: 20px; height: 20px; }
.feature-card strong { display: block; font-family: var(--font-head); font-size: 14.5px; margin-bottom: 4px; }
.feature-card span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.start-footnote { margin-top: 22px; text-align: center; color: var(--muted-2); font-size: 12px; line-height: 1.5; }

.test-view { animation: fadeUp .35s ease both; }
.test-grid { display: grid; grid-template-columns: 278px minmax(0, 1fr); gap: 26px; align-items: start; }
.test-main { min-width: 0; }
.sidebar { position: sticky; top: 96px; }
.side-card { background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: var(--shadow-sm); backdrop-filter: blur(12px); }
.side-progress { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.side-ring { position: relative; width: 88px; height: 88px; flex: 0 0 auto; }
.side-ring svg { width: 88px; height: 88px; transform: rotate(-90deg); }
.side-ring .track { fill: none; stroke: #e9ebf6; stroke-width: 8; }
.side-ring .fill { fill: none; stroke: url(#sideGrad); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.side-ring-text { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 18px; letter-spacing: -.5px; }
.side-progress-info strong { display: block; font-family: var(--font-head); font-size: 14px; }
.side-progress-info span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; max-height: 54vh; overflow: auto; padding-right: 4px; }
.side-link {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 9px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; cursor: pointer; text-align: left; transition: background .16s, border-color .16s;
}
.side-link:hover { background: #f5f6ff; }
.side-link.active { background: #eef0ff; border-color: #dfe2ff; }
.side-num { width: 27px; height: 27px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; background: #f1f2f9; color: var(--muted); font-size: 11.5px; font-weight: 800; }
.side-link.active .side-num { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.side-link.done .side-num { background: #d1fae5; color: #047857; }
.side-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.25; flex: 1 1 auto; }
.side-link.active .side-label { color: var(--brand); font-weight: 800; }
.side-check { color: var(--mint); display: none; flex: 0 0 auto; }
.side-link.done .side-check { display: block; }
.side-check svg { width: 14px; height: 14px; }

.mobile-sections { display: none; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 8px; scrollbar-width: thin; }
.mobile-section-btn { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 800; color: var(--muted); cursor: pointer; }
.mobile-section-btn.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }
.mobile-section-btn.done { background: #d1fae5; color: #047857; border-color: #a7f3d0; }

.section-view { animation: fadeUp .35s ease both; }
.section-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; align-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(245, 246, 255, .9));
  border: 1px solid var(--line); border-radius: 28px; padding: 28px 30px; box-shadow: var(--shadow-sm);
}
.section-hero::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 92, 252, .14), transparent 65%); right: -60px; top: -80px; }
.section-hero-text { position: relative; z-index: 1; }
.section-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.section-title { font-family: var(--font-head); font-size: clamp(1.55rem, 2.6vw, 2.15rem); letter-spacing: -.035em; line-height: 1.12; margin: 7px 0 6px; }
.section-sub { font-size: 14px; color: var(--muted); font-weight: 600; }
.section-intro { font-size: 13.5px; color: var(--muted); margin-top: 9px; max-width: 620px; line-height: 1.55; }
.section-illustration { position: relative; z-index: 1; }
.section-illustration .ill-svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 26px rgba(30, 35, 80, .12)); }

.passage-card { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow-sm); }
.passage-card h3 { font-family: var(--font-head); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 8px; }
.passage-card p { font-size: 15.5px; line-height: 1.85; color: var(--ink-2); }

.group-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px 26px; margin-top: 16px; box-shadow: 0 6px 22px rgba(30, 35, 80, .045); }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.group-title { font-family: var(--font-head); font-size: 18px; letter-spacing: -.25px; }
.group-instruction { color: var(--muted); font-size: 13px; }
.word-bank { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 4px; }
.word-chip { border: 1px solid #e0e2ff; background: #f3f4ff; color: var(--brand); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .15s, transform .15s; }
.word-chip:hover { background: #e9ebff; transform: translateY(-1px); }
.word-chip:active { transform: translateY(0); }
.word-bank-note { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

.q-list { margin-top: 8px; }
.q-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.q-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.q-num { height: 28px; border-radius: 9px; background: #f4f5fb; color: var(--muted); display: grid; place-items: center; font-size: 11.5px; font-weight: 800; margin-top: 3px; }
.q-body { min-width: 0; }
.q-text { font-size: 16.5px; line-height: 2; color: var(--ink-2); }
.q-text .sentence-hint { color: var(--muted); font-size: 13px; }
.q-hint { font-size: 12.5px; color: var(--muted-2); margin-top: 5px; }
.q-hint b { color: var(--muted); }

.blank {
  display: inline-block; vertical-align: baseline;
  width: var(--w, 8ch); min-width: 5ch; max-width: 100%;
  padding: 2px 7px 3px; margin: 0 3px;
  border: 0; border-bottom: 2px solid #c9cce0; border-radius: 4px 4px 0 0;
  background: #fbfbff; color: var(--brand);
  font-weight: 700; text-align: center; outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.blank::placeholder { color: #b9bdd1; font-weight: 500; }
.blank:focus { border-color: var(--brand); background: #f3f4ff; box-shadow: 0 4px 0 -2px rgba(90, 91, 214, .12); }
.blank.wide { display: block; width: 100%; max-width: 100%; text-align: left; margin: 9px 0 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fbfbff; font-weight: 600; }
.blank.wide:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(90, 91, 214, .08); }

.bank-select {
  appearance: none; -webkit-appearance: none;
  min-width: 130px; max-width: 100%;
  padding: 4px 28px 4px 9px; margin: 0 3px;
  border: 0; border-bottom: 2px solid #c9cce0; border-radius: 4px 4px 0 0;
  background: #fbfbff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a5bd6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 9px center;
  color: var(--brand); font-weight: 700; cursor: pointer; outline: none;
}
.bank-select:focus { border-color: var(--brand); background-color: #f3f4ff; }
.bank-select.empty { color: #9aa0b8; font-weight: 500; }

.choice-slot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 120px; padding: 2px 10px 3px; margin: 0 3px;
  border-bottom: 2px dashed #c9cce0; color: #9aa0b8; font-weight: 600;
}
.choice-slot.filled { color: var(--brand); font-weight: 800; border-bottom-style: solid; border-bottom-color: var(--brand); }
.choice-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 11px; }
.choice-btn { border: 1.5px solid var(--line); background: #fbfbff; color: var(--ink-2); border-radius: 12px; padding: 8px 15px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .16s; }
.choice-btn:hover { border-color: #c9cce0; background: #f5f6ff; }
.choice-btn.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(90, 91, 214, .24); }

.writing-box { margin-top: 6px; }
.writing-textarea {
  width: 100%; min-height: 250px; resize: vertical;
  padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 16px;
  background: #fbfbff; color: var(--ink-2); line-height: 1.75; font-size: 15.5px; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.writing-textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(90, 91, 214, .08); }
.writing-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 7px; }
.writing-meta .good { color: var(--mint); font-weight: 700; }
.writing-meta .warn { color: var(--amber); font-weight: 700; }
.writing-checklist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 7px; }
.writing-checklist li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.45; }
.writing-checklist li svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--mint); margin-top: 1px; }

.section-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.section-footer .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.section-progress-note { font-size: 12.5px; color: var(--muted); }

.result-view { animation: fadeUp .45s ease both; }
.result-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; align-items: center;
  background: linear-gradient(135deg, #fff, #f7f7ff 60%, #eefcff);
  border: 1px solid var(--line); border-radius: 30px; padding: 34px 36px; box-shadow: var(--shadow);
}
.result-hero::before { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, .14), transparent 65%); right: -80px; top: -120px; }
.score-ring { position: relative; width: 200px; height: 200px; justify-self: center; }
.score-ring svg { width: 200px; height: 200px; transform: rotate(-90deg); }
.score-ring .track { fill: none; stroke: #eceef8; stroke-width: 14; }
.score-ring .fill { fill: none; stroke: url(#ringGrad); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }
.score-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring-label strong { font-family: var(--font-head); font-size: 46px; line-height: 1; letter-spacing: -.05em; }
.score-ring-label span { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 5px; }
.result-copy { position: relative; z-index: 1; }
.result-title { font-family: var(--font-head); font-size: clamp(1.7rem, 3.2vw, 2.45rem); letter-spacing: -.04em; line-height: 1.12; margin: 10px 0 8px; }
.result-sub { color: var(--muted); font-size: 15px; max-width: 620px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.meta-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 12px; color: var(--muted); font-weight: 600; }
.meta-pill strong { color: var(--ink-2); }
.result-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.result-stat { background: rgba(255, 255, 255, .82); border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; }
.result-stat strong { display: block; font-family: var(--font-head); font-size: 23px; line-height: 1.1; letter-spacing: -.03em; }
.result-stat span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.result-stat.mint strong { color: #047857; }
.result-stat.violet strong { color: var(--brand); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: 26px 28px; margin-top: 20px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-title { font-family: var(--font-head); font-size: 21px; letter-spacing: -.35px; }
.panel-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breakdown { display: grid; grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 11px; }
.break-card { background: #fbfbff; border: 1px solid var(--line-2); border-radius: 16px; padding: 13px 15px; font: inherit; text-align: left; color: inherit; cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s; }
.break-card:hover { border-color: #c9cce0; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(30, 35, 80, .06); }
.break-card:focus-visible { outline: 3px solid rgba(90, 91, 214, .22); outline-offset: 2px; }
.break-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.break-top strong { font-size: 13px; font-weight: 700; line-height: 1.25; }
.break-top span { font-size: 12px; font-weight: 800; color: var(--brand); white-space: nowrap; }
.break-bar { height: 8px; border-radius: 999px; background: #eceef8; overflow: hidden; margin-top: 9px; }
.break-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); width: 0; transition: width .8s ease; }
.break-fill.high { background: linear-gradient(90deg, #10b981, #34d399); }
.break-fill.mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.break-fill.low { background: linear-gradient(90deg, #ef4444, #fb7185); }

.review { display: grid; gap: 9px; }
.review-section { border: 1px solid var(--line); border-radius: 16px; background: #fbfbff; overflow: hidden; }
.review-summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; user-select: none; }
.review-summary::-webkit-details-marker { display: none; }
.review-summary:hover { background: #f6f7ff; }
.review-summary .rs-num { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #eef0ff; color: var(--brand); font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.review-summary .rs-title { font-weight: 800; font-size: 14px; flex: 1 1 auto; }
.review-summary .rs-score { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.review-summary .rs-score.good { color: #047857; }
.review-summary .rs-score.bad { color: #be123c; }
.review-summary .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; flex: 0 0 auto; }
.review-section[open] .review-summary .chev { transform: rotate(180deg); }
.review-body { padding: 0 16px 16px; border-top: 1px solid var(--line-2); }
.review-group { margin-top: 14px; }
.review-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.review-item { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: flex-start; gap: 9px; }
.review-status { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; margin-top: 2px; }
.review-status svg { width: 13px; height: 13px; }
.review-status.ok { background: #d1fae5; color: #047857; }
.review-status.bad { background: #fee2e2; color: #b91c1c; }
.review-status.partial { background: #fef3c7; color: #b45309; }
.review-q { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); flex: 1 1 auto; }
.review-q .correct-fill { background: #d1fae5; color: #065f46; padding: 1px 6px; border-radius: 6px; font-weight: 800; }
.review-q .review-num { font-size: 11px; font-weight: 800; color: var(--muted-2); margin-right: 6px; }
.answer-compare { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0 0 31px; }
.answer-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.answer-chip b { color: var(--ink-2); font-weight: 700; }
.answer-chip.ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.answer-chip.bad { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.answer-chip .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }
.review-note { margin: 6px 0 0 31px; font-size: 12px; color: var(--muted); background: #f7f8fd; border-radius: 9px; padding: 7px 10px; line-height: 1.45; }

.writing-result { display: grid; gap: 16px; }
.essay-paper {
  background: #fffdf6;
  background-image: repeating-linear-gradient(transparent, transparent 31px, #f0e8d6 31px, #f0e8d6 32px);
  border: 1px solid #f0e6d2; border-radius: 16px; padding: 18px 20px; min-height: 170px;
  font-family: Georgia, "Times New Roman", serif; font-size: 15.5px; line-height: 32px; color: #3f3a2f;
  white-space: pre-wrap; word-break: break-word;
}
.essay-paper.empty { color: var(--muted-2); font-family: var(--font-body); font-size: 13.5px; }
.writing-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-card { background: #fbfbff; border: 1px solid var(--line-2); border-radius: 16px; padding: 16px; }
.mini-card h4 { font-family: var(--font-head); font-size: 14px; margin-bottom: 9px; }
.req-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.req-list li { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.req-list li svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--mint); margin-top: 1px; }
.criteria { display: grid; gap: 8px; }
.criterion { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 11px; }
.criterion label { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.criterion select { flex: 0 0 auto; border: 1.5px solid var(--line); border-radius: 9px; background: #fbfbff; padding: 5px 8px; font-size: 12.5px; font-weight: 700; color: var(--brand); outline: none; cursor: pointer; }
.criterion select:focus { border-color: var(--brand); }
.self-score-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.self-score-row .total { font-family: var(--font-head); font-size: 15px; font-weight: 800; }
.self-score-row .total b { font-size: 24px; color: var(--brand); }
.self-saved { font-size: 12px; color: var(--mint); font-weight: 700; }
.model-answer { border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 14px; padding: 0 16px; }
.model-answer summary { padding: 13px 0; cursor: pointer; font-weight: 800; font-size: 13.5px; color: #065f46; list-style: none; }
.model-answer summary::-webkit-details-marker { display: none; }
.model-answer summary::before { content: "▸"; margin-right: 7px; display: inline-block; transition: transform .2s; }
.model-answer[open] summary::before { transform: rotate(90deg); }
.model-answer p { padding: 0 0 14px; font-size: 14px; line-height: 1.8; color: #14532d; }

.shared-banner { display: flex; gap: 10px; align-items: center; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 16px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px; }
.shared-banner svg { width: 18px; height: 18px; flex: 0 0 auto; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(18, 20, 38, .55); backdrop-filter: blur(6px); padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: #fff; border-radius: 24px; padding: 28px; max-width: 440px; width: 100%; text-align: center; box-shadow: 0 40px 100px rgba(0, 0, 0, .25); animation: pop .22s ease both; }
.modal-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #fef3c7; color: #b45309; font-family: var(--font-head); font-size: 26px; font-weight: 800; margin: 0 auto 12px; }
.modal h3 { font-family: var(--font-head); font-size: 20px; letter-spacing: -.3px; margin-bottom: 7px; }
.modal p { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.modal-actions { display: flex; gap: 9px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 auto; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 18px); background: #1b1e33; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 16px 40px rgba(0, 0, 0, .22); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 120; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.loading-overlay { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; background: rgba(245, 246, 251, .82); backdrop-filter: blur(8px); }
.loading-overlay[hidden] { display: none; }
.loader-card { background: #fff; border-radius: 24px; padding: 28px 38px; text-align: center; box-shadow: var(--shadow); }
.loader-ring { width: 48px; height: 48px; border: 4px solid #e9ebf6; border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 14px; animation: spin 1s linear infinite; }
.loader-card strong { display: block; font-family: var(--font-head); font-size: 16px; }
.loader-card span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
.confetti[hidden] { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .start-hero { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .hero-art { max-width: min(520px, 100%); justify-self: center; width: 100%; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .test-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-sections { display: flex; }
  .section-hero { grid-template-columns: minmax(0, 1fr) 190px; }
  .result-hero { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
  .score-ring, .score-ring svg { width: 170px; height: 170px; }
}
@media (max-width: 760px) {
  .header-inner { padding: 10px 14px; gap: 12px; min-height: 64px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
  .brand-text strong { font-size: 14px; }
  .brand-text small { font-size: 10px; }
  .header-progress { display: none; }
  .header-actions .btn { padding: 7px 10px; font-size: 11.5px; }
  .app-shell { padding: 20px 14px 70px; }
  .start-hero { grid-template-columns: minmax(0, 1fr); }
  .start-copy, .start-lead { width: 100%; max-width: 100%; }
  .hero-art { max-width: 100%; }
  .start-title { font-size: clamp(2rem, 9vw, 2.7rem); overflow-wrap: break-word; }
  .start-lead { font-size: 15.5px; }
  .start-panel { padding: 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .section-hero { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
  .section-illustration { max-width: 210px; justify-self: center; margin-top: 4px; }
  .group-card { padding: 18px 16px; border-radius: 20px; }
  .q-item { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 13px 0; }
  .q-num { height: 24px; border-radius: 7px; font-size: 10.5px; }
  .q-text { font-size: 15.5px; line-height: 1.9; }
  .section-footer { flex-direction: column-reverse; align-items: stretch; }
  .section-footer .btn-row { display: grid; grid-template-columns: 1fr 1fr; }
  .section-footer .btn { width: 100%; }
  .section-footer .section-progress-note { text-align: center; }
  .result-hero { grid-template-columns: 1fr; padding: 24px 20px; gap: 16px; text-align: center; }
  .score-ring { width: 160px; height: 160px; }
  .score-ring svg { width: 160px; height: 160px; }
  .score-ring-label strong { font-size: 38px; }
  .result-meta, .result-stats { justify-content: center; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .result-stats .result-stat:last-child { grid-column: 1 / -1; }
  .panel { padding: 20px 16px; border-radius: 22px; }
  .breakdown { grid-template-columns: 1fr; }
  .writing-cols { grid-template-columns: 1fr; }
  .answer-compare { margin-left: 0; }
  .review-note { margin-left: 0; }
  .criterion { align-items: flex-start; flex-direction: column; }
  .criterion select { width: 100%; }
  .actions .btn { flex: 1 1 auto; }
}

@media print {
  .site-header, .bg-blobs, .actions, .panel-actions, .section-footer, .mobile-sections, .toast, .modal-backdrop, .loading-overlay, .confetti, .shared-banner { display: none !important; }
  body { background: #fff; }
  .app-shell { max-width: none; padding: 0; }
  .panel, .result-hero { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .review-section { break-inside: avoid; }
  .review-section[open] .review-body { display: block; }
  .review-summary .chev { display: none; }
  .score-ring .fill { transition: none; }
}

/* ---------- admin ---------- */
.admin-panel { max-width: 1120px; margin: 30px auto 0; }
.admin-key-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.admin-key-row input { flex: 1 1 320px; min-width: 220px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fbfbff; outline: none; }
.admin-key-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(90, 91, 214, .08); background: #fff; }
.admin-status { color: var(--muted); font-size: 12.5px; margin: 12px 0 4px; min-height: 18px; }
.admin-empty { background: #fbfbff; border: 1px dashed var(--line); border-radius: 14px; padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.admin-table-scroll { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line-2); border-radius: 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 880px; }
.admin-table th { text-align: left; padding: 10px 12px; background: #f6f7fc; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fbfbff; }
.admin-date { color: var(--muted); white-space: nowrap; }
.admin-score { font-weight: 800; color: var(--brand); white-space: nowrap; }
.admin-percent { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.admin-percent b { font-size: 11.5px; min-width: 34px; text-align: right; }
.admin-bar { display: block; width: 78px; height: 7px; border-radius: 999px; background: #eceef8; overflow: hidden; }
.admin-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.admin-bar span.high { background: linear-gradient(90deg, #10b981, #34d399); }
.admin-bar span.mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.admin-bar span.low { background: linear-gradient(90deg, #ef4444, #fb7185); }
.admin-essay { max-width: 260px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.self-saved { margin-left: 9px; }

@media (max-width: 760px) {
  .admin-panel { margin-top: 18px; }
  .admin-key-row .btn { flex: 1 1 auto; }
}
