:root { color-scheme: light; --ink: #20292e; --muted: #617378; --teal: #08766d; --line: #dce5e3; }
* { box-sizing: border-box; }
body { margin: 0; background: #fff; color: var(--ink); font: 18px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
main { width: min(1320px, 100%); margin: auto; padding: 20px 36px 14px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
h1 { margin: 0; font-size: 36px; line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
.analogy { margin: 7px 0 0; color: var(--muted); font-size: 18px; }
h2 { margin: 0; color: var(--muted); font-size: 18px; font-weight: 500; }
header label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
select, button { font: inherit; color: inherit; min-height: 44px; border: 1px solid #bccac9; border-radius: 5px; background: #fff; }
select { padding: 5px 14px; font-weight: 600; }
button { padding: 9px 25px; cursor: pointer; }
button:hover:not(:disabled) { background: #edf6f4; }
button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
button.primary:hover:not(:disabled) { background: #075d56; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 3px solid #427dba; outline-offset: 4px; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.workspace { display: grid; grid-template-columns: 46% 54%; min-height: 446px; padding-top: 20px; }
.code-panel { padding-right: 30px; border-right: 1px solid var(--line); min-width: 0; }
.current-call { display: flex; align-items: center; gap: 14px; min-height: 72px; margin: 14px 0 8px; padding: 10px 14px; border-radius: 7px; background: #f3f8f6; }
.current-call p { margin: 0 0 2px; color: var(--muted); font-size: 16px; }
.current-call code { font-size: 23px; }
#local-value { margin-left: auto; color: var(--teal); font-size: 26px; white-space: nowrap; }
.current-call.base { background: #fff5da; }
.current-call.base #local-value { color: #885b14; }
.source-code { font-size: 20px; line-height: 1.6; margin: 0 -12px 10px; overflow-x: auto; }
.source-code > code { display: block; min-width: max-content; white-space: normal; }
.code-line { display: block; padding: 2px 12px; white-space: pre; border-left: 3px solid transparent; }
.code-line.active { background: #eaf5f1; border-left-color: var(--teal); }
.evaluation { min-height: 58px; padding: 3px 0 8px; }
.evaluation span { display: block; color: var(--muted); font-size: 16px; }
.evaluation code { color: var(--teal); font-size: 23px; font-weight: 600; }
.result { padding-top: 7px; }
.result p { color: var(--muted); font-size: 16px; margin: 0 0 3px; }
.result > div { display: flex; gap: 15px; align-items: center; font-size: 25px; }
#result-value { color: var(--teal); font-size: 30px; }
.calls-panel { padding-left: 30px; min-width: 0; }
.calls-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
#phase { color: var(--teal); font-size: 16px; white-space: nowrap; }
#phase.base { color: #885b14; }
.direction { margin: 7px 0 13px; color: var(--teal); font-size: 17px; }
#empty-stack { border: 2px solid #96bdb5; border-radius: 12px; background: #f5faf8; padding: 48px 24px; text-align: center; }
#task-expression { margin: 0; font-size: 30px; font-weight: 600; color: var(--teal); }
#empty-message { color: var(--muted); margin: 14px 0 0; font-size: 18px; }
.frame { min-width: 0; border: 2px solid #9dbeb8; border-radius: 10px; background: #f3f8f6; padding: 8px 10px 10px; }
.frame-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; line-height: 1.2; }
.frame-heading code { font-size: 17px; }
.frame-heading span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.frame-expression { display: flex; align-items: center; gap: 9px; min-width: 0; }
.multiplier { flex: 0 0 auto; font-size: 26px; color: #315c56; white-space: nowrap; }
.frame-expression > .frame { flex: 1; }
.frame-detail { font-size: 26px; line-height: 1.3; padding: 3px 2px; color: var(--teal); }
.frame.active { border-color: var(--teal); background: #fff; }
.frame.base { border-color: #b18437; background: #fff2cc; }
.frame.base .frame-heading span, .frame.base .frame-detail { color: #885b14; }
.frame.returning { border-color: var(--teal); background: #e2f3eb; }
.frame.returning .frame-detail { font-weight: 650; }
.returned-value { display: inline-block; padding: 0 8px; border-radius: 5px; background: #c4e9d8; }
.frame-note { color: var(--muted); margin-left: 10px; font-size: 14px; white-space: nowrap; }
.caption { font-size: 22px; line-height: 1.4; border-top: 1px solid var(--line); padding: 15px 0 0; margin: 12px 0 13px; min-height: 76px; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.transport { display: flex; gap: 10px; }
#step-number { font-size: 16px; color: var(--muted); white-space: nowrap; }
footer { margin-top: 16px; font-size: 14px; }
footer a { color: var(--muted); text-underline-offset: 3px; }
[hidden] { display: none !important; }
@media (min-width: 1500px) { main { padding-top: 32px; } .workspace { min-height: 476px; } }
@media (max-width: 1100px) {
  main { padding-inline: 24px; }
  .source-code { font-size: 17px; }
  .code-panel { padding-right: 22px; }
  .calls-panel { padding-left: 22px; }
  .frame { padding: 7px 7px 9px; }
  .frame-expression { gap: 5px; }
  .multiplier { font-size: 22px; }
  .frame-heading code { font-size: 15px; }
  .frame-heading span { font-size: 12px; }
}
@media (max-width: 800px) {
  main { padding: 20px; }
  header { align-items: start; flex-direction: column; gap: 16px; }
  h1 { font-size: 30px; }
  .analogy { font-size: 17px; }
  .workspace { grid-template-columns: 1fr; min-height: 0; }
  .code-panel { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
  .source-code { font-size: 16px; }
  .current-call code { font-size: 20px; }
  #local-value { font-size: 23px; }
  .calls-panel { padding: 22px 0 0; }
  .calls-heading { flex-wrap: wrap; gap: 5px; }
  .frame { padding: 7px 5px 8px; border-radius: 6px; }
  .frame-heading { flex-wrap: wrap; gap: 2px 5px; }
  .frame-heading code { font-size: 14px; }
  .frame-heading span { font-size: 11px; }
  .multiplier { font-size: 20px; }
  .frame-expression { gap: 4px; }
  .frame-detail { font-size: 23px; }
  .frame-note { display: block; margin: 4px 0 0; font-size: 13px; }
  .caption { font-size: 20px; }
  .controls { flex-wrap: wrap; gap: 15px; }
  button { padding-inline: 19px; }
}
