/* Exam-paper look: white panels, black rules, a highlighter band on the line that just ran.
   Two columns: the code, and beside it everything the code changes. */
:root {
  --paper: #f3f5f8; --panel: #ffffff; --ink: #17202b; --ink-2: #4d5a6b; --rule: #d3d9e1;
  --mark: #ffe270; --mark-ink: #17202b; --pen: #1549b8; --pen-ink: #ffffff;
  --true: #17703f; --false: #b3261e; --tag: #6a3aa3; --block: #edf0f4; --ctl: #d5dae1; --blocked: #3b4757; --blocked-2: #6a7686;
  --ui: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --code: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --code-size: 16px;
  color-scheme: light dark;
}
/* The dark colors follow the system, unless a page that wraps the app (platform.html) says
   which theme the site is on. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e151e; --panel: #17212e; --ink: #e7ecf3; --ink-2: #9daabb; --rule: #2c3a4b;
    --mark: #5c4a06; --mark-ink: #fff2b8; --pen: #8ab4ff; --pen-ink: #0e151e;
    --true: #62d39a; --false: #ff8f85; --tag: #c8a6f2; --block: #1f2b3a; --ctl: #2a394b; --blocked: #05090e; --blocked-2: #4a5a6e;
  }
}
:root[data-theme="dark"] {
  --paper: #0e151e; --panel: #17212e; --ink: #e7ecf3; --ink-2: #9daabb; --rule: #2c3a4b;
  --mark: #5c4a06; --mark-ink: #fff2b8; --pen: #8ab4ff; --pen-ink: #0e151e;
  --true: #62d39a; --false: #ff8f85; --tag: #c8a6f2; --block: #1f2b3a; --ctl: #2a394b; --blocked: #05090e; --blocked-2: #4a5a6e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* The page scrolls as a whole. Inside the platform's frame, the bridge cancels a wheel unless
   an element in the chain says it scrolls (overflow auto or scroll), and a plain html element
   says visible, so the page could only be moved by dragging the scrollbar. */
html { overflow-y: auto; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--ui); padding: 12px; }
[hidden] { display: none !important; }
code, kbd, pre { font-family: var(--code); }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
p { margin: 0; }

.app { background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; min-width: 0; position: relative; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; border-bottom: 2px solid var(--ink); }
.brand { font-weight: 800; font-size: 17px; margin-right: 4px; }
.lbl { color: var(--ink-2); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.lbl.stack { display: flex; flex-direction: column; align-items: stretch; gap: 3px; margin-top: 10px; }
select, input[type="text"], input[type="number"] { background: var(--panel); border: 1.5px solid var(--ink); border-radius: 4px; padding: 6px 8px; max-width: 100%; color: var(--ink); }
.grow { flex: 1 1 0; }
.seg, .tabs { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; }
.tabs { align-self: flex-start; }
.seg button, .tabs button { background: var(--panel); border: 0; padding: 6px 12px; min-height: 36px; }
.seg button + button, .tabs button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed="true"], .tabs button[aria-selected="true"] { background: var(--ink); color: var(--panel); }
/* These groups clip at their rounded border, so the focus ring is drawn inside the button. */
.seg button:focus-visible, .tabs button:focus-visible { outline-offset: -4px; outline-color: var(--pen); box-shadow: inset 0 0 0 5px var(--panel); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn { background: var(--panel); border: 1.5px solid var(--ink); border-radius: 4px; padding: 6px 12px; min-height: 36px; }
.btn.go { background: var(--pen); border-color: var(--pen); color: var(--pen-ink); font-weight: 600; }
.btn.big { min-height: 44px; min-width: 78px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn kbd { font-size: 12px; opacity: .8; margin-left: 2px; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--pen); }
.cap { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.scrollx { overflow-x: auto; }

.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "code state" "code out"; }
.pane { min-width: 0; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.p-code { grid-area: code; }
.p-state { grid-area: state; border-left: 1.5px solid var(--rule); }
.p-out { grid-area: out; border-left: 1.5px solid var(--rule); border-top: 1.5px solid var(--rule); }
@media (max-width: 760px) {
  body { padding: 0; }
  .app { border-width: 0 0 2px; border-radius: 0; }
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "code" "state" "out"; }
  .p-state, .p-out { border-left: 0; border-top: 1.5px solid var(--rule); }
  :root { --code-size: 14px; }
}

/* Simple shows what it takes to follow one step. Detail adds the instruments. */
.app.simple .detail-only, .app.simple .col-hist, .app.simple .ln .runs { display: none; }
.app.simple .ln { grid-template-columns: 22px 2.6ch minmax(max-content, 1fr); }
.app.simple .say { font-size: 18px; }
.app:not(.editing) .edit-only, .app.editing .trace-only, .app.editing .hide-edit { display: none; }
.app.editing .p-state, .app.editing .p-out { opacity: .45; }
.app.proj { --code-size: 24px; max-width: none; }
.app.proj .hide-proj, .app.proj .detail-only { display: none; }
/* A program that does not parse opens in the editor even in projector mode, and needs its Run button. */
.app.proj.editing .codehead { display: block; }
.app.proj .grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.app.proj .say { font-size: 22px; }
.app.embed .brand, .app.embed #share { display: none; }

/* text form */
.codewrap { position: relative; }
.codebox { overflow: auto; max-height: 62vh; border: 1.5px solid var(--rule); border-radius: 4px; padding: 8px 0; }
/* Each row is as wide as the longest line, so the highlight band still spans a line that has been scrolled sideways. */
.codebox > .ln { min-width: max-content; }
.ln { display: grid; grid-template-columns: 22px 2.6ch minmax(max-content, 1fr) 4.5ch; align-items: baseline; gap: 6px; padding: 1px 10px 1px 4px; font-family: var(--code); font-size: var(--code-size); line-height: 1.55; border-left: 5px solid transparent; }
.ln .arrow { font-size: .8em; text-align: center; }
.ln .no { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; font-size: .82em; text-align: right; font-variant-numeric: tabular-nums; }
.ln .no:hover { color: var(--pen); text-decoration: underline; }
.ln .runs { color: var(--ink-2); font-size: .82em; text-align: right; font-variant-numeric: tabular-nums; }
.ln .src { white-space: pre; }
.kw { font-weight: 700; }
.cm { color: var(--ink-2); font-style: italic; }
.hole { background: var(--mark); color: var(--mark-ink); outline: 1.5px dashed var(--ink); }
.ln.cur { background: var(--mark); color: var(--mark-ink); border-left-color: var(--ink); }
.ln.cur .no, .ln.cur .runs, .ln.cur .cm { color: var(--mark-ink); }
.ln.soon, .b-stmt.soon, .b-head.soon { outline: 2.5px dashed var(--ink); outline-offset: -2px; }
mark { background: none; color: inherit; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; font-weight: 700; }
.note-cond, .note-pass { font-family: var(--code); font-size: .86em; margin-left: 14px; padding: 1px 8px; border-radius: 3px; background: var(--panel); color: var(--ink); border: 1.5px solid var(--ink); white-space: nowrap; font-weight: 400; }
.note-pass { border-style: dashed; }
.is-true { color: var(--true); font-weight: 700; }
.is-false { color: var(--false); font-weight: 700; }

/* the arrow a RETURN draws back to the line that called */
.flow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.flow path { fill: none; stroke: var(--pen); stroke-width: 2.5; }
.flow polygon { fill: var(--pen); }
.flow text { fill: var(--pen); font: 700 13px var(--code); paint-order: stroke; stroke: var(--panel); stroke-width: 5px; }

/* block form: the reference sheet's shapes */
.blocks { overflow: auto; max-height: 62vh; font-family: var(--code); font-size: calc(var(--code-size) - 1px); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 2px; }
.b-stmt { border: 1.5px solid var(--ink); border-radius: 9px; background: var(--panel); padding: 5px 10px; white-space: nowrap; }
.b-ctl { border: 1.5px solid var(--ink); border-radius: 12px; background: var(--ctl); padding: 0 0 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 220px; }
.b-head { padding: 6px 10px 1px; white-space: nowrap; border-radius: 10px 10px 0 0; align-self: stretch; }
.b-body { margin: 0 10px 0 22px; padding: 6px; background: var(--panel); border: 1.5px solid var(--ink); border-radius: 9px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.b-empty { min-width: 90px; min-height: 18px; }
.b-stmt.cur, .b-head.cur { background: var(--mark); color: var(--mark-ink); box-shadow: inset 5px 0 0 var(--ink); }
.b-stmt .arrow, .b-head .arrow { font-size: .8em; margin-right: 6px; }
.pill { display: inline-block; border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 9px; background: var(--panel); color: var(--ink); }
.slot { display: inline-block; border: 1.5px solid var(--ink); padding: 0 6px; background: var(--panel); color: var(--ink); min-width: 1.2ch; min-height: 1.3em; vertical-align: bottom; }
.arr { font-weight: 700; }

/* editor */
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.edbox { display: grid; grid-template-columns: auto minmax(0, 1fr); border: 1.5px solid var(--ink); border-radius: 4px; height: min(62vh, 520px); overflow: hidden; }
.gutter, .overlay, #edText { margin: 0; font-family: var(--code); font-size: var(--code-size); line-height: 1.55; padding: 8px 10px; white-space: pre; tab-size: 3; }
.gutter { color: var(--ink-2); text-align: right; overflow: hidden; border-right: 1.5px solid var(--rule); user-select: none; padding-right: 8px; }
.edwrap { position: relative; min-width: 0; }
.overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.overlay .el { min-height: 1.55em; }
.overlay .el.bad { background: var(--mark); color: var(--mark-ink); }
.match { outline: 2px solid var(--pen); border-radius: 2px; }
#edText { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; resize: none; background: transparent; color: transparent; caret-color: var(--ink); overflow: auto; outline-offset: -3px; }
.err { border: 2px solid var(--false); border-radius: 4px; padding: 8px 12px; }
.err strong { color: var(--false); }
.err pre, .snip { margin: 6px 0 0; font-size: 14px; white-space: pre; overflow-x: auto; }
.hint { color: var(--ink-2); font-size: 13px; }

/* the step, in words */
.say { border-left: 5px solid var(--ink); padding: 8px 12px; background: var(--block); min-height: 64px; font-size: 16px; }
.say code { font-weight: 700; }
.chain { font-family: var(--code); font-size: .9em; margin-top: 4px; overflow-x: auto; white-space: nowrap; }
.chain .to { color: var(--ink-2); padding: 0 6px; }
.say .status { margin-top: 6px; font-size: .88em; color: var(--ink-2); }
.tagline { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--tag); border: 1.5px dashed var(--tag); border-radius: 3px; padding: 1px 8px; }
.say .bad { color: var(--false); font-weight: 700; }
.budget { border: 2px solid var(--ink); border-radius: 4px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scrub input { width: 100%; accent-color: var(--pen); }
.count { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }

/* state */
table { border-collapse: collapse; font-size: 14px; }
th, td { border: 1.5px solid var(--rule); padding: 5px 10px; text-align: left; vertical-align: baseline; }
thead th { border-bottom-color: var(--ink); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.mono, .tt td, .tt thead th { font-family: var(--code); font-variant-numeric: tabular-nums; }
.tt thead th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.tt tbody th { font-weight: 400; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.tt tr.new td, .tt tr.new th { background: var(--mark); color: var(--mark-ink); }
.tt .d1 { padding-left: 26px; } .tt .d2 { padding-left: 42px; } .tt .d3 { padding-left: 58px; }
tr.chg td { outline: 2.5px solid var(--ink); outline-offset: -2px; }
.chip { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border: 1.5px solid currentColor; border-radius: 3px; padding: 0 5px; margin-left: 6px; font-family: var(--ui); }
s { color: var(--ink-2); }
.hist { color: var(--ink-2); font-family: var(--code); font-size: 13px; }
.empty { color: var(--ink-2); font-size: 14px; }
#lists { display: flex; flex-direction: column; gap: 6px; }
#table { max-height: 52vh; overflow: auto; }
.tt .chip { margin-left: 8px; }
#lists:not(:empty) { margin-bottom: 10px; }
.listhead { display: flex; align-items: baseline; gap: 10px; font-family: var(--code); }
.listhead small { font-family: var(--ui); color: var(--ink-2); }
.listrow { position: relative; height: 68px; --w: 64px; }
.cellbox { position: absolute; top: 0; left: 0; width: var(--w); transition: transform .28s ease, opacity .28s ease; text-align: center; font-family: var(--code); }
.cellbox .ix { font-size: 12px; color: var(--ink-2); height: 20px; }
/* A value too long for its box is cut at the end with an ellipsis, not in the middle; the full value is its tooltip. */
.cellbox .vl { border: 1.5px solid var(--ink); height: 40px; line-height: 37px; padding: 0 5px; text-align: center; background: var(--panel); font-size: 15px; margin-right: -1.5px; transition: transform .28s ease; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cellbox.acc .vl { background: var(--mark); color: var(--mark-ink); outline: 3px solid var(--ink); outline-offset: -3px; position: relative; z-index: 1; }
.cellbox.in { opacity: 0; }
.cellbox.in .vl { transform: translateY(-16px); }
.cellbox.gone { opacity: 0; }
.cellbox.ghost .vl { border-style: dashed; border-color: var(--false); color: var(--false); background: none; }
.cellbox.ghost .ix { color: var(--false); font-weight: 700; }
.listrow.long { height: auto; display: flex; flex-wrap: wrap; gap: 6px 0; align-items: flex-end; }
.listrow.long .cellbox { position: static; width: auto; min-width: 46px; }
.listrow.long .vl { padding: 0 8px; }
.gap { align-self: center; padding: 0 10px; color: var(--ink-2); font-size: 13px; }
.call { border: 1.5px solid var(--ink); border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; }
.call h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .cellbox, .cellbox .vl { transition: none !important; } }

/* the robot's grid */
.fieldwrap { padding: 18px; display: inline-block; }
.field { --cell: 44px; --cols: 5; position: relative; display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); border: 1.5px solid var(--ink); width: max-content; }
.sqr { width: var(--cell); height: var(--cell); border: 1px solid var(--rule); background: var(--panel); padding: 0; position: relative; display: flex; align-items: center; justify-content: center; font: 700 11px var(--ui); color: var(--ink); cursor: default; }
/* A finger on the grid in edit mode is a drag of the robot, not a scroll of the page. */
.field.editing { touch-action: none; }
.field.editing .sqr { cursor: pointer; }
.field.editing .sqr:hover { outline: 2px solid var(--pen); outline-offset: -2px; }
/* Hatching as well as a dark fill, so a blocked square does not depend on color. */
.sqr.blocked { background: repeating-linear-gradient(45deg, var(--blocked) 0 5px, var(--blocked-2) 5px 7px); }
.sqr.goal { box-shadow: inset 0 0 0 3px var(--ink); }
.sqr .flag { width: 18px; height: 18px; display: block; }
.sqr .flag path { fill: var(--ink); }
.sqr.trail::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); }
.sqr.goal.trail::after { display: none; }
.sqr.chk { outline: 3px dashed var(--pen); outline-offset: -4px; z-index: 1; }
/* Drawn inside the square and above its neighbors, so no later square paints over it. */
.field .sqr:focus-visible, .field.editing .sqr:focus-visible { outline: 3px solid var(--pen); outline-offset: -3px; z-index: 2; }
.sqr.chk .lab { background: var(--panel); color: var(--ink); padding: 0 3px; border-radius: 2px; position: relative; z-index: 1; }
/* A point on the border, with the word centered on it: only the word itself reaches past the grid, and the padding around the grid has room for it. */
.field .edge { position: absolute; top: 0; left: 0; width: 0; height: 0; pointer-events: none; z-index: 3; }
.field .edge span { position: absolute; transform: translate(-50%, -50%); background: var(--panel); border: 1.5px solid var(--false); border-radius: 3px; padding: 0 3px; font: 700 11px/1.3 var(--ui); color: var(--false); white-space: nowrap; }
.bot { position: absolute; top: 0; left: 0; width: var(--cell); height: var(--cell); transition: transform .28s ease; pointer-events: none; z-index: 2; }
.bot .turn { width: 100%; height: 100%; transition: transform .28s ease; }
.bot .nudge { width: 100%; height: 100%; }
.bot svg { width: 100%; height: 100%; display: block; }
.bot polygon { fill: var(--pen); stroke: var(--ink); stroke-width: 2; }
/* The triangle's own "up" is the way the robot faces, so forward is always this direction. */
@keyframes bump { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-34%); } 60% { transform: translateY(-20%); } }
.bot .nudge.bump { animation: bump .45s ease; }
@media (prefers-reduced-motion: reduce) { .bot, .bot .turn { transition: none !important; } .bot .nudge.bump { animation: none; } }

/* the Teach menu and the tool it opens */
.menu { position: absolute; right: 14px; top: 58px; z-index: 6; width: min(420px, calc(100% - 28px)); background: var(--panel); border: 2px solid var(--ink); border-radius: 4px; display: flex; flex-direction: column; }
.menu .it { background: var(--panel); border: 0; border-top: 1.5px solid var(--rule); text-align: left; padding: 8px 12px; display: flex; flex-direction: column; }
.menu .it:first-child { border-top: 0; }
.menu .it:hover:not(:disabled), .menu .it:focus-visible { background: var(--block); }
.menu .it:disabled { opacity: .45; cursor: default; }
.menu .it small { color: var(--ink-2); font-size: 13px; }
.tool { border-top: 2px solid var(--ink); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* The tools work on a run, so they wait while the program is being written. */
.app.editing .tool { display: none; }
.toolout { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sheetkey summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.toolhead { display: flex; align-items: center; gap: 10px; }
.toolhead h2 { margin: 0; font-size: 18px; font-weight: 800; }
#toolBody { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 1100px; }
#toolBody .q { font-size: 18px; font-weight: 600; }
.pick { border: 1.5px solid var(--rule); border-radius: 4px; padding: 6px 12px; display: flex; flex-direction: column; margin: 0; }
.pick legend { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 0 4px; }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.choices.edit { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.choice { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 8px; align-items: baseline; text-align: left; background: var(--panel); border: 1.5px solid var(--ink); border-radius: 4px; padding: 8px 10px; min-height: 44px; font-family: var(--code); }
.choice b { font-family: var(--ui); grid-row: span 3; }
.choice small, .choice em { grid-column: 2; font-family: var(--ui); font-size: 13px; color: var(--ink-2); font-style: normal; }
.choice.right { box-shadow: inset 6px 0 0 var(--true); }
.choice.right em { color: var(--true); font-weight: 700; }
.choice.wrong { box-shadow: inset 6px 0 0 var(--false); }
.choice.wrong em { color: var(--false); font-weight: 700; }
.choice:disabled { opacity: 1; cursor: default; color: var(--ink); }
.choice textarea, .choice input, #rowsText { width: 100%; font-family: var(--code); font-size: 14px; background: var(--panel); color: var(--ink); border: 1.5px solid var(--rule); border-radius: 3px; padding: 4px 6px; white-space: pre; resize: vertical; }
.choice .stack { display: flex; flex-direction: column; gap: 4px; }
.gridt th, .gridt td { text-align: center; }
.gridt thead th small { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; }
.gridt td { padding: 0; }
.cellbtn { background: none; border: 0; width: 100%; min-height: 40px; padding: 4px 10px; font-family: var(--code); display: block; }
.cellbtn:hover { background: var(--block); }
.cellbtn small, .gridt small { display: block; font-family: var(--ui); font-size: 11px; font-weight: 600; }
.gridt .diff, .gridt .diff small { color: var(--false); }
.cover { border: 1.5px dashed var(--ink); border-radius: 4px; padding: 14px; text-align: center; color: var(--ink-2); background: repeating-linear-gradient(-45deg, var(--block) 0 10px, var(--panel) 10px 20px); }
.app.covered .out > *, .app.covered #say, .app.covered #vars, .app.covered #lists, .app.covered #calls, .app.covered #table, .app.covered .note-cond { visibility: hidden; }
.app.covered .out { background: repeating-linear-gradient(-45deg, var(--block) 0 10px, var(--panel) 10px 20px); }
.charts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.chart h3 { margin: 0 0 4px; font-size: 15px; }
.bars { width: 100%; }
.bars caption { text-align: left; font-size: 13px; color: var(--ink-2); padding-bottom: 4px; }
.bars th, .bars td { border: 0; padding: 2px 6px; }
.bars th { font-family: var(--code); text-align: right; width: 1%; white-space: nowrap; font-weight: 400; }
.bars td:nth-child(2) { width: 99%; }
.bars .bar { display: block; height: 16px; background: var(--pen); border-radius: 0 3px 3px 0; min-width: 2px; }
.bars .num { font-family: var(--code); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.growth { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.growth .scrollx { max-height: 260px; overflow: auto; }
.plot { width: 100%; max-width: 460px; height: auto; }
.plot .axis { stroke: var(--ink); stroke-width: 1.5; }
.plot polyline { fill: none; stroke: var(--pen); stroke-width: 2.5; }
.plot circle { fill: var(--pen); }
.plot text { fill: var(--ink-2); font: 12px var(--code); }
.banner { border: 2px solid var(--ink); border-radius: 4px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--block); }
.banner span { flex: 1 1 200px; }
.classask { margin: 0; font-size: 15px; color: var(--ink-2); }
.classask strong { color: var(--ink); }
.app.editing .classask { display: none; }
#library { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.proc { border: 1.5px solid var(--rule); border-radius: 4px; padding: 6px 10px; }
.proc code { font-weight: 700; }
.proc small { display: block; color: var(--ink-2); font-size: 13px; }
.proc .tagline { margin-top: 4px; }
.proc ul { margin: 4px 0 0; padding-left: 18px; font-family: var(--code); font-size: 13px; }
.ln .no.point { color: var(--pen); font-weight: 700; text-decoration: underline; }
.ln .no.point::before { content: "? "; }
.app.pointing .ln .no { cursor: pointer; outline: 1.5px dashed var(--pen); outline-offset: 1px; }
.tt input { width: 7ch; font-family: var(--code); font-size: 14px; background: var(--panel); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 3px; padding: 2px 4px; }
.tt .verdict { display: block; font-family: var(--ui); font-size: 11px; font-weight: 600; }
.tt .verdict.no { color: var(--false); }
.tt .verdict.yes { color: var(--true); }

/* the printed worksheet: black on white whatever the screen theme, one page each */
.sheet { display: none; }
.sheetview { border: 1px solid var(--rule); background: #fff; max-height: 520px; overflow: auto; }
.sheet .page, .sheetview .page { background: #fff; color: #000; font: 13px/1.45 var(--ui); padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.sheetview .page + .page { border-top: 2px dashed #888; }
.page .row { display: flex; gap: 8px; align-items: flex-end; }
.page .fill { flex: 1; }
.page .rule { display: inline-block; width: 150px; border-bottom: 1.2px solid #000; height: 16px; }
.page .rule.wide { flex: 1; width: auto; }
.page pre { margin: 0; font: 12.5px/1.5 var(--code); border: 1.2px solid #000; padding: 8px 10px; white-space: pre; overflow: hidden; }
.page table { width: 100%; border-collapse: collapse; }
.page th, .page td { border: 1.2px solid #000; height: 26px; padding: 2px 8px; font-family: var(--code); color: #000; text-transform: none; letter-spacing: 0; font-size: 13px; }
.page footer { margin-top: auto; font-size: 10.5px; color: #333; }
@media print {
  body.printing { background: #fff; padding: 0; }
  body.printing .app { display: none; }
  body.printing .sheet { display: block; }
  body.printing .sheet .page { min-height: 96vh; break-after: page; padding: 0; }
  body.printing .sheet .page:last-child { break-after: auto; }
}

/* output and questions */
.out { border: 1.5px solid var(--ink); border-radius: 4px; min-height: 52px; max-height: 30vh; overflow-y: auto; padding: 10px 12px; font-family: var(--code); font-size: 18px; overflow-wrap: anywhere; white-space: pre-wrap; }
.out .dot { color: var(--ink-2); }
.out .empty { font-family: var(--ui); }
.out .new { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ask { border: 2px solid var(--ink); border-radius: 4px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--block); margin: 0; }
.ask .q { font-size: 17px; font-weight: 600; }
.ask input[type="text"] { flex: 1 1 120px; min-width: 0; min-height: 44px; font-family: var(--code); }
.settings { border-top: 1.5px solid var(--rule); padding-top: 8px; }
.settings summary { cursor: pointer; font-weight: 600; }
.toast { position: absolute; right: 14px; top: 62px; background: var(--ink); color: var(--panel); padding: 8px 12px; border-radius: 4px; max-width: min(420px, 90%); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toast input { flex: 1 1 100%; font-family: var(--code); font-size: 13px; }
.toast .btn { min-height: 30px; padding: 2px 10px; color: var(--ink); }
.foot { border-top: 1.5px solid var(--rule); padding: 8px 14px; font-size: 12px; color: var(--ink-2); }
.foot a { color: var(--pen); }
