:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --paper: rgba(255, 255, 255, 0.72);
  --blue: #0071e3;
  --green: #248a3d;
  --amber: #bf6a02;
  --red: #d70015;
  --soft-blue: rgba(0, 113, 227, 0.1);
  --soft-green: rgba(36, 138, 61, 0.11);
  --soft-amber: rgba(191, 106, 2, 0.12);
  --soft-red: rgba(215, 0, 21, 0.1);
  --material: rgba(255, 255, 255, 0.68);
  --material-strong: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  --button-shadow: 0 8px 22px rgba(0, 113, 227, 0.14);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fafafa 0%, #f3f5f8 46%, #eef1f5 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 120ms ease-out,
    background-color 180ms ease-out,
    border-color 180ms ease-out,
    box-shadow 180ms ease-out;
}

button:active {
  transform: scale(0.97);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.32);
  outline-offset: 3px;
}

.app-shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 44px;
}

.topbar {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 220px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, #050506 0%, #141416 54%, #050506 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 30px 90px rgba(0, 0, 0, 0.18);
  padding: 34px;
  animation: riseIn 620ms var(--ease-out) both;
}

.topbar .eyebrow {
  color: #2997ff;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  max-width: 960px;
  color: #f5f5f7;
  font-size: 64px;
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 720;
  overflow-wrap: anywhere;
  word-break: break-all;
}

h1::after {
  content: "";
  display: block;
  width: min(420px, 48vw);
  height: 2px;
  margin-top: 18px;
  background: linear-gradient(90deg, #2997ff, rgba(41, 151, 255, 0));
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 720;
  overflow-wrap: anywhere;
  word-break: break-all;
}

h3 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.28;
  letter-spacing: 0;
}

.top-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.top-focus span {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(180%);
  padding: 9px 13px;
  color: rgba(245, 245, 247, 0.9);
  font-size: 13px;
  font-weight: 680;
}

.mobile-title {
  display: none;
}

.learning-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    "prompt panel"
    "model panel";
  gap: 18px;
  align-items: start;
}

.prompt-card,
.model-card,
.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow);
}

.prompt-card,
.model-card,
.lesson-panel {
  animation: riseIn 680ms var(--ease-out) both;
}

.model-card {
  animation-delay: 80ms;
}

.lesson-panel {
  animation-delay: 140ms;
}

.prompt-card {
  grid-area: prompt;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 24px;
  align-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.prompt-card::after {
  content: none;
}

.prompt-card .eyebrow,
.prompt-card h2,
.prompt-card .feedback {
  grid-column: 1;
}

.choice-row {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: grid;
  gap: 12px;
  min-width: 240px;
}

.choice-row button,
.ghost-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 13px 16px;
  color: var(--ink);
  font-weight: 680;
  cursor: pointer;
}

.choice-row button:hover,
.ghost-button:hover,
.practice-card button:hover {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.primary-button {
  border-color: rgba(0, 113, 227, 0.12);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.22);
}

.choice-row button.is-right {
  border-color: rgba(36, 138, 61, 0.2);
  background: var(--soft-green);
  color: var(--green);
}

.choice-row button.is-wrong {
  border-color: rgba(215, 0, 21, 0.18);
  background: var(--soft-red);
  color: var(--red);
}

.feedback {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

.model-card {
  grid-area: model;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.model-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 180px),
    linear-gradient(90deg, rgba(0, 113, 227, 0.04), transparent 32%);
}

.model-card > * {
  position: relative;
}

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

.formula-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--material-strong);
  backdrop-filter: blur(20px) saturate(180%);
  padding: 10px 12px;
  margin: 0 24px;
}

.formula-pill {
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 8px 10px;
  color: var(--blue);
  font-weight: 720;
  animation: pillIn 460ms var(--ease-out) both;
}

.formula-pill.green {
  background: var(--soft-green);
  color: var(--green);
}

.formula-pill.amber {
  background: var(--soft-amber);
  color: #9d620c;
}

.formula-pill.red {
  background: var(--soft-red);
  color: #a12e2e;
}

.visual-stage {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfbfd 66%, #f4f5f7 100%);
  margin: 14px 24px 0;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 22px 60px rgba(0, 0, 0, 0.055);
}

.math-svg {
  display: block;
  width: 760px;
  height: 560px;
  transform: scale(var(--svg-scale, 1));
  transform-origin: left top;
  animation: stageIn 700ms var(--ease-out) both;
}

.scale-stand,
.scale-base {
  fill: url(#metalGrad);
  stroke: rgba(29, 29, 31, 0.9);
  stroke-width: 1.8;
  filter: url(#softShadow);
}

.scale-beam {
  fill: url(#metalGrad);
  stroke: rgba(29, 29, 31, 0.9);
  stroke-width: 1.8;
  filter: url(#softShadow);
}

.scale-cord {
  stroke: rgba(58, 58, 60, 0.86);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.pivot {
  fill: #fbfbfd;
  stroke: rgba(29, 29, 31, 0.9);
  stroke-width: 1.8;
  filter: url(#softShadow);
}

.pan {
  fill: url(#panGrad);
  stroke: rgba(29, 29, 31, 0.9);
  stroke-width: 1.7;
  filter: url(#softShadow);
}

.pan-lip {
  fill: none;
  stroke: rgba(29, 29, 31, 0.22);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.x-block {
  fill: url(#blueBlock);
  stroke: var(--blue);
  stroke-width: 2;
  filter: url(#softShadow);
}

.unit-block {
  fill: url(#greenBlock);
  stroke: var(--blue);
  stroke-width: 1.4;
  filter: url(#softShadow);
}

.removed-block {
  fill: rgba(255, 214, 10, 0.14);
  stroke: var(--amber);
  stroke-width: 1.8;
  opacity: 0.92;
}

.danger-mark {
  fill: rgba(216, 91, 89, 0.12);
  stroke: var(--red);
  stroke-width: 3;
  stroke-dasharray: 8 6;
}

.svg-label {
  fill: var(--ink);
  font-size: 19px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
}

.svg-note {
  fill: #6e6e73;
  font-size: 14px;
  font-weight: 700;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px 180px;
  gap: 12px;
  margin: 14px 24px 0;
}

.control-panel > * {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.045);
}

.practice-panel {
  display: grid;
  gap: 12px;
  margin: 18px 24px 24px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(248, 248, 250, 0.86);
  backdrop-filter: blur(22px) saturate(180%);
  padding: 16px;
}

.practice-panel h2 {
  font-size: 18px;
}

.practice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.practice-card {
  display: grid;
  gap: 10px;
  min-height: 128px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  transition:
    transform 180ms ease-out,
    box-shadow 180ms ease-out,
    border-color 180ms ease-out;
}

.practice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.07);
}

.practice-card div {
  display: grid;
  gap: 7px;
}

.practice-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.practice-card span {
  color: #52667e;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.practice-card button {
  align-self: end;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 8px;
  background: rgba(0, 113, 227, 0.09);
  padding: 9px 10px;
  color: var(--blue);
  font-weight: 680;
  cursor: pointer;
}

.answer-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 680;
}

.answer-line input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 760;
}

.practice-card p {
  display: grid;
  gap: 4px;
  margin-bottom: 0;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.practice-card p b {
  color: var(--green);
  font-size: 18px;
}

.practice-card p.wrong b {
  color: var(--red);
}

.practice-card p.wait b {
  color: #9d620c;
}

.practice-card.is-open {
  border-color: rgba(36, 138, 61, 0.22);
  background: rgba(255, 255, 255, 0.88);
}

.mastery-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.mastery-check p {
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 680;
}

.mastery-check input {
  width: min(180px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 760;
}

.mastery-check span {
  grid-column: 1 / -1;
  min-height: 20px;
  color: var(--muted);
  font-weight: 680;
}

.mastery-check span.is-right {
  color: var(--green);
}

.mastery-check span.is-wrong {
  color: var(--red);
}

.range-control,
.switch-control {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

.range-control span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.range-control input {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--blue);
}

.switch-control {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.switch-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

.lesson-panel {
  grid-area: panel;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 24px;
}

.lesson-panel .mini-card {
  transform-origin: top right;
}

.mini-card {
  padding: 17px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.05);
}

.mini-card:hover {
  border-color: rgba(0, 113, 227, 0.16);
}

.problem-card {
  border-color: rgba(36, 138, 61, 0.18);
  background: rgba(255, 255, 255, 0.82);
}

.mini-card ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-card li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
  color: #2f405a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.mini-card b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 13px;
}

.mistake-card {
  border-color: rgba(215, 0, 21, 0.16);
  background: rgba(255, 255, 255, 0.82);
}

.mistake-card p:last-child {
  margin-bottom: 0;
  color: #5f3131;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.58;
}

/* Premium lesson layout: the interactive model is the first-screen hero. */
.app-shell {
  width: min(1520px, calc(100% - 32px));
  padding: 16px 0 36px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  min-height: 72px;
  align-items: center;
  margin-bottom: 14px;
  border-color: rgba(255, 255, 255, 0.64);
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 50px rgba(20, 32, 51, 0.055);
  padding: 14px 18px;
}

.topbar .eyebrow {
  margin-bottom: 2px;
  color: #0066cc;
}

h1 {
  max-width: none;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.14;
  font-weight: 760;
  word-break: normal;
}

h1::after {
  display: none;
}

.top-focus span {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(248, 248, 250, 0.84);
  color: #343437;
}

.learning-flow {
  grid-template-columns: 300px minmax(0, 1fr) 330px;
  grid-template-areas: "prompt model panel";
  gap: 14px;
  align-items: start;
}

.prompt-card,
.model-card,
.mini-card {
  border-color: rgba(23, 37, 61, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 46px rgba(20, 32, 51, 0.06);
}

.prompt-card {
  align-self: start;
  position: sticky;
  top: 104px;
  grid-template-columns: 1fr;
  padding: 18px;
}

.prompt-card .eyebrow,
.prompt-card h2,
.prompt-card .feedback,
.choice-row {
  grid-column: auto;
  grid-row: auto;
}

.prompt-card h2 {
  font-size: 24px;
  line-height: 1.22;
}

.choice-row {
  min-width: 0;
  margin-top: 4px;
}

.choice-row button,
.ghost-button,
.primary-button {
  min-height: 48px;
}

.model-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 249, 252, 0.94) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 34px 110px rgba(20, 32, 51, 0.13);
}

.model-card::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0) 210px);
}

.model-head {
  padding: 20px 22px 12px;
}

.model-head h2 {
  font-size: 26px;
}

.formula-strip {
  margin: 0 22px;
  background: rgba(255, 255, 255, 0.92);
}

.visual-stage {
  min-height: 620px;
  margin: 12px 22px 0;
  background:
    linear-gradient(180deg, #ffffff 0%, #f9fbfd 56%, #edf3f9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -38px 70px rgba(36, 90, 148, 0.06),
    0 24px 70px rgba(20, 32, 51, 0.07);
}

.control-panel {
  grid-template-columns: minmax(0, 1fr) 180px 170px;
  margin: 12px 22px 0;
}

.practice-panel {
  margin: 14px 22px 22px;
  background: rgba(255, 255, 255, 0.66);
}

.lesson-panel {
  top: 104px;
  align-self: start;
  align-content: start;
}

.mini-card {
  padding: 18px;
}

/* Soft learning palette: reduce whiteboard glare and give each task zone a color role. */
:root {
  --ink: #18202c;
  --muted: #687586;
  --blue: #0969da;
  --green: #22865a;
  --amber: #b76518;
  --line: rgba(38, 56, 78, 0.1);
  --soft-blue: rgba(9, 105, 218, 0.12);
  --soft-green: rgba(34, 134, 90, 0.13);
  --soft-amber: rgba(255, 191, 87, 0.2);
  --soft-red: rgba(215, 0, 21, 0.1);
}

body {
  background:
    linear-gradient(135deg, #edf7f3 0%, #eef4ff 44%, #f7f3ee 100%);
}

.topbar {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.76), rgba(235, 247, 242, 0.72) 52%, rgba(237, 244, 255, 0.72));
}

.top-focus span {
  background: rgba(255, 255, 255, 0.62);
}

.prompt-card {
  border-color: rgba(255, 142, 91, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(255, 244, 234, 0.78));
}

.prompt-card .eyebrow {
  color: #c24e1b;
}

.choice-row button {
  background: rgba(255, 255, 255, 0.78);
}

.model-card {
  border-color: rgba(9, 105, 218, 0.12);
  background:
    linear-gradient(180deg, rgba(252, 254, 255, 0.98), rgba(241, 247, 252, 0.94));
}

.model-card .eyebrow,
.practice-panel .eyebrow {
  color: #0066cc;
}

.visual-stage {
  border-color: rgba(24, 68, 116, 0.1);
  background:
    linear-gradient(180deg, #fffdfa 0%, #f6fbff 56%, #eaf3f7 100%);
}

.range-control,
.switch-control {
  background: rgba(255, 255, 255, 0.76);
}

.primary-button {
  background: linear-gradient(180deg, #1185f7, #0969da);
  box-shadow: 0 14px 32px rgba(9, 105, 218, 0.24);
}

.practice-panel {
  border-color: rgba(34, 134, 90, 0.14);
  background:
    linear-gradient(180deg, rgba(247, 255, 251, 0.9), rgba(237, 248, 242, 0.74));
}

.practice-card {
  background: rgba(255, 255, 255, 0.72);
}

.lesson-panel .mini-card {
  background: rgba(255, 255, 255, 0.72);
}

.lesson-panel .mini-card:nth-child(1) {
  border-color: rgba(34, 134, 90, 0.18);
  background:
    linear-gradient(180deg, rgba(246, 255, 250, 0.92), rgba(239, 250, 244, 0.76));
}

.lesson-panel .mini-card:nth-child(2) {
  border-color: rgba(9, 105, 218, 0.14);
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.92), rgba(235, 243, 254, 0.76));
}

.lesson-panel .mini-card:nth-child(3) {
  border-color: rgba(255, 191, 87, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 253, 244, 0.92), rgba(255, 248, 227, 0.76));
}

.mistake-card {
  border-color: rgba(215, 0, 21, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 248, 248, 0.92), rgba(255, 239, 239, 0.76));
}

@keyframes riseIn {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes pillIn {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stageIn {
  from {
    opacity: 0;
    filter: blur(8px);
  }

  to {
    opacity: 1;
    filter: blur(0);
  }
}

@media (max-width: 1120px) {
  .learning-flow {
    grid-template-columns: 1fr;
    grid-template-areas:
      "prompt"
      "model"
      "panel";
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: calc(100% - 22px);
    max-width: 700px;
    padding-top: 14px;
  }

  .app-shell,
  .learning-flow,
  .prompt-card,
  .model-card,
  .formula-strip,
  .visual-stage,
  .control-panel,
  .choice-row {
    min-width: 0;
    max-width: calc(100vw - 22px);
  }

  .prompt-card,
  .model-card {
    width: 100%;
    overflow: hidden;
  }

  .choice-row,
  .choice-row button,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .topbar,
  .prompt-card,
  .model-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    min-height: auto;
    padding: 24px;
  }

  .prompt-card {
    grid-template-columns: 1fr;
  }

  .prompt-card .eyebrow,
  .prompt-card h2,
  .prompt-card .feedback,
  .choice-row {
    grid-column: auto;
    grid-row: auto;
  }

  .lesson-panel,
  .control-panel,
  .practice-list,
  .mastery-check {
    grid-template-columns: 1fr;
  }

  .prompt-card h2 {
    font-size: 18px;
    line-height: 1.28;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
  }

  h1 {
    font-size: 48px;
  }
}

@media (max-width: 460px) {
  h1 {
    max-width: 100%;
    font-size: 36px;
    line-height: 1;
    letter-spacing: 0;
  }

  h2 {
    font-size: 18px;
  }

  .prompt-card,
  .model-card,
  .mini-card {
    padding: 13px;
  }

  .choice-row {
    min-width: 0;
  }


  .mini-card li {
    grid-template-columns: 1fr;
  }
}

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

  button:active {
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .top-focus span,
  .prompt-card,
  .model-card,
  .mini-card,
  .formula-strip,
  .practice-panel {
    background: #fff;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(0, 0, 0, 0.38);
  }

  .prompt-card,
  .model-card,
  .mini-card,
  .practice-card,
  .formula-strip,
  .visual-stage {
    border-color: var(--line);
  }
}

/* Final visual system: premium learning studio, not a white dashboard. */
:root {
  --ink: #172033;
  --muted: #617088;
  --blue: #1769e0;
  --green: #16745f;
  --amber: #c16b23;
  --red: #c8333a;
  --line: rgba(34, 49, 71, 0.11);
  --soft-blue: rgba(23, 105, 224, 0.12);
  --soft-green: rgba(22, 116, 95, 0.13);
  --soft-amber: rgba(255, 188, 92, 0.22);
  --soft-red: rgba(200, 51, 58, 0.1);
  --studio-shadow: 0 26px 80px rgba(37, 55, 78, 0.14);
}

body {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(91, 157, 163, 0.1) 0 18%, transparent 18% 100%),
    linear-gradient(300deg, rgba(230, 168, 78, 0.14) 0 16%, transparent 16% 100%),
    linear-gradient(180deg, #f0f7f5 0%, #eef5fb 48%, #f8f1e8 100%);
}

.app-shell {
  width: min(1540px, calc(100% - 32px));
  padding: 18px 0 38px;
}

.topbar {
  top: 12px;
  min-height: 86px;
  border: 1px solid rgba(60, 126, 132, 0.16);
  background:
    linear-gradient(135deg, rgba(225, 243, 241, 0.98) 0%, rgba(202, 233, 228, 0.96) 64%, rgba(230, 239, 209, 0.94) 100%);
  color: #17384a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 20px 58px rgba(48, 91, 101, 0.14);
}

.topbar .eyebrow,
.topbar h1 {
  color: #17384a;
}

.topbar .eyebrow {
  color: #287b73;
}

.top-focus span {
  border-color: rgba(38, 112, 109, 0.2);
  background: rgba(255, 255, 255, 0.5);
  color: #24504f;
}

.learning-flow {
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  gap: 16px;
}

.prompt-card,
.model-card,
.mini-card {
  border: 1px solid rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(26px) saturate(145%);
}

.prompt-card {
  top: 116px;
  min-height: 360px;
  border-color: rgba(223, 135, 73, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.96), rgba(250, 231, 207, 0.88));
  box-shadow: 0 26px 70px rgba(142, 83, 42, 0.13);
  padding: 22px;
}

.prompt-card .eyebrow {
  color: #b45720;
}

.prompt-card h2 {
  margin-top: 16px;
  font-size: 28px;
  line-height: 1.18;
}

.choice-row {
  gap: 10px;
  margin-top: 16px;
}

.choice-row button {
  min-height: 54px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 28px rgba(89, 57, 34, 0.08);
}

.feedback {
  margin-top: 10px;
  color: #5e4b3b;
}

.model-card {
  border-color: rgba(35, 103, 137, 0.18);
  background: rgba(248, 253, 252, 0.86);
  box-shadow: var(--studio-shadow);
}

.model-card::before {
  background: none;
}

.model-head {
  align-items: center;
  margin: 14px 14px 0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #dceff3 0%, #c7e9e2 76%, #e4edce 100%);
  color: #17384a;
  padding: 18px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.model-head .eyebrow,
.model-head h2 {
  color: #17384a;
}

.model-head .eyebrow {
  color: #287b73;
}

.model-head h2 {
  font-size: 28px;
}

.model-head .ghost-button {
  border-color: rgba(38, 112, 109, 0.22);
  background: rgba(255, 255, 255, 0.52);
  color: #24504f;
}

.formula-strip {
  margin: 14px 18px 0;
  border-color: rgba(35, 103, 137, 0.14);
  background: rgba(243, 251, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.formula-pill {
  background: rgba(23, 105, 224, 0.11);
}

.formula-pill.green {
  background: rgba(22, 116, 95, 0.13);
}

.visual-stage {
  margin: 14px 18px 0;
  border-color: rgba(60, 111, 126, 0.16);
  background:
    linear-gradient(180deg, #fffaf0 0%, #f8fcfd 52%, #e7f1f2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -54px 90px rgba(50, 109, 130, 0.08),
    0 28px 80px rgba(41, 78, 96, 0.1);
}

.math-svg {
  margin: 0 auto;
  transform-origin: center top;
}

.visual-stage .math-svg {
  width: 100%;
  height: 100%;
  transform: none;
}

.control-panel {
  grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.7fr) minmax(170px, 0.75fr);
  margin: 14px 18px 0;
}

.range-control,
.switch-control {
  border-color: rgba(35, 103, 137, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #2d73d6 0%, #3c9b8f 100%);
  box-shadow: 0 16px 34px rgba(45, 115, 214, 0.18);
}

.practice-panel {
  margin: 14px 18px 18px;
  border-color: rgba(22, 116, 95, 0.16);
  background:
    linear-gradient(180deg, rgba(246, 255, 250, 0.94), rgba(231, 246, 238, 0.84));
}

.practice-card {
  border-color: rgba(22, 116, 95, 0.12);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 34px rgba(53, 93, 79, 0.06);
}

.practice-card button {
  background: rgba(23, 105, 224, 0.1);
}

.lesson-panel {
  top: 116px;
  gap: 16px;
}

.lesson-panel .mini-card {
  box-shadow: 0 22px 58px rgba(49, 69, 92, 0.09);
}

.lesson-panel .mini-card:nth-child(1) {
  background:
    linear-gradient(180deg, rgba(235, 252, 242, 0.96), rgba(217, 244, 229, 0.86));
}

.lesson-panel .mini-card:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(235, 246, 255, 0.96), rgba(218, 235, 252, 0.86));
}

.lesson-panel .mini-card:nth-child(3) {
  background:
    linear-gradient(180deg, rgba(255, 248, 225, 0.98), rgba(251, 235, 193, 0.86));
}

.mistake-card {
  background:
    linear-gradient(180deg, rgba(255, 242, 242, 0.96), rgba(251, 225, 225, 0.86));
}

.mini-card li {
  color: #27405b;
}

.mini-card b {
  background: rgba(23, 105, 224, 0.12);
}

@media (max-width: 1120px) {
  .learning-flow {
    grid-template-columns: 1fr;
  }

  .prompt-card,
  .lesson-panel {
    position: static;
  }

  .prompt-card {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    top: 8px;
    padding: 18px;
  }

  h1 {
    font-size: 32px;
  }

  .prompt-card h2,
  .model-head h2 {
    font-size: 24px;
  }

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

@media (max-width: 460px) {
  h1 {
    font-size: 30px;
  }

  .prompt-card,
  .model-card,
  .mini-card {
    padding: 14px;
  }

  .model-card {
    padding: 0;
  }
}
