:root {
  color: #202124;
  background: #f3f0ea;
  font-family:
    Inter, "Noto Sans JP", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(243, 240, 234, 0.86)),
    radial-gradient(circle at 16% 0%, rgba(72, 126, 131, 0.18), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(198, 95, 58, 0.14), transparent 26%),
    #f3f0ea;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid #c6beb1;
  border-radius: 6px;
  background: #fffdf9;
  color: #202124;
  cursor: pointer;
  min-height: 36px;
}

button:hover {
  border-color: #7b8b88;
  background: #f8f4eb;
}

.math {
  color: #263436;
}

.math-inline {
  margin-inline: 0.08em;
  white-space: nowrap;
}

.math-inline .katex {
  font-size: 1.02em;
}

.math-title {
  margin-right: 0.16em;
  color: #374f52;
}

.math-title .katex {
  font-size: 0.94em;
}

.formula-display {
  overflow-x: auto;
  margin: 16px 0;
  border-left: 4px solid #2f6f73;
  background: rgba(255, 253, 249, 0.74);
  padding: 13px 16px;
}

.formula-display .katex-display {
  margin: 0;
  text-align: left;
}

.formula-display .katex {
  font-size: 1.18em;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 36px;
  align-items: center;
  min-height: 78vh;
  padding: 52px clamp(20px, 5vw, 72px) 34px;
}

.hero-copy {
  max-width: 840px;
}

.kicker,
.chapter-label,
.eyebrow,
.tag {
  margin: 0;
  color: #8b4f35;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 820px;
  margin: 12px 0 18px;
  color: #172226;
  font-size: clamp(42px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 760px;
  color: #535b5c;
  font-size: 17px;
  line-height: 1.85;
}

.hero-panel {
  min-height: 430px;
  border: 1px solid rgba(70, 83, 84, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.94), rgba(232, 237, 230, 0.9)),
    #fffdf9;
  box-shadow: 0 24px 60px rgba(53, 55, 48, 0.12);
  overflow: hidden;
}

.hero-network {
  width: 100%;
  height: 100%;
  min-height: 430px;
}

.grid-line {
  fill: none;
  stroke: #91a5a1;
  stroke-dasharray: 8 10;
  stroke-width: 1.4;
}

.grid-line.soft {
  opacity: 0.45;
}

.hero-edge {
  fill: none;
  stroke: #748883;
  stroke-linecap: round;
  stroke-width: 3;
}

.hero-edge.thick {
  stroke: url("#edgeGradient");
  stroke-width: 10;
  opacity: 0.7;
}

.hero-node {
  stroke: #fffdf9;
  stroke-width: 5;
}

.hero-node.teal {
  fill: #2f6f73;
}

.hero-node.amber {
  fill: #d7a735;
}

.hero-node.green {
  fill: #6f8e45;
}

.hero-node.coral {
  fill: #c65f3a;
}

.vector-arrow {
  fill: none;
  stroke: #1f3f49;
  stroke-linecap: round;
  stroke-width: 5;
}

.vector-arrow.ghost {
  stroke: #c65f3a;
  opacity: 0.82;
}

.svg-label {
  fill: #1f3f49;
  font-size: 26px;
  font-weight: 800;
}

.translation-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-block: 1px solid #d8d0c4;
  background: #d8d0c4;
}

.translation-strip article {
  min-height: 116px;
  padding: 24px clamp(18px, 3vw, 34px);
  background: #fffdf9;
}

.translation-strip span {
  display: block;
  margin-bottom: 10px;
  color: #7b7064;
  font-size: 13px;
  font-weight: 700;
}

.translation-strip strong {
  color: #172226;
  font-size: 22px;
  line-height: 1.32;
}

.workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
}

.chapter-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  height: 100vh;
  padding: 26px 18px;
  border-right: 1px solid #d8d0c4;
  background: rgba(255, 253, 249, 0.9);
}

.chapter-nav a {
  border-radius: 6px;
  color: #4b5657;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  padding: 10px 12px;
  text-decoration: none;
}

.chapter-nav a:hover {
  background: #eef2ed;
  color: #172226;
}

.lesson-stack {
  min-width: 0;
}

.lesson-section {
  border-bottom: 1px solid #d8d0c4;
  padding: clamp(34px, 5vw, 64px);
}

.lesson-section.interactive {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}

#projection {
  grid-template-columns: minmax(300px, 0.78fr) minmax(460px, 1.22fr);
  row-gap: 28px;
}

#projection .derivation-panel {
  grid-column: 1 / -1;
}

#svd {
  grid-template-columns: minmax(300px, 0.78fr) minmax(460px, 1.22fr);
  row-gap: 28px;
  align-items: start;
}

#svd .derivation-panel {
  grid-column: 1 / -1;
}

.lesson-section.compact {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
}

.lesson-copy h2,
.lesson-section h2,
.section-title h2 {
  margin: 10px 0 14px;
  color: #172226;
  font-size: clamp(27px, 3vw, 44px);
  line-height: 1.14;
  letter-spacing: 0;
}

.lesson-copy p,
.lesson-section > div > p,
.translation-card p,
.concept-board p {
  color: #535b5c;
  font-size: 15.5px;
  line-height: 1.8;
}

.formula-list {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
}

.derivation-panel {
  margin-top: 0;
  border: 1px solid #d1c8ba;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 253, 249, 0.96), rgba(238, 242, 237, 0.9)),
    #fffdf9;
  padding: 18px;
}

.derivation-title {
  margin: 0 0 12px;
  color: #8b4f35;
  font-size: 13px;
  font-weight: 850;
}

.derivation-equation {
  overflow-x: auto;
  border-block: 1px solid #ded6ca;
  padding: 14px 0;
}

.derivation-equation .katex-display {
  margin: 0;
  text-align: left;
}

.derivation-equation .katex {
  font-size: 1.1em;
}

.derivation-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.derivation-steps article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: 44px 72px auto;
  gap: 12px;
  align-items: start;
  align-content: start;
  min-width: 0;
  border: 1px solid #ddd4c5;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.78);
  padding: 12px;
}

.derivation-steps article > span:first-child {
  display: inline-grid;
  align-self: center;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 999px;
  background: #2f6f73;
  color: #fffdf9;
  font-size: 12px;
  font-weight: 850;
}

.derivation-steps strong {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0;
  color: #172226;
  overflow: visible;
}

.derivation-steps strong .katex {
  font-size: 1.02em;
}

.derivation-steps p {
  grid-column: 1 / -1;
  height: 72px;
  margin: 0;
  color: #535b5c;
  font-size: 13.5px;
  line-height: 1.7;
  overflow: visible;
}

.derivation-figure {
  grid-column: 1 / -1;
  grid-row: 3;
  width: 100%;
  min-width: 132px;
  height: clamp(220px, 22vw, 300px);
  border: 1px solid rgba(128, 139, 133, 0.3);
  border-radius: 6px;
  background: rgba(250, 248, 242, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  cursor: grab;
  outline: none;
  touch-action: none;
}

.derivation-figure:active {
  cursor: grabbing;
}

.derivation-figure:focus-visible {
  box-shadow:
    inset 0 0 0 3px rgba(47, 111, 115, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.projection-space-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.36fr) minmax(0, 0.64fr);
  gap: 16px;
  margin-top: 18px;
  border-top: 1px solid #ded6ca;
  padding-top: 18px;
}

.projection-space-copy p:not(.derivation-title) {
  margin: 12px 0 0;
  color: #535b5c;
  font-size: 14px;
  line-height: 1.75;
}

#projection-space-canvas {
  display: block;
  width: 100%;
  height: clamp(300px, 25vw, 360px);
  border: 1px solid rgba(128, 139, 133, 0.3);
  border-radius: 6px;
  background: rgba(250, 248, 242, 0.8);
  cursor: grab;
  outline: none;
  touch-action: none;
}

#projection-space-canvas:active {
  cursor: grabbing;
}

#projection-space-canvas:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(47, 111, 115, 0.22);
}

.math-overlay-host {
  position: relative;
}

.canvas-math-overlay {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.canvas-math-label {
  position: absolute;
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 253, 249, 0.42);
  text-shadow: 0 1px 0 rgba(255, 253, 249, 0.9);
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.canvas-math-label .katex {
  font-size: 13px;
  font-weight: 800;
}

.projection-canvas-overlay .canvas-math-label .katex {
  font-size: 15px;
}

.svd-canvas-overlay .canvas-math-label .katex {
  font-size: 14px;
}

.svd-canvas-overlay .canvas-math-label,
.svd-2d-canvas-overlay .canvas-math-label,
.svd-2d-relative-canvas-overlay .canvas-math-label,
.svd-space-canvas-overlay .canvas-math-label,
.svd-animation-canvas-overlay .canvas-math-label,
.svd-relative-animation-canvas-overlay .canvas-math-label {
  background: transparent;
  text-shadow:
    0 1px 0 rgba(255, 253, 249, 0.68),
    0 0 5px rgba(255, 253, 249, 0.42);
}

.explore-canvas-overlay {
  z-index: 1;
}

.explore-canvas-overlay .canvas-math-label {
  background: rgba(16, 21, 22, 0.44);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.explore-canvas-overlay .canvas-math-label .katex {
  font-size: 17px;
  font-weight: 850;
}

.formula-list div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid #ded6ca;
  padding-top: 12px;
}

.formula-list dt {
  color: #8b4f35;
  font-size: 13px;
  font-weight: 850;
}

.formula-list dd {
  margin: 0;
  color: #303638;
  line-height: 1.7;
}

.lab-panel {
  min-width: 0;
  border: 1px solid #cfc7bb;
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 18px 48px rgba(53, 55, 48, 0.1);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #ded6ca;
  padding: 18px 18px 14px;
}

.panel-head h3 {
  margin: 4px 0 0;
  color: #172226;
  font-size: 22px;
}

.icon-action,
.preset-actions button {
  display: inline-grid;
  width: 38px;
  min-width: 38px;
  place-items: center;
  padding: 0;
  font-size: 18px;
  font-weight: 850;
}

#projection-canvas,
#svd-canvas,
#graph-svg {
  display: block;
  width: 100%;
  background: #fbf8f2;
}

#projection-canvas,
#svd-canvas {
  aspect-ratio: 720 / 460;
  cursor: grab;
  outline: none;
  touch-action: none;
}

#projection-canvas:active,
#svd-canvas:active {
  cursor: grabbing;
}

#projection-canvas:focus-visible,
#svd-canvas:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(47, 111, 115, 0.32);
}

.lab-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #ded6ca;
  padding: 12px 18px;
}

.lab-actions button {
  min-height: 36px;
  border-color: #2f6f73;
  background: #eef6f2;
  color: #173f42;
  font-weight: 850;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid #ded6ca;
  padding: 16px 18px;
}

.vector-controls {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.control-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #5b6263;
  font-size: 13px;
  font-weight: 760;
}

input[type="range"] {
  width: 100%;
  accent-color: #2f6f73;
}

.preset-actions {
  display: inline-flex;
  gap: 8px;
}

.node-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid #ded6ca;
  padding: 14px 18px 6px;
}

.node-controls label {
  display: grid;
  gap: 6px;
  color: #5b6263;
  font-size: 12px;
  font-weight: 760;
  min-width: 0;
}

.energy-readout {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 10px 18px 18px;
}

.energy-readout span {
  color: #8b4f35;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.energy-readout strong {
  color: #172226;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.energy-readout small {
  color: #5b6263;
}

.concept-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.matrix-view-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.matrix-product-panel {
  grid-column: 1 / -1;
  margin-top: 10px;
  border: 1px solid #d1c8ba;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 253, 249, 0.96), rgba(238, 242, 237, 0.88)),
    #fffdf9;
  padding: 18px;
}

.matrix-product-copy {
  max-width: 980px;
}

.matrix-product-copy p:not(.derivation-title) {
  margin: 8px 0 0;
  color: #535b5c;
  font-size: 14.5px;
  line-height: 1.75;
}

.matrix-diagram-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.matrix-diagram {
  min-width: 0;
  border: 1px solid #ded6ca;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.78);
  padding: 14px;
}

.matrix-diagram .derivation-equation {
  margin: 0 0 10px;
  background: transparent;
  padding: 0 0 10px;
}

.matrix-diagram p {
  margin: 10px 0 0;
  color: #535b5c;
  font-size: 13.5px;
  line-height: 1.7;
}

.matrix-visual {
  display: block;
  width: 100%;
  aspect-ratio: 13 / 7.5;
  border: 1px solid rgba(139, 151, 146, 0.22);
  border-radius: 8px;
  background: #fffdf9;
}

.matrix-grid-line {
  fill: none;
  stroke: rgba(143, 153, 146, 0.16);
  stroke-width: 1;
}

.matrix-axis {
  fill: none;
  stroke: rgba(79, 91, 91, 0.55);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.matrix-column,
.matrix-result,
.matrix-x-vector {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.matrix-column {
  stroke-width: 4;
}

.matrix-column.ghost {
  opacity: 0.3;
  stroke-dasharray: 7 7;
  stroke-width: 2.5;
}

.matrix-column.coral,
.matrix-row-sensor.coral,
.matrix-measure-line.coral {
  stroke: #c65f3a;
}

.matrix-column.green,
.matrix-row-sensor.green,
.matrix-measure-line.green {
  stroke: #6f8e45;
}

.matrix-column.blue,
.matrix-row-sensor.blue,
.matrix-measure-line.blue {
  stroke: #2f6f73;
}

.matrix-result {
  stroke: #d7a735;
  stroke-width: 5;
}

.matrix-x-vector {
  stroke: #6b4fb3;
  stroke-width: 5;
}

.matrix-row-sensor {
  fill: none;
  opacity: 0.88;
  stroke-linecap: round;
  stroke-width: 4;
}

.matrix-measure-line {
  fill: none;
  opacity: 0.42;
  stroke-dasharray: 6 7;
  stroke-width: 2;
}

.matrix-svg-label,
.matrix-coeff-bars text,
.matrix-output-list text {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.matrix-svg-label.coral {
  fill: #a84d31;
}

.matrix-svg-label.green {
  fill: #5c7839;
}

.matrix-svg-label.blue {
  fill: #285f63;
}

.matrix-svg-label.input {
  fill: #5a4694;
}

.matrix-svg-label.result {
  fill: #8b6a1f;
}

.matrix-coeff-bars rect {
  fill: #2f6f73;
  opacity: 0.72;
}

.matrix-coeff-bars text,
.matrix-output-list text {
  fill: #4b5657;
  font-size: 14px;
}

.matrix-output-list path {
  fill: rgba(255, 253, 249, 0.72);
  stroke: rgba(79, 91, 91, 0.42);
  stroke-width: 2;
}

.coral-fill {
  fill: #c65f3a;
}

.green-fill {
  fill: #6f8e45;
}

.blue-fill {
  fill: #2f6f73;
}

.concept-board article,
.translation-card,
.svd-strip div {
  border: 1px solid #d1c8ba;
  border-radius: 8px;
  background: #fffdf9;
  padding: 20px;
}

.concept-board span:not(.math),
.svd-strip span:not(.math) {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: #8b4f35;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 23px;
  font-weight: 850;
}

.concept-board .math,
.svd-strip .math {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  color: #8b4f35;
}

.concept-board .math .katex,
.svd-strip .math .katex {
  font-size: 1.35em;
}

.concept-board strong,
.svd-strip b {
  display: block;
  margin-top: 12px;
  color: #172226;
  font-size: 19px;
}

.svd-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  border-top: 1px solid #ded6ca;
  padding: 14px 18px 18px;
}

.svd-strip div {
  min-height: 112px;
  background:
    linear-gradient(145deg, rgba(255, 253, 249, 0.98), rgba(234, 241, 236, 0.92)),
    #fffdf9;
}

.svd-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.svd-coordinate-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.svd-coordinate-note article {
  border: 1px solid #ddd4c5;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.76);
  padding: 14px;
}

.svd-coordinate-note strong {
  display: block;
  color: #172226;
}

.svd-coordinate-note p {
  margin: 8px 0 0;
  color: #535b5c;
  font-size: 13.5px;
  line-height: 1.7;
}

.svd-animation-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 0.66fr);
  gap: 16px;
  margin-top: 18px;
  border-top: 1px solid #ded6ca;
  padding-top: 18px;
}

.svd-animation-copy p:not(.derivation-title) {
  margin: 12px 0 0;
  color: #535b5c;
  font-size: 14px;
  line-height: 1.75;
}

.svd-2d-panel,
.svd-space-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 0.66fr);
  gap: 16px;
  margin-top: 18px;
  border-top: 1px solid #ded6ca;
  padding-top: 18px;
}

.svd-2d-copy p:not(.derivation-title),
.svd-space-copy p:not(.derivation-title) {
  margin: 12px 0 0;
  color: #535b5c;
  font-size: 14px;
  line-height: 1.75;
}

.svd-2d-stage,
.svd-space-stage {
  min-width: 0;
}

#svd-2d-canvas,
#svd-2d-relative-canvas,
#svd-space-canvas {
  display: block;
  width: 100%;
  height: clamp(260px, 23vw, 340px);
  border: 1px solid rgba(128, 139, 133, 0.3);
  border-radius: 6px;
  background: rgba(250, 248, 242, 0.8);
}

#svd-space-canvas {
  cursor: grab;
  outline: none;
  touch-action: none;
}

#svd-space-canvas:active {
  cursor: grabbing;
}

#svd-space-canvas:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(47, 111, 115, 0.22);
}

.svd-2d-views {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.svd-2d-views figure {
  min-width: 0;
  margin: 0;
}

.svd-2d-views figcaption {
  margin: 0 0 5px;
  color: #596364;
  font-size: 11px;
  font-weight: 800;
}

.svd-animation-stage {
  min-width: 0;
}

.svd-animation-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.svd-animation-toolbar strong {
  margin-left: 4px;
  color: #172226;
  font-size: 13.5px;
}

.svd-animation-views {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.svd-animation-views figure {
  min-width: 0;
  margin: 0;
}

.svd-animation-views figcaption {
  margin: 0 0 5px;
  color: #596364;
  font-size: 11px;
  font-weight: 800;
}

.svd-animation-canvas {
  display: block;
  width: 100%;
  height: clamp(260px, 23vw, 340px);
  border: 1px solid rgba(128, 139, 133, 0.3);
  border-radius: 6px;
  background: rgba(250, 248, 242, 0.8);
  cursor: grab;
  outline: none;
  touch-action: none;
}

.svd-animation-canvas:active {
  cursor: grabbing;
}

.svd-animation-canvas:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(47, 111, 115, 0.22);
}

.svd-animation-scrub {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  color: #596364;
  font-size: 12px;
  font-weight: 800;
}

.svd-rectangular-equation {
  margin-top: 18px;
}

.svd-rectangular-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.svd-rectangular-note article {
  border: 1px solid #ddd4c5;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.76);
  padding: 14px;
}

.svd-rectangular-note strong {
  display: block;
  color: #172226;
}

.svd-rectangular-note p {
  margin: 8px 0 0;
  color: #535b5c;
  font-size: 13.5px;
  line-height: 1.7;
}

.section-title {
  max-width: 720px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.translation-card {
  min-height: 190px;
}

.translation-card h3 {
  margin: 12px 0;
  color: #172226;
  font-size: 22px;
}

.translation-card p {
  margin-bottom: 0;
}

.explore-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #101516;
  color: #fffdf9;
}

.explore-shell[hidden] {
  display: none;
}

#explore-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #101516;
}

.explore-hud,
.explore-toolbar,
.explore-center {
  position: absolute;
  z-index: 2;
}

.explore-hud {
  top: 18px;
  left: 18px;
  display: flex;
  max-width: min(760px, calc(100vw - 36px));
  align-items: flex-start;
  gap: 22px;
  border: 1px solid rgba(255, 253, 249, 0.18);
  border-radius: 8px;
  background: rgba(16, 21, 22, 0.62);
  padding: 14px 16px;
  backdrop-filter: blur(10px);
}

.explore-hud strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.explore-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #d9e2df;
  font-size: 12px;
  font-weight: 760;
}

.explore-readout span {
  border: 1px solid rgba(255, 253, 249, 0.16);
  border-radius: 999px;
  padding: 5px 8px;
}

.explore-center {
  top: 50%;
  left: 50%;
  width: min(360px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  text-align: center;
}

.explore-center button {
  min-height: 44px;
  border-color: #d7a735;
  background: #fffdf9;
  color: #172226;
  font-weight: 850;
  padding-inline: 18px;
}

.explore-center p {
  margin: 12px 0 0;
  color: #d9e2df;
  font-size: 13px;
  line-height: 1.7;
}

.explore-toolbar {
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
}

.explore-toolbar button {
  border-color: rgba(255, 253, 249, 0.22);
  background: rgba(255, 253, 249, 0.1);
  color: #fffdf9;
  font-weight: 800;
  padding-inline: 14px;
}

@media (max-width: 1080px) {
  .hero,
  .lesson-section.interactive,
  .lesson-section.compact {
    grid-template-columns: 1fr;
  }

  #projection {
    grid-template-columns: 1fr;
  }

  .derivation-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: auto;
  }

  .translation-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .chapter-nav {
    position: static;
    flex-direction: row;
    height: auto;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #d8d0c4;
  }

  .chapter-nav a {
    flex: 0 0 auto;
  }

  .card-grid,
  .concept-board,
  .matrix-diagram-grid,
  .projection-space-panel,
  .svd-coordinate-note,
  .svd-2d-panel,
  .svd-2d-views,
  .svd-space-panel,
  .svd-animation-panel,
  .svd-rectangular-note {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projection-space-copy,
  #projection-space-canvas,
  .svd-2d-copy,
  .svd-2d-stage,
  .svd-space-copy,
  .svd-space-stage,
  .svd-animation-copy,
  .svd-animation-stage {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 34px 18px 24px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-panel {
    min-height: 300px;
  }

  .hero-network {
    min-height: 300px;
  }

  .translation-strip,
  .card-grid,
  .concept-board,
  .matrix-diagram-grid,
  .derivation-steps,
  .projection-space-panel,
  .svd-coordinate-note,
  .svd-2d-panel,
  .svd-space-panel,
  .svd-animation-panel,
  .svd-animation-views,
  .svd-strip,
  .svd-rectangular-note,
  .control-grid,
  .node-controls {
    grid-template-columns: 1fr;
  }

  .lesson-section {
    padding: 34px 18px;
  }

  .formula-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .derivation-steps article {
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .derivation-steps p {
    grid-column: 1 / -1;
    height: auto;
  }

  .derivation-figure {
    grid-column: 1 / -1;
    height: 210px;
  }

  .energy-readout {
    grid-template-columns: 1fr;
  }
}
