/* BioGraphs app: page layout (layout C2, chosen 2026-11-22). One scrolling page, one screen per step:
   1 Data → 2 Chart → 3 Figure (tabs Chart / Code / Output / Statistics) → 4 Export. Uses only the UI kit's tokens (ui/ui.css), so light and
   gray both work. Shared basics (top bar, pills, tables, console, modal) come from /style.css. */
:root { --tb: 51px; --btn-gap: 8px; --page-pad: 14px 20px 16px; --block-gap: 16px; }
/* --page-pad: the space around every step's screen (top under the bar, sides, bottom); --block-gap: between two boxes side
   by side (Figure: settings | chart; Export: preview | file). One value each, so every screen is spaced alike. */ /* --btn-gap: the space between buttons side by side, everywhere in the app (one value: rows of buttons look alike) */
body { overflow-x: hidden; }
/* (the steps are placed by the paging, paging.js: the browser's own scroll anchoring moved the page a little when a
   step above grew, and the step shown was then left part way down, 2026-11-29) */
html { overflow-anchor: none; }

/* ---------- top bar: brand + Under development · Report a bug | steps (centred) | Python status, theme ---------- */
.topbar { gap: 16px; }
/* one small yellow button next to the title: a tag "Under development", then "Report a bug" */
.bug-btn { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px 0 3px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); white-space: nowrap; }
.bug-btn:hover { background: color-mix(in srgb, var(--warn) 22%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.bug-tag { padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--panel); background: var(--warn); }
.bug-lbl { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.bug-lbl .ui-icon { width: 13px; height: 13px; }
@media (max-width: 700px) { .bug-tag { display: none; } .bug-btn { padding-left: 9px; } } /* (a phone: Report a bug only) */
.topbar .topbar-left, .topbar .topbar-right { flex: 1 1 0; min-width: max-content; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar .topbar-right { justify-content: flex-end; }
/* (the top bar stays over everything below it, a closed step's cover included: on a narrow window a step can scroll
   under it) */
#top { z-index: 30; }
/* (room above and below for the "go here" ring, which the sideways scrolling would otherwise cut; the height stays) */
.stepper { display: flex; justify-content: center; align-items: center; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-block: 6px; margin-block: -6px; }
.stepper a { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 4px 10px; font-size: 13px; white-space: nowrap; text-decoration: none; border-radius: 999px; }
.stepper a:hover { background: var(--hover); color: var(--ink); }
.stepper a b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--sunken); color: var(--muted); }
.stepper a.done b { background: var(--ok-soft); color: var(--ok); }
.stepper a.on { color: var(--ink); font-weight: 600; }
.stepper a.on b { background: var(--accent); color: var(--accent-ink); }
.stepper a small { color: var(--faint); font-weight: 400; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.stepper .bar { width: 28px; height: 1.5px; background: var(--line-strong); align-self: center; flex: none; }
/* a step that is not open yet (the one before it is not done): quiet */
.stepper a.closed { color: var(--faint); }
.stepper a.closed b { background: transparent; border: 1px dashed var(--line-strong); color: var(--faint); }
/* the open step's parts (Data › Table · Columns, Chart › Type · Figure): small pills joined in one capsule */
/* the › before them is the last thing in the step's own pill: the same 8 px from the name and (with the pill's smaller
   right padding and 2 px outside it) from the parts, hovered or not */
.stepper a.has-subs { padding-right: 6px; margin-right: 2px; }
.stepper .sub-sep { color: var(--faint); font-weight: 400; }
/* a step's parts, listed on hover while another step is shown (main.js openMenu): floats over the page */
/* its look (design "Minimal"): a small plain menu, one row per part: tick | name | what it holds (grey, cut with … when
   long; all of it on pointing) | its key. Pointing fills the row with the accent, like a system menu. */
.step-menu { position: fixed; z-index: 40; width: max-content; min-width: 240px; max-width: min(400px, calc(100vw - 16px)); padding: 4px; display: grid;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); animation: sm-in .14s ease-out; }
.step-menu[hidden] { display: none; }
@keyframes sm-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .step-menu { animation: none; } }
.step-menu a { display: grid; grid-template-columns: 12px auto minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 5px;
  font-size: 13px; color: var(--ink); text-decoration: none; }
.step-menu a .ck { color: var(--ok); font-size: 11px; font-weight: 700; }
.step-menu a .nm { font-weight: 600; min-width: 56px; }
.step-menu a .inf { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-menu a kbd { font: 11px var(--mono); color: var(--faint); }
.step-menu a:hover, .step-menu a:focus-visible { background: var(--accent); color: var(--accent-ink); outline: none; }
.step-menu a:hover :is(.ck, .inf, kbd), .step-menu a:focus-visible :is(.ck, .inf, kbd) { color: inherit; opacity: .85; }
.step-menu a.off { cursor: not-allowed; }
.step-menu a.off .nm, .step-menu a.off .inf { color: var(--faint); }
.step-menu a.off:hover, .step-menu a.off:focus-visible { background: var(--hover); color: var(--ink); }
.step-menu a.off:hover :is(.nm, .inf, kbd) { color: var(--faint); opacity: 1; }
/* a segmented control: a sunken track, the part shown now a chip on it with a plain 1 px border (every part has a
   transparent one, so nothing moves), no shadow; done parts with a green tick; the same tokens in both themes */
.substeps { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); }
.substeps > a, .substeps > button { display: inline-flex; align-items: center; gap: 4px; padding: 2px 11px; border: 1px solid transparent; border-radius: 999px; background: none; box-shadow: none;
  font: inherit; font-size: 12.5px; line-height: 18px; color: var(--muted); text-decoration: none; height: auto; cursor: pointer; white-space: nowrap; }
.substeps > a:hover, .substeps > button:hover { color: var(--ink); }
.substeps > .on, .substeps > .on:hover { background: var(--panel); color: var(--accent); font-weight: 600; border-color: var(--line); box-shadow: none; } /* a plain 1 px border, the colour of the track's own line */
.substeps > .off, .substeps > .off:hover { color: var(--faint); cursor: not-allowed; opacity: .75; }
.substeps i.ok { font-style: normal; font-size: 11px; color: var(--ok); font-weight: 700; }
/* Where to go: the step to open next pulses (a ring going out from it) while a closed step's cover is on screen, and
   for a few seconds after a closed step was clicked; the cover's own button pulses with it (main.js paintGoHere) */
@keyframes sg-go { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); } }
.stepper > a.go-here b, .substeps > a.go-here, .step-lock-box .btn-primary { animation: sg-go 1.4s ease-out infinite; }
.stepper > a.go-here { color: var(--ink); }
.stepper > a.go-here b { background: var(--accent); color: var(--accent-ink); }
.substeps > a.go-here { color: var(--accent); background: var(--panel); border-color: var(--line); }
/* a step not open yet: covered, with why and the way back */
.step { position: relative; }
.step-lock { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(3px); }
.step-lock[hidden] { display: none; }
/* what is still needed (main.js lockBox): a short checklist; done = ticked, the next one highlighted with its button */
.step-lock-box { width: min(460px, 100%); display: grid; gap: 12px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); } /* (a 1 px line only, as every box) */
.step-lock-box > strong { font-size: 15px; color: var(--ink); }
.step-lock-box ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step-lock-box li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-size: 13.5px; }
.step-lock-box li .d { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
  border: 1px dashed var(--line-strong); color: var(--faint); }
.step-lock-box li .t { flex: 1; min-width: 0; display: grid; }
.step-lock-box li .t b { font-weight: 500; }
.step-lock-box li .t small { font-size: 12px; color: var(--muted); }
.step-lock-box li.done .d { border: 0; background: var(--ok-soft); color: var(--ok); }
.step-lock-box li.done .t b { color: var(--muted); }
.step-lock-box li.next { background: var(--accent-soft); color: var(--ink); }
.step-lock-box li.next .d { border: 0; background: var(--accent); color: var(--accent-ink); }
.step-lock-box li.next .t b { font-weight: 600; }
.step-lock-box a.btn-primary { flex: none; text-decoration: none; padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px; white-space: nowrap; }
@media (max-width: 1380px) { .stepper a small { display: none; } }
/* Python status: a button that opens the Python details */
button.py-btn { border: 0; box-shadow: none; cursor: pointer; font: inherit; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; max-width: 280px; }
button.py-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.py-btn:hover { filter: brightness(.95); }
button.py-btn.pill-busy::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; flex: none; }

/* ---------- steps ---------- */
/* the steps place the page themselves (paging.js): no browser scroll anchoring, which moved it when a part above or
   at the top of the screen was drawn again (e.g. the sheet arriving under Table) */
html { overflow-anchor: none; }
.step { min-height: calc(100vh - var(--tb)); display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.step:last-of-type { border-bottom: 0; }
.step > .page { flex: 1; display: flex; flex-direction: column; width: 100%; }
.page { max-width: 1400px; margin: 0 auto; padding: 32px 24px 28px; }
.page h1, .ws-title h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 10px; }
.page h1 span, .ws-title h1 span, .fig-head h1 span { color: var(--faint); font-weight: 500; }
.page .lead { color: var(--muted); margin: 0 0 20px; }
/* screen-sized steps (figure): panels scroll inside, the step never grows */
.screen { height: calc(100vh - var(--tb)); min-height: 560px; padding: var(--page-pad); }
.ws-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ws-title h1 { font-size: 18px; margin: 0; }
.grid { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); gap: 16px; }
.grid > * { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.panel h2 { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 10px; display: flex; align-items: center; gap: 8px; }
.cap { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cap i { font-style: normal; font-size: 11px; color: var(--faint); }
.cap i.req { color: var(--warn); }
.pi { width: 22px; height: 22px; flex: none; }
/* chart icons (pages.js ICON): one drawing, each part coloured by its layer class, all in the accent colour
   (duotone); the order matters where a part has two classes (e.g. "ax dash thin", "cs sep") */
.ci { --tile-solid: var(--panel); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ci .ax { stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-width: 1.1; }
.ci .thin { stroke-width: 1; }
.ci .med { stroke-width: 1.9; }
.ci .dash { stroke-dasharray: 1.5 1.6; }
.ci :is(.mk, .ac, .b, .c) { stroke: var(--accent); }
.ci .fl { fill: color-mix(in srgb, var(--accent) 24%, transparent); }
.ci .bf { fill: color-mix(in srgb, var(--accent) 45%, transparent); }
.ci :is(.cf, .fl2) { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.ci :is(.acf, .mkf, .hp) { fill: var(--accent); stroke: none; }
.ci .bs { fill: color-mix(in srgb, var(--accent) 50%, var(--tile-solid)); stroke: none; }
.ci .cs { fill: color-mix(in srgb, var(--accent) 25%, var(--tile-solid)); stroke: none; }
.ci .ns { fill: color-mix(in srgb, var(--accent) 35%, transparent); stroke: none; }
.ci .hn { fill: color-mix(in srgb, var(--accent) 40%, var(--tile-solid)); stroke: none; }
.ci .sl { fill: color-mix(in srgb, var(--accent) 16%, var(--tile-solid)); }
.ci .hole { fill: var(--tile-solid); }
.ci .sep { stroke: var(--tile-solid); stroke-width: .9; }
.empty-note { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }

/* ---------- step 1: data ---------- */
/* left: where the data comes from (a file, or a demo from the pop-up), and below it the recent work, which scrolls;
   right: the data itself, filling the rest of the screen and scrolling inside */
/* the whole step fits the window: the table and the recent list take the room that is left, and scroll inside */
/* (step 2 the same: the chart cards scroll inside their box) */
/* no page titles (the top bar says where you are): each step uses the whole window, with the Figure's margins */
.data-step, #s2 { height: calc(100vh - var(--tb)); min-height: 560px; }
.data-step .page, #s2 .page, #s4 .page { min-height: 0; max-width: none; padding: var(--page-pad); } /* (the panels reach down to the bottom) */
/* 1 Data's three parts (Open, Table, Columns): each a screen, its frame filling what is left of it */
.data-step .data-main { flex: 1 1 auto; min-height: 0; }
#tableView, #columnsView { display: flex; flex-direction: column; }
#tableView > .stage-frame, #columnsView > .stage-frame { flex: 1 1 auto; min-height: 0; }
.tbl-sheet { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.tbl-sheet .data-table { flex: 1 1 auto; min-height: 0; max-height: none; }
.tbl-msg:empty { display: none; }
/* Table's first line: the file, its size, how it is read; Reading options (one line, opens the options under it) */
.file-line { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; margin-bottom: 8px; min-height: 30px; }
.file-line strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.file-line .file-meta { font-size: 12px; color: var(--muted); }
.file-line .spacer { flex: 1; }
.file-line .read-toggle { flex-direction: row; align-items: center; gap: 8px; padding: 4px 10px; }
.file-line .read-toggle small { max-width: 360px; }
/* Columns' line over the box: which values are read (bold), what can be done with them */
.data-head.cols-line { align-items: center; flex: none; } /* (flex: none: in Review's column it was squeezed to its 30px, the box below then covered it) */
.cols-line strong { flex: none; }
.cols-line .file-meta { flex: 1 1 420px; line-height: 1.5; }
.cols-line .ui-help { margin-left: 4px; } /* (on the text's line, as the "?" in Table's message: the kit's own alignment) */
/* "Use the table found: A1:C7", at the end of the cells bar */
.sel-bar #selFound b { font-family: var(--mono); font-weight: 600; margin-left: 4px; }
.sel-info.pending { color: var(--warn); }
/* a file dragged over the Table or the Columns: it will replace the data */
.data-drop.dragging { position: relative; }
.data-drop.dragging::after { content: "Drop to open this file in place of the data"; position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; font-size: 17px; font-weight: 600;
  border: 2px dashed var(--accent); border-radius: var(--radius); background: color-mix(in srgb, var(--accent-soft) 88%, transparent); color: var(--ink); pointer-events: none; }
.recent-card.on { border-color: var(--accent); background: var(--accent-soft); }
/* the chooser: the categories as tabs joined to a frame of cards (the Figure's Chart / Code / Output / Statistics tabs,
   .view-tabs below). The frame's top-left corner is square under the first tab, rounded when another tab is open. */
#chooser { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* one row that scrolls sideways when the window is narrow (wrapped tabs could not join the frame); it overlaps the
   frame's top line by 1 px, so the open tab covers that line */
#chooser .chooser-tabs { flex: none; position: relative; z-index: 2; margin-bottom: -1px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
#chooser .chooser-tabs::-webkit-scrollbar { display: none; }
#chooser .chooser-tabs button { flex: none; margin-bottom: 0; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.charts-box { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.charts-frame { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius); overflow: hidden; }
#chooser.not-first .charts-frame { border-top-left-radius: var(--radius); }
#chooser .charts { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; align-content: start; padding: 16px;
  grid-auto-rows: minmax(min-content, max-content); } /* rows as tall as their cards (in a box of fixed height they would shrink) */
/* left: recent projects; right: the drop area until there is data you chose, then the data (a file dropped on it replaces it) */
.data-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
/* the start screen (no data chosen yet): under the drop area, the most recent projects as cards */
.recent-start { flex: none; margin-top: 18px; }
.recent-start[hidden] { display: none; }
.recent-start-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 12.5px; color: var(--faint); }
.recent-start-head b { font-size: 14px; color: var(--ink); }
.recent-start-head .spacer { flex: 1; }
.recent-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.recent-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; height: auto; padding: 10px; text-align: left; white-space: normal;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: none; font-weight: 400; }
.recent-card:hover { border-color: var(--accent); }
.recent-card img, .recent-card .thumb-empty { width: 100%; height: 92px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); }
.recent-card strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-card small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Recent projects, the pop-up: the list scrolls inside it */
/* Recent projects, the pop-up ("Show all"): what it is in one line and the ×; every project in one box that scrolls
   (as the page and its panels: the pop-up in the page's colour, the box in the panels' lighter one); Clear all under
   it. No heading. */
.recent-box-modal { width: min(560px, 94vw); padding: 16px 18px 12px; display: flex; flex-direction: column; overflow: hidden; max-height: min(80vh, 720px); background: var(--bg); }
.recent-box-modal #recent { flex: 1 1 auto; min-height: 0; }
.recent-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.recent-top .recent-cap { display: block; flex: 1; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.recent-top .recent-cap b { color: var(--ink); font-weight: 600; }
.recent-top .btn-icon { flex: none; margin: -4px -6px 0 0; }
#recent .recent-list { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
#recent .recent-list li { flex: none; min-height: 0; } /* (a row is never squeezed: the list scrolls) */
#recent .recent-open { padding: 7px 8px; gap: 12px; }
#recent .recent-list li:hover { background: var(--hover); }
#recent .recent-list li.on { background: var(--accent-soft); }
#recent .recent-list img, #recent .recent-list .thumb-empty { width: 52px; height: 36px; border-radius: 4px; }
#recent .recent-list .thumb-empty { background: var(--panel-2); }
#recent .recent-t { gap: 1px; }
#recent .recent-t strong { font-weight: 600; }
#recent .recent-t small em { font-style: normal; color: var(--accent); }
#recent .recent-foot { border-top: 0; padding-top: 10px; margin-top: 0; justify-content: flex-end; color: var(--faint); }
#recent .recent-foot .link:not(.danger) { color: var(--muted); }
#recent .recent-foot .link:not(.danger):hover { color: var(--accent); }.data-main { position: relative; }
.drop { flex: 1 1 auto; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; border-radius: var(--radius); text-align: center;
  border: 1.5px dashed var(--line-strong); color: var(--muted); background: var(--panel-2); transition: border-color .15s, background .15s; }
.drop[hidden] { display: none; }
.drop .drop-ic .ui-icon { width: 34px; height: 34px; }
.drop strong { color: var(--ink); font-weight: 600; font-size: 17px; }
.drop small { font-size: 12.5px; color: var(--faint); }
.demo-hint { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.demo-hint .link { font-size: inherit; }
.demo-hint span { color: var(--faint); }.data-main.dragging .drop { border-color: var(--accent); background: var(--accent-soft); }
.data-view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.data-view[hidden] { display: none; }
.data-swap { font-size: 12px; color: var(--faint); margin-top: 2px; }
.data-swap .link { font-size: inherit; }
/* a file dragged over the data shown: it will replace it */
.drop-over { display: none; position: absolute; inset: 0; z-index: 5; flex-direction: column; align-items: center; justify-content: center; gap: 8px; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: var(--radius); background: color-mix(in srgb, var(--accent-soft) 88%, transparent); color: var(--ink); }
.drop-over .ui-icon { width: 34px; height: 34px; color: var(--accent); }
.drop-over strong { font-size: 17px; }
.drop-over small { color: var(--muted); }
.data-main.dragging .data-view:not([hidden]) ~ .drop-over { display: flex; }
.drop-ic { display: inline-flex; color: var(--muted); }
.drop-ic .ui-icon { width: 22px; height: 22px; }
.recent-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.recent-box .recent-list { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; align-content: start; margin: 0 -6px; padding: 0 6px; }
.recent-box .recent-foot { color: var(--faint); padding-top: 6px; border-top: 1px solid var(--line); }
/* the demo datasets pop-up: a card per dataset */
.demo-box { width: min(1100px, 100%); max-width: none; display: flex; flex-direction: column; overflow: hidden; }
.demo-box .modal-head h2 { color: var(--ink); margin: 0; }
.demo-box .modal-head input[type="search"] { width: 260px; }
.demo-box > p { margin: 6px 0 14px; }
.demo-grid { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 2px; align-content: start; }
.demo-card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; height: auto; text-align: left; white-space: normal; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); box-shadow: none; }
.demo-card:hover { border-color: var(--accent); }
.demo-card.on { border-color: var(--accent); background: var(--accent-soft); }
.dc-top { display: flex; align-items: center; gap: 12px; }
.dc-top strong { font-size: 14px; font-weight: 600; }
/* the chart the demo opens on: its icon (the chart chooser's, in a smaller tile) and its name under the dataset's */
.dc-ic { --tile-solid: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: none; border-radius: 11px; background: var(--tile-solid); }
.dc-ic .pi { width: 38px; height: 38px; }
.demo-card.on .dc-ic { --tile-solid: var(--panel); }
.dc-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dc-chart { font-size: 12px; font-weight: 400; color: var(--muted); }
.dc-top .dc-now { align-self: flex-start; }
.dc-src { font-size: 11px; color: var(--faint); }
.dc-now { margin-left: auto; font-size: 11px; font-weight: 550; color: var(--accent); }
.dc-what { font-size: 12.5px; line-height: 1.45; font-weight: 400; color: var(--ink); }
/* a demo: its card, then its source (the dataset's documentation page) as a link under it */
.demo-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.demo-item .demo-card { flex: 1; }
.dc-try { font-size: 12px; line-height: 1.45; font-weight: 400; color: var(--muted); font-style: italic; }
/* the demo's source: one line (the package and dataset; the citation in its hover text), cut with … if ever too long */
.dc-link { display: block; font-size: 11.5px; color: var(--muted); padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.dc-link { color: var(--accent); text-decoration: none; }
a.dc-link:hover { text-decoration: underline; }
.dc-shape { font-size: 11.5px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-charts { display: flex; flex-wrap: wrap; gap: 4px; }
.dc-charts span { font-size: 11px; font-weight: 400; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }/* the data: file line, reading options (folded), table */
.data-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.data-main .data-table { flex: 1 1 auto; min-height: 0; max-height: none; }
.data-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.data-file { display: flex; flex-direction: column; min-width: 0; }
.data-file strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.data-file span { font-size: 12px; color: var(--muted); }
.read-toggle { display: flex; flex-direction: column; align-items: flex-end; gap: 0; padding: 4px 10px; box-shadow: none; text-align: right; max-width: 100%; }
.read-toggle span { font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 4px; }
.read-toggle span::after { content: ""; width: 12px; height: 12px; background: var(--chevron) no-repeat center / 12px; transition: transform .15s; }
.read-toggle.open span::after { transform: rotate(180deg); }
.read-toggle small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.read-panel { padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.type-tag { font-size: 11px; color: var(--faint); font-weight: 400; display: block; margin-top: 2px; }
.data-table { max-height: min(62vh, 560px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.data-table th { position: sticky; top: 0; z-index: 1; }
/* lines between the columns too, as between the rows (as in "Select cells"); the frame closes the last one */
.data-table th, .data-table td { border-right: 1px solid var(--line); }
.data-table th:last-child, .data-table td:last-child { border-right: 0; }
/* the frame fills the screen, so a short table ends above it: its last row keeps its line */
.data-table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.data-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
/* the drop area's two buttons: Browse, Paste cells */
.drop-btns { display: flex; gap: var(--btn-gap); flex-wrap: wrap; justify-content: center; }
/* right of the file name: Reading options */
.data-acts { display: flex; align-items: stretch; gap: var(--btn-gap); flex-wrap: wrap; }
/* the suggestion: the sheet has a title / notes around the table, or no row of names */
.suggest { display: flex; align-items: flex-start; gap: 10px 12px; flex-wrap: wrap; padding: 10px 12px; margin: 0 0 10px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: var(--radius-sm); background: var(--warn-soft); font-size: 13px; line-height: 1.5; }
/* the same box, neutral: one plain table found and used (information, nothing to check) */
.suggest.info { border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }
.suggest.info .sug-ic { background: var(--accent); color: var(--accent-ink); font-family: Georgia, serif; font-style: italic; }
.sug-ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--warn); color: var(--panel); font-weight: 700; font-size: 12px; margin-top: 1px; }
.sug-t { flex: 1 1 320px; min-width: 0; }
.sug-btns { display: flex; gap: var(--btn-gap); flex-wrap: wrap; align-items: center; }
/* several tables on one sheet: one button each (cells, column names, rows); the one shown on the sheet now: marked */
.sel-tables { display: flex; flex-wrap: wrap; gap: var(--btn-gap); align-items: center; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.sel-table { display: inline-flex; align-items: baseline; gap: 8px; height: auto; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); box-shadow: none; font-weight: 400; font-size: 12.5px; color: var(--ink); }
.sel-table:hover { border-color: var(--accent); color: var(--accent); }
.sel-table.on { border-color: var(--tc, var(--accent)); background: color-mix(in srgb, var(--tc, var(--accent)) 14%, transparent); box-shadow: 0 0 0 1px var(--tc, var(--accent)); } /* in the table's colour */
.sel-table b { font-family: var(--mono); font-size: 12px; }
.sel-table span { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-table small { color: var(--faint); font-size: 11.5px; }
/* where the guess may be wrong */
.sug-warn { margin-top: 8px; font-size: 12.5px; }
.sug-warn ul { margin: 2px 0 0; padding-left: 18px; }
.sug-warn li { margin: 1px 0; }
/* the cells bar, always above the sheet / the data: one row on its middle line ("Cells [A2:B32]", the names
   checkbox, what is chosen, the Sheet · Data switch, Whole sheet, Use these cells) */
.sel-bar { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; padding: 4px 8px 4px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
/* the Data step's stages are in the top bar (1 Data › Table · Columns); over the frame, one line on what the open
   stage is for; the frame holds the stage */
.stage-hint-line { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.stage-hint-line b { color: var(--ink); font-weight: 650; margin-right: 6px; }
.stage-box { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.stage-frame { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.stage-frame .suggest { margin-bottom: 10px; }
/* ② the changes made to the columns: one chip each, undone by its × */
.changes { display: flex; align-items: center; gap: var(--btn-gap); flex-wrap: wrap; margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.changes .chg { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.changes .chg button { all: unset; cursor: pointer; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 13px; line-height: 1; }
.changes .chg button:hover { background: var(--hover); color: var(--bad); }
.sel-bar .sel-a1 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.sel-bar .sel-a1 input { width: 110px; font-family: var(--mono); }
.sel-bar .sel-a1 input.bad { border-color: var(--bad); }
.sel-bar .ui-check { margin: 0; }
.sel-bar .spacer { flex: 1; }
.sel-bar .btn-sm { margin: 0; }
/* the three buttons: one group, close together, at the right end (wrapping as one) */
.sel-btns { display: inline-flex; align-items: center; gap: var(--btn-gap); }
.sel-info { font-size: 12px; color: var(--muted); }
.sel-hint { font-size: 12px; color: var(--faint, var(--muted)); }
.sel-bar .sel-a1 input { height: 28px; padding-block: 0; }
.sheet { user-select: none; }
.sheet table { width: auto; min-width: 100%; }
.sheet th.col-l { text-align: center; cursor: pointer; font-family: var(--mono); font-weight: 600; min-width: 64px; }
.sheet th.col-l:hover { background: var(--hover); color: var(--ink); }
.sheet td { cursor: cell; max-width: 260px; }
.sheet td:not(.rownum) { text-align: center; } /* every cell in the middle, text and numbers (as Columns) */
/* long text ends in "…" inside its cell; the cell itself does not clip (a table's outline reaches over its grid lines) */
.sheet td .cv { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet td.rownum { cursor: default; font-family: var(--mono); background: var(--panel-2); }
.sheet td.in { background: var(--accent-soft); }
/* the tables found: outlined (colour per table, inline); cells outside them marked */
.sheet td.stray { color: var(--warn); }
/* a table found: every cell lightly tinted in its colour; its row of names tinted more, and bold */
.sheet td.tcell { background: color-mix(in srgb, var(--tc) 6%, transparent); }
/* its outline: a layer over the edge cells. It reaches over the grid lines inside the table (--tbr / --tbb: the cell's
   own right / bottom line, when the table goes on that way), so the grey lines never cut it, but not over the grid
   line around the table: the line stays on the table's own cells, and two tables that touch each keep theirs */
.sheet td.tb { position: relative; }
.sheet td.tb::after { content: ""; position: absolute; top: 0; left: 0; right: var(--tbr, 0); bottom: var(--tbb, 0); box-shadow: var(--tb); pointer-events: none; } /* (no z-index: over the grid lines, under the sticky letters row) */
/* the letters row, sticky, stays over the outlines when the sheet scrolls. A collapsed table paints its grid lines for
   the whole table (not with the sticky cells), so the outlines showed through the letters row's lines: the sheet's
   table keeps separate borders (no spacing; each cell its right and bottom line), so each cell paints its own lines */
.sheet table { border-collapse: separate; border-spacing: 0; }
.sheet th { z-index: 3; }
.sheet td.tcell.in { background: var(--accent-soft); } /* (the cells chosen: over a table's tint) */
/* the cells chosen are exactly a table found: shown in that table's own colour, tinted more (its names row more
   still), not in the selection's blue over its outline */
.sheet.on-table td.tcell.in { background: color-mix(in srgb, var(--tc) 16%, transparent); }
/* the selection's outline (1 px, accent, on top of the grid lines): what is chosen stays clear over a table's tint.
   Not shown when the selection is exactly a table found: that table's own outline and colour mark it */
.sheet td.sb { position: relative; }
/* (over the grid lines around it, 1 px out on every side, as a spreadsheet draws its selection: there is only one,
   so it covers nothing of another's; the tables found keep their outlines on their own cells) */
.sheet td.sb::before { content: ""; position: absolute; inset: -1px; box-shadow: var(--sb); pointer-events: none; }
/* (at the sheet's own edges no grid line is there to cover, and 1 px out is hidden under the letters row or outside
   the frame: the line stays just inside the cell) */
.sheet td.sb-t::before { top: 0; }
.sheet td.sb-r::before { right: 0; }
.sheet td.sb-b::before { bottom: 0; }
.sheet.on-table td.sb::before { display: none; }
.sel-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.sel-legend .lg-box { width: 14px; height: 10px; border: 1px solid var(--accent); border-radius: 2px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sel-legend .lg-stray { color: var(--warn); }
.tdot { flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; }
/* Data step: how the file is read, column types, edited cells */
.parse-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.parse-row .ui-field { min-width: 150px; margin: 0; }
.parse-row .ui-field.narrow { min-width: 0; width: 150px; }
.parse-row .ui-label { white-space: nowrap; }
.data-table th { vertical-align: top; }
.th-name { white-space: nowrap; }
/* the column's letter on the sheet (A, B, C…), small above its name, as in a spreadsheet */
.th-letter { font: 600 10.5px var(--mono); color: var(--faint); letter-spacing: .04em; }
/* a column's header, top to bottom: its letter (and how many values are missing), its type, its name right above
   the values; the headers sit on their bottom line, so every name is on the same line */
.data-table:not(.sheet) th:not(.rownum) { vertical-align: bottom; }
.th-top { display: flex; align-items: baseline; justify-content: center; gap: 6px; min-height: 15px; }
/* Columns: a column is grabbed anywhere on its header, a row on its number, and dragged to any place (a line shows
   where it goes). A click without moving still renames (the name) or picks a type (the list). */
.data-table th[data-col-move], .data-table td[data-row-move] { cursor: grab; touch-action: none; }
.data-table th[data-col-move]:hover, .data-table td[data-row-move]:hover { background: var(--hover); }
.data-table th[data-col-move] .th-name { cursor: text; }
.data-table th[data-col-move] select { cursor: pointer; }
.data-table:not(.sheet) td.rownum { position: relative; min-width: 40px; }
/* Columns, as a spreadsheet (and as the Table step's sheet): one header row with each column's letter and type
   (A  auto: number), then the names as the sheet's first row, a row like the others (numbered with its row on the
   sheet); both stay at the top. One font for every value (numbers with even digits), thin lines only. */
.cols-table table { border-collapse: separate; border-spacing: 0; }
.data-table.cols-table:not(.sheet) thead th { vertical-align: middle; font-weight: 400; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.cols-table tr.h-head th { padding: 4px 8px; }
.cols-table tr.h-head .th-top { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 0; }
.cols-table tr.h-head .th-letter { font: 600 11px var(--mono); color: var(--faint); letter-spacing: .04em; }
.cols-table tr.h-head .type-sel, .data-table.cols-table:not(.sheet) tr.h-head .type-sel { margin: 0; }
.cols-table tr.h-head .type-tag { margin: 0; display: inline; }
.cols-table tr.h-head .miss { display: inline; }
/* the names: a row as the values under them (same font, colour, height, background), editable */
.data-table.cols-table:not(.sheet) tr.h-names th { padding: 6px 10px; background: var(--panel); color: var(--ink); font-weight: 400; }
.data-table.cols-table:not(.sheet) th.rownum, .data-table.cols-table:not(.sheet) tr.h-names th.rownum,
.cols-table td.rownum { background: var(--panel-2); color: var(--faint); font-weight: 400; text-align: right; padding: 0 8px; width: 1%; min-width: 40px; }
.cols-table .rownum .rn { font: 11px var(--mono); }
.cols-table td { padding: 6px 10px; }
.cols-table td.num { font-family: inherit; font-variant-numeric: tabular-nums; }
.cols-table th[data-col-move]:hover, .data-table.cols-table:not(.sheet) tr.h-names th[data-col-move]:hover { background: var(--hover); }/* dragging: the column or row being moved tinted, the place it goes to a line */
.data-table.moving { cursor: grabbing; user-select: none; position: relative; }
.data-table.moving * { cursor: grabbing; }
.data-table th.mv-src, .data-table td.mv-src, .data-table tr.mv-src td, .data-table.cols-table:not(.sheet) thead tr th.mv-src { background: var(--accent-soft); }
.data-table .drop-line { position: absolute; z-index: 4; background: var(--accent); border-radius: 1px; pointer-events: none; }
/* Python details: a dialog in the middle (option A, 2026-11-29), its sections as tabs; the body scrolls, the head and
   tabs stay */
.dbg-modal .dbg-box { max-width: 920px; height: min(86vh, 780px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.dbg-head { display: flex; align-items: center; gap: 8px 10px; padding: 14px 16px 10px 20px; flex-wrap: wrap; }
.dbg-box .dbg-head h2 { margin: 0; font-size: 16px; color: var(--ink); }
.dbg-x { width: 30px; height: 30px; padding: 0; font-size: 18px; line-height: 1; color: var(--muted); }
.dbg-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.dbg-tab { border: 0; border-radius: 0; background: none; box-shadow: none; padding: 9px 10px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.dbg-tab:hover { color: var(--ink); background: none; }
.dbg-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.dbg-tab.bad { color: var(--bad); }
.dbg-tab.bad[aria-selected="true"] { border-bottom-color: var(--bad); }
.dbg-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 20px; overscroll-behavior: contain; }
/* Python details: the note on top (under development, how to report) */
.modal-box h2.err-title-user { color: var(--ink); }
/* the error window's top (2026-11-29): the title in the text colour, the code as a small tag beside it, then what
   happened in a box with a red edge */
#errorModal .modal-box h2 { color: var(--ink); margin: 0; }
.err-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.err-head .err-code { margin: 0; font-family: inherit; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.err-chip { font: 500 11.5px/1.6 var(--mono); padding: 0 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.err-msg { display: grid; gap: 2px; margin: 0 0 10px; padding: 9px 12px; border-left: 3px solid var(--bad); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); font-size: 13px; color: var(--ink); }
.err-msg b { color: var(--bad); font-weight: 650; }
.dbg-body .err-chip { margin-left: 6px; }
/* Python details › Test: a button per test problem, what it does beside it */
.dbg-tests { display: grid; gap: 10px; }
.dbg-tests > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.dbg-tests button { min-width: 130px; }
.err-dev { margin: 0 0 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); font-size: 13px; line-height: 1.5; }
/* the error report: the user's own words (optional), Send, the result; copy / email as the other way */
.err-note { display: grid; gap: 5px; margin: 12px 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.err-note textarea.ui-input { resize: vertical; min-height: 64px; line-height: 1.45; font-weight: 400; display: block; }
.err-note textarea.ui-input::placeholder { color: var(--faint); }
.err-note-help { font-size: 12px; font-weight: 400; color: var(--muted); }
.err-sent { font-size: 13px; margin: 8px 0 0; }
.err-sent:empty { display: none; }
#errorModal .btns { justify-content: flex-start; }
.err-sent.ok { color: var(--ok); } .err-sent.bad { color: var(--bad); }
.err-alt { margin: 10px 0 4px; color: var(--muted); }
.lay-mock { border-collapse: collapse; width: auto; font-size: 9.5px; line-height: 1.25; flex: none; font-variant-numeric: tabular-nums; }
.lay-mock td { border: 1px solid var(--line-strong); padding: 1px 5px; text-align: center; white-space: nowrap; color: var(--ink); background: var(--panel); }
.lay-mock .lm-n { color: var(--muted); background: var(--bg); }
.lay-mock .lm-g, .lm-key i.lm-g { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); color: var(--accent); font-weight: 600; }
.lay-mock .lm-v, .lm-key i.lm-v { background: color-mix(in srgb, var(--ok) 16%, var(--panel)); }
.lay-mock .lm-f, .lm-key i.lm-f { background: color-mix(in srgb, #a855f7 18%, var(--panel)); color: color-mix(in srgb, #a855f7 70%, var(--ink)); }
.lm-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.lm-key > span { display: inline-flex; align-items: center; gap: 5px; }
.lm-key i { width: 11px; height: 11px; border-radius: 2px; border: 1px solid var(--line-strong); }
/* (the key's group names and values in the colours of the reshaping buttons' pictures, .wp: solid blue, the same green) */
.lm-key i.lm-g { background: var(--accent) !important; border-color: var(--accent); }
.lm-key i.lm-v { background: color-mix(in srgb, var(--ok) 35%, var(--panel)) !important; border-color: transparent; }
/* Columns: the card shown on pointing at a column (figure.js colPeekHtml): what it holds */
.col-peek { position: fixed; z-index: 60; max-width: 320px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-size: 12.5px; color: var(--ink); pointer-events: none; }
.col-peek .pk-top { display: flex; align-items: baseline; gap: 8px; }
.col-peek .pk-top b { font-size: 13.5px; overflow-wrap: anywhere; }
.col-peek .pk-kind { font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.col-peek .pk-facts { margin-top: 2px; color: var(--muted); font-size: 12px; }
.col-peek .pk-h { margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.col-peek .pk-vals { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.col-peek .pk-vals span { padding: 1px 7px; border-radius: var(--radius-xs); background: var(--sunken); font-variant-numeric: tabular-nums; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-peek .pk-vals .pk-more { background: none; color: var(--faint); }
.col-peek .pk-warn { margin: 8px 0 0; font-size: 12px; color: var(--warn); }
/* Select data: a workbook's sheets as tabs over the sheet (sheetTabs in pages.js), as Excel's */
.sheet-tabs { display: flex; align-items: flex-end; gap: 4px; flex-wrap: wrap; margin: 0 0 6px; }
.sheet-tabs .st-l { font-size: 12px; color: var(--muted); margin-right: 4px; align-self: center; }
.sheet-tab { display: inline-flex; align-items: baseline; gap: 6px; height: auto; padding: 4px 10px; font-size: 12.5px; box-shadow: none; border-radius: var(--radius-sm); }
.sheet-tab small { font-size: 11px; color: var(--muted); }
.sheet-tab.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.sheet-tab.empty { color: var(--faint); border-style: dashed; }
/* Review's Transpose button: at the right end of the "Values" line (transposeBtn in pages.js, 2026-11-29) */
.rs-pic { display: inline-flex; align-items: center; justify-content: center; width: 14px; font-size: 14px; line-height: 1; color: var(--accent); flex: none; }
.cols-line .tr-btn { margin-left: auto; flex: none; min-height: 0; height: auto; padding: 2px 9px 2px 7px; gap: 6px; border-radius: var(--radius-sm); }
.tr-btn .wb-t { gap: 0; }
.tr-btn .wb-t b { font-size: 12px; line-height: 1.2; }
.tr-btn .wb-t small { font-size: 10.5px; line-height: 1.2; }
.where-btn { display: flex; align-items: center; justify-content: flex-start; gap: 10px; height: auto; padding: 8px 12px; text-align: left; box-shadow: none; white-space: normal; }
.where-btn.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.where-btn .wb-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.where-btn .wb-t b { font-size: 13px; font-weight: 600; color: var(--ink); }
.where-btn.on .wb-t b { color: var(--accent); }
.where-btn small { font-size: 11.5px; color: var(--muted); }
.wp { display: grid; grid-template-columns: repeat(4, 9px); grid-auto-rows: 7px; gap: 2px; flex: none; }
.wp i { border-radius: 1.5px; background: var(--line); }
.wp .wp-g { background: var(--accent); }
.wp .wp-n { background: color-mix(in srgb, var(--muted) 45%, var(--panel)); }
.wp .wp-v { background: color-mix(in srgb, var(--ok) 35%, var(--panel)); }
.sq-guess { font-size: 10.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
/* the roles the answers add: subject IDs, X values, a matrix's row names, plate rows / columns, events, list items */
.lm-key i.lm-s { background: color-mix(in srgb, #ea580c 18%, var(--panel)); }
.lm-key i.lm-x { background: color-mix(in srgb, #db2777 16%, var(--panel)); }
.lm-key i.lm-t { background: color-mix(in srgb, #0d9488 18%, var(--panel)); }
.lm-key i.lm-p { background: color-mix(in srgb, #64748b 22%, var(--panel)); }
.lm-key i.lm-ev { background: color-mix(in srgb, var(--bad) 14%, var(--panel)); }
.lm-key i.lm-it { background: color-mix(in srgb, #65a30d 16%, var(--panel)); }
.cols-table td.rl-s, .data-table.cols-table:not(.sheet) tr.h-names th.rl-s { background: color-mix(in srgb, #ea580c 12%, var(--panel)); color: color-mix(in srgb, #ea580c 75%, var(--ink)); font-weight: 600; }
.cols-table td.rl-x, .data-table.cols-table:not(.sheet) tr.h-names th.rl-x { background: color-mix(in srgb, #db2777 10%, var(--panel)); color: color-mix(in srgb, #db2777 70%, var(--ink)); font-weight: 600; }
.cols-table td.rl-t, .data-table.cols-table:not(.sheet) tr.h-names th.rl-t { background: color-mix(in srgb, #0d9488 12%, var(--panel)); color: color-mix(in srgb, #0d9488 70%, var(--ink)); font-weight: 600; }
.cols-table td.rl-p, .data-table.cols-table:not(.sheet) tr.h-names th.rl-p { background: color-mix(in srgb, #64748b 14%, var(--panel)); color: color-mix(in srgb, #64748b 60%, var(--ink)); font-weight: 600; }
.cols-table td.rl-ev { background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
.cols-table td.rl-it { background: color-mix(in srgb, #65a30d 10%, var(--panel)); }
/* the cells' roles: the same colours in the small tables, their key, and Review's own table */
.lay-mock .lm-e { background: var(--panel); color: var(--muted); }
.lay-mock .lm-r, .lm-key i.lm-r { background: color-mix(in srgb, #0ea5e9 14%, var(--panel)); color: color-mix(in srgb, #0ea5e9 60%, var(--ink)); }
.lm-key i.lm-n { background: var(--bg); }.rl-key { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 8px; font-size: 11.5px; color: var(--muted); }
.rl-key .lm-key { margin-top: 0; }
.cols-table td.rl-g, .data-table.cols-table:not(.sheet) tr.h-names th.rl-g { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); color: var(--accent); font-weight: 600; }
.cols-table td.rl-v { background: color-mix(in srgb, var(--ok) 15%, var(--panel)); }
.cols-table td.rl-f, .data-table.cols-table:not(.sheet) tr.h-names th.rl-f { background: color-mix(in srgb, #a855f7 13%, var(--panel)); color: color-mix(in srgb, #a855f7 70%, var(--ink)); }
.cols-table td.rl-r, .data-table.cols-table:not(.sheet) tr.h-names th.rl-r { background: color-mix(in srgb, #0ea5e9 11%, var(--panel)); color: color-mix(in srgb, #0ea5e9 60%, var(--ink)); }
.cols-table td.rl-n, .data-table.cols-table:not(.sheet) tr.h-names th.rl-n { color: var(--muted); background: color-mix(in srgb, var(--ink) 4%, var(--panel)); }
/* the row of column names (a table read as it is): its own colour, so the top row is plainly the names */
.data-table.cols-table:not(.sheet) tr.h-names th.rl-h { background: color-mix(in srgb, var(--ink) 10%, var(--panel)); color: var(--ink); font-weight: 650; }
.lm-key i.lm-h { background: color-mix(in srgb, var(--ink) 18%, var(--panel)); }
/* an offer's buttons (a layout, words read as missing): one row under the text, from its left edge, side by side */
.sug-acts { display: flex; gap: var(--btn-gap); align-items: center; flex-wrap: wrap; margin-top: 8px; }
.sug-acts .btn-sm { margin: 0; }
.lay-note b { color: var(--ink); font-weight: 650; }
.th-top .miss { display: inline; }
.th-top .th-letter + .miss::before { content: "·"; margin-right: 6px; color: var(--faint); }
.data-table:not(.sheet) th .th-name { display: block; margin-top: 0; }
/* the name: click to change it (as the cells), changed ones in the accent colour */
.th-name[contenteditable] { cursor: text; border-radius: var(--radius-xs); padding: 1px 6px; margin: -1px -6px; outline: none; }
.th-name[contenteditable]:hover { background: var(--hover); }
.th-name[contenteditable]:focus { background: var(--panel); box-shadow: 0 0 0 2px var(--accent); }
.th-name.renamed { color: var(--accent); }
/* the corner: the "?" of the column types, in its exact middle */
.data-table:not(.sheet) th.rownum { vertical-align: middle; text-align: center; padding: 0; width: 40px; min-width: 40px; }
.data-table th.rownum .ui-help { margin: 0; vertical-align: middle; } /* (the kit's own inline-grid centres the "?" in its circle) */
/* the column type: quiet text until hovered or set */
.type-sel { display: block; margin: 2px 0 0 -5px; font-size: 11px; line-height: 20px; padding: 0 18px 0 7px; height: 22px; box-sizing: border-box; max-width: 160px; font-weight: 400; color: var(--faint); border-color: transparent; background-color: transparent; box-shadow: none; background-position: right 4px center; }
.type-sel { width: max-content; } /* as wide as its text, under the column name and aligned with it */
th.num .type-sel { margin: 2px -5px 0 auto; text-align: right; text-align-last: right; }
.type-sel:hover, .type-sel:focus { border-color: var(--line); color: var(--ink); background-color: var(--panel); }
.type-sel.set { color: var(--accent); }
.miss { display: block; font-size: 11px; font-weight: 400; color: var(--warn); }
.data-table td[contenteditable] { cursor: text; }
.data-table td[contenteditable]:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--panel); }
.data-table td.edited { background: var(--accent-soft); }
.data-table .rownum { color: var(--faint); font-size: 11px; text-align: right; width: 1%; }
/* the data (not "Select cells", which stays as a spreadsheet): every column centred, its name, type and missing count
   above its values, numbers and text alike (the table is as wide as the screen, so few columns would otherwise
   leave each name far from its values) */
.data-table:not(.sheet) th:not(.rownum), .data-table:not(.sheet) td:not(.rownum) { text-align: center; }
.data-table:not(.sheet) .type-sel, .data-table:not(.sheet) th.num .type-sel { margin: 1px auto 4px; text-align: center; text-align-last: center; background-position: right 4px center; }
/* recent projects: one line each */
.recent-cap { display: flex; align-items: center; gap: 4px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.recent-list li { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); min-height: 42px; }
.recent-list li:hover { background: var(--hover); }
.recent-list li.on { background: var(--accent-soft); }
.recent-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; border: 0; background: transparent; box-shadow: none; text-align: left; }
.recent-list img, .recent-list .thumb-empty { width: 44px; height: 30px; object-fit: contain; background: #fff; border-radius: 3px; flex: none; border: 1px solid var(--line); }
.recent-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recent-t strong, .recent-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-t strong { font-size: 13px; font-weight: 550; }
.recent-t small { font-size: 11.5px; color: var(--muted); }
.recent-more { border: 0; background: transparent; box-shadow: none; padding: 2px 8px; font-size: 16px; line-height: 1; color: var(--muted); opacity: 0; }
.recent-list li:hover .recent-more, .recent-more:focus-visible { opacity: 1; }
@media (hover: none) { .recent-more { opacity: 1; } }
.recent-b { display: flex; gap: 4px; align-items: center; padding-right: 4px; }
.recent-list .rename { width: 100%; margin: 4px 6px; }
.recent-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-top: 4px; }
.recent-foot .link { font-size: 12px; }

.link.danger { color: var(--bad); }

/* ---------- step 2: chart chooser ---------- */
/* a card per chart: icon and name, what it shows (V1's description), the columns it needs, its categories */
.charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.chart-card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px; height: auto; min-height: 190px; text-align: left; white-space: normal;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: none; font-weight: 400; }
.chart-card:hover { border-color: var(--accent); }
.chart-card.on { border-color: var(--accent); background: var(--accent-soft); }
.cc-top { display: flex; align-items: center; gap: 14px; }
/* the icon's tile: 64 px, the drawing filling 84% of it (54 px); --tile-solid = the colour behind the drawing */
.cc-ic { --tile-solid: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; flex: none; border-radius: 14px; background: var(--tile-solid); }
.cc-ic .pi { width: 54px; height: 54px; }
.chart-card.on .cc-ic { --tile-solid: var(--panel); }
.cc-top strong { font-size: 15px; font-weight: 600; }
.cc-now { margin-left: auto; font-size: 11px; font-weight: 550; color: var(--accent); }
/* what the chart is for (pages.js CHART_PURPOSE), the card's main text; what it draws is its hover text */
.cc-desc { flex: none; font-size: 13px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cc-needs { font-size: 12px; color: var(--muted); }
.cc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.cc-tags span { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--faint); }

/* ---------- step 3: options in side tabs | chart or code; run status in the title row ---------- */
.fig-head, .fig-grid { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: var(--block-gap); }
.fig-head { align-items: end; }
.fig-head h1 { font-size: 18px; font-weight: 600; margin: 0; padding-bottom: 12px; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.fig-head h1 small { font-size: 13px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the app's Figure: no title row; the tabs and the run status sit in the right column over the frame, so the
   settings on the left reach the top */
#s3 .mid > .fig-bar { flex: none; position: relative; z-index: 2; }
#s3 .fig-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.fig-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; min-width: 0; }
.fig-bar .run-slot { margin-bottom: 4px; } /* (28 + 4: the row stays the tabs' 32 px, so the frame starts where Export's does) */
.mid { display: flex; flex-direction: column; overflow: hidden; }

/* run status: gray = waiting, yellow + spinner = running (says what), green = applied, red = stopped */
.run { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px; border-radius: 999px; font-size: 12.5px; background: var(--sunken); color: var(--muted);
  max-width: 100%; min-width: 0; transition: background-color .2s, color .2s; }
.run .run-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run .run-s { opacity: .8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.run .run-s:not(:empty)::before { content: "· "; }
/* in the Figure's tab row: a slot of one width in every state (running, applied, waiting, stopped), so the zoom controls
   beside it never move; the status itself is only as long as its text, at the slot's right end (the user, 2026-11-28:
   no empty coloured space); a longer message is cut with "…" and shown whole on hover (and, when it stopped, over the chart) */
/* (the width: the longest usual status, "✓ Applied · 12.34 s · 10/10 cells"; in a narrow row without "cells") */
.fig-bar .run-slot { flex: none; width: 208px; display: flex; justify-content: flex-end; min-width: 0; }
.fig-bar.tight .run-slot { width: 172px; }
/* still narrower: the zoom's "100%" and its dividers go, then the status keeps its word only ("✓ Applied"; all on hover) */
.fig-bar.narrow .zoom-bar .zp-pct, .fig-bar.narrow .zoom-bar .zp-sep { display: none; }
.fig-bar.bare .run-slot { width: 104px; }
.fig-bar.bare .run .run-s { display: none; }
.fig-bar .run { flex: 0 1 auto; box-sizing: border-box; overflow: hidden; }
.fig-bar .run .run-t { flex: 0 1 auto; min-width: 0; }
.fig-bar .run .run-s { flex: none; }
.fig-bar.tight .run .rs-w { display: none; } /* (narrow: "✓ Applied · 0.20 s · 3/5": the word stays, "cells" goes) */
.run .run-ic { width: 14px; height: 14px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.run.busy { background: var(--warn-soft); color: var(--warn); }
.run.busy .run-ic::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
.run.ok { background: var(--ok-soft); color: var(--ok); }
.run.ok .run-ic::before { content: "✓"; }
.run.wait .run-ic::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.run.bad { background: var(--bad-soft); color: var(--bad); }
.run.bad .run-ic::before { content: "!"; }

/* side tabs: a gray column; the selected tab opens into the options with rounded joins */
/* The search bar (--tb-h high) runs across the whole panel, in the settings' colour, with a line under it; below it the
   gray side tabs and the settings (layout chosen 2026-11-26 from six on the real panel: no empty corner beside the bar,
   and the top tab well below the bar's line). */
.opts { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: var(--tb-h) minmax(0, 1fr);
  padding: 0; overflow: hidden; --tb-h: 54px; box-shadow: none; } /* (no shadow: every screen's boxes are a 1 px line only) */
.opts > .opt-search { grid-column: 1 / -1; grid-row: 1; }
.opts > .ol-body { grid-row: 2; grid-column: 2; }
.ol-list { grid-row: 2; grid-column: 1; --r: var(--radius-sm); overflow: auto; padding: 10px 0 10px 6px; display: flex; flex-direction: column; gap: 1px;
  box-shadow: inset -1px 0 0 var(--line); border-radius: 0 0 0 var(--radius); scrollbar-width: none;
  /* (its scrollbar is hidden: when the tabs do not fit, a soft shadow at the top / bottom edge shows there are more that
     way; the two "local" bands move with the list and cover the shadow at its very ends) */
  --edge: color-mix(in srgb, var(--ink) 16%, transparent);
  background: linear-gradient(var(--sunken) 40%, transparent) center top / 100% 24px no-repeat local,
    linear-gradient(transparent, var(--sunken) 60%) center bottom / 100% 24px no-repeat local,
    linear-gradient(var(--edge), transparent) center top / 100% 9px no-repeat scroll,
    linear-gradient(transparent, var(--edge)) center bottom / 100% 9px no-repeat scroll, var(--sunken); }
/* a short window: the tabs closer together, so the whole list still fits (it needs ~570 px; the panel has ~500 at 640 px) */
@media (max-height: 760px) { /* (.opts first: these win over the tabs' own rules further down) */
  .opts .ol-list { padding-top: 6px; }
  .opts .ol-list button { padding-top: 3px; padding-bottom: 3px; }
  .opts .ol-list .sec + .sec { margin-top: 8px; }
}
.ol-list .grp { font-size: 10px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 9px 8px 3px 11px; flex: none; }
.ol-list .sec:first-child .grp { padding-top: 2px; }
.ol-list button { position: relative; justify-content: flex-start; border: 1px solid transparent; border-right: 0; border-radius: var(--r) 0 0 var(--r);
  box-shadow: none; background: none; color: var(--muted); padding: 5px 8px 5px 11px; font-size: 12.5px; text-align: left; white-space: nowrap; display: block; flex: none;
  overflow: hidden; text-overflow: ellipsis; }
.ol-list button:hover:not(.on) { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); box-shadow: inset -1px 0 0 var(--line); }
.ol-list button.on { background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 600; z-index: 1; overflow: visible; }
/* one section (Data / Plot / Statistics / Look): its title in the text colour, and room between sections (chosen
   2026-11-23 over rules, cards and guide lines) */
.ol-list .sec { display: flex; flex-direction: column; gap: 1px; }
.ol-list .sec + .sec { margin-top: 14px; }
.ol-list .sec .grp { color: var(--ink); font-size: 10.5px; padding-top: 0; padding-bottom: 5px; }
/* a dot: this tab has settings changed from the defaults */
.ol-list button.changed::after { content: ""; position: absolute; right: 8px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--accent); }
.ol-list button.on.changed::after { display: none; }
.ol-list button.need { color: var(--warn); }
/* Rounded joins: a radius-sized box above / below the selected tab draws the curve; its shadow paints the panel colour
   outside the curve, covering the straight line there. */
.ol-list button.on::before, .ol-list button.on > i { content: ""; position: absolute; right: 0; width: var(--r); height: var(--r); pointer-events: none; border-right: 1px solid var(--line); }
.ol-list button.on::before { top: calc(-1 * var(--r) - 1px); border-bottom: 1px solid var(--line); border-bottom-right-radius: var(--r); box-shadow: var(--r) var(--r) 0 var(--r) var(--panel); }
.ol-list button.on > i { display: block; top: calc(100% + 1px); border-top: 1px solid var(--line); border-top-right-radius: var(--r); box-shadow: var(--r) calc(-1 * var(--r)) 0 var(--r) var(--panel); }
.ol-list button > i { display: none; }
/* bottom of the side list: chart-wide actions next to each other (Reset all; room for more) */
.ol-list .grow-sp { flex: 1; min-height: 8px; }
.ol-list .ol-foot { display: flex; flex-direction: column; gap: 1px; }

/* ---------- styles (style_ui.js): the Style item at the bottom of the list, its menu, the Manage window ---------- */
/* the style in use: an item of the list's last section ("Style"), with a small arrow: it opens a menu */
.ol-list .style-btn { display: flex; align-items: center; gap: 4px; color: var(--ink); }
.style-btn .sb-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-btn .sb-c { flex: none; width: 10px; height: 10px; background: var(--chevron) no-repeat center / 10px; opacity: .7; transform: rotate(180deg); }
.ol-list .style-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: inset -1px 0 0 var(--line); }
.style-menu { position: absolute; left: 8px; bottom: 46px; z-index: 21; width: 310px; max-width: calc(100% - 16px); max-height: calc(100% - 90px); overflow: auto;
  display: flex; flex-direction: column; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); box-shadow: var(--shadow-lg);
  font-size: 12.5px; color: var(--ink); }
.sm-head { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sm-head strong { font-size: 13px; }
.sm-head span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.sm-list { display: flex; flex-direction: column; gap: 1px; }
.sm-row { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-xs); }
.sm-row:hover { background: var(--hover); }
.sm-row.on { background: var(--accent-soft); }
.style-menu .sm-use { flex: 1; min-width: 0; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: baseline; gap: 6px; text-align: left;
  border: 0; background: none; box-shadow: none; padding: 6px 6px 6px 4px; font-size: 12.5px; color: var(--ink); }
.sm-use .sm-tick { color: var(--accent); font-weight: 700; }
.sm-use .sm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-row.on .sm-name { font-weight: 600; }
.sm-use small { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.sm-acts { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.style-menu .sm-act { justify-content: flex-start; text-align: left; border: 0; background: none; box-shadow: none; padding: 7px 8px; font-size: 12.5px; color: var(--ink); white-space: normal; }
.style-menu .sm-act:hover { background: var(--hover); }
.sm-form { display: flex; flex-direction: column; gap: 8px; padding: 6px 8px 8px; }
.sm-lbl { font-size: 12px; font-weight: 600; }
.sm-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.sm-btns { display: flex; justify-content: flex-end; gap: var(--btn-gap); }
.style-box { max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.style-box h2 { color: var(--ink); margin: 0; }
.sx-lead, .sx-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 70ch; }
.sx-note { font-size: 12.5px; color: var(--faint); }
.sx-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.sx-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; }
.sx-row + .sx-row { border-top: 1px solid var(--line); }
.sx-row.base { background: var(--sunken); }
.sx-row.confirm { background: var(--bad-soft); }
.sx-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.sx-name { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.sx-t small { color: var(--faint); font-size: 12px; }
.sx-btns { display: flex; flex-wrap: wrap; gap: var(--btn-gap); }
.sx-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.sx-rename { display: flex; flex-wrap: wrap; gap: var(--btn-gap); align-items: center; }
.sx-rename input { flex: 1 1 180px; min-width: 0; }
.sx-empty { margin: 0; padding: 14px 12px; color: var(--muted); font-size: 13px; }
.sx-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--ink); font-size: 13px; }
.sx-err { color: var(--bad); }
.sx-foot { display: flex; flex-wrap: wrap; gap: var(--btn-gap); }
/* the search box stays; the settings below it scroll, heading included */
.ol-body { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
/* the search row: a bar across the panel with a line under it (see .opts), so it reads apart from the settings under it */
.opt-search { flex: none; box-sizing: border-box; height: var(--tb-h); padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; }
.ol-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 16px 14px; }
.opt-dep { margin: -4px 0 10px 14px; } /* a setting that depends on the one above: indented, no line */
.opt-dep .ui-field, .opt-dep .ui-check { margin-bottom: 8px; }
.opt-note.undo { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--accent-soft); border-radius: var(--radius-sm); color: var(--ink); }
.ol-head { display: flex; align-items: center; gap: 8px; padding: 12px 0 8px; }
.ol-head h2 { margin: 0 !important; flex: 1; }
.ol-head .reset { font-size: 11.5px; color: var(--muted); background: none; border: 0; box-shadow: none; padding: 2px 4px; }
.ol-head .reset:hover { color: var(--accent); }
.opt-search { position: relative; margin: 0; }
.opt-search input { width: 100%; padding-left: 28px; font-size: 12.5px; }
/* on the search box's right: Undo, Redo, Reset all (figure.js) */
.opt-search { display: flex; align-items: center; gap: 2px; }
.opt-search input { flex: 1 1 auto; width: auto; min-width: 0; margin-right: 4px; }
.opt-search .hist-btn { flex: none; color: var(--muted); }
.opt-search .hist-btn:hover:not(:disabled) { color: var(--ink); }
.opt-search .hist-btn:disabled { opacity: .35; cursor: default; background: none; }
.opt-search .hist-btn .ui-icon { width: 16px; height: 16px; }
.opt-search .reset-all-btn { flex: none; margin-left: 4px; color: var(--muted); }
.opt-search .reset-all-btn:hover, .opt-search .reset-all-btn[aria-expanded="true"] { color: var(--ink); }
/* Reset all asks first, in a box under its button (child of .opts) */
.reset-ask { position: absolute; top: 58px; right: 14px; z-index: 20; width: 300px; max-width: calc(100% - 28px); display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); box-shadow: var(--shadow-lg);
  font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.reset-ask .reset-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--btn-gap); }
.reset-ask .reset-yes { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.reset-ask .reset-yes:hover { background: var(--bad-soft); }
.opt-search::before { content: ""; position: absolute; left: 26px; bottom: 21px; width: 11px; height: 11px; border: 1.6px solid var(--faint); border-radius: 50%; box-sizing: border-box; pointer-events: none; }
.opt-search::after { content: ""; position: absolute; left: 35px; bottom: 19px; width: 5px; height: 1.6px; background: var(--faint); transform: rotate(45deg); pointer-events: none; }
.opt-sec { padding: 4px 0 8px; }
.opt-sec + .opt-sec { border-top: 1px solid var(--line); padding-top: 12px; }
.opt-sec h3 { font-size: 12px; font-weight: 650; color: var(--ink); margin: 0 0 8px; }
.opt-hit { font-size: 11px; color: var(--faint); margin: -4px 0 6px; }
.opt-note { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.opt-note.warn { color: var(--warn); }
/* N = native code (the test menu's mark is the kit's .ui-tag; this one is the Statistics tab's box, pages.js nativeBox) */
.nat-n { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: var(--radius-xs); background: var(--native-soft);
  color: var(--ink); font: 700 11px/1 var(--font); cursor: help; box-shadow: inset 0 0 0 1px var(--line); }
.nat-n:focus-visible { box-shadow: var(--focus); }
/* the same N in the Statistics tab (pages.js nativeBox): which blocks of the script are native code */
.res-native { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.res-native .nat-n { cursor: default; margin-top: 1px; }
.res-native-t { min-width: 0; font-size: 13px; }
.res-native-t p { margin: 4px 0 6px; color: var(--muted); }
.res-native-t ul { margin: 0; padding-left: 18px; }
.res-native-t li { margin: 2px 0; }
/* Tick step: the steps that fit the axis drawn now, one click each */
.tick-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: -4px 0 10px; font-size: 12px; color: var(--muted); }
.tick-steps .btn-sm { padding: 2px 8px; box-shadow: none; }
.tick-steps .btn-sm.on { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.opt-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.opt-row > :only-child { grid-column: 1 / -1; } /* a field alone in the row takes all of it */
.ui-field input[type=text] { width: 100%; }
.list-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.list-edit .item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; padding: 8px 8px 2px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.list-edit .item .x { border: 0; box-shadow: none; background: none; color: var(--muted); padding: 2px 6px; font-size: 16px; line-height: 1; }
.order-list { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; }
.order-list li { list-style: none; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); font-size: 13px; cursor: grab; }
.order-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-list li button { padding: 1px 6px; font-size: 11px; box-shadow: none; }
.order-list li.drag { opacity: .4; }
.order-list { padding: 0; }

/* column mapping inside the Columns tab: chips (drag) and role boxes (drop, or choose) */
/* (many columns: their chips scroll in a box of their own, so the role boxes stay in sight under them) */
.cols { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; max-height: 196px; overflow-y: auto; padding: 1px; }
.col { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); border: 1px solid transparent; font-size: 12.5px; cursor: grab; user-select: none; }
.col b { font: 600 10.5px var(--mono); color: var(--accent); min-width: 16px; }
.col:hover { border-color: var(--accent); }
.col.in { cursor: grab; width: 100%; }
.col .col-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col .x { margin-left: auto; border: 0; box-shadow: none; background: none; padding: 0 4px; color: var(--muted); font-size: 16px; line-height: 1; }
.col .x + .x { margin-left: 0; }
/* a box with a column: the list's arrow (another column in its place); a transparent list over the arrow opens */
.col .col-pick { position: relative; flex: none; margin-left: auto; width: 22px; height: 20px; border-radius: 4px; background: var(--chevron) no-repeat center; cursor: pointer; }
.col .col-pick:hover { background-color: color-mix(in srgb, var(--accent) 14%, transparent); }
.col .col-pick + .x { margin-left: 0; }
.role .col .col-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.roles { display: grid; grid-template-columns: 1fr; gap: 8px; }
.role { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px 10px; background: var(--panel-2); }
.role.over { border-color: var(--accent); background: var(--accent-soft); }
.role select { border-style: dashed; color: var(--muted); width: 100%; }

/* chart / code frame */
.figwrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 0; overflow: hidden; }
.fig { position: relative; width: 100%; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
/* while a run is under way the chart fades on its white paper (the paper stays opaque, so the dots never show through) */
.fig > * { position: relative; }
.paper-inner, .fig-note { transition: opacity .2s; }
.fig.stale .paper-inner, .fig.stale .fig-note { opacity: .45; }
/* the backdrop: a dot grid in a well inset 6 px in the frame (the frame stays plain, so the open Chart tab joins it
   as before); the chart's white paper sits on it with a thin edge and a soft shadow. Only the app's view: the script,
   the figure and every export are unchanged. figure.js fit() leaves 22 px around the paper. */
#figView::before { content: ""; position: absolute; inset: 6px; border-radius: var(--radius-sm); border: 1px solid var(--line); pointer-events: none; }
/* the dot grid and the paper on it: the same on the Figure screen and in the Export step's preview */
#figView::before, .exp-prev { background: radial-gradient(circle, color-mix(in srgb, var(--ink) 20%, transparent) 1px, transparent 1.4px) 0 0 / 18px 18px, var(--sunken); }
.paper { flex: none; margin: 0 auto; background: var(--paper); border: 1px solid transparent; overflow: hidden; color-scheme: light; position: relative; }
#figView .paper, .exp-prev .paper { border-color: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: 0 1px 2px rgba(16, 24, 40, .10), 0 8px 24px rgba(16, 24, 40, .13); }
.paper-inner { transform-origin: 0 0; }
/* titles that can be edited on the chart: the "Click to enter …" hint only while the pointer is over the chart */
#plot .js-placeholder { opacity: 0 !important; }
#plot:hover .js-placeholder { opacity: .3 !important; }
#plot:has(.plugin-editable) .js-placeholder { opacity: 0 !important; } /* while a text is being typed: plotly's edit box only */
/* plotly's edit box sits on the white paper in every theme: a thin blue edge and the usual light selection */
#plot .plugin-editable { outline: 1px solid #2f6fde !important; outline-offset: 2px; box-shadow: none !important; border-radius: 2px; caret-color: #111; }
#plot .plugin-editable::selection, #plot .plugin-editable *::selection { background: #b4d5fe; color: #111; }
/* text notes on the chart (figure.js): drag to move, right-click to change; right-click elsewhere adds one */
#plot .sg-note, #plot .sg-note * { cursor: move; }
#plot .sg-note:hover text { text-decoration: underline dotted rgba(47, 111, 222, .7); }
#plot .sg-note.dragging { opacity: .75; }
/* a bracket's label: click to change its colours or hide it (figure.js openBracketPop) */
#plot .sg-bracket, #plot .sg-bracket * { cursor: pointer; }
#plot .sg-bracket:hover text { text-decoration: underline dotted rgba(47, 111, 222, .7); }
/* a bracket clicked (figure.js openBracketPop): compact, as wide as its contents: the pair and ×, then one row of
   two colour dots, Reset, Hide */
#figView > .note-pop.br-pop { --ctl: 28px; width: auto; max-width: calc(100% - 16px); gap: 6px; padding: 8px 8px 8px 12px; }
.br-pop .bp-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--muted); }
.br-pop .bp-head b { color: var(--ink); font-weight: 600; }
.br-pop .bp-x { width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; box-shadow: none; color: var(--muted); font-size: 17px; line-height: 1; }
.br-pop .bp-x:hover { background: var(--hover); color: var(--ink); }
.br-pop .bp-row { display: flex; align-items: center; gap: 6px 14px; }
.br-pop .bp-row .np-sp { flex: 1; min-width: 4px; }
.br-pop .ui-field { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.br-pop .ui-label { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.br-pop .ui-color1 .ui-chip { padding: 2px; }
.br-pop .ui-color1 .ui-chip b { display: none; } /* (the dot only: the hex code is in the picker) */
.br-pop .np-btn { height: var(--ctl); padding: 0 10px; font-size: 12px; margin-left: -8px; }
.br-pop .np-sp + .np-btn { margin-left: 0; }
/* the note box: the text, then one toolbar (size − n +, B, delete | Cancel, Add): every control 32 px tall */
#figView > .note-pop { --ctl: 32px; position: absolute; z-index: 5; width: 300px; display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-lg); font-size: 13px; color: var(--ink); }
.note-pop input[type="text"] { width: 100%; height: var(--ctl); padding-top: 0; padding-bottom: 0; }
.note-pop .np-row { display: flex; align-items: center; gap: 6px; }
/* zoom controls of the chart: in the tab row, before the run status, in the tabs' size and look (figure.js zoomPill) */
/* tabs … zoom buttons, status: the status at the row's right end, the zoom buttons right beside it (its slot's width:
   figure.js sizeSlot). Hidden (another tab open, a chart without axes), they keep their room: nothing moves. */
.fig-bar .zoom-bar { margin-left: auto; margin-bottom: 2px; display: flex; align-items: center; gap: 2px; min-width: 0; }
.fig-bar .zoom-bar[hidden] { display: flex !important; visibility: hidden; }
.fig-bar .run-slot { position: relative; }
.fig-bar .run-measure { position: absolute; top: 0; right: 0; visibility: hidden; pointer-events: none; }
.zoom-bar button { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; box-shadow: none; color: var(--muted); font: inherit; cursor: pointer; }
.zoom-bar button.zp-ic { width: 32px; padding: 0; justify-content: center; }
.zoom-bar button:hover:not(:disabled) { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.zoom-bar button:disabled { color: var(--faint); opacity: .6; cursor: default; }
.zoom-bar button[aria-pressed="true"] { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.zoom-bar .zp-sep { width: 1px; height: 18px; margin: 0 6px; background: var(--line); }
.zoom-bar .zp-pct { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.zoom-bar .zp-reset.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* a narrow row (figure.js fitBar): first the zoom buttons' words go (their names on hover), then the status' word */
.fig-bar .zoom-bar { flex: none; }
.fig-bar.compact .zoom-bar .zp-l { display: none; }
.fig-bar.compact .zoom-bar button { padding: 0 9px; }
.fig-bar.compact .zoom-bar button.zp-ic { padding: 0; }
.fig-bar.tight .run .run-s { opacity: 1; }
/* the style buttons in the toolbar row: the height of the other controls (ui.js richParts) */
#figView > .note-pop { width: 380px; max-width: calc(100% - 16px); }
.note-pop .ui-rt { min-height: var(--ctl); }
/* right-click on an axis: its lowest and highest value (figure.js openAxisPop) */
.note-pop.axis-pop { width: 300px; }
.axis-pop .ap-head { font-weight: 600; font-size: 13px; }
.axis-pop .ap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.axis-pop .ap-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.axis-pop .ap-row input { width: 100%; height: var(--ctl); box-sizing: border-box; }
/* plotly's handles on the axes (drag an axis end, or the boxes that type a range there): off; the range is set by a
   right-click on the axis or in Axes. The plot area itself still zooms and moves (the zoom bar's Zoom / Move). */
#plot .draglayer :is(.nsdrag, .ndrag, .sdrag, .ewdrag, .edrag, .wdrag, .nwdrag, .nedrag, .swdrag, .sedrag) { pointer-events: none !important; }
.note-pop .np-row .ui-rich { margin: 0; gap: 2px; }
.note-pop .np-row .ui-rich button { height: var(--ctl); min-width: 28px; padding: 0 6px; font-size: 13px; border-radius: var(--radius-sm); }
.note-pop .np-sp { flex: 1; }
.note-pop .np-stepper { display: inline-flex; height: var(--ctl); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.note-pop .np-stepper button { width: 28px; height: 100%; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--panel-2); color: var(--muted); font-size: 15px; }
.note-pop .np-stepper button:hover { background: var(--hover); color: var(--ink); }
.note-pop .np-stepper input[type="number"] { width: 38px; height: 100%; padding: 0; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  border-radius: 0; box-shadow: none; text-align: center; font-variant-numeric: tabular-nums; }
.note-pop .np-tool { width: var(--ctl); height: var(--ctl); padding: 0; background: var(--panel-2); color: var(--muted); }
.note-pop .np-tool:hover { color: var(--ink); }
.note-pop .np-bold { height: var(--ctl); display: flex; align-items: center; margin: 0 0 0 6px; }
.note-pop .np-del:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.note-pop .np-btn { height: var(--ctl); padding: 0 12px; font-size: 12.5px; }
#plot:not([data-chart="pie"]) .gtitle-subtitle.js-placeholder { display: none; } /* only the pie has a subtitle */
#plot .gtitle, #plot .xtitle, #plot .ytitle { cursor: text; }
.fig-note { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 40px 24px; color: var(--muted); max-width: 460px; }
.fig-note strong { color: var(--ink); font-size: 15px; }
.fig-note .pi { width: 48px; height: 48px; color: var(--accent); }
.loading-steps { list-style: none; padding: 0; margin: 8px 0 0; text-align: left; font-size: 13px; display: grid; gap: 4px; }
.loading-steps li { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.loading-steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.loading-steps li.done { color: var(--ok); }
.loading-steps li.done::before { background: currentColor; }
.loading-steps li.active { color: var(--ink); font-weight: 550; }
.loading-steps li.active::before { border-color: var(--warn); border-top-color: transparent; animation: spin .7s linear infinite; }
.codeview { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.code-area { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* the code's toolbar: a row of its own above the code (buttons never sit on the text) */
.code-tools { flex: none; display: flex; align-items: center; gap: var(--btn-gap); padding: 6px 10px 6px 14px; background: var(--code-bar); border-bottom: 1px solid var(--code-line); }
.code-tools .spacer { flex: 1; }
.code-file { display: inline-flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--muted); }
.code-file .ui-icon { width: 14px; height: 14px; }
.code-tools button.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
/* Run: green, as the "Applied" status */
.btn-run { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); font-weight: 600; }
.btn-run:hover { background: color-mix(in srgb, var(--ok-soft) 70%, var(--ok) 30%); border-color: var(--ok); }
.btn-run .ui-icon { fill: currentColor; }
.code-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; }
.code-bar .spacer { flex: 1; }
.code { position: relative; margin: 0; flex: 1; min-height: 0; background: var(--code-bg); color: var(--code-ink); font: 12px/1.6 var(--mono); overflow: auto; overscroll-behavior: contain; padding: 8px 0; tab-size: 4; }
/* one column as wide as the longest line (at least the view): highlights and cell lines reach the end when scrolled right */
.code .code-lines { width: max-content; min-width: 100%; }
.code .ln { display: block; white-space: pre; padding: 0 12px 0 0; }
.code .ln i { display: inline-block; width: 48px; padding-right: 16px; text-align: right; color: var(--code-gutter); font-style: normal; user-select: none; }
.code .ln.cell { font-weight: 600; border-top: 1px solid var(--code-line); margin-top: 4px; padding-top: 4px; }
.code .ln.chg { background: var(--code-chg); box-shadow: inset 3px 0 0 var(--code-chg-mark); }
/* the line where the script stopped (red, like changed lines are yellow) and Python's message under it */
.code .ln.err { background: var(--code-errline); box-shadow: inset 3px 0 0 var(--code-err); }
.code .ln.err i { color: var(--code-err); }
/* the header's pip command (run_help.js): a "Copy" pill in the blank space before "pip install", which copies the
   whole command as one line without the "#" (ui/pycode.js copyButtons); pointing at it lights the lines it copies
   (.cmd). The text itself does not move. */
.code .ln:has(.ln-copy) { position: relative; }
.code .ln-copy { position: absolute; top: 50%; left: calc(48px + 1.6ch); transform: translateY(-50%); height: 18px; padding: 0 7px 0 6px; gap: 4px;
  font: 600 11px/1 var(--font); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); box-shadow: none; user-select: none; white-space: nowrap; }
.code .ln-copy:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.code .ln-copy svg { width: 12px; height: 12px; flex: none; }
.code .ln-copy .i-done, .code .ln-copy.done .i-copy { display: none; }
.code .ln-copy.done .i-done { display: block; }
.code .ln-copy.done { background: var(--ok); border-color: var(--ok); color: var(--panel); }
.code:has(.ln-copy:hover, .ln-copy:focus-visible) .ln.cmd { background: color-mix(in srgb, var(--accent) 10%, var(--code-bg)); box-shadow: inset 3px 0 0 var(--accent); }
.code .ln-errmsg { display: block; contain: inline-size; /* wraps to the lines' width, never widens them */ white-space: pre-wrap; margin: 0 12px 4px 48px; padding: 3px 8px; border-radius: 4px; background: var(--code-errline); color: var(--code-err); font-weight: 600; }
/* syntax colours (VS Code Light+ / Dark+, tokens in ui.css) */
.t-com { color: var(--t-com); } .t-str { color: var(--t-str); } .t-num { color: var(--t-num); } .t-kw { color: var(--t-kw); }
.t-kc { color: var(--t-kc); } .t-fn { color: var(--t-fn); } .t-cls { color: var(--t-cls); } .t-var { color: var(--t-var); }
.t-const { color: var(--t-const); } .t-cell { color: var(--t-cell); font-weight: 600; }
.code-err { flex: none; max-height: 38%; display: flex; flex-direction: column; border-top: 1px solid var(--code-err); background: var(--bad-soft); color: var(--ink); }
.code-err-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12.5px; }
.code-err-head b { color: var(--bad); }
.code-err-head span { color: var(--muted); }
.code-err-head .spacer { flex: 1; }
.code-err pre { margin: 0; padding: 0 12px 10px; overflow: auto; overscroll-behavior: contain; font: 11.5px/1.55 var(--mono); white-space: pre; }
.run.bad { cursor: pointer; }
/* the editor: line numbers | highlighted text under a transparent textarea (same font, size and padding) */
.code-editor { flex: 1; min-height: 0; display: flex; background: var(--code-bg); overflow: hidden; }
.ce-gutter { flex: none; width: 48px; padding: 8px 16px 8px 0; font: 12px/1.6 var(--mono); color: var(--code-gutter); text-align: right; user-select: none; will-change: transform; }
.ce-gutter span { display: block; }
.ce-gutter span.on { color: var(--code-gutter-on); }
.ce-main { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.ce-hl, textarea.code-edit { margin: 0; padding: 8px 12px 8px 0; font: 12px/1.6 var(--mono); tab-size: 4; white-space: pre; letter-spacing: 0; word-spacing: 0; }
.ce-hl { position: absolute; top: 0; left: 0; min-width: 100%; color: var(--code-ink); pointer-events: none; will-change: transform; }
textarea.code-edit { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; resize: none; background: transparent; color: transparent;
  caret-color: var(--code-caret); outline: none; overflow: auto; overscroll-behavior: contain; box-shadow: none; }
textarea.code-edit::selection { background: var(--code-sel); color: transparent; }
/* Scrollbars on code: a solid track in the code's colour, the same in the editor, the read-only code and the output.
   The editor's text box is see-through with the coloured code drawn under it, so its scrollbars get a solid strip under
   them as well (--sbw / --sbh: their thickness, set by syncEditor), or the code there would show through them. */
textarea.code-edit, .code, .outview .console { scrollbar-color: color-mix(in srgb, var(--code-ink) 30%, var(--code-bg)) var(--code-bg); }
textarea.code-edit { z-index: 2; }
.ce-main::before, .ce-main::after { content: ""; position: absolute; z-index: 1; background: var(--code-bg); pointer-events: none; }
.ce-main::before { left: 0; right: 0; bottom: 0; height: var(--sbh, 0px); }
.ce-main::after { top: 0; bottom: 0; right: 0; width: var(--sbw, 0px); }

/* Chart / Code tabs: in the title row, joined to the frame below */
.view-tabs { --r: var(--radius-sm); display: flex; gap: 2px; }
.view-tabs button { position: relative; z-index: 2; margin-bottom: -1px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: none; box-shadow: none; color: var(--muted); padding: 8px 16px; gap: 6px; }
/* hover: a rounded highlight of its own that stops above the frame, so it neither tints the frame's top line (the
   tabs overlap it by 1 px) nor squares off the open tab's curved joints next to it */
.view-tabs button:hover { color: var(--ink); background: none; border-color: transparent; }
.view-tabs button:not(.on)::before { content: ""; position: absolute; inset: 0 0 3px; z-index: -1; border-radius: var(--radius-sm);
  background: transparent; pointer-events: none; transition: background .12s; }
.view-tabs button:not(.on):hover::before { background: color-mix(in srgb, var(--ink) 6%, transparent); }
/* the label keeps its bold width when not open (a hidden bold copy under it), so opening a tab moves no other tab */
.view-tabs .tl { display: inline-grid; justify-items: center; }
.view-tabs .tl::after { content: attr(data-t); font-weight: 600; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; user-select: none; }
.view-tabs button.on { --tab-bg: var(--panel); background: var(--tab-bg); border-color: var(--line); color: var(--ink); font-weight: 600; }
.view-tabs button .badge { font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
/* Code / Output: the open tab takes the colour of the toolbar right under it (analysis.py, Copy…), so they join */
#s3.show-code .view-tabs button.on { --tab-bg: var(--code-bar); color: var(--code-ink); }
.view-tabs button.on::before, .view-tabs button.on::after { content: ""; position: absolute; bottom: 0; width: var(--r); height: var(--r); pointer-events: none; }
.view-tabs button.on::before { left: calc(-1 * var(--r));
  background: radial-gradient(circle at 0 0, transparent calc(var(--r) - 1.5px), var(--line) calc(var(--r) - 1px), var(--line) calc(var(--r) - .5px), var(--tab-bg) var(--r)); }
.view-tabs button.on::after { right: calc(-1 * var(--r));
  background: radial-gradient(circle at 100% 0, transparent calc(var(--r) - 1.5px), var(--line) calc(var(--r) - 1px), var(--line) calc(var(--r) - .5px), var(--tab-bg) var(--r)); }
.view-tabs button:first-child.on::before { display: none; }
#s3.show-code .figwrap { background: var(--code-bg); }
/* any tab but the first (Chart) open: the frame's top-left corner is rounded */
#s3.not-first .figwrap { border-top-left-radius: var(--radius); z-index: 1; }

/* the Statistics tab's table count */
.view-tabs button .count { font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--sunken); color: var(--muted); }

/* ---------- step 3, Output tab: the printed text in the code colours, with the code's toolbar ---------- */
.outview { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.outview .console { flex: 1; min-height: 0; max-height: none; margin: 0; border: 0; border-radius: 0; padding: 10px 14px; overscroll-behavior: contain; }
.outview .console.empty { white-space: normal; font-family: inherit; font-size: 13px; }
.outview .console.empty .muted { color: var(--code-gutter); }

/* ---------- step 3, Statistics tab: the script's tables (each opens), the methods sentence ---------- */
.statview { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 18px 16px; }
details.resitem { border-bottom: 1px solid var(--line); }
details.resitem > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 9px 2px 9px 18px; position: relative; font-size: 13px; }
details.resitem > summary::-webkit-details-marker { display: none; }
details.resitem > summary::before { content: ""; position: absolute; left: 0; top: 12px; width: 12px; height: 12px; background: var(--chevron) no-repeat center; transform: rotate(-90deg); transition: transform .15s; }
details.resitem[open] > summary::before { transform: none; }
details.resitem > summary span { color: var(--muted); font-size: 12.5px; }
.resitem-body { padding: 0 0 12px 18px; }
/* the actions row is a bar across the top of the Statistics view, with a line under it, as the settings' search bar;
   it stays while the tables scroll under it (the view's padding: 12px 18px) */
.res-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--btn-gap); position: sticky; top: -12px; z-index: 3;
  margin: -12px -18px 4px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.res-actions .res-fold { margin-left: auto; }
.res-empty { margin: 10px 2px; }
/* each table's Copy: a normal small button, at the right end of the table's line */
details.resitem > summary .res-copy { margin-left: auto; align-self: center; }
.methods { margin: 0 0 8px; font-size: 13px; line-height: 1.55; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }

/* ---------- step 4: export ---------- */
/* Export fits the window. Left: the preview (scaled to fit its box). Right: the tabs Figure | Analysis files joined to
   a frame, as the Figure step's Chart / Code / Output / Statistics. Row 1: preview caption | tabs; row 2: the boxes. */
#s4 { height: calc(100vh - var(--tb)); min-height: 560px; }
.exp-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "prev tabs" "prev frame"; column-gap: var(--block-gap); }
/* the preview: one box from the top, its caption (Preview · size) in a strip of its own at the top of it */
.exp-prev-box { grid-area: prev; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); overflow: hidden; }
.exp-prev-head { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--panel); border-bottom: 1px solid var(--line); }
.exp-prev-head .ui-icon { width: 15px; height: 15px; color: var(--muted); }
.exp-prev-head span { color: var(--faint); font-weight: 400; }
.exp-prev { flex: 1 1 auto; min-height: 0; padding: 20px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.exp-tabs { grid-area: tabs; }
/* the frame reaches down to the bottom, level with the preview (its content scrolls if the window is short) */
.exp-box { grid-area: frame; position: relative; min-height: 0; display: flex; flex-direction: column; }
.exp-frame { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--panel);
  border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius); }
.exp-grid.not-first .exp-frame { border-top-left-radius: var(--radius); }
/* the open tab's content: one column of normal-sized controls, room between them */
.exp-pane { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.exp-pane .ui-field, .exp-pane #expOpts .ui-field { margin: 0; }
#expOpts { display: flex; flex-direction: column; gap: 14px; }
#expOpts .opt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
#expInfo { margin: 0; font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
#expInfo.exp-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); } /* (an image too large to draw: Export.sizeProblem) */
.exp-dl { width: 100%; justify-content: center; padding: 10px 16px; font-size: 14px; margin-top: 4px; }
/* Analysis files: one row per file, what it holds, and its action at the right */
.exp-files-lead { margin: 0; font-size: 13px; }
.files { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 14px; width: 100%; height: auto; text-align: left; white-space: normal; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: none; font-weight: 400; }
.file-row:hover { border-color: var(--accent); }
.fr-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.fr-ic .ui-icon { width: 18px; height: 18px; }
.fr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fr-t strong { font-size: 14px; font-weight: 600; }
.fr-t small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
/* the name each file is saved under (with the date and time when that setting is on) */
.fr-name { font-size: 12px; color: var(--faint); line-height: 1.4; overflow-wrap: anywhere; }
.fr-name:empty { display: none; }
.fr-name code, .save-as code { font: 12px var(--mono); color: var(--ink); }
.save-as { margin: 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
#filesStamp:empty { display: none; }
.fr-act { flex: none; font-size: 12.5px; font-weight: 550; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); background: var(--panel); }
.file-row:hover .fr-act { border-color: var(--accent); color: var(--accent); }
.file-tile strong { font-size: 13px; font-weight: 600; }
.file-tile small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- drawer (Python details) ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 94vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 30;
  display: flex; flex-direction: column; transform: translateX(102%); transition: transform .2s ease; }
.drawer:not(.open) { visibility: hidden; transition: transform .2s ease, visibility 0s .2s; }
.drawer.open { transform: none; }
.drawer.wide { width: min(860px, 96vw); }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.drawer-head h2 { margin: 0; font-size: 15px; }
.drawer-body { flex: 1; overflow: auto; padding: 12px 16px; overscroll-behavior: contain; }
.dbg h3 { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; }
.dbg h3:first-child { margin-top: 4px; }
.dbg-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dbg-cards div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--panel-2); min-width: 0; }
.dbg-cards b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbg-cards span { font-size: 11.5px; color: var(--muted); }
.dbg-wf { display: grid; grid-template-columns: 300px minmax(0, 1fr) 60px; gap: 3px 10px; align-items: center; font-size: 12px; }
.dbg-wf .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbg-wf .trk { position: relative; height: 10px; background: var(--sunken); border-radius: 3px; }
.dbg-wf .trk i { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 3px; background: var(--accent); }
.dbg-wf .trk i.net { background: #d9822b; } .dbg-wf .trk i.cache { background: var(--ok); } .dbg-wf .trk i.bg { background: var(--line-strong); }
.dbg-wf .ms { text-align: right; font-family: var(--mono); color: var(--muted); }
.dbg table { font-size: 12px; }
.dbg .mono { font-family: var(--mono); font-size: 11.5px; }
.dbg .tag-ok { color: var(--ok); } .dbg .tag-warn { color: var(--warn); } .dbg .tag-bad { color: var(--bad); }
.dbg-btns { display: flex; gap: var(--btn-gap); flex-wrap: wrap; }
.dbg pre { white-space: pre-wrap; font: 11.5px/1.5 var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; max-height: 240px; overflow: auto; margin: 0 0 8px; }

/* notices under the top bar (update notice, offline cache) */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 16px; background: var(--accent-soft); color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line); }
.notice .spacer { flex: 1; }

@media (max-width: 1100px) {
  .screen { height: auto; } .grid > * { overflow: visible; } .grid { grid-template-rows: none; }
  .data-grid { grid-template-columns: 1fr; }
  .exp-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "prev" "tabs" "frame"; }
  .exp-tabs { margin-top: 20px; }
  .data-step, #s2, #s4 { height: auto; } .tbl-sheet .data-table { max-height: 70vh; } .exp-prev { min-height: 320px; } .recent-box .recent-list { max-height: 260px; } .data-main .data-table { max-height: 70vh; } #chooser .charts { max-height: 75vh; }
  .fig-head, .fig-grid { grid-template-columns: minmax(0, 1fr); } .fig { min-height: 420px; } /* (1fr = at least the settings' own width: a phone page 559 px wide) */
  .opts { max-height: 70vh; } .ol-body { overflow: auto; }
}
/* Columns while Python reads an Excel / JSON file again: shown, but takes no changes until the new reading is there */
#columnsView.is-reading { pointer-events: none; opacity: .55; transition: opacity .15s; }
/* a phone: the steps get a row of their own under the name and the Python status, and scroll sideways in it (they made
   the whole page wider than the screen) */
@media (max-width: 700px) { .topbar { flex-wrap: wrap; } .topbar .stepper { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  .fig-bar { flex-wrap: wrap; } .fig-bar .view-tabs { max-width: 100%; overflow-x: auto; } }
@media (max-width: 700px) { .dbg-cards { grid-template-columns: 1fr 1fr; } .dbg-wf { grid-template-columns: 1fr 1fr 50px; } }
