/* CrunchyItem — the app's own CSS: its LAYOUT and its ACCENT. Linked with <link rel="stylesheet"> so it works on file://.
 *
 * The look itself (neutrals, buttons, sliders, checkboxes, the Library, suite, Settings, Feedback and desktop dialogs)
 * is crunchy-base.css, the suite's shared stylesheet (crunchyCore), linked FIRST; this file must not override its
 * FLOOR rules (square, the hard step, the neutrals, no blur, gradients or glows). Each app keeps its own accent
 * (CONSOLIDATION-PLAN.md §9): CrunchyItem is lime, as its row in suite.js.
 *
 * --css-build is checked by index.html: bump both together whenever a feature needs new rules here.
 * The layout follows CrunchyVFX's and CrunchyTile's (the suite's shape): one header row of globals, the generator row,
 * the picture strip, then the editor on the left and the preview on the right, the Library docked as a last column.
 */
:root {
  --css-build: 11;
  /* lime, and the darker step under a filled button */
  --accent: #a6e22e;
  --accent-dk: #5f8a14;
  /* the preview's backdrops: an item must read on both (a hand over a dark dungeon, an inventory slot on parchment) */
  --bd-dark: #2a2634;
  --bd-light: #c4c8ce;
  --chk-1: #2c2a33;
  --chk-2: #232129;
}

* { box-sizing: border-box; }
button:disabled { opacity: .45; cursor: default; }
/* [hidden] loses to any author `display` rule without this (inherited from CrunchyVFX and CrunchyTile) */
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; }

/* ---- the header: the app, the look (era, CRT), then the globals in the suite's order ---- */
header { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--panel);
         border-bottom: 2px solid var(--drop); min-width: 0; }
header h1 { margin: 0; font-size: 17px; white-space: nowrap; }
header .tag { color: var(--muted); font-family: var(--head); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
header .spacer { flex: 1; }
.hdr-globals { display: flex; align-items: center; gap: 8px; flex: none; }
.hdr-globals > button { padding: 6px 11px; white-space: nowrap; }
.erapick { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.erapick select { font-size: 13px; font-weight: 600; color: var(--ink); background: var(--panel2); border: 1px solid var(--accent); padding: 3px 6px; }
.crtbtn { font-size: 12px; padding: 3px 9px; white-space: nowrap; }
.crtbtn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700;
             box-shadow: var(--step) var(--step) 0 var(--accent-dk); }
#build { flex: none; }
@media (max-width: 1280px) { header .tag:not(#build) { display: none; } }

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

/* ---- the generators: their own full-width row (CrunchyVFX §22.1) ---- */
.genbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 14px;
          background: var(--bg); border-bottom: 1px solid var(--line); }
.genrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.genrow-keep { padding-left: 10px; border-left: 1px solid var(--line); }
.genbar button { padding: 5px 11px; }
.genbar .hint { font-size: 12px; color: var(--muted); }
.genkeep { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }

/* ---- the picture strip: one cell per (family, style), PAGED by arrows, never a sideways scrollbar ---- */
#presetbar { flex: none; display: flex; flex-direction: column; gap: 5px; padding: 6px 14px 7px; background: var(--panel);
             border-bottom: 2px solid var(--drop); min-width: 0; }
.pbar-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pbar-title { flex: none; font: 700 11px/1.5 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#stripSearch { flex: none; width: 180px; font-size: 12px; padding: 3px 8px; }
.pbar-chips { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.tagchip { font-size: 11px; padding: 1px 7px; background: var(--bg); border: 1px solid var(--line); box-shadow: none; color: var(--muted); white-space: nowrap; }
.tagchip:hover { color: var(--ink); border-color: var(--line2); }
.tagchip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#stripCount { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }
.pbar-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pstrip { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.pcell { flex: none; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px 3px;
         background: var(--panel2); border: 1px solid var(--line); box-shadow: none; cursor: pointer; }
.pcell:hover { border-color: var(--accent); }
.pcell.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pcell.on .pname { color: var(--accent); }
.pcell canvas { width: 64px; height: 64px; image-rendering: pixelated; background: var(--bd-dark); display: block; }
.pname { width: 100%; font-size: 10.5px; line-height: 14px; color: var(--ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfam { width: 100%; font-size: 9.5px; line-height: 12px; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; }
.pnone { color: var(--muted); font-size: 12px; padding: 30px 4px; }
.pbar-row .pgbtn { flex: none; box-shadow: none; align-self: stretch; padding: 0 6px; font-size: 18px; line-height: 1; }
.pbar-row .tbarpage { flex: none; min-width: 40px; text-align: center; font-size: 11px; color: var(--muted); }

/* ---- the workspace: the editor (left), the preview (right), the Library docked last ---- */
.app { flex: 1; display: flex; min-height: 0; }
aside#editor { width: 330px; flex: none; overflow-y: auto; padding: 10px 12px 16px; background: var(--panel); border-right: 1px solid var(--line); }
aside h2 { margin: 14px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--line); font: 700 11px/1.5 var(--head);
           text-transform: uppercase; letter-spacing: .1em; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
aside h2 .hint { margin-left: auto; font: 11px/1.5 var(--font); text-transform: none; letter-spacing: 0; color: var(--muted); }
aside > h2:first-child { margin-top: 0; }
.ctl { display: grid; grid-template-columns: 76px 1fr 40px; align-items: center; gap: 6px; margin: 5px 0; }
.ctl > label { color: var(--muted); }
.ctl > select, .ctl > .wide { grid-column: 2 / 4; }
.ctl output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.ctl input[type="text"], .ctl input[type="number"] { width: 100%; padding: 3px 6px; }
.seedrow { display: flex; gap: 6px; grid-column: 2 / 4; }
.seedrow input { flex: 1; min-width: 0; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.seg button { padding: 3px 9px; font-size: 12px; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.styles { grid-column: 2 / 4; }

/* the material slots: the current material as its ramp, and a picker grouped by kind under it when opened */
.matslot { margin: 6px 0; }
.matbtn { width: 100%; display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; padding: 4px 6px; text-align: left; }
.matbtn .slotname { color: var(--muted); font-size: 12px; }
.matbtn .matname { font-size: 12px; }
.ramp { display: inline-flex; height: 14px; border: 1px solid var(--drop); }
.ramp i { width: 10px; height: 100%; display: block; }
.matbtn.open { border-color: var(--accent); }
.matpick { margin: 4px 0 8px; padding: 6px; background: var(--panel2); border: 1px solid var(--line); }
.matkind { font: 700 10px/1.6 var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 0 2px; }
.matkind:first-child { margin-top: 0; }
.matgrid { display: flex; flex-wrap: wrap; gap: 4px; }
.matsw { padding: 2px; box-shadow: none; background: var(--bg); display: flex; flex-direction: column; align-items: stretch; gap: 1px; width: 68px; }
.matsw .ramp { height: 12px; display: flex; }
.matsw .ramp i { width: auto; flex: 1; }
.matsw .swname { font-size: 10px; line-height: 12px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matsw.on .swname, .matsw:hover .swname { color: var(--ink); }
.ctl > .enchants { grid-column: 1 / 4; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ctl.enchant-row > label { grid-column: 1 / 4; }
.enchants button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 3px 4px; }
.enchants .esw { width: 9px; height: 9px; border: 1px solid; display: inline-block; flex: none; }
.enchants .ethumb { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.enchants button { flex-wrap: wrap; }
/* rarity (§17, css 7): the tier swatch is stripes (the rainbow's six hues; one colour otherwise), and a tag by the title */
.rsw, .enchants .rsw { display: inline-flex; }
.rsw i { flex: 1; }
.rartag { display: inline-flex; align-items: center; gap: 4px; align-self: center; font-size: 12px; color: var(--ink); }
.rartag .rsw { width: 9px; height: 9px; border: 1px solid; flex: none; }
/* the enchant's colour (css 10, items.js 19): a row of swatches under the enchant picker, each its five tones as stripes */
.ctl > .ecolours { grid-column: 1 / 4; display: flex; flex-wrap: wrap; gap: 4px; }
.ecolours button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px; min-height: 26px; }
.ecolours .csw { display: inline-flex; width: 20px; height: 14px; border: 1px solid; flex: none; }
.ecolours .csw i { flex: 1; }
.matsw.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

main#stage { flex: 1; min-width: 0; overflow: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.stagehead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stagehead h2 { margin: 0; font: 700 15px/1.3 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--ink); }
.stagehead .hint { font-size: 12px; color: var(--muted); }
.preview-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.preview-row figure { margin: 0; }
figcaption { color: var(--muted); font-size: 12px; margin-top: 4px; }
canvas.art { display: block; image-rendering: pixelated; border: 1px solid var(--line); }
.bigbox { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.panel .hint { font-size: 11.5px; color: var(--muted); max-width: 26em; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.panel > h3 { margin: 0; font: 700 11px/1.5 var(--head); text-transform: uppercase; letter-spacing: .1em; color: var(--ink);
              display: flex; align-items: baseline; gap: 8px; }
.panel > h3 .hint { font: 11px/1.5 var(--font); text-transform: none; letter-spacing: 0; color: var(--muted); }
.trio { display: flex; gap: 12px; align-items: flex-end; }
.trio figure { margin: 0; text-align: center; }
.held { display: flex; gap: 10px; align-items: flex-end; }
.held figure { margin: 0; text-align: center; }
.legend { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.legend b { font-weight: 600; }
.mk { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: -1px; }
.mk.grip { background: var(--accent); }
.mk.tip { background: #45d0ff; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.status { font-size: 12px; color: var(--muted); min-height: 1.5em; }

/* My set: a name and an Add button; each item a row (its picture, its name, up, remove); the set's exports */
.setbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.setbar input[type="text"] { min-width: 14em; padding: 4px 8px; }
.setlist { display: flex; flex-wrap: wrap; gap: 6px; }
.setcard { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); padding: 3px 3px 3px 4px; }
.setcard canvas { width: 32px; height: 32px; image-rendering: pixelated; background: var(--bd-dark); display: block; }
.setcard .setname { cursor: pointer; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setcard .setname:hover { color: var(--accent); }
.setcard .setidx { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.5em; text-align: right; }
.setcard button { border: 0; background: none; box-shadow: none; padding: 0 5px; line-height: 1.2; color: var(--muted); }
.setcard button:hover { color: var(--ink); }
.setempty { font-size: 12px; color: var(--muted); }
.projline { font-size: 12px; color: var(--muted); }
.projline b { color: var(--ink); font-weight: 600; }

/* the Library (crunchyCore library.js), docked as the last column of the workspace */
.app > .lib-dock { width: 360px; flex: none; }

footer.license { flex: none; padding: 6px 14px; font-size: 12px; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line); }
footer.license p { margin: 0; }
footer.license strong { color: var(--ink); }
footer.license .tool-notice { margin-top: 2px; }
/* css-build 11 (the web launch): the About link, the website's one way to about.html (web only, data-web) */
footer.license a.aboutlink { color: var(--accent); margin-left: 6px; white-space: nowrap; }

/* THE WELCOME TOUR (CrunchyTile's, from CrunchyUI and CrunchyVFX): four plain panels around the hole, never a 9999 px
   box-shadow (that texture took a browser down in Tile), and nothing animates. */
.tour { position: fixed; inset: 0; z-index: 300; }
.tour-shade { position: absolute; background: rgba(8, 7, 12, 0.82); }
.tour-hole { position: absolute; border: 2px solid var(--accent); pointer-events: none; }
.tour-hole.notarget { border-color: transparent; }
.tour-card { position: absolute; width: min(360px, 90vw); background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; box-shadow: var(--lift); }
.tour-title { font: 700 14px/1.4 var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 6px; }
.tour-body { font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 10px; }
.tour-progress { font-size: 12px; color: var(--muted); }
.tour-btns { display: flex; gap: 8px; }
.tour-btns button { padding: 6px 12px; font-size: 13px; }

/* PHONE WIDTH: the page stacks and scrolls as a whole, the preview first (what it makes), the editor after. */
@media (max-width: 760px) {
  html, body { height: auto; }
  header { flex-wrap: wrap; row-gap: 6px; }
  header .spacer { display: none; }
  .hdr-globals { flex: 1 1 100%; flex-wrap: wrap; gap: 6px; }
  .genrow-keep { padding-left: 0; border-left: 0; }
  #presetbar { padding: 6px 10px 7px; }
  .pbar-top { flex-wrap: wrap; row-gap: 4px; }
  #stripSearch { flex: 1 1 auto; width: auto; }
  .app { flex-direction: column; min-height: auto; }
  main#stage { order: -1; overflow: visible; padding: 10px; }
  aside#editor { width: auto; overflow: visible; border-right: none; border-top: 1px solid var(--line); }
  .app > .lib-dock { width: auto; }
  canvas.art { max-width: 100%; height: auto; }
}

/* ---- build 3: the editor's sections fold; parts, add-ons and the effect (ITEMS-DESIGN §13) ---- */
.esec:first-child > h2 { margin-top: 0; }
aside h2.fold { cursor: pointer; user-select: none; }
aside h2.fold::before { content: "\2212"; display: inline-block; width: 10px; color: var(--muted); font-family: var(--font); }
aside .esec.folded > h2.fold::before { content: "+"; }
aside h2.fold:hover { color: var(--accent); }
aside h2.fold:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.esec.folded > .esec-body { display: none; }
.partrow { grid-template-columns: 64px 1fr; }
.partrow > .seg { grid-column: 2 / 3; }
.partseg button { padding: 2px 6px; font-size: 11.5px; }
.addons { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0; }
.addons .addonchip { font-size: 12px; padding: 2px 8px; }
.fxpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 5px 0; }
.fxpick button { padding: 3px 4px; }
.fxrow { grid-template-columns: 108px 1fr 40px; }
.fxrow > label { font-size: 11.5px; line-height: 1.25; }
.fxrow input[type="color"] { width: 100%; height: 22px; padding: 0 2px; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; }
.fxrow .fxshown { width: 14px; height: 14px; border: 1px solid var(--drop); justify-self: end; }
.fxautorow { margin-top: -2px; }
.fxautorow > .fxauto { grid-column: 2 / 4; font-size: 11px; padding: 2px 6px; justify-self: start; }
.fxramps { grid-template-columns: 1fr; }
.fxramps > label { grid-column: 1 / -1; }
.fxrampseg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.fxrampseg button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 3px 4px; font-size: 11.5px; }
.fxrampseg .esw { width: 9px; height: 9px; border: 1px solid; display: inline-block; flex: none; }
.fxbar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.fxbar button { padding: 3px 9px; font-size: 12px; }
.fxbar .hint { font-size: 11.5px; color: var(--muted); }

/* ---- build 4: the usability round (ITEMS-DESIGN §14) ---- */
/* the notice beside Back: "Replaced your edited Frostbite. Undo" */
.gennote { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); padding: 2px 4px 2px 10px; border-left: 2px solid var(--accent); }
.gennote button { padding: 2px 8px; font-size: 12px; }
/* one-line explanations under a section's controls */
.secnote { margin: 4px 0 2px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.secnote b { color: var(--ink); font-weight: 600; }
/* editing a set entry: the card marked, the Update button and its line */
.setcard.editing { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.setcard.editing::after { content: "editing"; font: 700 9.5px/1 var(--head); text-transform: uppercase; letter-spacing: .06em; color: var(--on-accent); background: var(--accent); padding: 2px 4px; }
.setcard .setfx { font: 700 9.5px/1 var(--head); text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-dk); padding: 1px 3px; }
.editline { font-size: 12px; color: var(--accent); }
.setnote { margin: 0; font-size: 11.5px; color: var(--muted); }
/* the effect peek: this item with the hovered effect, 16 px at 4x */
.fxpeek { position: fixed; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; background: var(--panel); border: 1px solid var(--accent); box-shadow: var(--lift); pointer-events: none; }
.fxpeek .hint { font-size: 11px; color: var(--muted); white-space: nowrap; }
/* the big view keeps its size whatever the effect's margin; the figure is as wide as it, never stretched by the effect bar */
.bigbox { width: 194px; align-items: flex-start; }
#bigView { flex: none; }
.bigbox .fxbar { flex-wrap: wrap; row-gap: 2px; min-height: 2.6em; }
/* SHORT SCREENS (a 1366 x 682 laptop): a smaller strip and a one-line footer, so the editor and the preview get the room */
@media (max-height: 760px) and (min-width: 761px) {
  .genbar { padding: 4px 14px; }
  #presetbar { padding: 4px 14px 5px; gap: 3px; }
  .pcell { width: 70px; padding: 3px 2px 2px; gap: 2px; }
  .pcell canvas { width: 48px; height: 48px; }
  .pfam { display: none; }
  footer.license { padding: 3px 14px; font-size: 11px; }
  footer.license p { display: inline; }
  footer.license .tool-notice { margin: 0 0 0 6px; }
  main#stage { padding: 10px 14px 12px; gap: 10px; }
}
.setcard.editing::after { order: 1; }
.setcard .setdel { order: 2; }

/* BREED (items.js 11): the suite's nine-child grid in the settings overlay's frame; the partner strip a picture each */
.breed-panel { width: min(980px, 100%); }
.breed-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; }
.breed-parent { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; min-width: 96px; }
.breed-parent canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.breed-parent select { max-width: 120px; }
.breed-x { font: 700 22px/1 var(--head); color: var(--accent); }
.breed-ctl { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.breed-wild { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.breed-wild input { flex: 1; }
.breed-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.breed-partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px; margin-bottom: 10px; }
.breed-fam { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 2px; font-size: 10.5px; }
.breed-fam canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.breed-fam.on { border-color: var(--accent); color: var(--accent); }
.breed-fam:disabled { opacity: 0.35; }
.breed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.breed-cell { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: start;
  padding: 6px 8px; text-align: left; white-space: normal; }
.breed-cell canvas { grid-row: 1 / 3; width: 64px; height: 64px; image-rendering: pixelated; }
.breed-cell.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.breed-name { font-size: 13px; color: var(--ink); }
.breed-cell.sel .breed-name { color: var(--accent); }
.breed-desc { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.itemdesc { margin: -4px 0 0; font-size: 13px; font-style: italic; color: var(--muted); }
.hybridline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.hybridchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 6px 2px 2px; border: 1px solid var(--line); }
.hybridchip canvas { width: 16px; height: 16px; image-rendering: pixelated; }
.hybridline .secnote { flex-basis: 100%; }
@media (max-width: 640px) { .breed-grid { grid-template-columns: 1fr; } }

/* ITEM KITS (ITEMS-DESIGN §18): the kit picker, the kit's controls, a grid of its slots (a picture, the role, Reroll) */
.kit-panel { width: min(1060px, 100%); }
.kit-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; margin: 6px 0 8px; }
.kit-pickbtn { display: grid; grid-template-columns: 32px 1fr; column-gap: 6px; align-items: center; padding: 4px 6px; text-align: left; font-size: 12px; white-space: normal; }
.kit-pickbtn canvas { grid-row: 1 / 3; width: 32px; height: 32px; image-rendering: pixelated; }
.kit-pickbtn small { color: var(--muted); font-size: 10.5px; }
.kit-pickbtn.on { border-color: var(--accent); color: var(--accent); }
.kit-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; margin-bottom: 4px; }
.kit-ctl label { display: flex; align-items: center; gap: 6px; }
.kit-ctl input[type=text] { width: 150px; }
.kit-what { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); }
.kit-look { font-size: 12px; color: var(--muted); }
.kit-look b { color: var(--ink); font-weight: 400; }
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 6px; margin: 8px 0; }
.kit-cell { min-width: 0; display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto 1fr auto; column-gap: 8px; row-gap: 3px; padding: 5px 6px; border: 1px solid var(--line); background: var(--bg); }
.kit-cell canvas { grid-row: 1 / 3; width: 64px; height: 64px; image-rendering: pixelated; }
.kit-role { font-size: 12.5px; color: var(--ink); }
.kit-item { font-size: 10.5px; color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-cellbtns { grid-column: 1 / -1; display: flex; gap: 4px; }
.kit-cellbtns button { flex: 1; justify-content: center; }
.kit-cellbtns button { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 11px; padding: 2px 6px; }
.kit-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kit-foot .spacer { flex: 1; }
.kit-msg { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .kit-grid { grid-template-columns: 1fr; } .kit-cell { grid-template-columns: 32px 1fr; } .kit-cell canvas { width: 32px; height: 32px; } }

/* ---- build 9: the usability round of 2026-10-17 ---- */
/* the TOAST: what #status says, where the person is looking (above the dialogs, under the tour) */
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 280; max-width: min(620px, calc(100vw - 32px));
         padding: 8px 12px; font-size: 13px; line-height: 1.4; color: var(--ink); background: var(--panel);
         border: 1px solid var(--line); border-left: 3px solid var(--accent); box-shadow: var(--lift); pointer-events: none; }
/* the set entry an identical Add to set points at */
.setcard.twin { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
/* PHONE WIDTH (360-400 px): the 16 px gutter; the sizes row wraps instead of widening the page (its figures keep room for an
   effect's margin, which at 3x is wider than a phone) */
@media (max-width: 760px) {
  main#stage { padding: 10px 16px; }
  .preview-row > * { min-width: 0; max-width: 100%; }
  .trio, .held { flex-wrap: wrap; }
  .trio figure { min-width: 0 !important; }
}
