:root {
  color-scheme: light;
  --blue-950: #174a83;
  --blue-900: #1769dc;
  --blue-800: #1687ed;
  --blue-700: #16a9f5;
  --blue-500: #45c3ff;
  --blue-100: #eaf7ff;
  --yellow-500: #ffc928;
  --yellow-600: #f2b900;
  --orange: #ff6a00;
  --ink: #283443;
  --muted: #7b8794;
  --soft: #f5f8fb;
  --line: #e4ebf2;
  --green: #25b99a;
  --red: #ff5b66;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(37, 71, 105, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #edf3f7;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.phone-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.app-screen {
  position: relative;
  width: min(100vw, 390px);
  height: min(100dvh - 40px, 844px);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(218, 229, 238, 0.95);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(31, 73, 112, 0.16);
}

.app-screen::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 44px;
  left: 0;
  right: 0;
  height: 92px;
  background:
    linear-gradient(132deg, rgba(255, 255, 255, 0.14) 0 22%, transparent 22% 100%),
    linear-gradient(38deg, transparent 0 62%, rgba(255, 255, 255, 0.1) 62% 78%, transparent 78% 100%),
    var(--blue-700);
}

.status-bar,
.top-nav,
.progress-strip,
.content-viewport,
.flow-action-bar {
  position: relative;
  z-index: 1;
}

.status-bar {
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 22px 8px;
  color: #26323f;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}

.status-icons {
  color: #4b5663;
  letter-spacing: 0;
}

.top-nav {
  height: 54px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #fff;
}

.top-nav h1,
.top-nav p,
.section-heading h2,
.section-heading p,
.hero-band h2,
.hero-band p,
.report-hero h2,
.report-hero p {
  margin: 0;
}

.top-nav h1 {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
}

.nav-eyebrow {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
}

.section-kicker {
  color: var(--blue-900);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
}

.icon-button:disabled {
  opacity: 0.42;
}

.chevron {
  width: 11px;
  height: 11px;
  margin-left: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.dot-menu,
.dot-menu::before,
.dot-menu::after {
  width: 4px;
  height: 4px;
  display: block;
  border-radius: 50%;
  background: currentColor;
}

.dot-menu {
  position: relative;
}

.dot-menu::before,
.dot-menu::after {
  content: "";
  position: absolute;
  top: 0;
}

.dot-menu::before {
  left: -8px;
}

.dot-menu::after {
  left: 8px;
}

.progress-strip {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 24px 5px;
}

.step-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: rgba(30, 105, 198, 0.42);
  transition: background 0.2s ease, transform 0.2s ease;
}

.step-dot.is-active {
  background: var(--yellow-500);
  box-shadow: 0 0 0 2px rgba(255, 201, 40, 0.2);
}

.step-line {
  height: 2px;
  flex: 1;
  background: rgba(255, 255, 255, 0.62);
}

.content-viewport {
  height: calc(100% - 44px - 54px - 38px - 72px);
  overflow: hidden;
  background: var(--soft);
}

.screen-panel {
  height: 100%;
  display: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 20px;
  scrollbar-width: none;
}

.screen-panel::-webkit-scrollbar {
  display: none;
}

.screen-panel.is-active {
  display: block;
}

.hero-band,
.section-heading {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 10px;
  color: var(--ink);
}

.hero-band h2,
.section-heading h2,
.report-hero h2 {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
}

.streak-chip {
  min-width: 60px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--blue-900);
  font-size: 12px;
  font-weight: 600;
}

.question-board,
.ai-card,
.choice-group,
.concept-stage,
.variant-board,
.report-card,
.knowledge-note,
.parent-note,
.feedback-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.question-board,
.ai-card,
.choice-group,
.variant-board {
  padding: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag-row span,
.mini-chip {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  color: var(--blue-950);
  background: var(--blue-100);
  font-size: 11px;
  font-weight: 600;
}

.tag-row span:first-child {
  color: #fff;
  background: #34475b;
}

.tag-row span:nth-child(2),
.tag-row span:nth-child(3) {
  color: #118970;
  background: #e9fbf6;
  border: 1px solid #bdeedf;
}

.question-text {
  margin: 0;
  color: #2f3b49;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 500;
}

.problem-geometry-svg,
.geometry-svg,
.mini-geometry-svg {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.problem-geometry-svg {
  margin-top: 8px;
  overflow: hidden;
  border-radius: 5px;
}

.problem-lines line {
  stroke: #65707f;
  stroke-width: 3;
  stroke-linecap: round;
}

.problem-angle {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}

.problem-angle.one {
  stroke: var(--blue-800);
}

.problem-angle.two {
  stroke: var(--yellow-500);
}

.problem-center {
  fill: #fff;
  stroke: #65707f;
  stroke-width: 2;
}

.problem-label circle {
  fill: #fff;
  stroke-width: 2;
}

.angle-one-label circle {
  stroke: var(--blue-800);
}

.angle-two-label circle {
  stroke: var(--yellow-600);
}

.problem-label text,
.point-labels text {
  fill: #43505f;
  font-size: 12px;
  font-weight: 700;
  dominant-baseline: middle;
}

.point-labels text {
  fill: #6d7785;
}

.answer-field {
  min-height: 48px;
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 78px 24px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.answer-field input {
  width: 100%;
  height: 40px;
  border: 1.5px solid #cbd7e1;
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #fff;
  text-align: center;
  font-weight: 700;
}

.answer-field input:focus {
  border-color: var(--blue-700);
}

.answer-field.is-wrong input {
  border-color: var(--red);
}

.answer-field strong {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-size: 13px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.answer-field.is-wrong strong {
  opacity: 1;
  transform: scale(1);
}

.coach-bubble {
  position: relative;
  min-height: 74px;
  margin-top: 10px;
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 6px;
  border: 1px solid #dfeaf2;
  border-radius: 8px;
  background: #edf3f7;
}

.coach-bubble.is-hidden {
  display: none;
}

.coach-avatar {
  width: 62px;
  height: 62px;
  display: block;
  object-fit: contain;
}

.coach-bubble p,
.coach-bubble small {
  margin: 0;
}

.coach-bubble p {
  color: #354250;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}

.coach-bubble small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.primary-action,
.secondary-action {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.primary-action {
  color: #624900;
  background: var(--yellow-500);
  box-shadow: inset 0 -2px 0 rgba(193, 139, 0, 0.18);
}

.primary-action:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.primary-action.is-saved:disabled {
  opacity: 1;
  color: #08735a;
  border: 1px solid #bde8db;
  background: #eaf8f3;
}

.secondary-action {
  color: var(--blue-900);
  border: 1px solid #c9e7f8;
  background: #eef8fe;
}

.primary-action:active:not(:disabled),
.secondary-action:active:not(:disabled),
.choice-button:active,
.answer-options button:active {
  transform: scale(0.988);
}

.section-heading {
  display: block;
  padding-top: 5px;
}

.ai-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.ai-orb {
  width: 46px;
  height: 46px;
  display: block;
  object-fit: contain;
}

.ai-card strong,
.ai-card span {
  display: block;
}

.ai-card strong {
  color: #263442;
  font-size: 14px;
  font-weight: 700;
}

.ai-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ai-card p,
.diagnosis-result p,
.knowledge-note p,
.parent-note p,
.feedback-card p {
  margin: 0;
  color: #455362;
  font-size: 13px;
  line-height: 1.65;
}

.choice-group {
  margin-top: 10px;
}

.choice-title {
  margin: 0 0 8px;
  color: #2e3a48;
  font-size: 14px;
  font-weight: 700;
}

.choice-button,
.answer-options button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}

.choice-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  padding: 0 12px;
  text-align: left;
}

.choice-button::after {
  content: "";
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1.5px solid #cbd7e1;
  border-radius: 50%;
}

.choice-button.is-selected {
  color: var(--blue-950);
  border-color: #63c3f3;
  background: #eef8fe;
}

.choice-button.is-selected::after {
  border-color: var(--blue-700);
  background: radial-gradient(circle, var(--blue-700) 0 42%, transparent 45%);
}

.diagnosis-result,
.knowledge-note,
.parent-note,
.feedback-card {
  margin-top: 10px;
  padding: 12px;
}

.diagnosis-result {
  border-color: #f1df9b;
  background: #fff9e6;
}

.diagnosis-result.is-pending {
  border-color: var(--line);
  background: #f7fafc;
}

.diagnosis-result.is-success,
.feedback-card.is-success {
  border-color: #b9e7d8;
  background: #ecf8f4;
}

.result-label {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 7px;
  padding: 0 7px;
  border-radius: 4px;
  color: #644c00;
  background: var(--yellow-500);
  font-size: 11px;
  font-weight: 700;
}

.concept-stage {
  overflow: hidden;
}

.stage-toolbar {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: var(--blue-950);
  border-bottom: 1px solid #d6eaf7;
  background: #eaf7ff;
  font-size: 13px;
  font-weight: 700;
}

.stage-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.replay-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #c7e2f2;
  border-radius: 50%;
  color: var(--blue-950);
  background: #fff;
  font-size: 20px;
  line-height: 1;
}

.replay-button:active {
  transform: rotate(-24deg) scale(0.96);
}

.concept-base line,
.mini-geometry-svg line {
  stroke: #5e6978;
  stroke-width: 4;
  stroke-linecap: round;
}

.concept-base .center-dot {
  fill: #fff;
  stroke: #5e6978;
  stroke-width: 3;
}

.point-text {
  fill: #6a7482;
  font-size: 12px;
  font-weight: 700;
}

.animation-layer {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transform-origin: center;
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.animation-layer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.common-ray {
  stroke: var(--blue-800);
  stroke-width: 8;
  stroke-linecap: round;
}

.straight-line {
  stroke: var(--yellow-500);
  stroke-width: 8;
  stroke-linecap: round;
}

.line-end {
  fill: var(--yellow-500);
  stroke: #fff;
  stroke-width: 2;
}

.svg-callout rect {
  fill: var(--blue-900);
}

.svg-callout.callout-orange rect {
  fill: var(--yellow-600);
}

.svg-callout text,
.equation-pill text,
.result-pill text,
.mini-geometry-svg text {
  fill: #fff;
  font-size: 13px;
  font-weight: 700;
  dominant-baseline: middle;
}

.angle-fill {
  stroke: #fff;
  stroke-width: 2;
}

.angle-one-fill {
  fill: rgba(22, 135, 237, 0.58);
}

.angle-two-fill {
  fill: rgba(255, 201, 40, 0.78);
}

.angle-value {
  fill: #2b3745;
  font-size: 14px;
  font-weight: 700;
}

.equation-pill rect {
  fill: #fff;
  stroke: var(--blue-800);
  stroke-width: 2;
}

.equation-pill text {
  fill: var(--blue-950);
  font-size: 15px;
}

.answer-arc {
  fill: none;
  stroke: var(--yellow-500);
  stroke-width: 12;
  stroke-linecap: round;
}

.result-pill rect {
  fill: var(--green);
}

.result-pill text {
  font-size: 17px;
}

.animation-caption {
  min-height: 62px;
  padding: 9px 12px 10px;
  border-top: 1px solid var(--line);
  background: #f7fafc;
}

.animation-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 7px;
}

.animation-bars span {
  height: 3px;
  border-radius: 2px;
  background: #d9e4ed;
  transition: background 0.22s ease;
}

.animation-bars span.is-active {
  background: var(--blue-700);
}

.animation-caption p {
  min-height: 21px;
  margin: 0;
  color: #3d4a58;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 600;
}

.knowledge-note h3,
.parent-note h3,
.feedback-card strong {
  display: block;
  margin: 0 0 6px;
  color: #2f3c4a;
  font-size: 14px;
  font-weight: 700;
}

.method-list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.method-list div {
  min-height: 36px;
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  color: #42505e;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}

.method-list span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue-800);
  font-size: 11px;
}

.mini-geometry-svg {
  margin: 10px 0;
  overflow: hidden;
  border-radius: 5px;
}

.angle-badge {
  fill: var(--yellow-500);
}

.variant-angle {
  stroke: #fff;
  stroke-width: 2;
}

.variant-angle.angle-a {
  fill: rgba(22, 135, 237, 0.26);
}

.variant-angle.angle-b {
  fill: rgba(255, 201, 40, 0.4);
}

.mini-geometry-svg text {
  fill: #5c4500;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.answer-options button.is-correct {
  color: #08735a;
  border-color: var(--green);
  background: #ecf8f4;
}

.answer-options button.is-wrong {
  color: #a43d45;
  border-color: var(--red);
  background: #fff1f2;
}

.feedback-card {
  background: #f7fafc;
}

.report-hero {
  min-height: 70px;
  display: grid;
  grid-template-columns: 1fr 46px;
  grid-template-rows: auto auto;
  align-items: center;
  padding: 4px 2px 12px;
  color: var(--ink);
  text-align: left;
}

.report-hero p,
.report-hero h2 {
  grid-column: 1;
}

.success-mark {
  position: relative;
  width: 44px;
  height: 44px;
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  border-radius: 50%;
  background: var(--blue-700);
}

.success-mark::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 10px;
  width: 11px;
  height: 18px;
  border-right: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(45deg);
}

.report-card {
  overflow: hidden;
  box-shadow: none;
}

.report-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

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

.report-row span {
  color: var(--muted);
  font-size: 12px;
}

.report-row strong {
  color: #344250;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.report-row .status-warning {
  color: #b47800;
}

.bottom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 8px;
}

.primary-action.compact {
  min-height: 48px;
}

.flow-action-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -3px 12px rgba(39, 69, 96, 0.05);
}

.flow-action {
  height: 100%;
  display: none;
}

.flow-action.is-active {
  display: block;
}

.flow-action.bottom-actions.is-active {
  display: grid;
}

.toast {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 84px;
  max-width: calc(100% - 44px);
  padding: 9px 12px;
  border-radius: 6px;
  color: #fff;
  background: rgba(36, 47, 60, 0.92);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 430px) {
  .phone-shell {
    min-height: 100dvh;
    padding: 0;
  }

  .app-screen {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-height: 720px) {
  .screen-panel {
    padding-top: 8px;
  }

  .hero-band,
  .section-heading {
    min-height: 50px;
    padding-bottom: 7px;
  }

  .hero-band h2,
  .section-heading h2,
  .report-hero h2 {
    font-size: 18px;
  }

  .problem-geometry-svg {
    max-height: 128px;
  }

  .coach-bubble small {
    display: none;
  }
}

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