/* CrunchyCharacter — all CSS. Linked with <link rel="stylesheet"> so it works on file://.
 *
 * --css-build is checked by index.html. Bump BOTH whenever the stylesheet gains rules a new feature
 * needs: a stale stylesheet is otherwise invisible, with every script fresh and the layout silently wrong.
 *
 * THE SHARED LOOK (CHAR-DESIGN.md §86, css-build 14): crunchyCore's crunchy-base.css is linked BEFORE this file and
 * gives the neutrals (--bg --panel --panel2 --line --line2 --ink --muted --bad --info), --on-accent, the hard step and
 * lift, buttons, selects, inputs, sliders, checkboxes, the pixel icons (.pxi) and the suite dialog (`suite-*`). This
 * file keeps Character's layout and its accent only: square corners, hard steps, no blur, no glow, no gradient in the
 * chrome. The checkers and the green ground are CONTENT (what a character is judged on) and keep their colours.
 * Ported from crunchyTile/styles.css (css-build 19, 2026-10-09).
 */
:root {
  --css-build: 33;

  /* Set from CHECKER in core.js at startup; these are only the fallback. */
  --chk-a: #ff00ff;
  --chk-b: #a000a0;

  /* Character's accent (CONSOLIDATION-PLAN.md §9): pink; --accent-dk is the hard step under a filled button */
  --accent: #ff5c8a;
  --accent-dk: #a8324f;
}

* { box-sizing: border-box; }

/* [hidden] loses to any author `display` rule without this (inherited from CrunchyVFX). */
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
header h1 { margin: 0; font-size: 16px; }
/* THE WORDMARK (2026-10-21; drawn in code by crunchyCore tools/make-wordmarks.mjs, the suite's header redesign): exactly
   2x, overhanging the header's padding rather than growing it; the h1's text stays for search engines and screen
   readers, visually hidden. At phone width it shows at 1x. */
header h1.wm { flex: none; line-height: 0; }
h1.wm img { image-rendering: pixelated; display: block; margin: -7px 0; }
h1.wm .wm-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) { h1.wm img { width: 146px; height: 22px; margin: 0; } }
/* the wider logo needs the room: the tagline gives way below 1600 px (as CrunchyVFX's does), and nothing in the header
   wraps onto two lines */
@media (max-width: 1599px) { header h1.wm + .tag { display: none; } }
header button, header .tag, header #build { white-space: nowrap; }
header .tag { color: var(--muted); font-size: 12px; }
header .spacer { flex: 1; }

#deps { display: none; padding: 6px 14px; background: #4d1418; color: #ffb3b8; font-weight: 700; }
#deps.show { display: block; }

.app { flex: 1; display: flex; min-height: 0; }

aside#controls {
  width: 280px;
  flex: none;
  overflow-y: auto;
  padding: 10px 12px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
aside h2 {
  margin: 14px 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
aside .group:first-child h2 { margin-top: 0; }

.ctl { display: grid; grid-template-columns: 104px 1fr 34px; align-items: center; gap: 6px; margin: 4px 0; }
.ctl label { color: var(--muted); }
.ctl select { grid-column: 2 / 4; }
.ctl output { text-align: right; font-variant-numeric: tabular-nums; }
/* §134: an item from CrunchyItems, pasted: the field and its Clear, then what it is on a line of its own */
.ctl.item { grid-template-columns: 104px 1fr auto; }
.ctl.item input { min-width: 0; }
.ctl.item output { grid-column: 1 / 4; text-align: left; color: var(--muted); }

/* buttons, selects and sliders are crunchy-base.css's */

main#stage {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stage-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.stage-row figure { margin: 0; }
.stage-row figcaption { color: var(--muted); font-size: 12px; margin-top: 4px; max-width: 60ch; }

/* The preview IS the renderer, scaled by integer nearest-neighbour, never a CSS approximation.
   Transparency shows as a MAGENTA checker: grey would be read as content (core.js CHECKER). */
canvas.art {
  display: block;
  /* (css-build 16: a canvas never shrinks to fit, its scale is chosen whole instead; crisp-edges first, for an engine,
     WebKit's, that lacks pixelated) */
  flex: none;
  max-width: none;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  background-color: var(--chk-a);
  background-image:
    linear-gradient(45deg, var(--chk-b) 25%, transparent 25%, transparent 75%, var(--chk-b) 75%),
    linear-gradient(45deg, var(--chk-b) 25%, transparent 25%, transparent 75%, var(--chk-b) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  border: 1px solid var(--line);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* THE PREVIEW (css-build 2): a character is judged on ground, not on the magenta checker, because that
   is where it will stand (CHAR-DESIGN.md §8). A field of two greens, 16 px squares at 3x. */
canvas.art.ground {
  background-color: #6f9a4a;
  background-image:
    linear-gradient(45deg, #668f44 25%, transparent 25%, transparent 75%, #668f44 75%),
    linear-gradient(45deg, #668f44 25%, transparent 25%, transparent 75%, #668f44 75%);
  background-size: 96px 96px;
  background-position: 0 0, 48px 48px;
}
/* RANDOMIZE (css-build 3): the bar above the controls, as CrunchyTile's (§26 there). */
.rollbar { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr; gap: 4px; margin-bottom: 10px; }
.rollbar button:disabled { opacity: 0.45; cursor: default; }
.rollbar button { white-space: nowrap; padding: 3px 4px; }

/* PICTURE PICKERS (css-build 4, §31): ported from crunchyTile/styles.css (css-build 4 there). */
.ctl.pick { display: block; }
.ctl.pick > label { display: none; }
.pickchip, .pickhead {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 5px 7px;
}
.pickhead { flex-direction: row; font-weight: 600; }
.ptitle { color: var(--muted); font-size: 11px; }
.prow { display: flex; align-items: center; gap: 7px; }
.pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcount { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pcaret { color: var(--muted); }
/* `input.`: the base's input[type=search] outranks a bare class (crunchyCore CLAUDE.md) */
input.pickfilter {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-top: 0; padding: 3px 7px;
}
.pickgrid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-height: 320px; overflow-y: auto;
  padding: 4px; background: var(--bg); border: 1px solid var(--line); border-top: 0;
}
.pickgrid.ramp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pickgrid.head, .pickgrid.body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* (css-build 33, §238: minmax(0, 1fr), so a picture never holds its column open; a plain 1fr is never narrower than its
   content, and a picture fitted to a wider panel kept the grid scrolling sideways in Slender and Lo-fi) */
.pickcell { min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px; font-size: 11px; text-align: left; }
.pickcell span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickcell.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }   /* a hard 1 px ring, no blur */
.swatchstrip { display: flex; height: 14px; min-width: 64px; border: 1px solid var(--line); overflow: hidden; }
.swatchstrip > span { flex: 1; }
.pickchip .swatchstrip { width: 96px; flex: none; }
/* the character, on the same field of green it is judged on everywhere else (§8) */
canvas.lookthumb { image-rendering: pixelated; background: #6f9a4a; border: 1px solid var(--line); }
/* (css-build 17, §116: no stretching; index.html fitThumbs sizes each picture at a whole device scale) */
.pickchip canvas.lookthumb { flex: none; }
.pickcell canvas.lookthumb { align-self: center; }
.animpick { display: inline-flex; margin-right: 8px; }
.exportrow { align-items: center; }
.exportrow label { color: var(--muted); }
.exportrow input[type="text"] { width: 12em; }
/* a FUSED row of buttons: the step is under the row, not under each button */
.animpick { box-shadow: var(--step) var(--step) 0 var(--drop); }
.animpick button { padding: 2px 10px; box-shadow: none; }
.animpick button:active { transform: none; }
.animpick button + button { border-left: 0; }
.animpick button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
/* §228: the SMOOTHNESS switch beside the animations (1x as drawn, 2x with redrawn in-betweens), the same fused row */
.smoothpick { display: inline-flex; margin-right: 8px; box-shadow: var(--step) var(--step) 0 var(--drop); }
.smoothpick button { padding: 2px 8px; box-shadow: none; }
.smoothpick button:active { transform: none; }
.smoothpick button + button { border-left: 0; }
.smoothpick button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }

footer.license {
  padding: 6px 14px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border-top: 1px solid var(--line);
}
footer.license strong { color: var(--ink); }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  aside#controls { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}
/* §223, A PHONE (css-build 30; the fresh-eyes pass before the web launch): the character FIRST, then the panel that edits
   it (stacked the other way round, the preview was some 2,500 px down, under every control). The whole page scrolls, not
   two boxes inside it; the header wraps rather than running off the right edge; a wide picture (the lineup) scrolls
   sideways in its own row rather than being clipped. The preview's facings go two by two when a row of four would be 1x
   (index.html drawPreview). */
@media (max-width: 760px) {
  html, body { height: auto; }
  .app { flex: none; }
  main#stage { order: -1; flex: none; overflow: visible; padding: 12px; }
  aside#controls { overflow: visible; border-top: 1px solid var(--line); }
  header { flex-wrap: wrap; row-gap: 6px; padding: 8px 12px; }
  header .spacer { display: none; }
  .stage-row { min-width: 0; }
  .stage-row figure { max-width: 100%; overflow-x: auto; }
  .animpick { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 4px; box-shadow: none; }
  .animpick button + button { border-left: 1px solid var(--line2); }
  .smoothpick { margin: 0 0 4px; }
  /* the 3D model by touch: a sideways swipe turns it, an up-and-down one still scrolls the page (a full-width canvas that
     took every touch would trap the scroll; tilting is the mouse's) */
  canvas.model3d { touch-action: pan-y; }
}

/* THE CRUNCHY SUITE: suite.js's dialog is styled by crunchy-base.css (its `suite-*` rules); only the button is ours. */
#suiteBtn { white-space: nowrap; }

/* ERAS (§49, css-build 6; from crunchyTile/styles.css css-build 21): the header's era select, set apart so it
   reads as a mode. */
.erapick { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.erapick select { font-size: 13px; font-weight: 600; border-color: var(--accent); padding: 3px 6px; }
@media (max-width: 760px) { .erapick { margin-left: 0; order: 9; } }

/* THE ROSTER (§50, css-build 7; from crunchyUI/styles.css's roster and kit strip). Tabs, not a picker: the
   set of styles and species IS the product. Each tab draws the live character, so the bar recolours with
   it. The styles are pinned at the left; the species strip PAGES rather than scrolls (a horizontal
   scrollbar is awkward without a trackpad). */
/* (§59, css-build 9: two bars, `.rosterbar`: the style and the looks, then the species) */
#roster, .rosterbar {
  display: flex; gap: 14px; flex: none; overflow: hidden; align-items: flex-end;
  padding: 3px 12px 4px; border-bottom: 1px solid var(--line); background: var(--panel2);
}
.rosterbar .rstrip { display: flex; gap: 14px; flex: 1 1 auto; min-width: 0; overflow: hidden; align-items: flex-end; }
.rosterbar .pgbtn { align-self: center; flex: none; }
.tbarpage { font-size: 10px; color: var(--muted); flex: none; min-width: 34px; text-align: center; align-self: center; }
.rgroup { display: flex; flex-direction: column; gap: 1px; flex: none; }
.rgroup + .rgroup, .rosterbar > .rgroup + .rstrip { padding-left: 14px; border-left: 1px solid var(--line); }
.rlab { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* (css-build 22, §203, Grout's usability round: "Monsters" read "RS" on the strip's second page, its group begun on the
   page before: a group's label STICKS to the strip's left edge while any of its group shows) */
.rstrip .rlab { position: sticky; left: 0; align-self: flex-start; width: max-content; }
.rtabs { display: flex; gap: 4px; }
.etab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: none; min-width: 62px; padding: 3px 6px 2px;
  background: transparent; border: 1px solid transparent; box-shadow: none; cursor: pointer;
}
.etab:active { transform: none; }
/* A FIXED BOX WITH THE SPRITE AT ITS FOOT: a cat and a cyclops differ by 40 px, and a box that sized itself
   would step the labels up and down the bar. */
.etab .art { display: flex; align-items: flex-end; justify-content: center; height: 58px; }
.etab .art canvas { display: block; image-rendering: pixelated; }
.etab .cap { font-size: 11px; color: var(--muted); }
.etab:hover { border-color: var(--line); background: var(--panel); }
.etab.on { border-color: var(--accent); background: var(--panel); }
.etab.on .cap { color: var(--accent); }

/* THE VIEW SWITCH (§51, css-build 8; crunchyUI/styles.css `.tswitch`): two buttons in one box, the lit one
   the current view. In the header beside the era: both are whole-app modes. */
.tswitch { display: flex; flex: none; border: 1px solid var(--line2); overflow: hidden; margin-left: 10px;
           box-shadow: var(--step) var(--step) 0 var(--drop); }
.tswitch button {
  border: 0; box-shadow: none; padding: 5px 12px; font-size: 13px; font-weight: 600;
  background: var(--panel2); color: var(--muted); cursor: pointer; letter-spacing: .3px;
}
.tswitch button + button { border-left: 1px solid var(--line2); }
.tswitch button:hover { color: var(--ink); }
.tswitch button:active { transform: none; }
.tswitch button.on { background: var(--accent); color: var(--on-accent); }
/* THE PORTRAIT (§63, css-build 10): its Chunky / Fine switch sits inline at the start of the caption. */
.tswitch.portraitpick { display: inline-flex; margin: 0 10px 0 0; vertical-align: middle; }
.tswitch.portraitpick button { padding: 3px 10px; font-size: 12px; }
/* THE TABS (§66, css-build 11): the stage's outputs, a tab each, over a line; the panel drives them all. */
.stagetabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex: none; }
.stagetabs button {
  border: 1px solid transparent; border-top-width: 2px; border-bottom: 0; box-shadow: none; background: transparent;
  color: var(--muted); padding: 7px 16px; font-size: 13px; font-weight: 600; margin-bottom: -1px;
}
.stagetabs button:hover { color: var(--ink); border-color: transparent; }
.stagetabs button:active { transform: none; }
.stagetabs button.on { color: var(--ink); background: var(--panel2); border-color: var(--line); border-top: 2px solid var(--accent);
                       border-bottom: 1px solid var(--panel2); }
.tabpane { display: flex; flex-direction: column; gap: 14px; }
.tabpane[hidden] { display: none; }
.tabnote { color: var(--muted); font-size: 13px; max-width: 70ch; margin: 0; }
/* THE PICTURE (§67, css-build 12): a sprite look's small buffer is shown whole-pixel; the others are 512 already. */
canvas.art.picture { image-rendering: pixelated; }
#pictureName { color: var(--ink); font-weight: 600; margin-left: 8px; }
/* THE FAMILY (§68, css-build 13): a strip of members on one ground, each a button with its name; the
   elements start a new line. */
.family { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; max-width: 1100px; }
.famcell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; background: var(--panel2); border: 1px solid var(--line); }
.famcell.on { border-color: var(--accent); }
.famcell.brk { margin-left: 18px; }
.famcell canvas { image-rendering: pixelated; }
.famcell span { font-size: 11px; color: var(--muted); max-width: 110px; text-align: center; }

/* THE PLANTED LIBRARY (§87, desktop only): crunchyCore's library.js docks its panel as a column of .app, beside the
   stage, as CrunchyTile's does; the status line under the export buttons says what each save did. */
.app > .lib-dock { width: 380px; flex: none; }
@media (max-width: 760px) { .app > .lib-dock { width: auto; } }
.plant-msg { min-height: 1.5em; }

/* §118 THE CHARACTER CREATOR (css-build 18): a modal over the app, one step at a time: the panel is wide, the preview
   on the left, the step's rows scrolling on the right. */
.creator-open { width: 100%; margin: -4px 0 10px; }
/* (its own overlay, the suite's look: the suite dialog's tests find theirs by .suite-overlay) */
.cr-overlay[hidden] { display: none !important; }
.cr-overlay { position: fixed; inset: 0; z-index: 250; background: rgba(8, 7, 12, 0.78); display: flex;
              align-items: center; justify-content: center; padding: 16px; }
.cr-panel { width: min(1120px, 100%); height: min(780px, 100%); display: flex; flex-direction: column; background: var(--panel);
            border: 2px solid var(--line2); box-shadow: var(--lift); }
.cr-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cr-steps { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.cr-step { font-size: 12px; padding: 4px 9px; }
.cr-step.done { color: var(--muted); }
.cr-step.on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cr-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px 1fr; }
.cr-side { display: flex; align-items: flex-start; justify-content: center; padding: 14px; border-right: 1px solid var(--line);
           background: var(--bg); }
.cr-side canvas { background: #6f9a4a; border: 1px solid var(--line); }
.cr-body { min-height: 0; display: flex; flex-direction: column; padding: 12px 16px 0; }
.cr-title { margin: 0; font: 700 17px/1.4 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.cr-line { margin: 2px 0 10px; color: var(--muted); }
.cr-rows { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; padding-bottom: 12px; }
.cr-row { margin-bottom: 14px; }
.cr-row h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.cr-grid { display: grid; gap: 4px; }
.cr-grid.pics { grid-template-columns: repeat(auto-fill, minmax(162px, 1fr)); }   /* (a 72 px body picture at a whole 2x, §114) */
.cr-grid.ramp { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.cr-grid.words { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.cr-cell { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px; font-size: 11px; text-align: left; }
.cr-cell canvas.lookthumb { align-self: center; }
.cr-cell span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-cell.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }   /* a hard 1 px ring, no blur */
.cr-range { display: flex; align-items: center; gap: 10px; max-width: 360px; }
.cr-range input { flex: 1; }
/* §169: an item pasted from CrunchyItems in the Creator: the field and Clear on a line, what it holds or wears below */
.cr-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; max-width: 460px; }
.cr-item input { flex: 1; min-width: 0; }
.cr-item output { flex-basis: 100%; font-size: 12px; opacity: 0.8; }
#crName { width: 100%; max-width: 360px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); padding: 4px 7px; }
.cr-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.cr-gap { flex: 1; }
@media (max-width: 760px) { .cr-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .cr-side { border-right: 0; border-bottom: 1px solid var(--line); } }
/* §136: THE NPC CROWD, on the creator's frame: the tags on the left, the crowd on the right */
.cw-side { flex-direction: column; align-items: stretch; justify-content: flex-start; overflow-y: auto; gap: 12px; }
.cw-sec h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.cw-chip { font-size: 12px; padding: 4px 9px; margin: 0 4px 4px 0; }
.cw-chip.on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cw-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; align-content: start; padding-bottom: 12px; }
.cw-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--line); background: var(--panel2); }
.cw-cell.kept { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cw-cell canvas { background: #6f9a4a; }
.cw-name { font-size: 12px; color: var(--ink); }
.cw-acts { display: flex; gap: 3px; }
.cw-acts button { font-size: 11px; padding: 2px 6px; }
.cw-acts button.on { border-color: var(--accent); color: var(--accent); }


/* THE WIZARD (css-build 23, §208): ported from crunchyTile/styles.css (its §86 block), with pictures on the cards. */
.wiz-overlay { position: fixed; inset: 0; z-index: 240; background: rgba(8, 7, 12, 0.78); display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.wiz-overlay[hidden] { display: none !important; }
.wiz-panel { width: min(1040px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 2px solid var(--line2); box-shadow: var(--lift);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.wiz-head { display: flex; align-items: center; gap: 10px; }
.wiz-title { margin: 0; font-family: var(--head); text-transform: uppercase; letter-spacing: .03em; font-size: 17px; color: var(--accent);
  display: flex; align-items: center; gap: 8px; }
.wiz-steps { flex: 1; font-size: 12px; color: var(--muted); }
.wiz-close { font-size: 16px; line-height: 1; padding: 4px 9px; }
.wiz-q { margin: 0; font-size: 15px; }
.wiz-group { margin: 4px 0 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wiz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.wiz-card { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 11px; }
.wiz-words { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wiz-card b { font-size: 13.5px; }
.wiz-card i { font-style: normal; font-size: 12px; color: var(--muted); }
.wiz-card.on { border-color: var(--accent); }
.wiz-card-pic { padding: 6px 10px 6px 6px; }
.wiz-card-art { flex: none; background: var(--bg); }
.wiz-swatches { display: grid; grid-template-columns: repeat(3, 12px); gap: 2px; flex: none; }
.wiz-swatch { width: 12px; height: 12px; }
.wiz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wiz-pick { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px; font-size: 12px; color: var(--muted); }
.wiz-thumb { background: var(--bg); }
.wiz-foot { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 640px) { .wiz-grid { grid-template-columns: repeat(2, 1fr); } }
/* (css-build 24, §209: the hand-off under each pick, as Tile's) */
.wiz-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wiz-pick { flex: 1; }
.wiz-tocreator { font-size: 12px; padding: 4px 8px; }

/* (css-build 25, §211: an OPEN family among other tabs (the elementals among the monsters), boxed so its kinds read as one) */
.rkin { display: flex; gap: 4px; padding: 0 3px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel); }

/* (css-build 26, §211: a FOLDED family reads as one that opens (AJ, 2026-11-09: "some sort of indication to imply they'll
   be expanded on click"): a PILE, two card edges behind the tab as hard offset shadows (an outer shadow never paints
   under its box, so only the edges show; no blur), its kinds counted in the corner, and a chevron after the caption,
   drawn square in the caption's color) */
.etab.efold {
  border-color: var(--line); background: var(--panel); margin: 4px 6px 0 0;
  box-shadow: 3px -3px 0 -1px var(--panel), 3px -3px 0 0 var(--line), 6px -6px 0 -1px var(--panel), 6px -6px 0 0 var(--line);
}
.etab.efold:hover { border-color: var(--accent); }
.etab.efold { position: relative; }
.etab.efold .fcount {
  position: absolute; top: 3px; right: 3px; min-width: 14px; padding: 0 3px; font-size: 10px; line-height: 14px;
  text-align: center; color: var(--bg); background: var(--muted);
}
.etab.efold:hover .fcount { background: var(--accent); }
.etab.efold .cap { display: inline-flex; align-items: center; gap: 4px; }
.etab.efold .fchev { width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 4px solid currentColor; }

/* (css-build 27, §217: THE 3D TAB: its clip buttons fused as the sheet's are (their own class: the sheet's code lights every
   .animpick by its animation), and the facing as a turn: ‹ the name › ) */
.c3pick { display: inline-flex; margin-right: 8px; box-shadow: var(--step) var(--step) 0 var(--drop); }
.c3pick button { padding: 2px 10px; box-shadow: none; }
.c3pick button:active { transform: none; }
.c3pick button + button { border-left: 0; }
.c3pick button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.c3turn { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.c3turn button { padding: 2px 9px; }
#dir3dName { min-width: 7.5em; text-align: center; color: var(--ink); }
#status3d { color: var(--accent); font-weight: 700; }
#look3dPick { margin-left: 0; margin-right: 8px; display: inline-flex; }

/* (css-build 28, §218: 2D | 3D in the header, and the Model tab's live view: a fixed size, never stretched by the page) */
.dimpick button { min-width: 3.2em; }
canvas.model3d { display: block; max-width: 100%; height: auto; cursor: grab; image-rendering: pixelated; border: 1px solid var(--line); }
canvas.model3d:active { cursor: grabbing; }
#statusModel { color: var(--accent); font-weight: 700; }
#lookModelPick { margin-left: 0; margin-right: 8px; display: inline-flex; }

/* (css-build 29, §219: THE SURFACES panel beside the model: chips per surface, the chosen one's swatch and knobs) */
#rowModel { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.surfaces3d { flex: 1 1 300px; max-width: 460px; display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); padding: 12px; }
.surfaces3d h3 { margin: 0; font-family: var(--head); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sf-chips button { padding: 3px 9px; font-size: 12px; }
.sf-chips button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.sf-head { display: flex; gap: 10px; align-items: center; }
.sf-swatch { image-rendering: pixelated; border: 1px solid var(--line2); flex: none; }
.sf-dim { color: var(--muted); font-size: 12px; }
.sf-knobs { display: grid; grid-template-columns: 1fr; gap: 6px; }
.sf-knobs label { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.sf-knobs select, .sf-knobs input { min-width: 0; width: 100%; }
/* §236: the Built from row as pictures (surface-pick.js), in the ramp picker's box */
.sp-btn .sp-pic { width: 32px; height: 32px; }
.sp-pic { image-rendering: pixelated; display: block; flex: none; width: 64px; height: 64px; border: 1px solid #000; }
.sp-pop { position: fixed; z-index: 300; width: 372px; max-width: calc(100vw - 16px); max-height: min(440px, calc(100vh - 16px)); overflow: auto;
          display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 2px solid var(--accent); box-shadow: var(--lift);
          padding: 8px; scrollbar-color: var(--line) #0e0d12; }
.sp-pop[hidden] { display: none; }
.sp-pop input { width: 100%; }
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.sp-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px; border: 2px solid transparent; cursor: pointer; min-width: 0; }
.sp-opt:hover { border-color: var(--line); }
.sp-opt.on { border-color: var(--accent); background: #2b2734; }
.sp-opt:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.sp-name { font-size: 11px; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surfaces3d details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
