/* Okabe-Ito: orange #E69F00 live, sky blue #56B4E9 second series, bluish green
   #009E73 solved, yellow #F0E442 fill only, blue #0072B2 the reader's hand,
   vermillion #D55E00 loss, reddish purple #CC79A7 the model's output. */
:root { --ink: #1f2328; --muted: #6b7280; --rule: #d6d8dc; --hand: #0072B2; --ok: #009E73; --loss: #D55E00; }
html { height: 100%; }
body { margin: 0; font: 13px/1.35 "Iowan Old Style", Palatino, Georgia, serif; color: var(--ink); background: #fff; }
body.bare { background: transparent; height: auto; }
#app { padding: 10px; }
body.bare #app { padding: 2px 0 6px; }
/* In a frame wider than its contents (a laptop column) each line sits in the middle, under the centred diagrams. */
.tr-head { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.tr-title { font-weight: 600; }
.tr-badge { font: 11px ui-monospace, Menlo, monospace; border: 1px solid var(--ink); border-radius: 3px; padding: 1px 5px; }
.tr-badge.fallback { border-style: dashed; }
.tr-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; align-items: flex-start; }
.tr-diagrams { flex: 1 1 100%; min-width: 260px; }
.tr-dia { overflow: hidden; height: 200px; }
.tr-diagrams iframe { display: block; width: 100%; border: 0; height: 200px; background: transparent; transform-origin: 0 0; }
/* On a frame narrower than the drawing (a phone) the world and its canvas shrink to fit; the canvas keeps its aspect (main.js painter). */
.tr-world { flex: 0 0 auto; max-width: 100%; }
.tr-world canvas { display: block; max-width: calc(100% - 2px); border: 1px solid var(--rule); background: #fff; }
.tr-info { font: 11px ui-monospace, Menlo, monospace; color: var(--muted); max-width: 282px; margin-top: 3px; min-height: 2.6em; }
.tr-laws { flex: 1 1 220px; min-width: 210px; max-width: 320px; }
.tr-law { margin-bottom: 6px; }
.tr-law-head { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.tr-law-val { font: 11px ui-monospace, Menlo, monospace; white-space: nowrap; }
.tr-law canvas { display: block; width: 100%; height: 46px; }
.tr-law.under .tr-law-val { color: var(--ok); }
.tr-slider { display: flex; align-items: center; gap: 6px; font: 11px ui-monospace, Menlo, monospace; color: var(--hand); }
.tr-slider input { flex: 1; accent-color: var(--hand); }
.tr-solved { margin: 6px 0; padding: 3px 6px; border: 1px dashed var(--rule); font-size: 12px; color: var(--muted); }
.tr-solved.on { border: 1.5px solid var(--ok); color: var(--ok); font-weight: 600; background: rgba(0,158,115,0.06); }
.tr-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center; margin-top: 8px; font: 11px ui-monospace, Menlo, monospace; }
.tr-controls button { font: inherit; padding: 2px 8px; border: 1px solid var(--ink); background: #fff; border-radius: 3px; cursor: pointer; }
.tr-controls button.primary { background: var(--ink); color: #fff; }
.tr-controls label { display: inline-flex; align-items: center; gap: 4px; color: var(--hand); max-width: 100%; }
.tr-controls select { min-width: 0; }   /* a long option list narrows on a phone instead of pushing past the edge */
.tr-controls input[type=range] { width: 80px; accent-color: var(--hand); }
.tr-controls input[type=number] { width: 52px; font: inherit; }
.tr-clock { color: var(--muted); }
.tr-error { color: var(--loss); font: 12px ui-monospace, Menlo, monospace; }

/* fully elaborate: a learner box opened into its internals, under the equation */
.tr-open { border-top: 1px dashed #E69F00; margin-top: 6px; padding-top: 4px; }
.tr-open-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: #57606a; }
.tr-open-toggle[aria-pressed="true"] { background: #fff4dc; border-color: #E69F00; }
