/* GENERATED from crunchyCore/crunchy-base.css @ f58de9f by tools/pull-core.mjs. DO NOT EDIT HERE: edit crunchyCore, then pull. */
/* sha256 0af4b186f9dd072b47955898cc3beafa0f3a8d2db787b3b37f08215a2c0c2525 */
/* CRUNCHY BASE — the Crunchy suite's shared look (CONSOLIDATION-PLAN.md §9, TILE-DESIGN.md §105).
 *
 * CANONICAL HERE; every Crunchy tool copies it unchanged. It is linked BEFORE the app's own stylesheet, which
 * keeps only its layout and its accent (--accent, --accent-dk). Nothing in it names an app's classes.
 *
 * The look is chrome that belongs to pixel art (a friend on CrunchyBGM: "too round, and was obviously AI
 * generated, make it more angular"): square corners, 1 px solid borders, HARD offset shadows (a step, never a
 * blur), no gradients, no glows, pixel icons (crunchy-icons.js) instead of emoji.
 *
 * --base-build is checked by the app's index.html, as --css-build is; tools/pull-core.mjs moves the app's `want` when
 * it pulls a new one. What each bump changed is in CHANGELOG.md: read it before pulling.
 *
 * FLOOR AND DEFAULT. Rules marked FLOOR are the suite's shared look: an app must NOT override them, or the apps stop
 * looking like siblings (square corners, the hard step and lift instead of blur, the neutrals, the accent pairing,
 * no gradients or glows). Everything else here is a DEFAULT: override it freely for the app's layout and density
 * (sizes, padding, fonts on a particular control). An app's own stylesheet loads after this one, so it wins any tie.
 */
:root {
  --base-build: 17;
  color-scheme: dark;

  /* FLOOR. The neutrals: one set for the whole suite. CONSUMERS MEASURE AGAINST THESE: CrunchyUI scores every kit's
     artwork against --panel and --panel2 (best-separated color must clear 25 from each ground; headroom 2.4 at
     build 1), so moving --panel or --panel2 is a change to a consumer's test data. Name it in CHANGELOG.md. */
  --bg: #111015;
  --panel: #1a1820;
  --panel2: #23202b;
  --line: #3b3746;
  --line2: #575167;
  --ink: #ece9f2;
  --muted: #9b95a8;
  --bad: #ff8f97;
  --info: #b9c6d8;          /* secondary marks (badges, linked) — a neutral, never a second accent */
  --accent2: var(--info);   /* the old name, kept so older blocks still resolve */

  /* each app sets its own pair (CONSOLIDATION-PLAN.md §9); these are only the fallback */
  --accent: #ff7a45;
  --accent-dk: #a9431c;
  --on-accent: #140b06;     /* text on an accent fill: dark, readable on all six accents */

  /* depth is a hard step, not a blur */
  --drop: #08070b;
  --step: 2px;
  --lift: 6px 6px 0 var(--drop);   /* dialogs and floating cards */

  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --head: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

/* FLOOR. Square: an app rounds something only on purpose, and then by 2 px at most. */
*, *::before, *::after { border-radius: 0; }

body { background: var(--bg); color: var(--ink); font: 13px/1.5 var(--font); }
* { scrollbar-color: var(--line2) var(--bg); scrollbar-width: thin; }

/* the app name: heavy, tight, capitals; the second word in the accent (Crunchy<span>Tile</span>) */
header h1 { font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; }
header h1 span { color: var(--accent); }

/* BUTTONS AND SELECTS. FLOOR: the hard step (box-shadow on --step/--drop, never a blur), the 1 px solid border, the
   pressed sink, the primary on --accent/--accent-dk/--on-accent. DEFAULT: padding, font size, hover tint. */
select, button, input, textarea { font: inherit; color: var(--ink); }
select, button {
  background: var(--panel2);
  border: 1px solid var(--line2);
  padding: 3px 8px;
  box-shadow: var(--step) var(--step) 0 var(--drop);
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); background: #2b2734; }
button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--drop); }
button:disabled { transform: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700;
                 box-shadow: var(--step) var(--step) 0 var(--accent-dk); }
button.primary:hover { background: var(--accent); border-color: var(--ink); }

input[type="text"], input[type="search"], input[type="number"], textarea {
  background: var(--bg); border: 1px solid var(--line2); padding: 3px 7px;
}
input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible {
  outline: 1px solid var(--accent); outline-offset: 1px;
}

/* SLIDERS. DEFAULT, except the square knob and flat track (FLOOR). */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--line2); border: 0; }
input[type="range"]::-moz-range-progress { height: 4px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 14px; border: 1px solid var(--drop); border-radius: 0;
                                        background: var(--ink); box-shadow: 1px 1px 0 var(--drop); }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--line2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 14px; margin-top: -5px;
                                            border: 1px solid var(--drop); border-radius: 0; background: var(--ink); }
input[type="radio"] { accent-color: var(--accent); }
/* CHECKBOXES. FLOOR: square, drawn here rather than by the platform (WebKit's is round), a filled accent square when on. */
input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0; flex: none;
                         display: inline-grid; place-content: center; vertical-align: -3px; cursor: pointer;
                         background: var(--bg); border: 1px solid var(--line2); box-shadow: 1px 1px 0 var(--drop); }
input[type="checkbox"]::before { content: ""; width: 8px; height: 8px; background: var(--accent); transform: scale(0); }
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="checkbox"]:checked { border-color: var(--accent); }
input[type="checkbox"]:disabled { opacity: .45; cursor: default; }

/* PIXEL ICONS (crunchy-icons.js): 12 x 12 cells, one CSS pixel each, in the text's color */
.pxi { width: 12px; height: 12px; flex: none; vertical-align: -1px; margin-right: 6px; fill: currentColor;
       shape-rendering: crispEdges; }

/* ===== THE SHARED DIALOGS (build 3): library.js's Library and suite.js's Crunchy suite, styled once for every app.
   Only the tokens above and `lib-*` / `suite-*` classes. An app's own stylesheet keeps nothing for them but its own
   placement (its buttons that open them). DEFAULT throughout, except the square corners, borders and lift (FLOOR). */

/* THE LIBRARY (library.js): the desktop asset viewer. Self-hiding, as a host may lack a global [hidden] rule. */
.lib-overlay[hidden] { display: none !important; }
.lib-overlay { position: fixed; inset: 0; z-index: 250; background: rgba(8, 7, 12, 0.78); display: flex;
               align-items: center; justify-content: center; }
.lib-panel { width: min(1100px, 94vw); height: min(820px, 90vh); display: flex; flex-direction: column; gap: 10px;
             background: var(--panel); border: 2px solid var(--line2); box-shadow: var(--lift); padding: 14px 16px; }
.lib-busy .lib-panel { cursor: progress; }
.lib-top, .lib-bar, .lib-tools, .lib-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-title { margin: 0; font: 700 16px/1.4 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.lib-spacer { flex: 1; }
.lib-close { font-size: 16px; line-height: 1; padding: 4px 9px; }
.lib-path { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.lib-links { display: grid; gap: 6px; background: var(--panel2); border: 1px solid var(--line); padding: 8px 10px; }
.lib-link strong { min-width: 4.5em; }
.lib-link.linked strong { color: var(--info); }
.lib-toggle { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.lib-search { flex: 1; min-width: 14em; }
.lib-chip { font-size: 12px; padding: 3px 10px; box-shadow: none; }
.lib-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lib-grid { flex: 1; overflow: auto; padding-right: 4px; }
.lib-h { font: 700 11px/1.5 var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 6px; }
.lib-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lib-card { background: var(--panel2); border: 1px solid var(--line2); padding: 6px; display: flex;
            flex-direction: column; gap: 4px; min-width: 0; box-shadow: var(--step) var(--step) 0 var(--drop); }
.lib-pic { padding: 6px; height: 110px; display: flex; align-items: center; justify-content: center; overflow: hidden;
           background: var(--bg); border: 1px solid var(--drop); }
.lib-thumb { image-rendering: pixelated; width: 100%; height: 100%; object-fit: contain; }
.lib-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
.lib-rename { width: 100%; font-size: 13px; }
.lib-meta { font-size: 11px; color: var(--muted); }
.lib-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.lib-badge { font-size: 10px; padding: 0 5px; border: 1px solid var(--info); color: var(--info); }
.lib-badge.hot { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 700; }
.lib-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.lib-acts button { font-size: 11px; padding: 2px 6px; }
.lib-danger.armed { border-color: var(--bad); color: var(--bad); }
.lib-start { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.lib-recent { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 24em; text-align: left; }
.lib-hint { color: var(--muted); font-size: 13px; max-width: 70ch; }
.lib-status { font-size: 12px; color: var(--muted); min-height: 1.5em; }

/* THE LIBRARY AS A DOCKED PANEL (library.js build 2, DESKTOP-ROADMAP.md): the app places `opts.dock`; the panel fills
   it, one column of narrower cards, and the suite view (what the other Crunchy tools planted in the same game) under. */
.lib-dock[hidden] { display: none !important; }
.lib-dock { height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--panel);
            border-left: 2px solid var(--line2); }
.lib-panel.lib-docked { width: auto; height: 100%; padding: 10px 12px; gap: 8px; border: 0; box-shadow: none; }
.lib-docked .lib-cards { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.lib-docked .lib-pic { height: 84px; }
.lib-docked .lib-path { max-width: 22ch; }
.lib-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 2px solid var(--line2); }
.lib-tab { box-shadow: none; border-bottom: 0; background: var(--bg); color: var(--muted); font: 11px/1.6 var(--head);
           text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; }
.lib-tab.on { background: var(--panel2); color: var(--ink); border-color: var(--line2); border-top: 2px solid var(--accent); }
.lib-own { display: flex; flex-direction: column; gap: 6px; }
.lib-suite { border-top: 1px solid var(--line); padding-top: 6px; display: grid; gap: 4px; }
.lib-suite-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.lib-suite-row .lib-meta { flex: 1; }

/* THE CRUNCHY SUITE (suite.js). Each row carries its tool's accent as --tool (suite.js sets it): a stripe on the left,
   its icon, and the "you're here" mark, so the apps read as siblings, each in its own color. */
.suite-overlay[hidden] { display: none !important; }
.suite-overlay { position: fixed; inset: 0; z-index: 260; background: rgba(8, 7, 12, 0.78); display: flex;
                 align-items: center; justify-content: center; padding: 16px; }
.suite-panel { width: min(640px, 100%); max-height: 100%; overflow: auto; background: var(--panel);
               border: 2px solid var(--line2); box-shadow: var(--lift); padding: 16px 18px; }
.suite-head { display: flex; align-items: center; gap: 8px; }
.suite-title { margin: 0; flex: 1; font: 700 17px/1.4 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.suite-close { font-size: 16px; line-height: 1; padding: 4px 9px; }
.suite-line { margin: 6px 0 12px; color: var(--ink); }
.suite-list { display: grid; gap: 8px; }
.suite-tool { display: flex; align-items: center; gap: 12px; background: var(--panel2); border: 1px solid var(--line);
              border-left: 4px solid var(--tool, var(--line2)); padding: 10px 12px; }
.suite-tool.here { border-color: var(--tool, var(--accent)); }
.suite-icon { flex: none; width: 28px; text-align: center; font-size: 22px; color: var(--tool, var(--info)); }
.suite-icon .pxi { width: 24px; height: 24px; margin: 0; vertical-align: middle; }
.suite-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.suite-name { font-size: 14px; }
.suite-what { font-size: 12.5px; color: var(--muted); }
.suite-go { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.suite-link { font-size: 12.5px; color: var(--ink); text-decoration: none; background: var(--panel); border: 1px solid var(--line2);
              padding: 3px 9px; box-shadow: var(--step) var(--step) 0 var(--drop); }
.suite-link:hover { border-color: var(--tool, var(--accent)); }
.suite-here, .suite-soon { font-size: 12px; color: var(--muted); }
.suite-here { color: var(--tool, var(--accent)); font-weight: 700; }
.suite-foot { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 520px) { .suite-tool { flex-wrap: wrap; } .suite-go { flex-direction: row; } }

/* THE SETTINGS DIALOG (settings.js): a row per preference, the label and its explanation left, the control right. */
.set-overlay[hidden] { display: none !important; }
.set-overlay { position: fixed; inset: 0; z-index: 260; background: rgba(8, 7, 12, 0.78); display: flex;
               align-items: center; justify-content: center; padding: 16px; }
.set-panel { width: min(620px, 100%); max-height: 100%; overflow: auto; background: var(--panel);
             border: 2px solid var(--line2); box-shadow: var(--lift); padding: 16px 18px; }
.set-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.set-title { margin: 0; font: 700 17px/1.4 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.set-hint { flex: 1; font-size: 12px; color: var(--muted); }
.set-close { font-size: 16px; line-height: 1; padding: 4px 9px; }
.setrow { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setrow:last-of-type { border-bottom: 0; }
.setlbl { flex: 1; font-size: 13.5px; color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.setsub { font-size: 12px; color: var(--muted); line-height: 1.45; }
.setchk { margin-top: 2px; }
.setchk input { width: 18px; height: 18px; }
.setchk input::before { width: 10px; height: 10px; }
.set-btn { flex: none; white-space: nowrap; }
.set-el { flex: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 60%; }

/* ASK (library.js libraryAsk, base 11): a guard's question as a small dialog over everything; the safe answer is the
   primary button and has the focus, the risky one is drawn in --bad */
.lib-ask { z-index: 280; }
.lib-ask-panel { width: min(480px, 100%); display: flex; flex-direction: column; gap: 10px; }
.lib-ask-msg { margin: 0; font-size: 13px; color: var(--ink); }
.lib-ask-list { margin: 0; padding: 6px 10px 6px 26px; background: var(--panel2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.lib-ask-list li { margin: 2px 0; overflow-wrap: anywhere; }
.lib-ask-acts { display: flex; justify-content: flex-end; gap: 8px; }
.lib-ask-yes { color: var(--bad); border-color: var(--bad); }

/* FEEDBACK (feedback.js): the person writes, sees every detail that would go with it, and sends from their own mail. */
.fb-overlay[hidden] { display: none !important; }
.fb-overlay { position: fixed; inset: 0; z-index: 260; background: rgba(8, 7, 12, 0.78); display: flex;
              align-items: center; justify-content: center; padding: 16px; }
.fb-panel { width: min(620px, 100%); max-height: 100%; overflow: auto; background: var(--panel);
            border: 2px solid var(--line2); box-shadow: var(--lift); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.fb-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fb-title { margin: 0; font: 700 17px/1.4 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.fb-hint { flex: 1; font-size: 12px; color: var(--muted); }
.fb-close { font-size: 16px; line-height: 1; padding: 4px 9px; }
.fb-field { display: flex; flex-direction: column; gap: 4px; }
.fb-label { font-size: 12.5px; color: var(--muted); }
.fb-text { width: 100%; resize: vertical; min-height: 54px; font: inherit; color: var(--ink); background: var(--bg);
           border: 1px solid var(--line2); padding: 6px 8px; }
.fb-details { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; padding: 6px 8px;
              background: var(--panel2); border: 1px solid var(--line); font-size: 12px; }
.fb-det { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); }
.fb-det b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.fb-val { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-said { flex: 1; font-size: 12px; color: var(--muted); }

/* THE WEB'S ONE INVITATION (desktop.js): the header button, and what the desktop adds. */
.desk-cta { white-space: nowrap; border-color: var(--accent); color: var(--accent); }
.desk-overlay[hidden] { display: none !important; }
.desk-overlay { position: fixed; inset: 0; z-index: 260; background: rgba(8, 7, 12, 0.78); display: flex;
                align-items: center; justify-content: center; padding: 16px; }
.desk-panel { width: min(600px, 100%); max-height: 100%; overflow: auto; background: var(--panel);
              border: 2px solid var(--line2); box-shadow: var(--lift); padding: 16px 18px; }
.desk-head { display: flex; align-items: center; gap: 8px; }
.desk-title { margin: 0; flex: 1; font: 700 17px/1.4 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.desk-close { font-size: 16px; line-height: 1; padding: 4px 9px; }
.desk-line { margin: 6px 0 10px; color: var(--ink); }
.desk-adds { margin: 0; padding: 0 0 0 18px; display: grid; gap: 6px; list-style: square; }
.desk-adds li { color: var(--muted); }
.desk-adds b { color: var(--ink); }
.desk-note { margin: 12px 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--panel2); font-size: 12.5px; }
.desk-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.desk-hint { font-size: 12px; color: var(--muted); }

/* THE DESKTOP TOUR (desktop.js build 2): four panels, each a live miniature drawn in the page. The stage is a picture
   (inert); the Library in it is the real library.js, docked. Prefixed dtour-: an app's own first-run tour keeps tour-. */
.dtour-overlay { position: fixed; inset: 0; z-index: 270; background: rgba(8, 7, 12, 0.82); display: flex;
                 align-items: center; justify-content: center; padding: 16px; }
.dtour-panel { width: min(760px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 2px solid var(--line2);
               box-shadow: var(--lift); padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.dtour-head { display: flex; align-items: center; gap: 10px; }
.dtour-kicker { flex: 1; display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1.5 var(--head);
                text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dtour-step { font: 11px/1.5 var(--head); color: var(--muted); }
.dtour-x { font-size: 16px; line-height: 1; padding: 4px 9px; }
.dtour-title { margin: 0; font: 700 19px/1.3 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.dtour-line { margin: 0; color: var(--ink); font-size: 13.5px; min-height: 3em; }
.dtour-stage { position: relative; height: 350px; overflow: hidden; background: var(--bg); border: 2px solid var(--line2);
               padding: 12px; display: flex; gap: 12px; align-items: stretch; user-select: none; }
.dtour-end[hidden] { display: none !important; }
.dtour-end { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--panel2); }
.dtour-closing { margin: 0; font-size: 13.5px; color: var(--ink); }
.dtour-getrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dtour-soon { font-size: 12px; color: var(--muted); }
.dtour-coming { font: 700 12px/1.5 var(--head); text-transform: uppercase; letter-spacing: .05em; color: var(--accent);
                border: 1px dashed var(--accent); padding: 3px 9px; }
.dtour-foot { display: flex; align-items: center; gap: 10px; }
.dtour-dots { flex: 1; display: flex; justify-content: center; gap: 8px; }
.dtour-dot { width: 12px; height: 12px; padding: 0; box-shadow: none; background: var(--bg); border: 2px solid var(--line2); }
.dtour-dot.on { background: var(--accent); border-color: var(--accent); }
.dtour-link { border-color: var(--accent); color: var(--accent); }
/* the miniatures */
.dtour-btn { display: inline-block; padding: 3px 12px; font-size: 12px; border: 1px solid var(--line2); background: var(--panel2);
             box-shadow: var(--step) var(--step) 0 var(--drop); transition: transform .08s, box-shadow .08s; }
.dtour-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700;
                     box-shadow: var(--step) var(--step) 0 var(--accent-dk); }
.dtour-btn.press { transform: translate(var(--step), var(--step)); box-shadow: 0 0 0 var(--drop); outline: 2px solid var(--ink); }
.dtour-fic { display: inline-block; width: 10px; height: 8px; margin-right: 6px; background: var(--line2); flex: none; }
.dtour-dlg { flex: 1; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2);
             box-shadow: var(--lift); transition: opacity .4s, transform .4s; }
.dtour-dlg.done { opacity: .25; transform: translateY(6px); }
.dtour-dlgbar { padding: 6px 10px; font: 700 11px/1.5 var(--head); text-transform: uppercase; letter-spacing: .05em;
                color: var(--muted); border-bottom: 1px solid var(--line); }
.dtour-dlgbody { flex: 1; display: flex; min-height: 0; }
.dtour-places { flex: 0 0 120px; padding: 8px 6px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.dtour-place { padding: 3px 8px; }
.dtour-place.on { color: var(--ink); background: var(--panel2); }
.dtour-dlglist { flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.dtour-dlgrow { display: flex; align-items: center; gap: 4px; padding: 5px 8px; font-size: 13px; border: 1px solid transparent; }
.dtour-dlgrow .dtour-fic { background: var(--info); }
.dtour-dlgrow.sel { background: var(--panel2); border-color: var(--accent); }
.dtour-dlgname { flex: 1; }
.dtour-dlgtag { font: 10px/1.5 var(--head); color: var(--muted); border: 1px solid var(--line2); padding: 0 5px; }
.dtour-dlgfoot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }
.dtour-dlgpath { flex: 1; font: 12px/1.5 var(--head); color: var(--muted); background: var(--bg); border: 1px solid var(--line2); padding: 2px 6px; }
.dtour-result { position: absolute; left: 50%; top: 50%; width: min(420px, calc(100% - 32px)); transform: translate(-50%, -40%);
                opacity: 0; transition: opacity .35s, transform .35s; display: flex; flex-direction: column; gap: 4px;
                background: var(--panel2); border: 2px solid var(--accent); box-shadow: var(--lift); padding: 12px 14px; font-size: 13px; }
.dtour-result.on { opacity: 1; transform: translate(-50%, -50%); }
.dtour-result b { color: var(--accent); font: 700 14px/1.4 var(--head); text-transform: uppercase; }
.dtour-mute { color: var(--muted); font-size: 12px; }
.dtour-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.dtour-big { flex: 1; min-height: 0; width: 100%; object-fit: contain; image-rendering: pixelated; background: var(--panel); border: 1px solid var(--line2); }
.dtour-saverow { display: flex; gap: 8px; align-items: center; }
.dtour-input { flex: 1; min-height: 1.8em; font-size: 13px; background: var(--bg); border: 1px solid var(--line2); padding: 3px 7px; }
.dtour-input::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--ink); }
.dtour-tree { flex: 1.3; min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line2);
              font: 12px/1.6 var(--head); padding-bottom: 6px; }
.dtour-treebar { padding: 4px 8px; margin-bottom: 4px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.dtour-file { display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.dtour-file.dir .dtour-fic { background: var(--info); }
.dtour-file.new { animation: dtour-in .5s steps(4) both; }
.dtour-file.new:not(.dir) .dtour-fic { background: var(--accent); }
.dtour-file.side { color: var(--muted); }
@keyframes dtour-in { from { background: var(--accent); color: var(--on-accent); } to { background: transparent; } }
.dtour-dock { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line2); }
.dtour-dock .lib-dock { border-left: 0; }
.dtour-dock .lib-panel { padding: 8px 10px; gap: 6px; }
.dtour-dock .lib-grid { overflow: hidden; min-height: 0; }
.dtour-library .lib-acts { display: none; }
.dtour-dock .lib-cards { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.dtour-dock .lib-pic { height: 64px; }
.dtour-dock .lib-acts:empty, .dtour-dock .lib-badges:empty { display: none; }
.dtour-dock .lib-close { display: none; }
.dtour-dock .lib-badge.hot { animation: dtour-in .6s steps(3) both; }
.dtour-dock .lib-acts button.press { transform: translate(1px, 1px); box-shadow: none; outline: 2px solid var(--accent); }
.dtour-guard { flex: 0 0 34%; align-self: flex-end; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; font-size: 12.5px;
               background: var(--panel2); border: 2px solid var(--bad); box-shadow: var(--lift); opacity: 0; transform: translateY(8px);
               transition: opacity .35s, transform .35s; }
.dtour-guard.on { opacity: 1; transform: none; }
.dtour-guard b { color: var(--bad); font: 700 12px/1.4 var(--head); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 620px) {
  .dtour-panel { padding: 12px; }
  .dtour-title { font-size: 16px; }
  .dtour-stage { height: 330px; padding: 8px; flex-direction: column; }
  .dtour-places { display: none; }
  .dtour-dock .lib-path, .dtour-dock .lib-suite-row button { display: none; }
  .dtour-dock .lib-cards { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .dtour-dock .lib-pic { height: 48px; padding: 3px; }
  .dtour-dock .lib-card .lib-meta { display: none; }
  .dtour-dock .lib-cards > :nth-child(n+4) { display: none; }
  .dtour-update .dtour-guard { position: absolute; left: 8px; right: 8px; bottom: 8px; }
  .dtour-save .dtour-editor { flex: 0 0 auto; flex-direction: row; align-items: stretch; }
  .dtour-save .dtour-big { flex: 0 0 64px; width: 64px; height: 64px; }
  .dtour-save .dtour-saverow { flex: 1; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .dtour-file.new, .dtour-dock .lib-badge.hot { animation: none; }
  .dtour-dlg, .dtour-result, .dtour-guard, .dtour-btn { transition: none; }
}

/* THE FIRST-RUN HINT (settings.js crunchyHint, base-build 10): pixel sparkles round a control and a hard outline that
   steps on and off. No blur, no glow, no easing: every keyframe is a step, as the suite's look asks. The sparkles are a
   2 px square with four hard shadows (a plus), twinkling out of phase. */
.crunchy-hint { position: relative; outline: 2px solid var(--accent); outline-offset: 2px;
  animation: crunchy-hint-blink 1.2s steps(1, end) infinite; }
@keyframes crunchy-hint-blink { 0% { outline-color: var(--accent); } 50% { outline-color: transparent; } }
.crunchy-spark { position: absolute; width: 2px; height: 2px; background: var(--accent); pointer-events: none; opacity: 0;
  animation: crunchy-spark 1.6s steps(1, end) infinite; }
.crunchy-spark-tl { top: -9px; left: -7px; }
.crunchy-spark-tr { top: -8px; right: -9px; animation-delay: .4s; }
.crunchy-spark-bl { bottom: -9px; left: 30%; animation-delay: .8s; }
.crunchy-spark-br { bottom: -7px; right: -8px; animation-delay: 1.2s; }
@keyframes crunchy-spark {
  0%   { opacity: 0; box-shadow: none; }
  25%  { opacity: 1; box-shadow: none; }
  50%  { opacity: 1; box-shadow: 0 -2px 0 var(--accent), 0 2px 0 var(--accent), -2px 0 0 var(--accent), 2px 0 0 var(--accent); }
  75%  { opacity: 1; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .crunchy-hint { animation: none; }
  .crunchy-spark { display: none; }
}


/* THE GAME MOMENT MODAL (moments-ui.js, base-build 12; MOMENTS.md): nearly the whole window, a stage left (the target
   and the moment played over it, pixel-scaled), the slots right, the feel and the actions under them. */
.mom-panel { width: min(1080px, 100%); height: min(720px, 100%); display: flex; flex-direction: column; gap: 10px; }
.mom-head { display: flex; align-items: center; gap: 10px; }
.mom-head .set-title { flex: 1; }
.mom-top, .mom-feel, .mom-delays, .mom-acts, .mom-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.mom-lab { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.mom-lab input[type=number] { width: 64px; }
/* (AJ, 2026-10-25: after a pasted link the stage's lines spilled over the feel row) every column keeps to its own box:
   the stage's canvas takes what is LEFT once its controls and lines have their room (object-fit keeps the pixels square),
   and the slots scroll */
.mom-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 14px; overflow: hidden; }
.mom-stage { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }
.mom-stage > :not(.mom-canvas) { flex: none; }
.mom-canvas { flex: 1 1 0; min-height: 96px; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; background: var(--bg);
              border: 2px solid var(--line2); }
.mom-say { font-size: 12px; color: var(--muted); min-height: 1.4em; }
.mom-slots { overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-right: 4px;
  scrollbar-width: auto; scrollbar-color: auto; }
/* a scrollbar that always shows (WebKitGTK's overlay bars hide, so a cut-off slot gave no hint there was more); the
   standard scrollbar-width/-color above are reset because a set one makes WebKit ignore these */
.mom-slots::-webkit-scrollbar { width: 8px; }
.mom-slots::-webkit-scrollbar-track { background: var(--bg); }
.mom-slots::-webkit-scrollbar-thumb { background: var(--line2); }
.mom-slot { border: 1px solid var(--line); background: var(--panel2); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.mom-slot h3 { margin: 0; font: 700 12px/1.3 var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.mom-slot select { width: 100%; }
.mom-more { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.mom-more input[type=text] { flex: 1; min-width: 120px; }
.mom-rescan { align-self: flex-start; }
.mom-link { display: flex; gap: 6px; }
.mom-link input { flex: 1; min-width: 0; }
.mom-dl { font-size: 12px; color: var(--muted); }
.mom-acts { justify-content: flex-end; }
@media (max-width: 760px) { .mom-body { grid-template-columns: 1fr; overflow: auto; } .mom-panel { height: 100%; } .mom-canvas { flex: none; height: auto; aspect-ratio: 160 / 112; } }

/* THE PALETTE EDITOR (palette-ui.js, base-build 14; PALETTES.md): the moment window's shape. The ramps left (a row of
   swatches each, light to dark), the chosen color and the preview right; each column keeps to its own box and scrolls
   on its own, so nothing spills over the actions (the moment window's first layout bug, not repeated). */
.pal-panel { width: min(1080px, 100%); height: min(720px, 100%); display: flex; flex-direction: column; gap: 10px; }
.pal-panel > :not(.pal-body) { flex: none; }
.pal-head { display: flex; align-items: center; gap: 10px; }
.pal-head .set-title { flex: 1; }
.pal-top, .pal-acts, .pal-tools, .pal-pickrow, .pal-mvrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pal-top input[type=text] { width: 180px; }
.pal-lab { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.pal-n { width: 56px; }
.pal-paste { display: flex; gap: 8px; align-items: flex-start; }
.pal-paste[hidden] { display: none; }
.pal-paste textarea { flex: 1; min-width: 0; resize: vertical; font: 12px/1.4 var(--head); background: var(--bg); color: var(--ink); border: 1px solid var(--line2); padding: 6px; }
.pal-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 14px; overflow: hidden; }
.pal-ramps, .pal-side { overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-right: 4px;
  scrollbar-width: auto; scrollbar-color: auto; }
/* a scrollbar that always shows (WebKitGTK's overlay bars hide; see .mom-slots) */
.pal-ramps::-webkit-scrollbar, .pal-side::-webkit-scrollbar { width: 8px; }
.pal-ramps::-webkit-scrollbar-track, .pal-side::-webkit-scrollbar-track { background: var(--bg); }
.pal-ramps::-webkit-scrollbar-thumb, .pal-side::-webkit-scrollbar-thumb { background: var(--line2); }
.pal-ramps > *, .pal-side > * { flex: none; }
.pal-info { font-size: 12px; color: var(--muted); }
.pal-ramp, .pal-pick, .pal-prev { border: 1px solid var(--line); background: var(--panel2); padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.pal-rhead { display: flex; align-items: center; gap: 6px; }
.pal-rname { flex: 1; min-width: 60px; font: 700 12px/1.3 var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--accent);
  background: transparent; border: 1px solid transparent; padding: 3px 4px; }
.pal-rname:hover, .pal-rname:focus { border-color: var(--line2); background: var(--bg); }
.pal-setmode .pal-rhead { justify-content: space-between; }
.pal-rcount { font-size: 12px; color: var(--muted); min-width: 1.5em; text-align: right; }
.pal-icon { padding: 4px 6px; }
.pal-asset { font-size: 12px; padding: 3px 8px; }
.pal-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 36px; }
/* a swatch is its color: no step shadow, a 1 px frame; the chosen one a 2 px accent frame; drop marks a bar before */
.pal-sw { width: 32px; height: 32px; padding: 0; border: 1px solid var(--drop); box-shadow: none; cursor: grab; position: relative; }
.pal-sw:hover { box-shadow: none; transform: none; outline: 1px solid var(--line2); outline-offset: 1px; }
.pal-sw.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.pal-sw:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.pal-sw.drag { opacity: .35; }
.pal-sw.before::before, .pal-add.before::before { content: ""; position: absolute; left: -4px; top: -2px; bottom: -2px; width: 3px; background: var(--accent); }
.pal-add { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.pal-empty { font-size: 12px; color: var(--muted); }
.pal-icon .pxi, .pal-add .pxi { margin-right: 0; }
.pal-panel button:disabled { opacity: .45; cursor: default; }
.pal-pick h3, .pal-prev h3 { margin: 0; font: 700 12px/1.3 var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-picker { width: 56px; height: 36px; padding: 2px; border: 1px solid var(--line2); background: var(--bg); cursor: pointer; }
.pal-hex { width: 96px; font-family: var(--head); }
.pal-mv { min-width: 32px; padding: 4px 8px; }
.pal-balls, .pal-host { display: block; max-width: 100%; height: auto; align-self: flex-start; image-rendering: pixelated; background: var(--bg); border: 2px solid var(--line2); }
.pal-host[hidden] { display: none; }
.pal-say { font-size: 12px; color: var(--muted); min-height: 1.4em; }
.pal-note { font-size: 12px; color: var(--muted); }
.pal-gap { flex: 1; }
@media (max-width: 760px) { .pal-body { grid-template-columns: 1fr; overflow: auto; } .pal-ramps, .pal-side { overflow: visible; } .pal-panel { height: 100%; } }

/* ---- THE TEXTURE GENERATOR (texgen-ui.js, CrunchyTile §174): the palette window's shape ---- */
.tg-panel { width: min(1080px, 100%); height: min(760px, 100%); display: flex; flex-direction: column; gap: 10px; }
.tg-panel > :not(.tg-body) { flex: none; }
.tg-head { display: flex; align-items: center; gap: 10px; }
.tg-head .set-title { flex: 1; }
.tg-top, .tg-row, .tg-foot, .tg-tabs, .tg-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tg-top input[type=text] { width: 180px; }
.tg-foot { justify-content: flex-end; }
.tg-lab { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.tg-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr); gap: 14px; overflow: hidden; }
.tg-left, .tg-right { overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.tg-right::-webkit-scrollbar { width: 8px; }
.tg-right::-webkit-scrollbar-track { background: var(--bg); }
.tg-right::-webkit-scrollbar-thumb { background: var(--line2); }
.tg-left > *, .tg-right > * { flex: none; }
.tg-canvas { width: 100%; max-width: 480px; aspect-ratio: 1; image-rendering: pixelated; border: 1px solid var(--line); background: var(--bg); }
.tg-tiny { width: 64px; height: 64px; image-rendering: pixelated; border: 1px solid var(--line); }
.tg-info { font-size: 12px; color: var(--muted); flex: 1; min-width: 160px; }
.tg-tabs { gap: 4px; }
.tg-tab.on, .tg-choice button.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.tg-add { margin-left: auto; }
.tg-layer { display: flex; flex-direction: column; gap: 10px; }
.tg-group { border: 1px solid var(--line); background: var(--panel2); padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.tg-gh { margin: 0; font: 700 12px/1.3 var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.tg-choice { gap: 4px; }
.tg-choice button { padding: 4px 9px; font-size: 12px; }
.tg-slider { display: grid; grid-template-columns: 112px minmax(0, 1fr) 40px; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); }
.tg-sval { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.tg-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.tg-strip { display: inline-flex; border: 1px solid var(--line2); }
.tg-sw { width: 16px; height: 18px; padding: 0; border: 0; border-bottom: 3px solid transparent; min-width: 0; }
.tg-sw.in { border-bottom-color: var(--accent); }
.tg-remove { align-self: flex-start; }
@media (max-width: 760px) { .tg-body { grid-template-columns: 1fr; overflow: auto; } .tg-left, .tg-right { overflow: visible; } .tg-panel { height: 100%; } }
.tg-vars { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.tg-vars .tg-gh { flex: none; }
.tg-vargrid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.tg-varbtn { padding: 0; border: 1px solid var(--line2); background: var(--bg); line-height: 0; flex: none; }
.tg-varbtn:hover, .tg-varbtn:focus-visible { border-color: var(--accent); }
.tg-var { width: 88px; height: 88px; image-rendering: pixelated; }
.tg-follow .tg-sw { cursor: default; opacity: .85; }

/* CLICK WHAT YOU SEE (pick.js, base-build 16; CrunchyTile §195, moved here for every app): the outline is a canvas OVER
   the picture, hard pixels, never a blur or glow; the label follows the pointer; the jump's flash is a hard accent ring
   that blinks three times (with reduced motion it just shows, then goes). `.pick-from` is the line an app shows over a
   page it jumped to, with the way back ("From the map: … Back to the map"). */
.pick-host { position: relative; }
.pick-over { position: absolute; left: 0; top: 0; pointer-events: none; image-rendering: pixelated; z-index: 2; }
canvas.pick-on { cursor: pointer; }
.pick-label { position: fixed; z-index: 1000; pointer-events: none; max-width: 340px; padding: 4px 8px;
              background: var(--panel2); color: var(--muted); border: 1px solid var(--accent); box-shadow: 2px 2px 0 #000;
              font-size: 12px; line-height: 1.35; }
.pick-label b { color: var(--ink); font-weight: 700; }
.pick-label .pick-note { color: var(--accent); margin-top: 2px; }
.pick-flash { outline: 2px solid var(--accent) !important; outline-offset: 2px; animation: pickblink 1.8s steps(1, end) 1; }
@keyframes pickblink { 0% { outline-color: var(--accent); } 17% { outline-color: transparent; } 33% { outline-color: var(--accent); }
                       50% { outline-color: transparent; } 67% { outline-color: var(--accent); } 100% { outline-color: var(--accent); } }
@media (prefers-reduced-motion: reduce) { .pick-flash { animation: none; } }
.pick-from { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0; padding: 4px 6px 4px 10px;
             border-left: 3px solid var(--accent); background: var(--panel2); color: var(--muted); font-size: 13px; }
.pick-from b { color: var(--ink); }
.pick-from button { font-size: 12px; padding: 3px 10px; }
.pick-from .pick-from-x { padding: 3px 7px; }

/* THE VISUAL RAMP PICKER (ramp-pick.js, base-build 17; CrunchyTexture §28, moved here for the texture generator's window):
   a button showing the chosen ramp as a strip of its steps and its name, over a hidden <select>; the open grid of strips
   under headings floats above everything (a modal window passes its overlay as the grid's parent). A strip longer than 12
   steps narrows its steps rather than crowding the name. */
.rp-hidden { display: none !important; }
.rp-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 170px; max-width: 300px; text-align: left; padding: 3px 6px; }
.rp-btn .rp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-btn .rp-caret { color: var(--muted); }
.rp-strip { display: inline-flex; flex: none; max-width: 96px; border: 1px solid #000; }
.rp-strip i { display: block; width: 7px; height: 14px; }
.rp-strip[hidden] { display: none; }
.rp-opt .rp-strip i { width: 8px; }
.rp-tag { flex: none; font-size: 10px; padding: 0 4px; border: 1px solid var(--line2); color: var(--muted); line-height: 14px; }
.rp-pop { position: fixed; z-index: 300; width: 340px; 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; }
.rp-pop[hidden] { display: none; }
.rp-pop input { width: 100%; }
.rp-group { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin: 4px 2px 0; }
.rp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.rp-opt { display: flex; align-items: center; gap: 6px; padding: 3px 5px; border: 2px solid transparent; cursor: pointer; color: var(--ink); font-size: 12px; min-width: 0; }
.rp-opt .rp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-opt:hover { border-color: var(--line); }
.rp-opt.on { border-color: var(--accent); background: #2b2734; }
.rp-opt:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.rp-opt.wide { grid-column: 1 / -1; }
.rp-opt[aria-disabled="true"] { opacity: .5; cursor: default; }
.rp-none { color: var(--muted); padding: 4px; }
