:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --ink: #171717;
  --muted: #6f6b61;
  --line: #ded9cc;
  --panel: #fffdf8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warm: #d9a441;
  --bad: #b85c38;
  --sci-fi: #0f766e;
  --action: #b85c38;
  --comedy: #d9a441;
  --romance: #7c3aed;
  --shadow: 0 18px 60px rgba(24, 22, 18, 0.11);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), transparent 34%),
    linear-gradient(260deg, rgba(217, 164, 65, 0.14), transparent 28%),
    var(--bg);
  color: var(--ink);
}

button {
  font: inherit;
}

.target-user-name {
  font-weight: 900;
}

.app-shell {
  min-height: 100svh;
  padding: 22px;
}

.workspace {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100svh - 44px);
}

.workspace.has-side-inspector {
  grid-template-columns: 168px minmax(0, 1fr) 280px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 4px;
}

.eyebrow,
.step-count {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 5vw, 72px);
  line-height: 1;
  letter-spacing: 0;
  max-width: none;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.playback-controls {
  display: grid;
  grid-template-columns: 40px minmax(88px, max-content) 40px;
  gap: 8px;
  align-items: center;
}

.k-control {
  display: inline-grid;
  grid-template-columns: auto repeat(6, 32px);
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 5px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.13), rgba(15, 118, 110, 0.05)),
    rgba(255, 253, 248, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 253, 248, 0.72), 0 8px 28px rgba(15, 118, 110, 0.12);
}

.k-label {
  padding: 0 7px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.k-choice {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 820;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.k-choice:hover,
.k-choice:focus-visible {
  color: var(--accent-strong);
  transform: translateY(-1px);
  outline: 0;
}

.k-choice.is-active {
  background: var(--accent);
  color: white;
}

.icon-button,
.primary-button {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
  height: 40px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-button {
  width: 40px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.primary-button {
  min-width: 88px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 760;
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.icon-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.step-rail,
.inspector {
  align-self: stretch;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.step-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.step-tab span {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.step-tab:hover,
.step-tab.is-active {
  background: rgba(255, 253, 248, 0.74);
  color: var(--ink);
  transform: translateX(2px);
}

.stage {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.stage-copy {
  min-height: 178px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  animation: copyIn 520ms ease both;
}

.stage-copy p:last-child {
  max-width: none;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.visual-plane {
  position: relative;
  overflow: visible;
  min-height: 0;
  padding: 26px;
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow);
}

.stage-note {
  display: grid;
  gap: 6px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  animation: copyIn 520ms ease both;
}

.stage-note h3 {
  margin-bottom: 0;
  color: var(--ink);
}

.stage-note p {
  max-width: none;
  width: 100%;
  margin-bottom: 0;
  line-height: 1.55;
}

.inspector {
  color: var(--muted);
}

.metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.metric-row strong {
  color: var(--ink);
  font-size: 22px;
}

.divider {
  height: 28px;
}

.inspector p {
  color: var(--muted);
  line-height: 1.55;
}

.matrix-wrap {
  position: relative;
  inset: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  animation: planeIn 520ms ease both;
}

.matrix-wrap.embedded {
  position: static;
  inset: auto;
  min-width: 0;
  overflow-x: auto;
}

.matrix-wrap.wide {
  gap: 10px;
}

.matrix-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.matrix-grid {
  display: grid;
  gap: 5px;
  width: max-content;
  min-width: 100%;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: 5px;
  background: white;
  color: var(--ink);
  font-size: clamp(10px, 1.05vw, 14px);
  font-weight: 720;
  overflow: hidden;
  min-width: 0;
  transition: transform 260ms ease, background 260ms ease, color 260ms ease;
}

.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cell-color, transparent);
  opacity: var(--cell-opacity, 0);
  transition: opacity 260ms ease;
}

.cell span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.movie-header,
.user-header {
  min-height: 50px;
  background: rgba(255, 253, 248, 0.94);
}

.movie-header {
  border-top: 4px solid var(--category-color);
}

.movie-header span,
.user-header span {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 100%;
  line-height: 1.05;
  text-align: center;
}

.movie-header b,
.user-header b {
  font-size: 10px;
  font-weight: 860;
  color: var(--category-color, var(--accent-strong));
  text-transform: uppercase;
}

.movie-header em,
.user-header em {
  color: var(--ink);
  max-width: 100%;
  font-size: clamp(8px, 1.2vw, 11px);
  font-style: normal;
  font-weight: 760;
  line-height: 1.05;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
}

.user-header em {
  color: var(--muted);
  font-size: 10px;
}

.category-sci-fi {
  --category-color: var(--sci-fi);
}

.category-action {
  --category-color: var(--action);
}

.category-comedy {
  --category-color: var(--comedy);
}

.category-romance {
  --category-color: var(--romance);
}

.matrix-wrap.wide .cell {
  min-height: 28px;
  font-size: 10px;
}

.matrix-wrap.wide .movie-header em {
  font-size: clamp(7px, 0.95vw, 9px);
}

.cell.missing {
  color: rgba(23, 23, 23, 0.28);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(23, 23, 23, 0.035) 0,
      rgba(23, 23, 23, 0.035) 7px,
      transparent 7px,
      transparent 15px
    ),
    white;
}

.cell.implicit-zero {
  color: rgba(23, 23, 23, 0.36);
  background: rgba(23, 23, 23, 0.045);
  border-style: dashed;
}

.cell.known {
  --cell-color: var(--accent);
}

.cell.residual-positive {
  --cell-color: var(--accent);
}

.cell.residual-negative {
  --cell-color: var(--bad);
}

.cell.recommendation {
  outline: 2px solid var(--warm);
  transform: translateY(-3px);
}

.cell.target-user-cell {
  border-color: rgba(217, 164, 65, 0.72);
  background: rgba(217, 164, 65, 0.1);
  box-shadow: inset 0 0 0 1px rgba(217, 164, 65, 0.26);
}

.cell.target-user-cell::before {
  background: linear-gradient(135deg, rgba(217, 164, 65, 0.28), rgba(15, 118, 110, 0.14));
  opacity: 0.85;
}

.cell.target-user-header {
  color: var(--accent-strong);
}

.matrix-scene,
.editable-matrix-scene {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.rating-editor {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.rating-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.rating-editor-head div {
  display: grid;
  gap: 3px;
}

.rating-editor-head strong {
  font-size: 15px;
}

.rating-editor-head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.reset-ratings {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.reset-ratings:hover,
.reset-ratings:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.rating-control {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(222, 217, 204, 0.8);
}

.rating-movie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.rating-category-tag,
.rank-category {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  border-radius: 999px;
  background: color-mix(in srgb, var(--category-color) 14%, white);
  color: var(--category-color);
  font-size: 10px;
  font-weight: 860;
  line-height: 1;
  text-transform: uppercase;
}

.rating-category-tag {
  padding: 4px 7px;
}

.rank-category {
  margin-left: 7px;
  padding: 4px 6px;
  vertical-align: middle;
}

.rating-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.rating-choice,
.rating-clear {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(23, 23, 23, 0.1);
  border-radius: 5px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.rating-choice:hover,
.rating-choice:focus-visible,
.rating-clear:hover,
.rating-clear:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.rating-choice.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.rating-clear {
  font-size: 11px;
  line-height: 1;
  padding: 0;
  text-align: center;
  white-space: nowrap;
}

.rating-clear.is-active {
  border-color: var(--warm);
  background: rgba(217, 164, 65, 0.18);
  color: #7a560c;
}

.sparse-map {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  align-items: start;
  align-content: start;
  gap: 30px;
  animation: planeIn 520ms ease both;
}

.coordinate-list {
  max-height: 340px;
  overflow: auto;
  border-left: 1px solid var(--line);
  padding-left: 18px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
}

.dot-field {
  position: relative;
  aspect-ratio: 1.25 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 6) calc(100% / 5);
}

.dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%) scale(0);
  animation: dotIn 520ms ease forwards;
  animation-delay: var(--delay);
}

.svd-origin-scene,
.svd-story-scene,
.coordinate-origin-scene,
.movie-coordinate-scene {
  display: grid;
  align-items: start;
  align-content: start;
  gap: 24px;
  animation: planeIn 520ms ease both;
}

.svd-origin-scene {
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1fr) minmax(220px, 0.8fr);
}

.energy-concept-scene,
.k-choice-scene {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
  align-items: start;
  align-content: start;
  gap: 28px;
  animation: planeIn 520ms ease both;
}

.energy-conversion-panel,
.factor-percent-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.energy-concept-scene > .factor-percent-panel:last-child {
  grid-column: 1 / -1;
}

.svd-story-scene {
  gap: 18px;
}

.svd-machine {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.svd-machine > div {
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 128px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.svd-machine span,
.svd-story-panel span,
.k-choice-explainer span,
.k-choice-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.svd-machine strong {
  color: var(--ink);
  font-size: clamp(23px, 3vw, 38px);
  line-height: 1;
}

.svd-machine-core {
  background: rgba(15, 118, 110, 0.06);
}

.svd-machine-core strong {
  color: var(--accent-strong);
}

.svd-machine p,
.svd-story-panel p,
.k-choice-explainer p,
.k-choice-main p,
.k-choice-result p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.svd-story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.svd-story-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}

.svd-story-panel strong {
  color: var(--ink);
  font-size: clamp(19px, 2vw, 28px);
  line-height: 1.1;
}

.svd-big-number {
  color: var(--accent-strong);
  font-size: clamp(38px, 7vw, 86px);
  line-height: 0.95;
}

.k-choice-explainer {
  display: grid;
  gap: 14px;
}

.k-choice-explainer > div,
.k-choice-result {
  display: grid;
  gap: 7px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.k-choice-explainer strong,
.k-choice-result strong {
  color: var(--accent-strong);
  font-size: clamp(21px, 2.7vw, 32px);
  line-height: 1.1;
}

.k-choice-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.svd-strength-list,
.user-coordinate-mini,
.movie-factor-rows {
  display: grid;
  gap: 8px;
}

.svd-strength-row,
.user-coordinate-mini div,
.movie-factor-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) minmax(62px, 0.55fr) minmax(74px, 0.7fr);
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.svd-strength-row span,
.svd-strength-row em,
.user-coordinate-mini span,
.movie-factor-row span,
.movie-factor-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
}

.svd-strength-row strong,
.user-coordinate-mini strong,
.movie-factor-row strong {
  color: var(--ink);
  font-size: 17px;
  text-align: right;
}

.svd-strength-row.is-kept strong,
.svd-strength-row.is-kept em,
.movie-factor-row strong {
  color: var(--accent-strong);
}

.factor-vector-mini {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.factor-vector-mini div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(78px, auto);
}

.factor-vector-mini.is-scrollable {
  max-height: 292px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.45) transparent;
}

.factor-vector-mini.is-scrollable div:first-child {
  position: sticky;
  top: 0;
  z-index: 2;
}

.factor-vector-mini span,
.factor-vector-mini strong {
  min-height: 34px;
  display: grid;
  align-items: center;
  padding: 7px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.factor-vector-mini.is-compact span,
.factor-vector-mini.is-compact strong {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
}

.factor-vector-mini span {
  color: var(--muted);
}

.factor-vector-mini strong {
  justify-items: end;
  color: var(--ink);
}

.factor-vector-mini div:first-child span,
.factor-vector-mini div:first-child strong {
  background: rgba(15, 118, 110, 0.06);
  font-weight: 820;
}

.factor-vector-mini div.is-target span,
.factor-vector-mini div.is-target strong {
  color: var(--accent-strong);
  font-weight: 850;
}

.factor-vector-mini div.is-pending strong {
  justify-items: center;
  color: rgba(23, 23, 23, 0.42);
}

.factor-vector-mini div.is-pending.is-target strong {
  color: var(--accent-strong);
}

.factor-line-card {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.factor-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.factor-line-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.1;
  text-transform: uppercase;
}

.factor-line-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.factor-line-controls button {
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.factor-line-controls button:hover {
  border-color: rgba(15, 118, 110, 0.34);
  color: var(--accent-strong);
}

.factor-line-viewport {
  position: relative;
  min-height: 166px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  background: rgba(15, 118, 110, 0.035);
  cursor: grab;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.45) transparent;
}

.factor-line-viewport:active {
  cursor: grabbing;
}

.factor-line-track {
  position: relative;
  width: 760px;
  min-width: 100%;
  height: 148px;
}

.factor-line-axis {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 75px;
  height: 2px;
  background: linear-gradient(90deg, rgba(117, 110, 99, 0.28), rgba(15, 118, 110, 0.68));
}

.factor-line-zero {
  position: absolute;
  left: 50%;
  top: 65px;
  width: 1px;
  height: 20px;
  background: var(--line);
}

.factor-line-axis span {
  position: absolute;
  top: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.factor-line-axis span:first-child {
  left: 0;
}

.factor-line-axis span:last-child {
  right: 0;
}

.factor-line-point {
  position: absolute;
  left: calc(28px + (100% - 56px) * var(--x));
  top: 75px;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.factor-line-point i {
  position: absolute;
  left: 50%;
  top: -5px;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.factor-line-point.is-negative i {
  background: #756e63;
  box-shadow: 0 0 0 4px rgba(117, 110, 99, 0.12);
}

.factor-line-point b,
.factor-line-point em {
  position: absolute;
  left: 50%;
  display: block;
  width: 104px;
  opacity: 0;
  transform: translateX(-50%);
  font-style: normal;
  line-height: 1.1;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.factor-line-point:hover b,
.factor-line-point:hover em,
.factor-line-point:focus-visible b,
.factor-line-point:focus-visible em,
.factor-line-point.is-anchor b,
.factor-line-point.is-anchor em {
  opacity: 1;
}

.factor-line-point b {
  color: var(--ink);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.factor-line-point em {
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
}

.factor-line-point.is-top b {
  bottom: 15px;
}

.factor-line-point.is-top em {
  bottom: 3px;
}

.factor-line-point.is-bottom b {
  top: 15px;
}

.factor-line-point.is-bottom em {
  top: 28px;
}

.coordinate-origin-scene {
  grid-template-columns: minmax(280px, 1fr) auto minmax(320px, 1.1fr);
}

.movie-coordinate-scene {
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
}

.user-coordinate-scene {
  grid-template-columns: minmax(420px, 1.2fr) minmax(300px, 0.8fr);
}

.factor-source-scene {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  align-items: start;
  gap: 28px;
  animation: planeIn 520ms ease both;
}

.factor-source-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.factor-flow {
  display: grid;
  gap: 10px;
}

.factor-flow div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.factor-flow span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 850;
}

.factor-flow strong {
  font-size: 15px;
}

.factor-flow p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.singular-value-card,
.energy-equation {
  display: grid;
  gap: 6px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.singular-value-card span,
.energy-equation span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.singular-value-card strong,
.energy-equation strong {
  color: var(--accent-strong);
  font-size: 21px;
  line-height: 1.15;
}

.singular-value-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.energy-equation b {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.energy-equation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.energy-equation-grid div {
  display: grid;
  gap: 7px;
  min-height: 112px;
  align-content: start;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.energy-equation-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.25;
  text-transform: uppercase;
}

.energy-equation-grid strong {
  color: var(--ink);
  font-size: clamp(18px, 2vw, 27px);
  line-height: 1.1;
}

.energy-equation-grid .is-result strong {
  color: var(--accent-strong);
  font-size: clamp(26px, 3vw, 40px);
}

.factor-source-table {
  display: grid;
  grid-template-columns: minmax(70px, 0.8fr) minmax(94px, 1fr) minmax(80px, 0.9fr) minmax(94px, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  overflow: hidden;
}

.factor-source-table > span,
.factor-source-row > * {
  min-height: 42px;
  display: grid;
  align-items: center;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.factor-source-table > span {
  background: rgba(15, 118, 110, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.factor-source-row {
  display: contents;
}

.factor-source-row span,
.factor-source-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.factor-source-row strong,
.factor-source-row b {
  color: var(--ink);
  font-size: 16px;
}

.factor-source-row.is-kept strong,
.factor-source-row.is-kept b {
  color: var(--accent-strong);
}

.origin-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.origin-panel:has(.info-preview:hover),
.origin-panel:has(.info-preview:focus-within) {
  z-index: 60;
}

.origin-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.axis-list {
  display: grid;
  gap: 12px;
}

.energy-list {
  display: grid;
  gap: 0;
  align-content: start;
}

.factor-percent-list {
  display: grid;
  gap: 8px;
}

.energy-row {
  display: grid;
  grid-template-columns: 54px 78px minmax(68px, auto);
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 7px 0 8px;
  border-top: 1px solid var(--line);
}

.energy-row span,
.energy-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
}

.energy-row strong {
  color: var(--ink);
  font-size: clamp(18px, 1.6vw, 25px);
  line-height: 1;
  text-align: right;
}

.energy-row.is-kept strong,
.energy-row.is-kept em {
  color: var(--accent-strong);
}

.energy-row.is-before-target strong,
.energy-row.is-before-target em {
  color: #6f6240;
}

.energy-row.is-target strong,
.energy-row.is-target em {
  color: #8a5c00;
}

.energy-row.is-comparison strong,
.energy-row.is-comparison em {
  color: var(--muted);
}

.energy-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: rgba(15, 118, 110, 0.13);
  border-radius: 999px;
  overflow: hidden;
}

.energy-bar span {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.energy-row.is-target .energy-bar span {
  background: var(--warm);
}

.energy-row.is-before-target .energy-bar span {
  background: #a99a73;
}

.energy-row.is-comparison .energy-bar span {
  background: #9a9488;
}

.axis-row {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) 62px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  animation: slideUp 440ms ease both;
  animation-delay: var(--delay);
}

.axis-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.axis-row strong {
  color: var(--ink);
  font-size: 18px;
  text-align: right;
}

.axis-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.axis-bar {
  grid-column: 1 / -1;
  height: 8px;
  background: rgba(15, 118, 110, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.axis-bar span {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.factor-percent-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.8fr) minmax(58px, 0.55fr) minmax(92px, 0.8fr) minmax(60px, 0.5fr);
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  animation: slideUp 440ms ease both;
  animation-delay: var(--delay);
}

.factor-percent-row span,
.factor-percent-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
}

.factor-percent-row strong,
.factor-percent-row b {
  color: var(--ink);
  font-size: 17px;
  text-align: right;
}

.factor-percent-row b {
  color: var(--accent-strong);
}

.factor-percent-row .axis-bar {
  grid-column: 1 / -1;
}

.coordinate-arrow {
  color: var(--muted);
  font-size: 34px;
  line-height: 1;
  padding-top: 58px;
}

.factor-label {
  color: var(--muted);
  font-size: 13px;
}

.inline-source-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 4px;
}

.inline-source-preview > strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.factor-explainer {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.factor-coordinate-rows {
  display: grid;
  gap: 7px;
}

.factor-coordinate-rows div {
  display: grid;
  grid-template-columns: 64px minmax(50px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.factor-coordinate-rows span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.factor-coordinate-rows strong {
  color: var(--accent-strong);
  font-size: 17px;
}

.factor-coordinate-rows em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.user-factor-dot {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.user-factor-dot p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.dot-product-table {
  display: grid;
  grid-template-columns: minmax(116px, 1fr) minmax(64px, 0.58fr) minmax(80px, 0.7fr) minmax(78px, 0.68fr);
  max-height: 420px;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.dot-product-table > span,
.dot-product-row > * {
  min-height: 34px;
  display: grid;
  align-items: center;
  padding: 7px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.dot-product-table > span {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--panel) 93%, var(--accent));
  color: var(--muted);
  font-weight: 820;
}

.dot-product-row {
  display: contents;
}

.dot-product-row span {
  color: var(--muted);
}

.dot-product-row strong,
.dot-product-row b {
  justify-items: end;
  color: var(--ink);
}

.dot-product-row b {
  color: var(--accent-strong);
}

.dot-product-row.is-implicit strong:first-of-type {
  color: rgba(23, 23, 23, 0.38);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(23, 23, 23, 0.035) 0,
      rgba(23, 23, 23, 0.035) 6px,
      transparent 6px,
      transparent 12px
    ),
    white;
}

.coordinate-sum {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.coordinate-sum span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.coordinate-sum strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.preference-map-scene {
  display: grid;
  grid-template-columns: minmax(260px, 0.52fr) minmax(420px, 1fr);
  gap: 24px;
  align-items: stretch;
  animation: planeIn 520ms ease both;
}

.map-explainer {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.map-explainer > strong,
.map-switch-scene strong {
  font-size: 18px;
}

.map-explainer p,
.map-switch-scene p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding-top: 6px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.map-legend b {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-user {
  background: var(--accent);
}

.legend-movie {
  background: var(--warm);
}

.legend-movie.category-sci-fi,
.legend-movie.category-action,
.legend-movie.category-comedy,
.legend-movie.category-romance {
  background: var(--category-color);
}

.legend-you {
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.map-toolbar button {
  min-width: 34px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-weight: 820;
}

.map-toolbar button:hover,
.map-toolbar button:focus-visible {
  border-color: rgba(15, 118, 110, 0.38);
  color: var(--accent-strong);
  outline: 0;
}

.map-toolbar strong {
  min-width: 48px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.map-toggle-button {
  width: auto !important;
  padding: 0 12px;
  color: var(--accent-strong) !important;
}

.map-toggle-button.is-active {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: white !important;
}

.map-comparison-summary {
  display: grid;
  gap: 7px;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.07);
  color: var(--muted);
  font-size: 12px !important;
}

.map-comparison-summary p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  margin: 0;
}

.map-comparison-summary p > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.map-comparison-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.map-comparison-summary em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.map-comparison-summary small {
  padding-top: 6px;
  border-top: 1px solid rgba(15, 118, 110, 0.14);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.map-hint {
  max-width: 280px;
}

.map-guide {
  display: grid;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.map-guide > strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 860;
}

.map-user-row {
  display: grid;
  grid-template-columns: 46px minmax(92px, auto) minmax(0, 1fr);
  gap: 7px;
  align-items: baseline;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.map-user-row strong {
  color: var(--ink);
  font-size: 12px;
}

.map-user-row span {
  color: var(--accent-strong);
  font-weight: 790;
}

.map-user-row em {
  font-style: normal;
}

.map-user-row.is-you {
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.09);
}

.map-category-row {
  display: grid;
  grid-template-columns: 11px 68px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.map-category-row b {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--category-color);
}

.map-category-row strong {
  color: var(--ink);
  font-size: 12px;
}

.map-movie-guide {
  max-height: 238px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.45) transparent;
}

.map-movie-guide > strong {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 2px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.map-movie-row {
  display: grid;
  grid-template-columns: 11px minmax(82px, 1fr) minmax(54px, auto) minmax(48px, auto);
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.map-movie-row b {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--category-color);
}

.map-movie-row strong {
  color: var(--ink);
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-movie-row span {
  color: var(--muted);
  font-weight: 760;
}

.map-movie-row em {
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 780;
}

.map-movie-row.is-target {
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(184, 92, 56, 0.09);
}

.preference-map {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.comparison-link-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.comparison-link-layer.is-visible,
.preference-map.is-showing-comparison .comparison-link-layer {
  opacity: 1;
}

.comparison-link-layer line {
  stroke: var(--accent-strong);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 8 7;
  filter: drop-shadow(0 2px 4px rgba(15, 118, 110, 0.24));
}

.comparison-link-layer .recommended-link {
  stroke: var(--warm);
  stroke-dasharray: none;
}

.preference-map.is-dragging {
  cursor: grabbing;
}

.map-layer {
  position: absolute;
  inset: 0;
  transform: translate(var(--map-pan-x, 0), var(--map-pan-y, 0)) scale(var(--map-scale, 1));
  transform-origin: center;
  transition: none;
  pointer-events: none;
}

.map-axis {
  position: absolute;
  z-index: 1;
  background: rgba(111, 107, 97, 0.58);
}

.x-axis {
  top: 50%;
  left: 2%;
  right: 2%;
  height: 1px;
}

.y-axis {
  top: 2%;
  bottom: 2%;
  left: 50%;
  width: 1px;
}

.axis-label {
  position: absolute;
  z-index: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.x-label {
  right: 16px;
  bottom: 12px;
}

.y-label {
  top: 14px;
  left: 14px;
}

.map-point {
  position: absolute;
  z-index: 4;
  left: var(--x);
  top: var(--y);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 253, 248, 0.92), 0 4px 14px rgba(24, 22, 18, 0.16);
  transform: translate(-50%, -50%);
  transition: none;
}

.preference-map.is-dragging .map-point {
  transition: none;
}

.map-point.movie {
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: var(--category-color, var(--warm));
  box-shadow: none;
}

.map-point.is-target.user {
  width: 18px;
  height: 18px;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.24), 0 6px 18px rgba(24, 22, 18, 0.22);
}

.map-point.is-target.movie {
  width: 10px;
  height: 10px;
  background: #b85c38;
  box-shadow: none;
}

.map-point.is-nearest.movie {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22);
}

.map-point.is-recommended.movie {
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.3);
}

.map-point.is-nearest.is-recommended.movie {
  box-shadow:
    0 0 0 3px rgba(15, 118, 110, 0.2),
    0 0 0 6px rgba(217, 164, 65, 0.24);
}

.map-point em {
  position: absolute;
  left: 50%;
  top: calc(100% + 5px);
  width: max-content;
  max-width: 132px;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--ink);
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.15;
  transform: translateX(-50%);
}

.map-point em b,
.map-point em small {
  display: block;
}

.map-point em small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 760;
}

.map-point.user em {
  color: var(--accent-strong);
}

.map-point.is-target.user em {
  color: var(--ink);
  font-size: 12px;
}

.map-switch-scene {
  display: grid;
  justify-items: start;
  gap: 18px;
  max-width: 680px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.84);
  animation: planeIn 520ms ease both;
}

.map-switch-button {
  min-width: 132px;
}

.with-info,
.matrix-title > span {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.info-preview {
  position: relative;
  z-index: 80;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.info-button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.9);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  cursor: help;
}

.info-button:hover,
.info-button:focus-visible {
  border-color: var(--accent);
  outline: 0;
}

.preview-popover {
  position: absolute;
  z-index: 90;
  top: calc(100% + 10px);
  left: 50%;
  display: none;
  gap: 10px;
  width: min(520px, 70vw);
  overflow-x: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  transform: translate(-50%, 6px);
}

.info-preview:hover .preview-popover,
.info-preview:focus-within .preview-popover {
  display: grid;
  transform: translate(-50%, 0);
}

.matrix-title .preview-popover {
  right: 0;
  left: auto;
  transform: translate(0, 6px);
}

.matrix-title .info-preview:hover .preview-popover,
.matrix-title .info-preview:focus-within .preview-popover {
  transform: translate(0, 0);
}

.svd-origin-scene .origin-panel:first-child .preview-popover,
.coordinate-origin-scene .origin-panel:first-child .preview-popover {
  right: auto;
  left: 0;
  transform: translate(0, 6px);
}

.svd-origin-scene .origin-panel:first-child .info-preview:hover .preview-popover,
.svd-origin-scene .origin-panel:first-child .info-preview:focus-within .preview-popover,
.coordinate-origin-scene .origin-panel:first-child .info-preview:hover .preview-popover,
.coordinate-origin-scene .origin-panel:first-child .info-preview:focus-within .preview-popover {
  transform: translate(0, 0);
}

.preview-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.mini-matrix-preview,
.coordinate-preview {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.mini-matrix-cell,
.coordinate-preview > * {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.mini-matrix-cell.is-header,
.coordinate-preview strong {
  background: rgba(15, 118, 110, 0.06);
  color: var(--muted);
  font-size: 11px;
}

.mini-matrix-cell.is-implicit {
  color: rgba(23, 23, 23, 0.38);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(23, 23, 23, 0.035) 0,
      rgba(23, 23, 23, 0.035) 6px,
      transparent 6px,
      transparent 12px
    ),
    white;
}

.coordinate-preview {
  grid-template-columns: 96px repeat(2, minmax(82px, 1fr));
}

.coordinate-preview span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.coordinate-preview b {
  font-size: 17px;
}

.vector-preview,
.hidden-factor-preview {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(54px, auto);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.hidden-factor-preview {
  grid-template-columns: minmax(88px, 0.8fr) minmax(58px, auto) minmax(130px, 1fr);
}

.vector-preview span,
.vector-preview strong,
.hidden-factor-preview span,
.hidden-factor-preview strong,
.hidden-factor-preview em {
  min-height: 34px;
  display: grid;
  align-items: center;
  padding: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.vector-preview span,
.hidden-factor-preview span,
.hidden-factor-preview em {
  color: var(--muted);
}

.hidden-factor-preview em {
  font-style: normal;
}

.vector-preview strong,
.hidden-factor-preview strong {
  justify-items: end;
  color: var(--ink);
}

.vector-preview strong.is-implicit {
  color: rgba(23, 23, 23, 0.38);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(23, 23, 23, 0.035) 0,
      rgba(23, 23, 23, 0.035) 6px,
      transparent 6px,
      transparent 12px
    ),
    white;
}

.recommend-scene {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  align-items: start;
  align-content: start;
  gap: 30px;
  animation: planeIn 520ms ease both;
}

.calculation-scene {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(260px, 0.9fr);
  align-items: start;
  align-content: start;
  gap: 24px;
  animation: planeIn 520ms ease both;
}

.calc-panel,
.mini-rank {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.calc-panel .matrix-title {
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.formula-stack {
  display: grid;
  gap: 6px;
}

.formula-line {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.formula-line span,
.column-list span,
.factor-table span {
  color: var(--muted);
  font-size: 13px;
}

.formula-line strong {
  font-size: clamp(16px, 1.7vw, 22px);
  line-height: 1.15;
}

.formula-line.emphasis strong {
  color: var(--accent-strong);
}

.dot-product-scene {
  grid-template-columns: minmax(420px, 1.2fr) minmax(280px, 0.8fr);
}

.dot-product-panel {
  gap: 14px;
}

.dot-intro {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dot-intro strong {
  font-size: 15px;
}

.dot-intro span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.factor-compare-grid {
  display: grid;
  grid-template-columns: minmax(86px, 0.7fr) repeat(3, minmax(92px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  overflow: hidden;
}

.factor-compare-grid > * {
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.factor-heading {
  justify-content: center;
  background: rgba(15, 118, 110, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-align: center;
}

.factor-label-cell {
  color: var(--muted);
  font-size: 13px;
}

.factor-value {
  justify-content: center;
  color: var(--ink);
  font-size: 17px;
  font-weight: 820;
  text-align: center;
}

.factor-product {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.15;
}

.factor-product span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
}

.factor-product b {
  color: var(--accent-strong);
  font-size: 18px;
}

.dot-formula-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.dot-formula-strip div {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 94px;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dot-formula-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.25;
}

.dot-formula-strip strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.dot-formula-strip .is-final strong {
  color: var(--accent-strong);
}

.dot-summary {
  gap: 14px;
}

.dot-summary p {
  margin-bottom: 2px;
}

.dot-summary div {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.dot-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.dot-summary b {
  color: var(--ink);
  line-height: 1.3;
}

.column-list {
  display: grid;
  gap: 7px;
  max-height: 420px;
  overflow: auto;
}

.column-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.factor-table {
  display: grid;
  grid-template-columns: minmax(130px, 0.85fr) repeat(2, minmax(104px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  overflow: hidden;
}

.factor-table > * {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.factor-table > strong {
  justify-content: center;
  background: rgba(15, 118, 110, 0.06);
}

.factor-table b {
  justify-content: center;
  color: var(--ink);
  font-size: 18px;
}

.mini-rank {
  color: var(--muted);
  line-height: 1.55;
}

.target-user-panel {
  display: grid;
  gap: 16px;
}

.target-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.target-row .cell {
  min-height: 58px;
  text-align: center;
  line-height: 1.25;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: grid;
  grid-template-columns: 30px 1fr 56px;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  animation: slideUp 440ms ease both;
  animation-delay: var(--delay);
}

.rank-number {
  color: var(--accent-strong);
  font-weight: 850;
}

.rank-score {
  font-weight: 840;
}

.rank-bar {
  grid-column: 2 / -1;
  height: 7px;
  background: rgba(15, 118, 110, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.rank-bar span {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

@keyframes copyIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes planeIn {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dotIn {
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1040px) {
  .workspace,
  .workspace.has-side-inspector {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .step-rail {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .step-tab {
    min-width: 126px;
  }

  .inspector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .inspector .divider,
  .inspector h3,
  .inspector p {
    grid-column: 1 / -1;
  }

  .sparse-map,
  .calculation-scene,
  .recommend-scene {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .dot-product-scene {
    grid-template-columns: 1fr;
  }

  .svd-origin-scene,
  .energy-concept-scene,
  .k-choice-scene,
  .svd-story-scene,
  .svd-machine,
  .svd-story-grid,
  .coordinate-origin-scene,
  .movie-coordinate-scene,
  .factor-source-scene,
  .preference-map-scene {
    grid-template-columns: 1fr;
  }

  .coordinate-arrow {
    display: none;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .workspace {
    min-height: calc(100svh - 28px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    width: 100%;
    justify-content: flex-start;
  }

  .k-control {
    order: 2;
    grid-template-columns: auto repeat(6, minmax(28px, 1fr));
    width: 100%;
    border-radius: var(--radius);
  }

  .k-choice {
    width: auto;
  }

  .visual-plane {
    padding: 16px;
  }

  .preview-popover {
    width: min(280px, calc(100vw - 88px));
  }

  .factor-compare-grid {
    grid-template-columns: minmax(74px, 0.7fr) repeat(3, minmax(76px, 1fr));
  }

  .factor-compare-grid > * {
    min-height: 46px;
    padding: 8px;
  }

  .factor-coordinate-rows div {
    grid-template-columns: minmax(68px, 0.7fr) minmax(54px, 0.6fr);
  }

  .factor-coordinate-rows em {
    grid-column: 1 / -1;
  }

  .factor-value {
    font-size: 13px;
  }

  .factor-product b {
    font-size: 14px;
  }

  .dot-formula-strip {
    grid-template-columns: 1fr;
  }

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

  .factor-percent-row {
    grid-template-columns: minmax(64px, 0.8fr) minmax(48px, 0.55fr) minmax(78px, 0.8fr) minmax(54px, 0.5fr);
    gap: 8px;
  }

  .cell {
    min-height: 42px;
    font-size: 11px;
  }

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