:root {
  color-scheme: light;
  --canvas: #eef2ef;
  --surface: #fbfcf8;
  --surface-2: #eef4ef;
  --ink: #17211d;
  --muted: #64706a;
  --line: rgba(23, 33, 29, 0.13);
  --heavy-line: rgba(23, 33, 29, 0.22);
  --charcoal: #17211d;
  --editor: #101312;
  --editor-2: #181d1b;
  --editor-line: #26302c;
  --editor-text: #edf4ea;
  --mint: #4fc28a;
  --teal: #137b72;
  --amber: #f2b947;
  --coral: #e65d45;
  --blue: #4c96c7;
  --plum: #7b668f;
  --attention-read: var(--blue);
  --attention-create: var(--mint);
  --attention-update: var(--amber);
  --attention-call: var(--plum);
  --attention-return: var(--blue);
  --attention-remove: var(--coral);
  --attention-output: #5fbfc7;
  --attention-check: var(--plum);
  --attention-error: var(--coral);
  --shadow: 0 18px 46px rgba(23, 33, 29, 0.12);
  --tight-shadow: 0 8px 22px rgba(23, 33, 29, 0.1);
  --radius: 8px;
  --mono: "SFMono-Regular", "Cascadia Code", "Menlo", "Consolas", monospace;
  --body: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --line-height: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 33, 29, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 8%, rgba(79, 194, 138, 0.18), transparent 28%),
    linear-gradient(135deg, #f7faf6 0%, var(--canvas) 58%, #e6eef0 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
  color: var(--ink);
  font-family: var(--body);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

button {
  border: 0;
  border-radius: 7px;
  color: var(--ink);
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible,
.tip:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(650px, 1.28fr) minmax(430px, 0.82fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.visual-pane,
.editor-pane {
  min-width: 0;
}

.visual-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 252, 248, 0.82);
  box-shadow: var(--tight-shadow);
}

.title-block {
  align-self: center;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 31px;
  line-height: 1.06;
  font-weight: 900;
}

.header-tools {
  display: grid;
  place-items: center;
  gap: 10px;
  flex: 0 0 clamp(122px, 16vw, 172px);
}

.locale-toggle,
.mode-toggle,
.control-row {
  display: grid;
  gap: 7px;
}

.locale-toggle {
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 33, 29, 0.05);
}

.locale-toggle button {
  min-width: 44px;
  min-height: 32px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.locale-toggle button.active {
  background: var(--charcoal);
  color: #f8fbf3;
}

.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  --popover-top: 18px;
  --popover-arrow-y: 38px;
}

.reader-card,
.action-panel,
.panel,
.editor-shell,
.toolbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.reader-card {
  position: relative;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  min-height: clamp(380px, 44vh, 520px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 33, 29, 0.075) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(23, 33, 29, 0.055) 0 1px, transparent 1px 100%),
    #f9fbf5;
  background-size: 28px 28px;
}

.robot-track {
  position: relative;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(242, 185, 71, 0.2), rgba(79, 194, 138, 0.16)),
    rgba(251, 252, 248, 0.64);
}

.node-bot {
  position: absolute;
  top: 14px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 60px;
  border: 2px solid var(--charcoal);
  border-radius: 8px;
  background: var(--mint);
  box-shadow: 4px 4px 0 var(--charcoal);
  transition: top 280ms ease, transform 180ms ease;
}

.node-bot.running {
  transform: translateX(4px);
}

.node-bot .antenna {
  position: absolute;
  top: -13px;
  left: 25px;
  width: 2px;
  height: 12px;
  background: var(--charcoal);
}

.node-bot .antenna::after {
  content: "";
  position: absolute;
  top: -5px;
  left: -4px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--charcoal);
  border-radius: 50%;
  background: var(--amber);
}

.node-bot .face {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.node-bot .face span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--charcoal);
}

.node-bot strong {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1;
}

.reader-lines {
  max-height: 350px;
  overflow: auto;
  padding: 12px min(46%, 430px) 12px 0;
  font-family: var(--mono);
  font-size: 13px;
}

.reader-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  min-height: var(--line-height);
  border-left: 4px solid transparent;
  color: rgba(23, 33, 29, 0.48);
}

.reader-line .reader-number {
  padding: 3px 8px 0 0;
  color: rgba(23, 33, 29, 0.34);
  text-align: right;
}

.reader-line code {
  min-width: 0;
  padding: 3px 9px;
  white-space: pre-wrap;
  word-break: break-word;
}

.reader-line.visited {
  color: rgba(23, 33, 29, 0.88);
}

.reader-line.active {
  border-left-color: var(--coral);
  background: rgba(230, 93, 69, 0.12);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(230, 93, 69, 0.18);
  animation: readerFlash 520ms ease;
}

.action-panel {
  position: absolute;
  z-index: 14;
  top: var(--popover-top);
  right: 18px;
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100% - 116px));
  max-height: calc(100% - 36px);
  overflow: visible;
  padding: 18px;
  border-color: rgba(248, 251, 243, 0.1);
  background:
    linear-gradient(135deg, rgba(79, 194, 138, 0.12), transparent 38%),
    var(--charcoal);
  color: #f8fbf3;
  transition:
    top 260ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.action-panel::before {
  content: "";
  position: absolute;
  top: calc(var(--popover-arrow-y) - 11px);
  left: -16px;
  width: 16px;
  height: 22px;
  background: var(--charcoal);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  opacity: 1;
  transition: opacity 160ms ease;
}

.action-panel.is-idle {
  transform: translateY(0);
}

.action-panel.is-idle::before {
  opacity: 0;
}

.panel-kicker {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 18px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(242, 185, 71, 0.16);
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.action-panel h2 {
  margin: 0 0 12px;
  font-size: 25px;
  line-height: 1.12;
}

.action-panel p {
  margin: 0;
  color: rgba(248, 251, 243, 0.78);
  line-height: 1.5;
}

.attention-cue {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(248, 251, 243, 0.13);
  border-radius: 8px;
  background: rgba(248, 251, 243, 0.08);
}

.attention-dot {
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--attention-read);
  box-shadow: 0 0 0 7px rgba(76, 150, 199, 0.12);
}

.attention-cue[data-action="create"] .attention-dot {
  background: var(--attention-create);
  box-shadow: 0 0 0 7px rgba(79, 194, 138, 0.13);
}

.attention-cue[data-action="update"] .attention-dot {
  background: var(--attention-update);
  box-shadow: 0 0 0 7px rgba(242, 185, 71, 0.13);
}

.attention-cue[data-action="call"] .attention-dot,
.attention-cue[data-action="check"] .attention-dot {
  background: var(--attention-call);
  box-shadow: 0 0 0 7px rgba(123, 102, 143, 0.14);
}

.attention-cue[data-action="remove"] .attention-dot,
.attention-cue[data-action="error"] .attention-dot {
  background: var(--attention-remove);
  box-shadow: 0 0 0 7px rgba(230, 93, 69, 0.13);
}

.attention-cue[data-action="output"] .attention-dot {
  background: var(--attention-output);
  box-shadow: 0 0 0 7px rgba(95, 191, 199, 0.13);
}

.attention-label {
  display: block;
  color: #f8fbf3;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.attention-route {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 24px;
  margin-top: 8px;
  color: rgba(248, 251, 243, 0.7);
  font-size: 11px;
  font-weight: 850;
}

.attention-route span {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border: 1px solid rgba(248, 251, 243, 0.13);
  border-radius: 999px;
  background: rgba(248, 251, 243, 0.08);
  color: rgba(248, 251, 243, 0.84);
}

.attention-route i {
  color: var(--amber);
  font-style: normal;
  font-weight: 950;
}

.step-meter {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  color: rgba(248, 251, 243, 0.72);
  font-family: var(--mono);
  font-size: 12px;
}

.step-meter div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(248, 251, 243, 0.14);
}

.step-meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--mint));
  transition: width 220ms ease;
}

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

.call-stack-panel,
.memory-panel,
.heap-panel {
  grid-column: span 2;
}

.function-panel,
.workspace-panel {
  grid-column: span 3;
}

.output-panel {
  grid-column: 1 / -1;
}

.panel {
  min-height: 176px;
  overflow: visible;
  background: rgba(251, 252, 248, 0.84);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.panel.is-muted {
  opacity: 0.48;
}

.panel.is-spotlight {
  border-color: rgba(76, 150, 199, 0.52);
  box-shadow:
    0 0 0 3px rgba(76, 150, 199, 0.12),
    var(--shadow);
  transform: translateY(-1px);
}

.panel.is-spotlight[data-action="create"] {
  border-color: rgba(79, 194, 138, 0.62);
  box-shadow:
    0 0 0 3px rgba(79, 194, 138, 0.16),
    var(--shadow);
}

.panel.is-spotlight[data-action="update"] {
  border-color: rgba(242, 185, 71, 0.68);
  box-shadow:
    0 0 0 3px rgba(242, 185, 71, 0.16),
    var(--shadow);
}

.panel.is-spotlight[data-action="call"],
.panel.is-spotlight[data-action="check"] {
  border-color: rgba(123, 102, 143, 0.62);
  box-shadow:
    0 0 0 3px rgba(123, 102, 143, 0.16),
    var(--shadow);
}

.panel.is-spotlight[data-action="remove"],
.panel.is-spotlight[data-action="error"] {
  border-color: rgba(230, 93, 69, 0.62);
  box-shadow:
    0 0 0 3px rgba(230, 93, 69, 0.15),
    var(--shadow);
}

.panel.is-spotlight[data-action="output"] {
  border-color: rgba(95, 191, 199, 0.62);
  box-shadow:
    0 0 0 3px rgba(95, 191, 199, 0.15),
    var(--shadow);
}

.panel header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 244, 239, 0.76);
}

.panel header span:first-child {
  font-size: 14px;
  font-weight: 900;
}

.panel header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(23, 33, 29, 0.06);
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
}

.tip::after,
[data-tip-key]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 40;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(280px, 72vw);
  padding: 9px 10px;
  border: 1px solid rgba(23, 33, 29, 0.18);
  border-radius: 7px;
  background: #17211d;
  color: #f8fbf3;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: 0 14px 30px rgba(23, 33, 29, 0.24);
}

[data-tip-key]::after {
  left: 10px;
  right: auto;
}

.tip:hover::after,
.tip:focus-visible::after,
[data-tip-key]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.list-surface,
.console-output {
  margin: 0;
  padding: 12px;
}

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

.empty {
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.memory-item,
.heap-item,
.function-item,
.workspace-item,
.stack-item {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 7px;
  background: rgba(251, 252, 248, 0.86);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.stack-item {
  grid-template-columns: 24px 1fr;
  align-items: center;
}

.stack-badge {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(76, 150, 199, 0.16);
  color: #27678e;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.memory-item strong,
.heap-item strong,
.function-item strong,
.workspace-item strong,
.stack-item strong {
  font-family: var(--mono);
  font-size: 13px;
}

.value-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(19, 123, 114, 0.12);
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.tag.collectible {
  background: rgba(230, 93, 69, 0.14);
  color: #a9402f;
}

.tag.stack {
  background: rgba(76, 150, 199, 0.16);
  color: #27678e;
}

.tag.type {
  background: rgba(123, 102, 143, 0.15);
  color: #67527c;
}

.is-attention-target {
  border-color: rgba(76, 150, 199, 0.58);
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(76, 150, 199, 0.14),
    0 12px 24px rgba(23, 33, 29, 0.12);
  transform: translateY(-1px);
  animation: targetPulse 680ms ease;
}

.attention-create {
  border-color: rgba(79, 194, 138, 0.72);
  box-shadow:
    0 0 0 3px rgba(79, 194, 138, 0.16),
    0 12px 24px rgba(23, 33, 29, 0.12);
}

.attention-update {
  border-color: rgba(242, 185, 71, 0.76);
  box-shadow:
    0 0 0 3px rgba(242, 185, 71, 0.18),
    0 12px 24px rgba(23, 33, 29, 0.12);
}

.attention-call,
.attention-check {
  border-color: rgba(123, 102, 143, 0.7);
  box-shadow:
    0 0 0 3px rgba(123, 102, 143, 0.16),
    0 12px 24px rgba(23, 33, 29, 0.12);
}

.attention-remove,
.attention-error {
  border-color: rgba(230, 93, 69, 0.72);
  box-shadow:
    0 0 0 3px rgba(230, 93, 69, 0.16),
    0 12px 24px rgba(23, 33, 29, 0.12);
}

.attention-output {
  border-color: rgba(95, 191, 199, 0.7);
  box-shadow:
    0 0 0 3px rgba(95, 191, 199, 0.16),
    0 12px 24px rgba(23, 33, 29, 0.12);
}

.attention-badge {
  justify-self: start;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(76, 150, 199, 0.13);
  color: #27678e;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.15;
  text-transform: uppercase;
}

.attention-create .attention-badge {
  background: rgba(79, 194, 138, 0.16);
  color: #28734f;
}

.attention-update .attention-badge {
  background: rgba(242, 185, 71, 0.18);
  color: #826017;
}

.attention-call .attention-badge,
.attention-check .attention-badge {
  background: rgba(123, 102, 143, 0.16);
  color: #67527c;
}

.attention-remove .attention-badge,
.attention-error .attention-badge {
  background: rgba(230, 93, 69, 0.15);
  color: #a9402f;
}

.attention-output .attention-badge {
  background: rgba(95, 191, 199, 0.16);
  color: #2d6b72;
}

.change-diff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 7px;
  border-radius: 7px;
  background: rgba(23, 33, 29, 0.045);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.change-diff span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-diff b {
  color: var(--amber);
  font-family: var(--body);
  font-size: 12px;
  line-height: 1;
}

.console-output {
  min-height: 170px;
  background: #101312;
  color: #eff7df;
  font-family: var(--mono);
  font-size: 13px;
}

.output-line {
  display: block;
  padding: 4px 0;
  border-bottom: 1px solid rgba(239, 247, 223, 0.08);
  white-space: pre-wrap;
}

.editor-pane {
  display: grid;
  grid-template-rows: auto minmax(440px, 1fr);
  gap: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  padding: 12px;
  background: var(--charcoal);
  color: #f8fbf3;
}

.mode-toggle {
  grid-template-columns: 1fr 1fr;
}

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

.mode-toggle button,
.control-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  background: rgba(248, 251, 243, 0.1);
  color: #f8fbf3;
  font-weight: 900;
}

.control-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.mode-toggle button.active,
.control-row button.primary {
  background: var(--amber);
  color: var(--charcoal);
}

.control-row button.is-paused {
  background: rgba(230, 93, 69, 0.25);
  color: #ffc2b6;
}

.example-picker,
.speed-control {
  display: grid;
  gap: 6px;
}

.example-picker span,
.speed-control span {
  color: rgba(248, 251, 243, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(248, 251, 243, 0.16);
  border-radius: 7px;
  background: rgba(248, 251, 243, 0.1);
  color: #f8fbf3;
  padding: 0 10px;
}

select option {
  background: var(--charcoal);
  color: #f8fbf3;
}

input[type="range"] {
  accent-color: var(--amber);
}

.editor-shell {
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
  overflow: hidden;
  background: var(--editor);
}

.editor-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  border-bottom: 1px solid rgba(248, 251, 243, 0.08);
  background: var(--editor-2);
  color: rgba(237, 244, 234, 0.82);
}

.editor-titlebar strong {
  font-family: var(--mono);
  font-size: 12px;
}

.editor-status {
  min-width: 0;
  margin-left: auto;
  color: rgba(237, 244, 234, 0.52);
  font-size: 11px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-body {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.line-numbers {
  z-index: 2;
  padding: 14px 8px 14px 0;
  border-right: 1px solid rgba(248, 251, 243, 0.08);
  background: #0d100f;
  color: rgba(237, 244, 234, 0.34);
  font-family: var(--mono);
  font-size: 13px;
  line-height: var(--line-height);
  text-align: right;
  user-select: none;
  overflow: hidden;
}

.highlight-layer,
#codeEditor {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--editor-text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: var(--line-height);
  tab-size: 2;
  white-space: pre;
}

.highlight-layer {
  z-index: 1;
  min-width: 0;
  overflow: auto;
  pointer-events: none;
}

#codeEditor {
  z-index: 3;
  width: 100%;
  height: 100%;
  min-height: 440px;
  resize: none;
  outline: none;
  caret-color: #f8fbf3;
  color: transparent;
  overflow: auto;
}

#codeEditor::selection {
  background: rgba(76, 150, 199, 0.35);
  color: transparent;
}

.active-editor-line {
  position: absolute;
  z-index: 2;
  left: 48px;
  right: 0;
  top: -100px;
  height: var(--line-height);
  background: rgba(242, 185, 71, 0.14);
  border-left: 3px solid var(--amber);
  box-shadow: inset 0 0 0 1px rgba(242, 185, 71, 0.18);
  transition: top 180ms ease;
  pointer-events: none;
}

.active-editor-line::after {
  content: attr(data-label);
  position: absolute;
  right: 10px;
  top: 3px;
  max-width: min(220px, 46%);
  overflow: hidden;
  padding: 2px 7px;
  border: 1px solid rgba(242, 185, 71, 0.26);
  border-radius: 999px;
  background: rgba(16, 19, 18, 0.88);
  color: #f2b947;
  font-family: var(--body);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.25;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.active-editor-line[data-action="create"] {
  background: rgba(79, 194, 138, 0.14);
  border-left-color: var(--attention-create);
}

.active-editor-line[data-action="update"] {
  background: rgba(242, 185, 71, 0.14);
  border-left-color: var(--attention-update);
}

.active-editor-line[data-action="call"],
.active-editor-line[data-action="check"] {
  background: rgba(123, 102, 143, 0.16);
  border-left-color: var(--attention-call);
}

.active-editor-line[data-action="remove"],
.active-editor-line[data-action="error"] {
  background: rgba(230, 93, 69, 0.13);
  border-left-color: var(--attention-remove);
}

.active-editor-line[data-action="output"] {
  background: rgba(95, 191, 199, 0.13);
  border-left-color: var(--attention-output);
}

.tok-keyword {
  color: #ec8b60;
  font-weight: 850;
}

.tok-string {
  color: #d5c677;
}

.tok-number {
  color: #9bc6f0;
}

.tok-comment {
  color: #7d887b;
}

.tok-builtin {
  color: #75cbd5;
}

.tok-type {
  color: #c3adff;
}

.tok-boolean {
  color: #f08ca0;
}

@keyframes targetPulse {
  0% {
    transform: translateY(0) scale(0.995);
  }

  45% {
    transform: translateY(-1px) scale(1.012);
  }

  100% {
    transform: translateY(-1px) scale(1);
  }
}

@keyframes readerFlash {
  0% {
    background: rgba(230, 93, 69, 0.22);
  }

  100% {
    background: rgba(230, 93, 69, 0.12);
  }
}

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

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-pane {
    grid-template-rows: auto minmax(460px, 62vh);
  }
}

@media (max-width: 840px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    padding: 10px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .visual-pane,
  .editor-pane,
  .app-header,
  .stage,
  .reader-card,
  .action-panel,
  .panel,
  .toolbar,
  .editor-shell {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .app-header {
    display: grid;
  }

  .header-tools {
    flex: auto;
    place-items: stretch;
    justify-items: stretch;
  }

  h1 {
    font-size: 24px;
  }

  .stage,
  .visual-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .call-stack-panel,
  .memory-panel,
  .heap-panel,
  .function-panel,
  .workspace-panel,
  .output-panel {
    grid-column: 1 / -1;
  }

  .reader-card {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 300px;
  }

  .reader-lines {
    padding-right: 12px;
  }

  .action-panel {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 10px;
    overflow: visible;
  }

  .action-panel::before {
    top: -11px;
    left: 34px;
    width: 22px;
    height: 11px;
    clip-path: polygon(0 100%, 50% 0, 100% 100%);
  }

  .node-bot {
    left: 7px;
    width: 48px;
    height: 54px;
  }

  .toolbar {
    gap: 9px;
  }

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

  .control-row button:first-child {
    grid-column: span 2;
  }

  .reader-line {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .reader-line code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre;
  }

  .panel header small {
    display: none;
  }

  .action-panel p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .editor-body {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .active-editor-line {
    left: 42px;
  }

  .editor-status {
    display: none;
  }

}
