:root {
  --ink: #f7f3ea;
  --paper: #090b0e;
  --panel: #15191f;
  --panel-2: #1f2530;
  --fog: #aab2bd;
  --muted: #6f7a86;
  --cyan: #69e7ff;
  --brass: #d7a84d;
  --garnet: #b94d63;
  --violet: #9b8cff;
  --green: #8bdc9f;
  --rose: #ff7c9a;
  --amber: #f0c35a;
  --blue: #7bb7ff;
  --line: rgba(247, 243, 234, 0.16);
  --plate-cut: polygon(0 0, calc(100% - 0.85rem) 0, 100% 0.85rem, 100% 100%, 0.85rem 100%, 0 calc(100% - 0.85rem));
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Inter", Arial, sans-serif;
}

button,
select,
textarea {
  font: inherit;
}

a,
button,
select,
textarea {
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 180ms ease, transform 180ms ease, opacity 160ms ease;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(155deg, transparent 0 48%, rgba(213, 168, 77, 0.08) 48.2% 48.35%, transparent 48.6% 100%),
    linear-gradient(104deg, transparent 0 30%, rgba(105, 231, 255, 0.08) 30.2% 30.38%, transparent 30.7% 100%),
    radial-gradient(circle at 72% 18%, rgba(105, 231, 255, 0.14), transparent 20rem),
    var(--paper);
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 34px, 44px 100%;
}

.demo-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.36fr);
  gap: 1px;
  width: min(100vw - 1.25rem, 1560px);
  height: min(100vh - 1.25rem, 980px);
  margin: 0.625rem auto;
  border: 1px solid rgba(105, 231, 255, 0.26);
  background: rgba(105, 231, 255, 0.22);
  clip-path: var(--plate-cut);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0.8rem clamp(0.9rem, 2vw, 1.5rem);
  background: rgba(13, 15, 18, 0.94);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  color: var(--cyan);
}

.brand-mark {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: Consolas, "SFMono-Regular", monospace;
  text-transform: uppercase;
  clip-path: var(--plate-cut);
  box-shadow: 0 0 1.2rem rgba(105, 231, 255, 0.22);
}

.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.brand small {
  display: block;
  color: var(--fog);
  font-size: 0.72rem;
}

.nav,
.segmented {
  min-width: 0;
}

.segmented {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  clip-path: var(--plate-cut);
}

.segmented button {
  min-height: 2.35rem;
  padding: 0 0.72rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--fog);
  cursor: pointer;
  white-space: nowrap;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button:hover,
.segmented button:focus-visible,
.segmented .is-active {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.presentation {
  position: relative;
  display: grid;
  grid-template-columns: minmax(20rem, 0.34fr) minmax(0, 1fr);
  gap: 1px;
  min-height: 0;
  overflow: hidden;
  background: rgba(105, 231, 255, 0.22);
}

.demo-frame.is-review-slide .review-window {
  border-left-color: rgba(105, 231, 255, 0.55);
}

.stage-copy {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: clamp(1rem, 2vw, 1.5rem);
  background:
    linear-gradient(150deg, rgba(213, 168, 77, 0.09), transparent 48%),
    rgba(13, 15, 18, 0.94);
}

.slide-progress {
  display: grid;
  gap: 0.38rem;
  margin-top: 1.2rem;
}

.slide-progress button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  min-height: 2.35rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--fog);
  cursor: pointer;
  text-align: left;
  clip-path: var(--plate-cut);
}

.slide-progress button:hover,
.slide-progress button:focus-visible,
.slide-progress .is-active {
  border-color: var(--cyan);
  background: rgba(105, 231, 255, 0.12);
  color: var(--ink);
  outline: none;
}

.slide-progress span {
  color: var(--brass);
  font-family: Consolas, "SFMono-Regular", monospace;
}

.slide-progress strong {
  overflow: hidden;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.74rem;
  font-weight: 400;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--brass);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

h1 {
  max-width: 16rem;
  font-size: clamp(2.25rem, 3.25vw, 3.25rem);
  line-height: 0.92;
  overflow-wrap: normal;
}

h1 span {
  display: block;
}

.stage-copy p:not(.kicker) {
  max-width: 31rem;
  color: var(--fog);
  font-size: clamp(0.92rem, 1.5vw, 1.1rem);
  line-height: 1.5;
}

.slide-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: rgba(247, 243, 234, 0.14);
}

.lecture-slide {
  position: relative;
  display: grid;
  min-height: 0;
  padding: clamp(0.85rem, 1.6vw, 1.35rem);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), transparent 65%),
    rgba(20, 24, 31, 0.95);
  opacity: 0;
  filter: saturate(0.55);
  animation: riseIn 520ms ease forwards;
}

.lecture-slide::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.25rem;
  background: linear-gradient(var(--cyan), var(--brass));
  opacity: 0.68;
}

.slide-label {
  color: var(--brass);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.lecture-slide h2 {
  display: block;
  max-width: 58rem;
  margin-top: 0.65rem;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 5.4rem);
  line-height: 0.98;
}

.lecture-slide p {
  max-width: 60rem;
  margin: 0.45rem 0 0;
  color: var(--fog);
  line-height: 1.42;
}

.message-slide {
  align-content: stretch;
  background:
    linear-gradient(110deg, rgba(105, 231, 255, 0.12), transparent 70%),
    rgba(20, 24, 31, 0.96);
}

.message-canvas {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1px;
  min-height: 0;
  margin-top: 0.85rem;
  border: 1px solid rgba(105, 231, 255, 0.3);
  background: rgba(105, 231, 255, 0.3);
  clip-path: var(--plate-cut);
}

.message-tabs {
  display: inline-flex;
  gap: 1px;
  background: rgba(105, 231, 255, 0.3);
}

.message-tabs button {
  min-height: 2.35rem;
  padding: 0 0.85rem;
  border: 0;
  background: rgba(9, 11, 14, 0.86);
  color: var(--fog);
  cursor: pointer;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.message-tabs button:hover,
.message-tabs button:focus-visible,
.message-tabs .is-active {
  background: rgba(105, 231, 255, 0.18);
  color: var(--ink);
  outline: none;
}

.message-panel {
  display: none;
  min-height: 0;
}

.message-panel.is-active {
  display: grid;
}

.message-panel[data-message-panel="message"] {
  grid-template-columns: minmax(13rem, 0.32fr) minmax(0, 1fr);
  gap: 1px;
}

.message-card {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-height: 22rem;
  padding: clamp(0.9rem, 1.6vw, 1.2rem);
  background: rgba(9, 11, 14, 0.76);
}

.message-card span {
  color: var(--cyan);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.message-card p {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Inter", Arial, sans-serif;
  font-size: clamp(0.98rem, 1.28vw, 1.24rem);
  font-weight: 500;
  line-height: 1.48;
  white-space: pre-wrap;
}

.message-translation {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.15rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(247, 243, 234, 0.14);
}

.message-translation > span {
  color: var(--brass);
}

.message-translation p {
  display: block;
  color: var(--fog);
  font-size: clamp(0.84rem, 1vw, 0.94rem);
  line-height: 1.35;
  white-space: normal;
}

.translation-part {
  cursor: pointer;
  white-space: normal;
}

.fragment-purpose-list {
  display: grid;
  align-content: start;
  gap: 0.42rem;
  min-height: 0;
  overflow: auto;
  padding: 0.7rem;
  background: rgba(20, 24, 31, 0.96);
}

.fragment-hover-prompt {
  padding: 0.55rem 0.65rem;
  border: 1px dashed rgba(247, 243, 234, 0.18);
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.purpose-chip {
  display: grid;
  gap: 0.35rem;
  max-height: 0;
  overflow: hidden;
  padding: 0 0.65rem;
  border: 0 solid var(--chip);
  background: color-mix(in srgb, var(--chip) 11%, transparent);
  color: var(--fog);
  cursor: default;
  text-align: left;
  clip-path: var(--plate-cut);
  opacity: 0;
  transform: translateX(-0.65rem);
  transition:
    max-height 260ms ease,
    opacity 220ms ease,
    padding 220ms ease,
    transform 220ms ease,
    border-width 220ms ease;
}

.purpose-chip.is-active {
  max-height: 8rem;
  padding: 0.58rem 0.65rem;
  border-width: 1px;
  opacity: 1;
  transform: translateX(0);
  box-shadow: inset 0 0 0 1px var(--chip), 0 0.8rem 1.8rem rgba(0, 0, 0, 0.24);
}

.purpose-chip strong {
  color: var(--chip);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.purpose-chip span {
  color: var(--fog);
  font-size: 0.8rem;
  line-height: 1.28;
}

.tone-entry,
.tone-pressure {
  --chip: var(--cyan);
}

.tone-deferral,
.tone-time {
  --chip: var(--violet);
}

.tone-resource {
  --chip: var(--amber);
}

.tone-action,
.tone-record {
  --chip: var(--green);
}

.tone-denial,
.tone-split {
  --chip: var(--rose);
}

.tone-consent,
.tone-authority {
  --chip: var(--blue);
}

.outcome-strip {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(105, 231, 255, 0.32);
  background: rgba(105, 231, 255, 0.08);
  clip-path: var(--plate-cut);
}

.outcome-strip span {
  color: var(--cyan);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.outcome-strip strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.05;
}

.outcome-strip p {
  margin: 0;
  color: var(--fog);
  font-size: 0.9rem;
  line-height: 1.35;
}

mark {
  padding: 0.02rem 0.16rem;
  border-bottom: 2px solid var(--chip, var(--brass));
  background: color-mix(in srgb, var(--chip, var(--brass)) 24%, transparent);
  color: var(--ink);
  animation: pulseMark 1.6s ease-in-out infinite;
}

.message-card > p mark {
  white-space: nowrap;
}

mark:hover,
mark:focus,
mark.is-active {
  outline: 2px solid var(--chip, var(--brass));
  outline-offset: 2px;
}

.signal-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  min-height: 0;
  background: rgba(105, 231, 255, 0.3);
}

.signal-card {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  min-height: 9rem;
  padding: 0.8rem;
  border: 0;
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--chip, var(--cyan)) 13%, transparent), transparent 62%),
    rgba(9, 11, 14, 0.82);
}

.signal-card span,
.signal-card small {
  color: var(--chip, var(--cyan));
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.signal-card strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.05;
}

.signal-card p {
  margin: 0;
  color: var(--fog);
  font-size: 0.9rem;
  line-height: 1.35;
}

.layer-L1 {
  --chip: var(--blue);
}

.layer-L2 {
  --chip: var(--green);
}

.layer-L3 {
  --chip: var(--rose);
}

.layer-L4 {
  --chip: var(--cyan);
}

.layer-L5 {
  --chip: var(--violet);
}

.layer-L6 {
  --chip: var(--amber);
}

.synthesis-slide,
.phase-slide,
.review-unlock-slide {
  align-content: center;
}

.behavior-summary {
  max-width: 42rem;
  margin: 0.65rem 0 0;
  color: var(--fog);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.42;
}

.unlock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.unlock-grid {
  padding: 0.85rem;
  border: 1px solid rgba(105, 231, 255, 0.32);
  background: rgba(9, 11, 14, 0.56);
  clip-path: var(--plate-cut);
}

.behavior-flow,
.pattern-ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: start;
  margin-top: 1rem;
}

.behavior-node,
.pattern-behavior {
  --node: var(--cyan);
  position: relative;
  display: grid;
  gap: 0.26rem;
  min-height: 6.4rem;
  padding: 0.58rem;
  border: 1px solid color-mix(in srgb, var(--node) 50%, transparent);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--node) 10%, transparent), transparent 64%),
    rgba(9, 11, 14, 0.64);
  flex: 1 1 7.4rem;
  opacity: 0;
  outline: none;
  cursor: default;
  animation: chipIn 420ms ease forwards;
  animation-delay: var(--d, 0ms);
}

.behavior-node:hover,
.behavior-node:focus-visible,
.behavior-node:focus-within,
.pattern-behavior:hover,
.pattern-behavior:focus-visible,
.pattern-behavior:focus-within {
  border-color: var(--node);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--node) 18%, transparent), transparent 64%),
    rgba(9, 11, 14, 0.82);
  z-index: 4;
}

.behavior-node.intensity-0 {
  --node: var(--cyan);
}

.behavior-node.intensity-1,
.pattern-behavior.intensity-1 {
  --node: var(--green);
}

.behavior-node.intensity-2,
.pattern-behavior.intensity-2 {
  --node: var(--amber);
}

.behavior-node.intensity-3,
.behavior-node.intensity-4,
.pattern-behavior.intensity-3,
.pattern-behavior.intensity-4 {
  --node: var(--rose);
}

.pattern-behavior.intensity-0 {
  --node: var(--cyan);
}

.behavior-arrow {
  display: grid;
  flex: 0 0 1.35rem;
  place-items: center;
  min-height: 6.4rem;
  color: var(--brass);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 1.4rem;
  opacity: 0.75;
}

.behavior-node span,
.pattern-behavior span,
.unlock-grid span,
.unlock-grid em {
  color: var(--cyan);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.68rem;
  font-style: normal;
  text-transform: uppercase;
}

.behavior-node span,
.pattern-behavior span {
  color: var(--node);
}

.behavior-node strong,
.pattern-behavior strong,
.unlock-grid strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 1.3vw, 1.18rem);
  line-height: 1.05;
}

.behavior-node > p,
.pattern-behavior > p {
  margin: 0;
  color: var(--fog);
  font-size: 0.75rem;
  line-height: 1.25;
}

.behavior-source {
  position: absolute;
  top: calc(100% + 0.32rem);
  left: 0;
  z-index: 12;
  display: grid;
  gap: 0.36rem;
  width: min(25rem, 48vw);
  max-height: 0;
  overflow: hidden;
  padding: 0 0.62rem;
  border: 0 solid color-mix(in srgb, var(--node) 58%, transparent);
  background: rgba(13, 15, 18, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(-0.3rem);
  transition:
    max-height 220ms ease,
    opacity 180ms ease,
    padding 180ms ease,
    transform 180ms ease,
    border-width 180ms ease;
}

.behavior-node:hover .behavior-source,
.behavior-node:focus-visible .behavior-source,
.behavior-node:focus-within .behavior-source,
.pattern-behavior:hover .behavior-source,
.pattern-behavior:focus-visible .behavior-source,
.pattern-behavior:focus-within .behavior-source {
  max-height: 13rem;
  padding: 0.62rem;
  border-width: 1px;
  opacity: 1;
  transform: translateY(0);
}

.behavior-node:focus-visible,
.pattern-behavior:focus-visible {
  outline: 2px solid var(--node);
  outline-offset: 3px;
}

.source-fragment {
  display: grid;
  gap: 0.22rem;
}

.source-fragment small {
  color: var(--node);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.source-fragment p {
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.32;
}

.review-window {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(155, 140, 255, 0.08), transparent 46%),
    rgba(13, 15, 18, 0.97);
}

.review-head,
.review-controls,
.chat-form,
.chat-answer {
  border-bottom: 1px solid var(--line);
}

.review-head {
  padding: 1rem;
}

.review-head span {
  display: block;
  color: var(--brass);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.lecture-note {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid rgba(213, 168, 77, 0.32);
  background: rgba(213, 168, 77, 0.055);
  clip-path: var(--plate-cut);
}

.lecture-note span {
  color: var(--brass);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.lecture-note strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  line-height: 1.1;
}

.lecture-note p {
  margin: 0;
  color: var(--fog);
  line-height: 1.45;
}

/* §03 dynamics discriminator + §04 scorecard */
.dynamics-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.dynamics-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.dynamics-row td {
  padding: 0.55rem 0.75rem;
  color: var(--fog);
  border-bottom: 1px solid rgba(247, 243, 234, 0.07);
}

.dynamics-row.is-coercive td {
  color: var(--ink);
  background: rgba(105, 231, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.dynamics-row.is-coercive td strong {
  color: var(--cyan);
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1.1rem 0;
}

.scorecard-metric {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem;
  border: 1px solid rgba(105, 231, 255, 0.26);
  background: rgba(105, 231, 255, 0.06);
  clip-path: var(--plate-cut);
}

.scorecard-metric span {
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.scorecard-metric strong {
  color: var(--cyan);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1;
}

.hard-negative {
  display: grid;
  gap: 0.4rem;
  padding: 0.9rem;
  border: 1px solid rgba(185, 77, 99, 0.4);
  background: rgba(185, 77, 99, 0.08);
  clip-path: var(--plate-cut);
}

.hard-negative span {
  color: var(--garnet);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.hard-negative p {
  margin: 0;
  color: var(--fog);
  line-height: 1.45;
}

.chat-form,
.chat-answer {
  display: none;
}

.chat-form.is-available {
  display: grid;
}

.chat-answer.is-available {
  display: block;
}

.review-head strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--cyan);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.05;
}

.review-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.review-controls button,
.chat-actions button {
  min-height: 2.55rem;
  border: 0;
  background: rgba(247, 243, 234, 0.08);
  color: var(--fog);
  cursor: pointer;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.review-controls button:hover,
.review-controls button:focus-visible,
.chat-actions button:hover,
.chat-actions button:focus-visible {
  background: var(--cyan);
  color: var(--paper);
  outline: none;
}

.review-body {
  min-height: 0;
  overflow: auto;
  padding: 1rem;
}

.review-verdict {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(213, 168, 77, 0.32);
  background: rgba(213, 168, 77, 0.06);
  clip-path: var(--plate-cut);
}

.review-verdict span,
.review-section > span,
.chat-form label {
  color: var(--brass);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.review-verdict strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.15;
}

.review-section {
  margin-top: 1rem;
}

.review-section ul {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.review-section li {
  padding: 0.65rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  clip-path: var(--plate-cut);
}

.review-section li strong {
  display: block;
  color: var(--cyan);
}

.review-section li span,
.review-section li p {
  margin: 0.25rem 0 0;
  color: var(--fog);
  font-size: 0.86rem;
  line-height: 1.35;
}

.chat-form {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(9, 11, 14, 0.9);
  color: var(--ink);
}

textarea {
  min-height: 5rem;
  resize: vertical;
  padding: 0.65rem;
  line-height: 1.4;
}

select {
  min-height: 2.55rem;
  padding: 0 0.65rem;
}

.chat-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.chat-actions button {
  min-width: 5rem;
  background: var(--cyan);
  color: var(--paper);
}

.chat-answer {
  min-height: 4rem;
  max-height: 9rem;
  overflow: auto;
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--fog);
  white-space: pre-wrap;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}

.demo-frame:not(.is-review-slide) .chat-form,
.demo-frame:not(.is-review-slide) .chat-answer {
  display: none;
}

.demo-frame.is-review-slide .chat-form.is-available {
  display: grid;
}

.demo-frame.is-review-slide .chat-answer.is-available {
  display: block;
}

.interaction-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid rgba(105, 231, 255, 0.48);
  background: rgba(13, 15, 18, 0.94);
  color: var(--ink);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.38);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.6rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.interaction-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

@keyframes riseIn {
  to {
    opacity: 1;
    filter: saturate(1);
  }
}

@keyframes pulseMark {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(213, 168, 77, 0);
  }
  50% {
    box-shadow: 0 0 0.9rem rgba(213, 168, 77, 0.32);
  }
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: translateX(0.55rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1040px) {
  .demo-frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) minmax(15rem, 0.42fr);
  }

  .presentation {
    grid-template-columns: minmax(16rem, 0.35fr) minmax(0, 1fr);
  }

  .review-window {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .demo-frame {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border: 0;
    clip-path: none;
  }

  .topbar {
    display: grid;
    gap: 0.65rem;
    min-height: auto;
    padding: 0.65rem;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

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

  .stage-copy {
    display: none;
  }

  .lecture-slide {
    padding: 0.55rem 0.75rem;
  }

  .lecture-slide h2 {
    font-size: clamp(1.7rem, 8vw, 2.7rem);
  }

  .message-canvas {
    margin-top: 0.55rem;
  }

  .message-panel[data-message-panel="message"],
  .signal-board {
    grid-template-columns: 1fr;
  }

  .message-card {
    min-height: 15rem;
    padding: 0.75rem;
  }

  .message-card p {
    font-size: clamp(0.98rem, 4.4vw, 1.22rem);
    line-height: 1.42;
  }

  .fragment-purpose-list {
    max-height: 8rem;
    overflow: auto;
    padding: 0.55rem;
  }

  .purpose-chip {
    padding: 0.55rem;
  }

  .outcome-strip {
    padding: 0.6rem;
  }

  .behavior-grid,
  .unlock-grid {
    grid-template-columns: 1fr;
  }

  .review-head {
    padding: 0.65rem;
  }

  .review-body {
    padding: 0.65rem;
  }

  .demo-frame:not(.is-review-slide) .chat-form,
  .demo-frame:not(.is-review-slide) .chat-answer,
  .chat-answer.is-available {
    display: none;
  }

  .demo-frame.is-review-slide .chat-form.is-available {
    display: grid;
    padding: 0.5rem 0.65rem;
  }

  .demo-frame.is-review-slide textarea {
    min-height: 3.2rem;
  }
}

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