:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --ink: #07194a;
  --muted: #43557c;
  --line: #cbd8ee;
  --blue: #2563eb;
  --teal: #0e9aa0;
  --green: #3e8738;
  --purple: #7c4dd8;
  --orange: #f07a22;
  --red: #d61f1f;
  --shadow: 0 24px 70px rgba(7, 25, 74, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.1), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(14, 154, 160, 0.12), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
}

.guide-language-bar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  width: min(1580px, calc(100% - 28px));
  margin: 0 auto;
  padding: 0.75rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
}

.guide-language-bar span,
.guide-language-bar a {
  display: inline-flex;
  min-width: 2.35rem;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}

.guide-language-bar span {
  background: var(--ink);
  color: #fff;
}

.guide-language-bar a:hover,
.guide-language-bar a:focus-visible {
  background: #ffdc4a;
  outline: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.page-shell {
  width: min(1580px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 34px) 0;
}

.intro-page,
.lesson-app {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.intro-page {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
  padding: clamp(20px, 3vw, 34px);
}

.intro-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.72fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: stretch;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.intro-copy-wide {
  align-items: center;
  width: min(1120px, 100%);
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.intro-copy p:not(.eyebrow),
.section-heading p:not(.eyebrow) {
  max-width: 900px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  justify-content: center;
}

.intro-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.text-link.secondary {
  background: #fff;
  color: var(--ink);
}

.chat-demo {
  overflow: hidden;
  min-width: 0;
  border: 1px solid #b7c7e4;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96));
  box-shadow: 0 18px 50px rgba(7, 25, 74, 0.1);
}

.chat-demo-wide {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.chat-topbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f3f7fe;
}

.chat-topbar strong {
  margin-left: 6px;
  color: var(--ink);
}

.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9fb0ca;
}

.window-dot:nth-child(1) {
  background: #ff8b8b;
}

.window-dot:nth-child(2) {
  background: #ffd36e;
}

.window-dot:nth-child(3) {
  background: #78d98b;
}

.chat-thread {
  display: grid;
  gap: 14px;
  padding: clamp(14px, 2vw, 22px);
}

.split-chat-thread {
  grid-template-columns: 1fr;
}

.visible-chat-pane,
.model-work-pane {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
}

.visible-chat-pane {
  border: 1px solid #91b4f7;
  border-left: 6px solid var(--blue);
  background:
    linear-gradient(180deg, rgba(237, 244, 255, 0.95), rgba(248, 251, 255, 0.98));
}

.model-work-pane {
  border: 1px solid #74cbc7;
  border-left: 6px solid var(--teal);
  background:
    linear-gradient(180deg, rgba(232, 252, 251, 0.94), rgba(246, 252, 250, 0.98));
}

.pane-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  align-self: start;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.chat-label {
  background: #dfeaff;
  color: var(--blue);
}

.model-label {
  background: #dff6f4;
  color: var(--teal);
}

.chat-message {
  display: grid;
  gap: 8px;
  max-width: 92%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.chat-message p {
  margin-bottom: 0;
  color: var(--ink);
}

.chat-message strong {
  color: var(--ink);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.user-message {
  justify-self: end;
  width: min(720px, 100%);
  border-color: #91b4f7;
  background: #eef5ff;
}

.assistant-visible-message {
  width: min(760px, 100%);
  border-color: #91b4f7;
  background: #fff;
}

.assistant-message {
  justify-self: start;
  width: 100%;
  max-width: 100%;
  border-color: #9dd4d3;
}

.assistant-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.assistant-head span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef7f7;
  color: var(--teal);
  font-weight: 900;
}

.thinking-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thinking-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue);
  font-weight: 850;
}

.thinking-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.thinking-visual small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 850;
}

.reasoning-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce6f4;
}

.reasoning-meter span {
  display: block;
  width: 52%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--green));
  transition: width 180ms ease;
}

.branch-preview {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 14px;
}

.branch-preview i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c9d5e6;
}

.branch-preview i.active {
  background: var(--teal);
}

.chat-thinking-levels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reasoning-bridge {
  display: grid;
  gap: 16px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid #bdd3f4;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(239, 246, 255, 0.95), rgba(235, 252, 252, 0.88));
}

.bridge-copy {
  display: grid;
  gap: 8px;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.bridge-copy h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.bridge-copy p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
}

.bridge-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.trace-step {
  position: relative;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  text-align: center;
}

.trace-step span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
}

.trace-step::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 10;
  width: min(280px, 78vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.trace-step:hover::after,
.trace-step:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.bridge-step {
  min-height: 58px;
  border-color: #8bb7ed;
  background: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.bridge-step:nth-of-type(3),
.bridge-step:nth-of-type(4) {
  border-color: #8ed2cf;
}

.bridge-arrow {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.bridge-arrow::after {
  position: absolute;
  right: -1px;
  top: -5px;
  width: 12px;
  height: 12px;
  border-top: 4px solid var(--teal);
  border-right: 4px solid var(--teal);
  content: "";
  transform: rotate(45deg);
}

.candidate-path-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.path-candidate {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.path-candidate.best {
  border-color: #80c37a;
  background: #f0faf0;
}

.path-candidate span {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
}

.path-candidate.best span {
  background: #e3f6e3;
  color: var(--green);
}

.path-candidate strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.95rem;
}

.path-candidate p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-answer-box {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid #9dd4d3;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5ffff, #f8fbff);
}

#chat-reasoning-note {
  color: var(--muted);
  font-size: 0.96rem;
}

.section-heading h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.thinking-levels {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.thinking-option {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.thinking-option strong {
  font-size: 1.05rem;
}

.thinking-option span {
  color: var(--muted);
  font-weight: 720;
}

.thinking-option:hover,
.thinking-option:focus-visible,
.thinking-option.active {
  transform: translateY(-1px);
  border-color: var(--blue);
  background: #eef5ff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.math-demo {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.65fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: stretch;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid #9dd4d3;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(238, 254, 254, 0.86), rgba(248, 251, 255, 0.96));
}

.math-copy,
.math-controls,
.math-output {
  min-width: 0;
}

.math-copy h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.18rem;
}

.math-copy h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.math-copy p,
.math-controls p,
.math-output p {
  margin-bottom: 0;
  color: var(--muted);
}

.math-copy p + p,
.math-caveat {
  margin-top: 10px;
}

.math-copy code {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.math-controls {
  display: grid;
  gap: 12px;
  align-content: center;
}

.math-controls label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.math-controls label span {
  color: var(--ink);
  font-weight: 850;
}

.math-controls input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--teal);
}

.math-controls b {
  color: var(--teal);
}

.math-output {
  display: grid;
  gap: 9px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.math-output strong {
  color: var(--green);
  font-size: 1.2rem;
}

.math-output span {
  display: inline-flex;
  width: fit-content;
  padding: 7px 9px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue);
  font-weight: 900;
}

.math-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.math-routes i {
  display: grid;
  min-width: 34px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #e7edf6;
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.math-routes i.active {
  background: #e8f7eb;
  color: var(--green);
}

.lesson-app {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: clamp(12px, 2vw, 20px);
}

.step-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.step-button,
.control-button,
.text-link {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.step-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  text-align: left;
}

.step-button span,
.number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
}

.step-button:hover,
.step-button:focus-visible,
.step-button.active,
.control-button:not(:disabled):hover,
.control-button:not(:disabled):focus-visible,
.text-link:hover,
.text-link:focus-visible {
  transform: translateY(-1px);
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
}

.step-button.active {
  background: #eef5ff;
}

.lesson-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.lesson-toolbar-bottom {
  margin-top: 18px;
}

.control-button {
  min-height: 42px;
  padding: 0.68rem 1rem;
}

.control-button.primary,
.text-link {
  background: var(--ink);
  color: #fff;
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.progress-meter {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef3fb;
}

.progress-meter span {
  display: block;
  width: 16.666%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--green));
  transition: width 200ms ease;
}

.panel {
  display: none;
  min-width: 0;
}

.panel.active {
  display: block;
}

.diagram-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 720px;
  overflow-x: auto;
  padding: clamp(16px, 2.4vw, 28px);
  border: 1px solid #b7c7e4;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(7, 25, 74, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(7, 25, 74, 0.035) 1px, transparent 1px),
    #fff;
  background-size: 38px 38px;
}

.diagram-heading {
  margin-bottom: 20px;
}

.diagram-heading.center {
  text-align: center;
}

.diagram-heading h2 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.diagram-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 2rem);
}

.overview-flow {
  display: grid;
  grid-template-columns: minmax(128px, 0.75fr) 20px minmax(190px, 1.18fr) 20px minmax(154px, 0.92fr) 20px minmax(160px, 0.95fr) 20px minmax(190px, 1.18fr) 20px minmax(150px, 0.85fr);
  gap: 6px;
  align-items: stretch;
}

.overview-step {
  display: grid;
  gap: 10px;
  min-height: 290px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-align: center;
}

.overview-step strong {
  min-height: 42px;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.12;
}

.overview-step small {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 760;
}

.overview-step.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.visual {
  min-height: 114px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.mini-question {
  display: grid;
  gap: 12px;
  align-content: center;
  justify-items: center;
  min-height: 132px;
  padding: 12px;
}

.question-circle {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 2.2rem;
  font-weight: 950;
  line-height: 1;
}

.mini-question > span:last-child {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 820;
  line-height: 1.18;
}

.mini-paths,
.mini-checks,
.mini-bars {
  display: grid;
  gap: 7px;
  align-content: center;
  padding: 12px;
}

.mini-paths i {
  height: 18px;
  border-radius: 6px;
}

.blue {
  background: #7aa4ff;
}

.teal {
  background: #5ac8c8;
}

.purple {
  background: #a782e8;
}

.orange {
  background: #ffad5c;
}

.mini-tree {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  background:
    radial-gradient(circle at 50% 16%, rgba(14, 154, 160, 0.12), transparent 18px),
    #fff;
}

.mini-tree svg {
  position: absolute;
  inset: 12px 12px 22px;
  width: calc(100% - 24px);
  height: calc(100% - 34px);
}

.mini-tree path {
  fill: none;
  stroke: #7e8794;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.tree-node {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(7, 25, 74, 0.14);
  background: var(--teal);
}

.tree-node.root { top: 14px; left: calc(50% - 9px); }
.tree-node.branch-a { top: 44px; left: 28%; }
.tree-node.branch-b { top: 46px; left: calc(50% - 9px); }
.tree-node.branch-c { top: 44px; right: 26%; }
.tree-node.leaf-a { bottom: 28px; left: 18%; }
.tree-node.leaf-b { bottom: 28px; left: 35%; }
.tree-node.leaf-c { bottom: 28px; right: 35%; }
.tree-node.leaf-d { bottom: 28px; right: 18%; }
.tree-node.pale {
  background: #b8dfe2;
  opacity: 0.9;
}

.tree-node.open {
  border-color: #7e8794;
  background: #fff;
}

.tree-dots {
  position: absolute;
  right: 14%;
  bottom: 44px;
  color: var(--teal);
  font-size: 1.4rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0;
}

.mini-select {
  display: grid;
  gap: 7px;
  align-content: center;
  min-height: 132px;
  padding: 10px;
}

.select-row {
  display: grid;
  grid-template-columns: 3.9rem repeat(4, 1fr) 1.2rem;
  gap: 5px;
  align-items: center;
  min-height: 24px;
  padding: 5px;
  border: 1px solid #d2dbe8;
  border-radius: 7px;
  background: #f8fafc;
}

.select-row b {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: left;
}

.select-row i {
  height: 13px;
  border-radius: 4px;
  background: #d7dee9;
}

.select-row em {
  color: var(--red);
  font-size: 1.2rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.select-row.winner {
  border-color: #5f8eed;
  background: #eff5ff;
}

.select-row.winner b {
  color: var(--blue);
}

.select-row.winner i {
  background: linear-gradient(180deg, #7aa4ff, var(--blue));
}

.select-row.winner em {
  color: #14a45a;
}

.mini-checks i {
  padding: 7px;
  border-radius: 8px;
  background: #edf8ed;
  color: var(--green);
  font-style: normal;
  font-weight: 950;
}

.mini-checks i:nth-child(3) {
  background: #fff0f0;
  color: var(--red);
}

.mini-bars {
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
}

.mini-bars i {
  align-self: end;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #77d68a, var(--green));
}

.mini-bars i:nth-child(1) { height: 38px; }
.mini-bars i:nth-child(2) { height: 60px; }
.mini-bars i:nth-child(3) { height: 90px; }

.arrow {
  position: relative;
  align-self: center;
  height: 4px;
  background: var(--ink);
}

.arrow::after {
  position: absolute;
  right: -1px;
  top: -7px;
  width: 16px;
  height: 16px;
  border-top: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.feedback-loop {
  margin: 18px 7% 0;
  padding: 12px;
  border: 2px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.insight-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: min(880px, 100%);
  margin: 18px auto 0;
  padding: 16px;
  border: 2px solid #5f86d8;
  border-radius: 14px;
  background: rgba(244, 249, 255, 0.92);
}

.insight-box ul {
  margin: 0;
  padding-left: 1.2rem;
}

.insight-box li,
.insight-box p {
  color: var(--ink);
  font-size: 1.05rem;
}

.insight-box p {
  margin-bottom: 0;
}

.bulb {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, transparent 16px, var(--ink) 17px 19px, transparent 20px),
    #e6eefc;
}

.text-link {
  min-height: 42px;
  padding: 0.68rem 1rem;
}

.generation-grid,
.verify-grid,
.selection-grid,
.learn-grid {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.generation-grid {
  grid-template-columns: minmax(152px, 0.92fr) 24px minmax(216px, 1.18fr) 24px minmax(152px, 0.82fr) 24px minmax(216px, 1.15fr) 24px minmax(264px, 1.34fr);
  gap: 4px;
  align-items: stretch;
}

.generation-step {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-width: 0;
}

.generation-step-title {
  display: grid;
  min-height: 112px;
  align-content: start;
  justify-items: center;
  text-align: center;
}

.generation-arrow {
  position: relative;
  align-self: center;
  width: 100%;
  height: 5px;
  margin-top: 116px;
  border-radius: 99px;
  background: var(--ink);
}

.generation-arrow::after {
  position: absolute;
  right: 2px;
  top: -6px;
  width: 14px;
  height: 14px;
  border-top: 5px solid var(--ink);
  border-right: 5px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.generation-step-title .number {
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
}

.generation-step-title h3 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: clamp(1rem, 1.45vw, 1.42rem);
  line-height: 1.08;
}

.generation-step .process-column {
  display: grid;
  gap: 11px;
  width: 100%;
  min-width: 0;
  min-height: 360px;
  align-content: start;
  padding: 15px;
  border-color: #2b64c7;
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.94));
}

.inner-title {
  margin: 0;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.process-column,
.context-box,
.route-reader,
.answer-extract,
.check-panel,
.status-panel,
.score-panel,
.verify-stage-card,
.folder-card,
.ranking-card,
.choose-card,
.final-answer-card,
.reward-card,
.weights-card,
.probability-card-large,
.future-card {
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.process-column h3,
.context-box h3,
.route-reader h3,
.verify-grid h3,
.selection-grid h3,
.learn-grid h3 {
  margin: 10px 0 12px;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.1;
}

.prompt-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
  font-style: italic;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}

.prompt-token-arrow {
  justify-self: center;
  width: 0;
  height: 30px;
  border-left: 4px solid var(--ink);
}

.prompt-token-arrow::after {
  display: block;
  width: 14px;
  height: 14px;
  margin: 14px 0 0 -9px;
  border-right: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.token-cloud,
.context-tokens,
.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.token-cloud span,
.context-tokens span,
.token-row span,
.sequence-row span,
.fan-row span,
.branch-row span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border: 1px solid #7aa4ff;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--ink);
  font-weight: 780;
}

.token-cloud {
  justify-content: center;
}

.token-cloud span {
  min-width: 42px;
  white-space: nowrap;
}

.token-cloud span:nth-child(3) {
  font-size: 0.82rem;
}

.token-caption {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 850;
  text-align: center;
}

.candidate-list,
.sequence-rows,
.path-fan,
.ranking-list {
  display: grid;
  gap: 8px;
}

.token-choice {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) 34px minmax(30px, 0.45fr);
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.token-choice[data-token="it"] { --candidate-color: var(--blue); }
.token-choice[data-token="photosynthesis"] { --candidate-color: var(--teal); }
.token-choice[data-token="plants"] { --candidate-color: var(--purple); }
.token-choice[data-token="the"] { --candidate-color: var(--orange); }

.token-choice strong {
  min-width: 0;
  padding: 8px 7px;
  overflow: hidden;
  border: 1px solid var(--candidate-color);
  border-radius: 7px;
  color: var(--candidate-color);
  font-size: 0.7rem;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-choice[data-token="photosynthesis"] strong {
  padding-inline: 3px;
  font-size: 0.62rem;
}

.token-choice span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: right;
}

.token-choice i {
  width: 100%;
  height: 11px;
  overflow: hidden;
  border-radius: 99px;
  background: #dde6f2;
}

.token-choice i::before {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--candidate-color);
  content: "";
}

.token-choice.active {
  border-color: var(--candidate-color);
  background: #edf4ff;
  background: color-mix(in srgb, var(--candidate-color) 10%, #fff);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--candidate-color) 15%, transparent);
}

.candidate-dots {
  justify-self: center;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 950;
}

.chosen-card {
  justify-items: center;
}

.selected-token-stage {
  position: relative;
  display: grid;
  min-height: 156px;
  place-items: center;
  width: 100%;
}

.selection-rays {
  position: absolute;
  inset: 32px 20px 58px;
  background:
    linear-gradient(var(--blue), var(--blue)) 50% 2% / 3px 26px no-repeat,
    linear-gradient(35deg, transparent 45%, var(--blue) 46% 54%, transparent 55%) 18% 28% / 34px 34px no-repeat,
    linear-gradient(-35deg, transparent 45%, var(--blue) 46% 54%, transparent 55%) 82% 28% / 34px 34px no-repeat,
    linear-gradient(125deg, transparent 45%, var(--blue) 46% 54%, transparent 55%) 23% 90% / 34px 34px no-repeat,
    linear-gradient(-125deg, transparent 45%, var(--blue) 46% 54%, transparent 55%) 77% 90% / 34px 34px no-repeat;
  opacity: 0.95;
}

.selected-token {
  display: grid;
  z-index: 1;
  width: min(100%, 120px);
  min-width: 0;
  min-height: 54px;
  padding: 0 8px;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 9px;
  background: #f8fbff;
  color: var(--blue);
  font-size: clamp(0.72rem, 0.82vw, 1.18rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.choice-check {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 3px solid #0f9f55;
  border-radius: 50%;
  color: #0f9f55;
  font-size: 1.5rem;
  font-weight: 950;
}

.choice-note {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.sequence-row {
  display: grid;
  grid-template-columns: 2.8rem minmax(0, 1fr);
  gap: 5px;
  align-items: start;
}

.sequence-row strong {
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.9;
  white-space: nowrap;
}

.sequence-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.sequence-row span {
  min-height: 24px;
  padding: 3px 5px;
  font-size: 0.68rem;
  white-space: nowrap;
}

.fan-row {
  position: relative;
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.path-fan {
  position: relative;
  min-width: 0;
  padding-left: 28px;
}

.path-fan::before {
  position: absolute;
  top: calc(50% - 8px);
  left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.fan-row:nth-child(1) { --path-color: var(--blue); }
.fan-row:nth-child(2) { --path-color: var(--teal); }
.fan-row:nth-child(3) { --path-color: var(--purple); }
.fan-row:nth-child(4) { --path-color: var(--orange); }

.fan-row strong {
  flex: 0 0 3.5rem;
  color: var(--path-color);
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.fan-row span {
  min-height: 24px;
  padding: 3px 5px;
  border-color: var(--path-color);
  color: var(--path-color);
  font-size: 0.68rem;
  white-space: nowrap;
}

.fan-row.active {
  border-color: var(--path-color);
  background: #f4fbff;
  background: color-mix(in srgb, var(--path-color) 9%, #fff);
}

.search-lab {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 2.55fr);
  gap: 22px;
  align-items: start;
}

.search-callout {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
  color: var(--ink);
}

.search-callout .number {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
}

.search-callout h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.12;
}

.search-left-rail {
  display: grid;
  grid-template-rows: auto 44px auto;
  align-content: start;
  padding-top: 86px;
  z-index: 2;
}

.context-box {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  min-height: 126px;
  align-items: center;
  padding: 18px 18px 18px 70px;
  border-color: var(--ink);
}

.document-icon {
  position: relative;
  width: 48px;
  height: 58px;
  border: 3px solid var(--ink);
  border-radius: 9px;
  background: linear-gradient(180deg, #fff 0%, #f4f8ff 100%);
  box-shadow: 0 8px 18px rgba(7, 25, 74, 0.08);
}

.document-icon::before {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  border-bottom-left-radius: 5px;
  background: #eaf2ff;
  content: "";
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.document-icon::after {
  position: absolute;
  left: 10px;
  top: 21px;
  width: 25px;
  height: 3px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 25px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 10px / 20px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 20px / 26px 3px no-repeat;
  border-radius: 99px;
  content: "";
}

.context-down-arrow {
  position: relative;
  justify-self: center;
  width: 4px;
  height: 44px;
  background: var(--ink);
}

.context-down-arrow::after {
  position: absolute;
  left: -7px;
  bottom: 1px;
  width: 16px;
  height: 16px;
  border-right: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.context-tokens {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  width: 360px;
  max-width: calc(100% + 40px);
  min-width: 0;
  padding: 8px;
  border: 2px solid #8aa9dc;
  border-radius: 12px;
  background: #f8fbff;
}

.context-tokens::after {
  position: absolute;
  right: -19px;
  top: calc(50% - 2px);
  width: 18px;
  height: 4px;
  border-radius: 99px;
  background: var(--ink);
  content: "";
}

.context-tokens span {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  padding: 6px 7px;
  overflow: hidden;
  border-color: #8aa9dc;
  color: var(--ink);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-right-stage {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.search-top-callouts,
.search-bottom-callouts {
  display: grid;
  align-items: stretch;
  gap: 18px;
}

.search-top-callouts {
  grid-template-columns: minmax(230px, 0.88fr) minmax(300px, 1.12fr);
  width: min(680px, 100%);
}

.search-bottom-callouts {
  grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1fr);
  width: min(760px, 86%);
  margin-left: 112px;
}

.expand-callout,
.branch-callout,
.route-reader,
.diversity-callout {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 18px 18px 18px 70px;
}

.expand-callout {
  align-self: end;
  margin-top: 58px;
  border-color: var(--blue);
}

.branch-callout {
  border-color: var(--teal);
}

.branch-mini-icon,
.tree-mini-icon,
.magnify-icon,
.people-icon {
  position: relative;
  display: block;
  justify-self: center;
}

.branch-mini-icon {
  width: 56px;
  height: 48px;
}

.branch-mini-icon::before {
  position: absolute;
  inset: 5px 8px 7px;
  background:
    radial-gradient(circle, var(--blue) 0 7px, transparent 8px) 50% 0 / 16px 16px no-repeat,
    radial-gradient(circle, #87a7ee 0 7px, transparent 8px) 7% 80% / 16px 16px no-repeat,
    radial-gradient(circle, #87a7ee 0 7px, transparent 8px) 50% 80% / 16px 16px no-repeat,
    radial-gradient(circle, #87a7ee 0 7px, transparent 8px) 93% 80% / 16px 16px no-repeat,
    linear-gradient(62deg, transparent 45%, var(--blue) 46% 54%, transparent 55%) 20% 43% / 28px 28px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 50% 42% / 3px 24px no-repeat,
    linear-gradient(-62deg, transparent 45%, var(--blue) 46% 54%, transparent 55%) 80% 43% / 28px 28px no-repeat;
  content: "";
}

.tree-mini-icon {
  width: 72px;
  height: 54px;
}

.tree-mini-icon::before {
  position: absolute;
  inset: 2px;
  background:
    radial-gradient(circle, var(--teal) 0 7px, transparent 8px) 50% 0 / 16px 16px no-repeat,
    radial-gradient(circle, var(--teal) 0 7px, transparent 8px) 22% 55% / 16px 16px no-repeat,
    radial-gradient(circle, var(--teal) 0 7px, transparent 8px) 50% 55% / 16px 16px no-repeat,
    radial-gradient(circle, var(--teal) 0 7px, transparent 8px) 78% 55% / 16px 16px no-repeat,
    radial-gradient(circle, #80c7cb 0 6px, transparent 7px) 14% 100% / 14px 14px no-repeat,
    radial-gradient(circle, #80c7cb 0 6px, transparent 7px) 34% 100% / 14px 14px no-repeat,
    radial-gradient(circle, #80c7cb 0 6px, transparent 7px) 66% 100% / 14px 14px no-repeat,
    radial-gradient(circle, #80c7cb 0 6px, transparent 7px) 86% 100% / 14px 14px no-repeat,
    linear-gradient(60deg, transparent 47%, var(--teal) 48% 53%, transparent 54%) 30% 24% / 34px 34px no-repeat,
    linear-gradient(var(--teal), var(--teal)) 50% 25% / 3px 30px no-repeat,
    linear-gradient(-60deg, transparent 47%, var(--teal) 48% 53%, transparent 54%) 70% 24% / 34px 34px no-repeat;
  content: "";
}

.branch-network {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px;
  gap: 8px;
  min-width: 0;
  min-height: 310px;
  align-items: center;
}

.branch-lines {
  position: absolute;
  inset: 0 145px 0 0;
  pointer-events: none;
}

.branch-lines path {
  fill: none;
  stroke-width: 3.3;
}

.branch-lines .route-temperature { stroke: var(--teal); }
.branch-lines .route-surface { stroke: var(--blue); }
.branch-lines .route-humidity { stroke: var(--purple); }
.branch-lines .route-pressure { stroke: var(--orange); }
.branch-lines .route-constant {
  stroke: #9aa4b2;
  stroke-dasharray: 9 9;
}

.branch-origin {
  position: absolute;
  top: calc(50% - 14px);
  left: 22px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(7, 25, 74, 0.08);
}

.branch-board {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-left: 128px;
}

.branch-row {
  --route-color: var(--teal);
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--route-color);
}

.branch-row[data-route="energy"] { --route-color: var(--teal); }
.branch-row[data-route="inputs"] { --route-color: var(--blue); }
.branch-row[data-route="outputs"] { --route-color: var(--purple); }
.branch-row[data-route="wording"] { --route-color: var(--orange); }
.branch-row[data-route="weak"] { --route-color: #9aa4b2; }

.branch-row span {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 6px 7px;
  overflow: hidden;
  border-color: var(--route-color);
  color: var(--route-color);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-row span:not(:last-child)::after {
  position: absolute;
  left: calc(100% + 2px);
  top: calc(50% - 1px);
  width: 11px;
  height: 2px;
  background: var(--route-color);
  content: "";
}

.branch-row span:not(:last-child)::before {
  position: absolute;
  left: calc(100% + 7px);
  top: calc(50% - 5px);
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--route-color);
  border-right: 2px solid var(--route-color);
  content: "";
  transform: rotate(45deg);
}

.branch-row::after {
  display: block;
  flex: 0 0 18px;
  height: 2px;
  border-top: 2px dashed var(--route-color);
  content: "";
}

.branch-row.active span {
  background: color-mix(in srgb, var(--route-color) 10%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--route-color) 14%, transparent);
}

.branch-row.muted {
  opacity: 0.45;
}

.sequence-brace {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--ink);
}

.sequence-brace span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13rem;
  font-weight: 400;
  line-height: 0.72;
}

.sequence-brace strong {
  display: block;
  max-width: none;
  font-size: 1.06rem;
  line-height: 1.12;
}

.route-reader {
  min-height: 120px;
  border-color: var(--teal);
}

.route-reader p {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.32;
}

.route-reader strong {
  grid-column: 1 / -1;
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eafeff;
  color: var(--teal);
  font-size: 0.82rem;
}

.magnify-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border: 4px solid var(--teal);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.95) 0 7px, transparent 8px),
    linear-gradient(180deg, #fff 0%, #eafeff 100%);
  box-shadow: 0 8px 18px rgba(9, 129, 138, 0.12);
}

.magnify-icon::before {
  position: absolute;
  top: 11px;
  left: 13px;
  width: 17px;
  height: 8px;
  border-top: 3px solid rgba(9, 129, 138, 0.45);
  border-radius: 50%;
  content: "";
  transform: rotate(-28deg);
}

.magnify-icon::after {
  position: absolute;
  right: -13px;
  bottom: -8px;
  width: 26px;
  height: 7px;
  border-radius: 99px;
  background: var(--teal);
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.diversity-callout {
  border-color: var(--green);
}

.people-icon {
  width: 70px;
  height: 54px;
  background:
    radial-gradient(circle, var(--green) 0 7px, transparent 8px) 50% 6px / 18px 18px no-repeat,
    radial-gradient(circle, var(--green) 0 7px, transparent 8px) 22% 14px / 18px 18px no-repeat,
    radial-gradient(circle, var(--green) 0 7px, transparent 8px) 78% 14px / 18px 18px no-repeat,
    radial-gradient(ellipse, var(--green) 0 15px, transparent 16px) 50% 32px / 34px 22px no-repeat,
    radial-gradient(ellipse, var(--green) 0 13px, transparent 14px) 20% 36px / 30px 18px no-repeat,
    radial-gradient(ellipse, var(--green) 0 13px, transparent 14px) 80% 36px / 30px 18px no-repeat;
}

/* Flattened Step 3 flow */
.search-lab {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 1180px;
}

.search-flow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.search-flow-row-top {
  width: min(820px, 100%);
  justify-self: center;
}

.search-flow-row-bottom {
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  width: min(900px, 100%);
  justify-self: center;
}

.search-block,
.search-block.context-box,
.search-block.expand-callout,
.search-block.branch-callout,
.search-block.route-reader,
.search-block.diversity-callout {
  position: relative;
  display: grid;
  grid-template-columns: 42px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 132px;
  margin: 0;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
  color: var(--ink);
}

.search-block .number {
  align-self: start;
  width: 38px;
  height: 38px;
  font-size: 1.12rem;
}

.search-block h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.12;
}

.search-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.28;
}

.search-block.context-box {
  border-color: var(--ink);
}

.search-block.expand-callout {
  border-color: var(--blue);
}

.search-block.route-reader {
  border-color: var(--teal);
}

.search-block.diversity-callout {
  border-color: var(--green);
}

.flat-connector,
.down-connector {
  position: relative;
  align-self: center;
  justify-self: stretch;
  height: 4px;
  border-radius: 99px;
  background: var(--ink);
}

.flat-connector::after {
  position: absolute;
  right: -1px;
  top: -7px;
  width: 16px;
  height: 16px;
  border-top: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.down-connector {
  width: 4px;
  height: 28px;
  justify-self: center;
}

.down-connector-from-step-two {
  transform: translateX(224px);
}

.down-connector::after {
  position: absolute;
  left: -6px;
  bottom: 0;
  width: 14px;
  height: 14px;
  border-right: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.search-block .document-icon,
.search-block .branch-mini-icon,
.search-block .tree-mini-icon,
.search-block .magnify-icon,
.search-block .people-icon {
  justify-self: center;
  transform: scale(0.9);
}

.search-block .magnify-icon {
  width: 48px;
  height: 48px;
}

.context-tokens,
.search-block .context-tokens {
  display: flex;
  width: 100%;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid #8aa9dc;
  border-radius: 10px;
  background: #f8fbff;
}

.context-tokens::after {
  content: none;
}

.context-tokens span,
.next-token-strip span {
  min-height: 30px;
  padding: 5px 6px;
  overflow: hidden;
  border: 1px solid #8aa9dc;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-tokens span {
  flex: 0 0 auto;
}

.next-token-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.next-token-strip span:nth-child(1) {
  border-color: var(--teal);
  color: var(--teal);
}

.next-token-strip span:nth-child(2) {
  border-color: var(--blue);
  color: var(--blue);
}

.next-token-strip span:nth-child(3) {
  border-color: var(--purple);
  color: var(--purple);
}

.next-token-strip span:nth-child(4) {
  border-color: var(--orange);
  color: var(--orange);
}

.search-block.branch-stage {
  position: relative;
  display: block;
  min-height: 0;
  padding: 18px;
  border: 2px solid #9fc0ef;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.78);
}

.branch-step-heading {
  display: grid;
  grid-template-columns: 42px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  max-width: 560px;
  margin: 0 auto 18px;
  padding: 12px 14px;
  border: 2px solid var(--teal);
  border-radius: 14px;
  background: #fff;
}

.branch-step-heading .number {
  align-self: center;
}

.branch-step-heading h3 {
  margin: 0 0 5px;
  font-size: 1.08rem;
  line-height: 1.12;
}

.branch-step-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.22;
}

.branch-stage-body {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 175px;
  gap: 16px;
  align-items: center;
  min-height: 275px;
}

.branch-stage-label {
  display: grid;
  gap: 12px;
  justify-items: center;
  color: var(--ink);
  font-weight: 950;
  text-align: center;
}

.branch-origin {
  position: static;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 6px rgba(7, 25, 74, 0.08);
}

.branch-lines {
  position: absolute;
  inset: 0 190px 0 112px;
  width: auto;
  height: auto;
  pointer-events: none;
}

.branch-lines path {
  fill: none;
  stroke-width: 3;
}

.branch-board {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0;
}

.branch-row {
  --route-color: var(--teal);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.branch-row::after {
  content: none;
}

.branch-row span {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid var(--route-color);
  border-radius: 8px;
  background: #fff;
  color: var(--route-color);
  font-size: 0.82rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-row span:not(:last-child)::after {
  position: absolute;
  left: calc(100% + 1px);
  top: calc(50% - 1px);
  width: 10px;
  height: 2px;
  background: var(--route-color);
  content: "";
}

.branch-row span:not(:last-child)::before {
  position: absolute;
  left: calc(100% + 7px);
  top: calc(50% - 5px);
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--route-color);
  border-right: 2px solid var(--route-color);
  content: "";
  transform: rotate(45deg);
}

.branch-row.active span {
  background: color-mix(in srgb, var(--route-color) 10%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--route-color) 14%, transparent);
}

.branch-row.muted {
  opacity: 0.46;
}

.sequence-brace {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--ink);
}

.sequence-brace span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9rem;
  font-weight: 400;
  line-height: 0.72;
}

.sequence-brace strong {
  max-width: 9rem;
  font-size: 1.02rem;
  line-height: 1.12;
}

.route-reader p,
.route-reader strong {
  grid-column: auto;
}

.route-reader strong {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eafeff;
  color: var(--teal);
  font-size: 0.82rem;
}

/* Step 3: simple five-container walkthrough */
.search-steps-grid {
  display: grid;
  grid-template-columns: minmax(172px, 0.95fr) 24px minmax(192px, 1fr) 24px minmax(250px, 1.26fr) 24px minmax(210px, 1.08fr) 24px minmax(210px, 1.08fr);
  gap: 4px;
  align-items: stretch;
  min-width: 1180px;
}

.search-step {
  min-width: 0;
}

.search-step .generation-step-title {
  min-height: 112px;
}

.search-arrow {
  margin-top: 116px;
}

.search-process-card {
  min-height: 360px;
  gap: 12px;
  align-content: start;
  overflow: hidden;
}

.search-context-card {
  border-color: var(--ink);
}

.search-candidate-card {
  border-color: var(--blue);
}

.search-branch-card {
  border-color: var(--teal);
}

.search-route-card {
  justify-items: center;
  border-color: var(--teal);
  text-align: center;
}

.search-sequence-card {
  justify-items: center;
  border-color: var(--green);
  text-align: center;
}

.search-context-card .document-icon,
.search-route-card .magnify-icon,
.search-sequence-card .people-icon {
  justify-self: center;
  margin: 2px 0;
}

.search-context-card .document-icon {
  position: relative;
}

.search-token-line,
.search-token-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.search-token-line span,
.search-token-options span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  border: 1px solid #7aa4ff;
  border-radius: 7px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 830;
  line-height: 1;
  white-space: nowrap;
}

.search-token-options span:nth-child(1) {
  border-color: var(--teal);
  color: var(--teal);
}

.search-token-options span:nth-child(2) {
  border-color: var(--blue);
  color: var(--blue);
}

.search-token-options span:nth-child(3) {
  border-color: var(--purple);
  color: var(--purple);
}

.search-token-options span:nth-child(4) {
  border-color: var(--orange);
  color: var(--orange);
}

.search-token-options span:nth-child(5) {
  border-color: #9aa4b2;
  color: #6b7280;
}

.search-card-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.3;
  text-align: center;
}

.compact-branch-board {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 0;
}

.compact-branch-board .branch-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--route-color) 55%, #d7deea);
  border-radius: 10px;
  background: #fff;
  color: var(--route-color);
  cursor: pointer;
}

.compact-branch-board .branch-row::after {
  content: none;
}

.compact-branch-board .branch-row span {
  min-width: 0;
  min-height: 28px;
  padding: 4px;
  border-color: var(--route-color);
  border-radius: 7px;
  color: var(--route-color);
  font-size: 0.62rem;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-branch-board .branch-row span::before,
.compact-branch-board .branch-row span::after {
  content: none;
}

.compact-branch-board .branch-row.active {
  background: color-mix(in srgb, var(--route-color) 9%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--route-color) 13%, transparent);
}

.compact-branch-board .branch-row.muted {
  opacity: 0.62;
}

.search-route-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.12;
}

.search-route-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.32;
}

.search-route-card strong {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eafeff;
  color: var(--teal);
  font-size: 0.78rem;
}

.search-sequence-brace {
  grid-template-columns: 34px minmax(0, 1fr);
  width: 100%;
  gap: 8px;
  text-align: left;
}

.search-sequence-brace span {
  font-size: 6.2rem;
  line-height: 0.78;
}

.search-sequence-brace strong {
  max-width: none;
  font-size: 0.86rem;
  line-height: 1.18;
}

.verify-grid {
  grid-template-columns: minmax(245px, 1.18fr) 18px minmax(175px, 0.84fr) 18px minmax(245px, 1.18fr) 18px minmax(140px, 0.68fr) 18px minmax(140px, 0.68fr);
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.verify-arrow {
  position: relative;
  align-self: center;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--ink);
}

.verify-arrow::after {
  position: absolute;
  right: 2px;
  top: -6px;
  width: 14px;
  height: 14px;
  border-top: 5px solid var(--ink);
  border-right: 5px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.path-list {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}

.verify-stage-card {
  border-color: var(--blue);
}

.verify-stage-card .number,
.answer-extract .number,
.check-panel .number,
.status-panel .number,
.score-panel .number {
  margin-inline: auto;
}

.verify-stage-card h3,
.answer-extract h3,
.check-panel h3,
.status-panel h3,
.score-panel h3 {
  text-align: center;
}

.verify-path {
  display: grid;
  grid-template-columns: minmax(3.75rem, 0.75fr) repeat(3, 0.8rem) minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.verify-path span {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 5px;
  background: var(--blue);
}

.verify-path strong {
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verify-path em {
  justify-self: end;
  min-width: 0;
  overflow: visible;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.12;
  font-style: normal;
  font-weight: 850;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}

.verify-path.active {
  border-color: var(--blue);
  background: #edf4ff;
}

.path-b span { background: var(--teal); }
.path-c span { background: var(--purple); }
.path-d span { background: var(--orange); }

.answer-extract,
.status-panel,
.score-panel,
.choose-card,
.final-answer-card,
.future-card {
  text-align: center;
}

.answer-extract strong,
.score-panel strong,
.final-answer-card strong {
  display: grid;
  min-height: 84px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 12px;
  color: var(--blue);
  font-size: 2.4rem;
}

.answer-extract strong {
  min-height: 122px;
  padding: 12px;
  color: var(--blue);
  font-size: 0.92rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.answer-extract p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.25;
}

.check-panel {
  display: grid;
  gap: 9px;
  border-color: var(--teal);
}

.check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3rem;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.check-row strong {
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.check-row span {
  justify-self: end;
  font-weight: 950;
}

.status-panel,
.score-panel {
  border-color: var(--green);
}

.check-ok,
.status-pass {
  color: var(--green);
}

.check-bad,
.status-fail {
  color: var(--red);
}

#verify-status {
  display: grid;
  min-height: 90px;
  place-items: center;
  font-size: 2rem;
  font-weight: 950;
}

.selection-grid {
  grid-template-columns: 0.8fr 2.2fr 0.85fr 0.95fr;
}

.folder-icon {
  width: 120px;
  height: 88px;
  margin: 22px auto;
  border: 6px solid var(--ink);
  border-radius: 12px;
  position: relative;
}

.folder-icon::before {
  position: absolute;
  top: -23px;
  left: 8px;
  width: 58px;
  height: 24px;
  border: 6px solid var(--ink);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  content: "";
}

.ranking-row {
  display: grid;
  grid-template-columns: 4.5rem 5rem minmax(0, 1fr) 3.6rem 2rem;
  gap: 8px;
  align-items: center;
  padding: 10px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.ranking-row strong,
.ranking-row > span:not(.path-squares) {
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-row.active {
  border-color: var(--green);
  background: #f1fbf0;
}

.path-squares {
  display: flex;
  gap: 5px;
}

.path-squares i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--blue);
}

.ranking-row b {
  justify-self: end;
  min-width: 3.2rem;
  padding: 4px 7px;
  border-radius: 7px;
  background: #dff3df;
  color: var(--green);
  font-size: 0.84rem;
  text-align: center;
}

.ranking-row em {
  justify-self: center;
  color: var(--red);
  font-style: normal;
  font-weight: 950;
}

.ranking-row.active em {
  color: var(--green);
}

.big-check {
  width: 96px;
  height: 96px;
  margin: 20px auto;
  border-radius: 50%;
  background: var(--green);
  position: relative;
}

.big-check::after {
  position: absolute;
  top: 24px;
  left: 34px;
  width: 22px;
  height: 42px;
  border-right: 8px solid #fff;
  border-bottom: 8px solid #fff;
  content: "";
  transform: rotate(45deg);
}

.trophy {
  width: 72px;
  height: 66px;
  margin: 8px auto;
  border-radius: 12px 12px 28px 28px;
  background: var(--green);
}

.final-answer-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.final-answer-card strong {
  width: 100%;
  min-height: 112px;
  padding: 12px;
  color: var(--green);
  font-size: 0.88rem;
  line-height: 1.24;
  overflow-wrap: anywhere;
  text-align: center;
}

.final-answer-card p,
.choose-card p,
.folder-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.learn-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.reward-card.success {
  border-color: var(--green);
}

.reward-card.penalty {
  border-color: var(--red);
}

.reward-card strong {
  display: block;
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: #eef9ed;
  color: var(--green);
  text-align: center;
  font-size: 1.25rem;
}

.reward-card.penalty strong {
  background: #fff1f1;
  color: var(--red);
}

.token-row.faded {
  opacity: 0.45;
}

.network {
  position: relative;
  width: 170px;
  height: 150px;
  margin: 10px auto 18px;
}

.network::before,
.network::after {
  position: absolute;
  inset: 16px;
  border-top: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  content: "";
  transform: rotate(28deg);
}

.network::after {
  transform: rotate(-28deg);
}

.network i {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--teal);
}

.network i:nth-child(1) { top: 12px; left: 74px; }
.network i:nth-child(2) { top: 58px; left: 24px; }
.network i:nth-child(3) { top: 58px; right: 24px; }
.network i:nth-child(4) { bottom: 14px; left: 42px; }
.network i:nth-child(5) { bottom: 14px; right: 42px; }
.network i:nth-child(6) { top: 78px; left: 74px; }

.bar-chart {
  display: flex;
  gap: 10px;
  align-items: end;
  height: 112px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.bar-chart i {
  flex: 1;
  min-height: 12px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #65d58a, var(--green));
  transition: height 220ms ease;
}

.bar-chart.up i:nth-child(1) { height: 30px; }
.bar-chart.up i:nth-child(2) { height: 46px; }
.bar-chart.up i:nth-child(3) { height: 64px; }
.bar-chart.up i:nth-child(4) { height: 84px; }

.bar-chart.down i {
  background: linear-gradient(180deg, #d3d8e3, var(--red));
}

.bar-chart.down i:nth-child(1) { height: 74px; }
.bar-chart.down i:nth-child(2) { height: 58px; }
.bar-chart.down i:nth-child(3) { height: 38px; }
.bar-chart.down i:nth-child(4) { height: 26px; }

.future-card strong {
  display: inline-flex;
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue);
}

/* Step 6: offline learning loop */
.learn-status-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  margin-bottom: 18px;
  border: 2px solid #b7cce9;
  border-radius: 10px;
  background: #fff;
}

.learn-status {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  line-height: 1.15;
  text-align: center;
}

.learn-status.normal {
  color: var(--teal);
  background: linear-gradient(90deg, rgba(9, 129, 138, 0.09), rgba(255, 255, 255, 0.78));
}

.learn-status.training {
  color: var(--red);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.78), rgba(220, 38, 38, 0.09));
}

.learn-status strong {
  flex: 0 0 auto;
  font-weight: 950;
}

.learn-status span:last-child {
  min-width: 0;
  font-weight: 820;
}

.learn-user-icon,
.learn-data-icon {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.learn-user-icon {
  background:
    radial-gradient(circle, var(--teal) 0 8px, transparent 9px) 50% 3px / 20px 20px no-repeat,
    radial-gradient(ellipse, var(--teal) 0 15px, transparent 16px) 50% 24px / 34px 18px no-repeat;
}

.learn-data-icon {
  background:
    radial-gradient(ellipse, #e13a2f 0 15px, transparent 16px) 50% 4px / 30px 12px no-repeat,
    linear-gradient(#e13a2f, #e13a2f) 50% 9px / 30px 22px no-repeat,
    radial-gradient(ellipse, #c81f1f 0 15px, transparent 16px) 50% 25px / 30px 12px no-repeat;
}

.learn-flow-grid {
  display: grid;
  grid-template-columns: minmax(178px, 1.08fr) 24px minmax(178px, 1.08fr) 24px minmax(188px, 1.12fr) 24px minmax(188px, 1.12fr) 24px minmax(178px, 1.08fr);
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.learn-step-card {
  display: grid;
  min-width: 0;
  min-height: 330px;
  align-content: start;
  gap: 10px;
  overflow: hidden;
  padding: 15px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.94));
  text-align: center;
}

.learn-step-card .number {
  margin-inline: auto;
}

.learn-step-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.12;
}

.learn-step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.outcomes-card,
.future-card {
  border-color: var(--green);
}

.scoring-card {
  border-color: var(--red);
}

.weights-card {
  border-color: var(--teal);
}

.probability-card-large {
  border-color: var(--green);
}

.learn-arrow {
  position: relative;
  align-self: center;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--ink);
}

.learn-arrow::after {
  position: absolute;
  right: 2px;
  top: -6px;
  width: 14px;
  height: 14px;
  border-top: 5px solid var(--ink);
  border-right: 5px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.outcome-stack,
.score-list {
  display: grid;
  gap: 8px;
}

.outcome-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--row-color) 42%, #d8e0ec);
  border-radius: 10px;
  background: color-mix(in srgb, var(--row-color) 7%, #fff);
  color: var(--row-color);
}

.outcome-row.success {
  --row-color: var(--green);
}

.outcome-row.weak {
  --row-color: var(--red);
}

.outcome-row strong {
  flex-basis: 100%;
  font-size: 0.8rem;
}

.outcome-row span,
.future-token-row span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 7px;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.score-list span {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 9px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 820;
  text-align: left;
}

.score-list b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

.score-list span:last-child b {
  background: var(--red);
}

.reward-formula {
  display: block;
  padding: 10px;
  border: 1px dashed var(--red);
  border-radius: 10px;
  color: var(--red);
  font-size: 0.86rem;
  line-height: 1.2;
}

.learn-step-card .network {
  width: 150px;
  height: 120px;
  margin: 2px auto;
}

.learn-step-card .network::before,
.learn-step-card .network::after {
  inset: 14px;
}

.learn-step-card .network i {
  width: 20px;
  height: 20px;
}

.learn-step-card .network i:nth-child(1) { top: 8px; left: 65px; }
.learn-step-card .network i:nth-child(2) { top: 48px; left: 22px; }
.learn-step-card .network i:nth-child(3) { top: 48px; right: 22px; }
.learn-step-card .network i:nth-child(4) { bottom: 10px; left: 38px; }
.learn-step-card .network i:nth-child(5) { bottom: 10px; right: 38px; }
.learn-step-card .network i:nth-child(6) { top: 66px; left: 65px; }

.weight-network {
  display: grid;
  width: min(100%, 168px);
  height: 124px;
  margin: 2px auto;
  place-items: center;
}

.weight-network svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.weight-links path {
  fill: none;
  stroke: #087985;
  stroke-linecap: round;
  stroke-width: 2.2;
  opacity: 0.5;
}

.weight-nodes circle {
  stroke: #fff;
  stroke-width: 3;
  filter: drop-shadow(0 3px 5px rgba(7, 25, 74, 0.14));
}

.weight-nodes .node-input {
  fill: #0f8f9b;
}

.weight-nodes .node-hidden {
  fill: #066d78;
}

.weight-nodes .node-output {
  fill: #0b60d1;
}

.weight-dots circle {
  fill: #087985;
  opacity: 0.85;
}

.learn-step-card #train-round {
  width: 100%;
  min-height: 42px;
  padding-inline: 10px;
  font-size: 0.82rem;
}

.probability-panels {
  display: grid;
  gap: 10px;
}

.probability-panels > div {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
}

.probability-panels strong {
  font-size: 0.8rem;
  line-height: 1.1;
}

.probability-panels > div:first-child strong {
  color: var(--green);
}

.probability-panels > div:last-child strong {
  color: var(--red);
}

.learn-step-card .bar-chart {
  height: 58px;
  padding: 0 12px;
}

.learn-step-card .bar-chart i {
  width: 20px;
}

.future-token-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  color: var(--blue);
}

.future-card #training-round-label {
  display: inline-flex;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 0.82rem;
}

.learn-clarity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 16px;
  margin-top: 18px;
}

.query-loop-card,
.model-loop-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 2px solid #7aa4ff;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.query-loop-card h3,
.model-loop-card h3 {
  margin: 0;
  color: var(--blue);
  font-size: 1.04rem;
  line-height: 1.15;
  text-align: center;
}

.mini-query-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.mini-query-flow span {
  display: grid;
  min-height: 46px;
  place-items: center;
  padding: 6px;
  border: 1px solid #7aa4ff;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.mini-query-flow i {
  position: relative;
  height: 3px;
  border-radius: 99px;
  background: var(--ink);
}

.mini-query-flow i::after {
  position: absolute;
  right: 0;
  top: -5px;
  width: 11px;
  height: 11px;
  border-top: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.query-loop-card p {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--blue);
  border-radius: 10px;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 820;
  line-height: 1.25;
  text-align: center;
}

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

.loop-types span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border-right: 1px dashed #9fb7da;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.22;
  text-align: center;
}

.loop-types span:last-child {
  border-right: 0;
}

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

@media (max-width: 1200px) {
  .intro-hero {
    grid-template-columns: 1fr;
  }

  .candidate-path-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bridge-flow {
    grid-template-columns: 1fr;
  }

  .bridge-arrow {
    width: 4px;
    height: 22px;
    justify-self: center;
    background: linear-gradient(180deg, var(--blue), var(--teal));
  }

  .bridge-arrow::after {
    right: -5px;
    top: auto;
    bottom: -1px;
    transform: rotate(135deg);
  }

  .math-demo {
    grid-template-columns: 1fr;
  }

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

  .overview-flow,
  .generation-grid,
  .search-lab,
  .learn-grid {
    min-width: 1180px;
  }

  .verify-grid {
    min-width: 0;
  }

  .selection-grid {
    min-width: 0;
  }

  .diagram-card {
    overflow-x: auto;
  }
}

@media (max-width: 900px) {
  .overview-flow,
  .generation-grid,
  .search-steps-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .overview-step {
    min-height: 0;
  }

  .overview-step strong {
    min-height: 0;
  }

  .overview-flow .arrow,
  .generation-arrow,
  .search-arrow {
    width: 4px;
    height: 28px;
    margin: 0;
    justify-self: center;
  }

  .overview-flow .arrow::after,
  .generation-arrow::after,
  .search-arrow::after {
    right: -5px;
    top: auto;
    bottom: -1px;
    transform: rotate(135deg);
  }

  .generation-step-title,
  .search-step .generation-step-title {
    min-height: 0;
  }

  .generation-step .process-column,
  .search-process-card {
    min-height: 0;
  }

  .verify-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .selection-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .selection-grid .ranking-row {
    grid-template-columns: 4.2rem minmax(0, 1fr) 3.2rem 1.6rem;
  }

  .selection-grid .path-squares {
    display: none;
  }

  .selection-grid .ranking-row > span:not(.path-squares) {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .learn-status-band,
  .learn-clarity-grid {
    grid-template-columns: 1fr;
  }

  .learn-flow-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .learn-arrow {
    width: 4px;
    height: 28px;
    justify-self: center;
  }

  .learn-arrow::after {
    right: -5px;
    top: auto;
    bottom: -1px;
    transform: rotate(135deg);
  }

  .learn-step-card {
    min-height: 0;
  }

  .mini-query-flow,
  .loop-types {
    grid-template-columns: 1fr;
  }

  .mini-query-flow i {
    width: 4px;
    height: 20px;
    justify-self: center;
  }

  .mini-query-flow i::after {
    right: -4px;
    top: auto;
    bottom: -1px;
    transform: rotate(135deg);
  }

  .loop-types span {
    border-right: 0;
    border-bottom: 1px dashed #9fb7da;
  }

  .loop-types span:last-child {
    border-bottom: 0;
  }

  .verify-arrow {
    width: 4px;
    height: 28px;
    justify-self: center;
  }

  .verify-arrow::after {
    right: -5px;
    top: auto;
    bottom: -1px;
    transform: rotate(135deg);
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 12px, 1580px);
    padding-top: 8px;
  }

  .intro-page {
    padding: 14px;
  }

  .intro-actions {
    display: grid;
  }

  .intro-actions a,
  .intro-actions button {
    width: 100%;
  }

  .chat-message {
    max-width: 100%;
  }

  .thinking-visual,
  .chat-thinking-levels,
  .split-chat-thread,
  .candidate-path-preview {
    grid-template-columns: 1fr;
  }

  .math-demo {
    padding: 12px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.6rem);
  }

  .step-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .step-button {
    min-width: 12rem;
  }

  .lesson-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .progress-meter {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .diagram-heading.center {
    text-align: left;
  }

  .diagram-heading h2 {
    font-size: 2.25rem;
  }

  .diagram-heading p {
    font-size: 1.1rem;
  }

  .insight-box {
    grid-template-columns: 1fr;
  }

  .bulb {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
  }
}
