
/* the site's own fonts by name, for a page the visitor let past the guards (`%raw`); a browser fetches one only when a
   page uses it. Comic Sans is the device's own where it has one, Comic Neue where it doesn't (phones, mostly). */
@font-face { font-family: "Comic Neue"; src: url("files/ComicNeue.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Comic Sans MS"; src: local("Comic Sans MS"), local("ComicSansMS-Regular"), url("files/ComicNeue.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("files/Montserrat.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "LRT Oksana"; src: url("files/LRTOksana.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Analog Whispers"; src: url("files/AnalogWhispers.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #000; --fg: #f1f0f1; --dim: #b9b5b9; --panel: #787478; --tab: #a0a0a0; --line: #c9c5c9;
  --khaki: #cec688; --blue: #8896ce; --green: #91d185; --purple: #ae88ce; --white: #fff; --grey: #a0a0a0;
  --red: #d98a8a; --orange: #d9aa7a; --pink: #d98ac0;
  --layout: #7ece78; --copy: #5bc6d6; --coord: #f5b041;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, "DejaVu Sans Mono", "Roboto Mono", monospace;
  --lh: 1.3;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
/* the background image the visitor picked, behind the page once one is showing (app.js) */
/* the background: the page's own (% page) if it sets one, else the visitor's picture, with any % tint over it */
body { background: linear-gradient(var(--tint, transparent), var(--tint, transparent)) fixed, var(--pagebg, var(--bgimg, none)) center / cover no-repeat fixed; }
body { font: 16px/var(--lh) var(--mono); min-height: 100vh; padding: 16px 0 260px; }
@media (max-width: 520px) { body { font-size: 13px; } }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.sf { font-family: "SiteFont", var(--mono); }
#stage { display: flex; justify-content: center; }
body:has(#stage > .grid.unguarded) { padding-top: 0; }   /* a page in its own HTML and CSS, such as the full-featured site, starts at the top */

/* ---- the grid. A page's `%` lines (grid.js) set these colours on it; these are the look without them. */
.grid { width: calc(var(--cols) * 1ch); --page: #000; --text: #f1f0f1; --panel: #787478; --tab: #a0a0a0; --heading: #fff; --accent: #fff;
  --link: #fff; --muted: #c9c5c9; color: var(--text); }
/* a little room around the page, either tier, outside its cells (cols() leaves space for it); fixed parts are placed
   against the page, never the screen */
/* An HTML page's spacing, which the page sets with these and the framework applies: --inset (and --inset-y) inside the
   page's own edge, --gap under the header, --pad inside each panel. A wider inset narrows the page rather than running
   past the screen. They sit in the base rules, so a page's own rule for .grid still wins over them. Grid pages keep
   their spacing in whole cells. */
.grid { padding: var(--inset-y, var(--inset, 5px)) var(--inset, 5px); box-sizing: content-box; contain: layout;
  width: min(calc(var(--cols) * 1ch), calc(100% - 32px - 2 * var(--inset, 5px))); }
.r:where(:not(.html *)) { white-space: pre; min-height: calc(var(--lh) * 1em); overflow: hidden; }
.k { background: var(--caret, var(--fg)); animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { background: transparent; } }
.hd:where(:not(.html *)) { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: calc(var(--lh) * 1em); }
.hd.narrow:where(:not(.html *)) { flex-direction: column; gap: 6px; }
/* a title stays on one line: one too wide for its space shrinks to fit (fitTitles in app.js). The padding, taken back by
   the margin, gives a glyph that reaches past its box (a j's hook, a shadow's glow) room before the clip */
.ti:where(:not(.html *)) { font-size: 3.4em; line-height: 0.9; white-space: nowrap; overflow: hidden; min-width: 0; max-width: calc(100% + 0.4em);
  padding: 0.15em 0.2em; margin: -0.15em -0.2em; color: var(--heading); }
.hd.narrow .ti:where(:not(.html *)) { font-size: 2.6em; }
.hd.center:where(:not(.html *)) { align-items: center; text-align: center; }
.chips:where(:not(.html *)) { text-align: right; }
.hd.narrow .chips:where(:not(.html *)), .hd.center .chips:where(:not(.html *)) { text-align: inherit; }
.tiw { min-width: 0; position: relative; }
.hd:not(.narrow):not(.center) > .tiw { flex: 1 1 0; }
.hd:not(.narrow):not(.center) > .chips { flex: 0 1 auto; max-width: 48%; }   /* the chips' rows are laid out for under half the width */   /* the title's width is the room beside the chips, not its own, so fitting it holds */
.sub, .note { font-size: 1.25em; line-height: 1.2; color: var(--heading); opacity: 0.85; white-space: normal; }
.sub { padding: 0.3em 0 0 0.1em; }
.note { margin-bottom: 0.4em; }
/* % bar: a bar of its colour or gradient beside the title; % column: one see-through column behind the whole page */
.grid.bar .tiw::before { content: ""; position: absolute; left: -1.3ch; top: 0.1em; bottom: 0.1em; width: 4px; border-radius: 2px; background: var(--bar); }
.grid.column { background: var(--column); padding: var(--inset-y, 1.2em) var(--inset, 2ch); backdrop-filter: blur(8px); }
:where(.grid.column) { border-radius: 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }   /* so the page's own .grid rule can square or reshade it */
.grid.column > .hd { padding-bottom: 0.8em; border-bottom: 1px solid color-mix(in srgb, var(--muted) 35%, transparent); }
/* % tabs pills and % chips pills: rounded, with a faint edge; the open tab filled with the accent */
.tabs-pills .r.tabs { margin-bottom: 0.5em; overflow: visible; }
.tabs-pills .tb:where(:not(.html *)) { border-radius: 99px; padding: 0.2em 0.3ch; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 22%, transparent); }
.tabs-pills .tb.on:where(:not(.html *)) { background: var(--accent); color: var(--tabon, #111); box-shadow: none; }
.chips-pills .chips .chip:where(:not(.html *)) { border-radius: 99px; padding: 0.15em 0.3ch; color: var(--c, var(--link)); background: color-mix(in srgb, var(--c, var(--link)) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--link)) 45%, transparent); }
.chips-pills .chips .r { margin-bottom: 8px; overflow: visible; }
.htmlpage.tabs-pills .tb, .htmlpage.chips-pills .chip { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 600; }
.chips .r:where(:not(.html *)) { margin-bottom: 4px; }
.chip:where(:not(.html *)) { text-decoration: none; color: #fff; background: var(--grey); }
.chip.khaki:where(:not(.html *)) { --c: var(--khaki); } .chip.blue:where(:not(.html *)) { --c: var(--blue); } .chip.green:where(:not(.html *)) { --c: var(--green); } .chip.purple:where(:not(.html *)) { --c: var(--purple); }
.chip.red:where(:not(.html *)) { --c: var(--red); } .chip.orange:where(:not(.html *)) { --c: var(--orange); } .chip.pink:where(:not(.html *)) { --c: var(--pink); } .chip.white:where(:not(.html *)) { --c: var(--white); color: #000; }
.chip.grey:where(:not(.html *)) { --c: var(--grey); } .chip.link:where(:not(.html *)) { --c: var(--link); } .chip.accent:where(:not(.html *)) { --c: var(--accent); } .chip.text:where(:not(.html *)) { --c: var(--text); }
.chip:where(:not(.html *)) { background: var(--c, var(--grey)); }
.chips-links .chip:where(:not(.html *)), .chips-brackets .chip:where(:not(.html *)) { background: none; color: var(--c, var(--link)); }
.chips-links .chip:hover:where(:not(.html *)), .chips-brackets .chip:hover:where(:not(.html *)) { text-decoration: underline; }
.sep:where(:not(.html *)) { color: var(--muted); }
.chip:hover:where(:not(.html *)), .tb:hover:where(:not(.html *)) { filter: brightness(1.15); }
.tabs:where(:not(.html *)) { overflow: visible; }
.tb:where(:not(.html *)) { display: inline-block; text-decoration: none; background: var(--tab); color: var(--tabtext, var(--text)); }
.tb.on:where(:not(.html *)) { background: var(--panel); }
.tabs-links .tabs:where(:not(.html *)) { text-align: center; }
.tabs-links .tb:where(:not(.html *)), .tabs-side:not(.side) .tb:where(:not(.html *)) { background: none; }
.tabs-links .tb.on:where(:not(.html *)), .tabs-side:not(.side) .tb.on:where(:not(.html *)) { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.pn { background: var(--panel); }
.folded [data-pane]:not(.on) { display: none !important; }   /* data-pane is only ever set by grid.js, never by the bots' HTML; a page rule that sets a panel's display can't open every tab at once */
.pn a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.pn b { color: var(--heading); }
/* a header wraps rather than running wide, so it shows what reaches past its line (a y's tail in a deep font) */
.h1:where(:not(.html *)) { font-size: 2.2em; line-height: 1.1; white-space: normal; padding: 0.15em 0 0.05em; overflow: visible; color: var(--heading); }
.h1 > span:where(:not(.html *)) { display: inline-block; }
.h1 > .ed:where(:not(.html *)) { white-space: pre; font-size: calc(1em / 2.2); }   /* the panel's margin, in grid cells, so the header lines up with the text */
.h2:where(:not(.html *)), .h2 b:where(:not(.html *)), .bx b:where(:not(.html *)) { color: var(--accent); }
.q:where(:not(.html *)) { color: var(--muted); font-style: italic; }
.dim:where(:not(.html *)), .bx:where(:not(.html *)) { color: var(--muted); }
/* HTML the bots write where the grid can't draw a design: a block inside a panel, or the whole page (grid.js) */
.r.hb:where(:not(.html *)) { display: flex; }
.html { overflow-wrap: break-word; white-space: normal; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; color: var(--text); }
.html img { max-width: 100%; height: auto; }
.html .demo-embed.playing { display: block; aspect-ratio: var(--demo-ratio, 4 / 3); max-width: 1024px; margin: 0 auto 12px; }
.html .demo-embed-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.html h1, .html h2 { font-family: "SiteFont", var(--mono); color: var(--heading); line-height: 1.1; }
/* an HTML page is as wide as a grid page (grid.js sets --cols on it), and every tab's panel is the same, grid or HTML:
   the panel colour, and the grid's blank row and two-cell margin around the content */
.htmlpage .pn.html { padding: var(--pad, calc(var(--lh) * 1em) 2ch); }
:where(.htmlpage) > .hd { margin-bottom: var(--gap, calc(var(--lh) * 1em)); }
/* an HTML page's header parts take the page's own spacing, so a row of them wraps rather than clipping */
.htmlpage .r.tabs, .htmlpage .chips .r { white-space: pre-wrap; }
/* the page's own wrappers (the header and each tab) can be styled, as a flex row say, but a single block the bots
   wrap their content in still fills the width rather than shrinking to its content */
.htmlpage > .html > :only-child { flex: 1 1 100%; min-width: 0; }
.html.hdr { color: var(--heading); }
.html figure > .ph { display: flex; align-items: center; justify-content: center; text-align: center; aspect-ratio: 16 / 9; padding: 1em;
  background: color-mix(in srgb, var(--muted) 35%, transparent); color: var(--text); }   /* the header sits on the background picture, not on the panel */
/* in HTML the contact form is the part web/parts/contact.html, which carries its own style */
@media (max-width: 520px) {   /* a phone stacks the bots' columns and floats, whatever their widths */
  .html * { grid-template-columns: 1fr !important; float: none !important; }
  .html [style*="width"] { max-width: 100%; }
}
/* the sidebar layout: title, tabs and chips in a column, the open tab beside it */
.sidewrap:where(:not(.html *)) { display: flex; gap: 2ch; align-items: stretch; }
.sb:where(:not(.html *)) { flex: none; background: var(--tab); padding: 0.6em 0 0.8em; }
.sb .ti:where(:not(.html *)) { font-size: 1.7em; padding: 0 0.5ch; margin: 0; white-space: normal; line-height: 1; color: var(--tabheading, var(--heading)); }
.sb .tb:where(:not(.html *)) { display: block; background: none; padding-left: 1ch; }
.sb .tb:where(:not(.html *))::before { content: "  "; }
.sb .tb.on:where(:not(.html *)) { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.sb .tb.on:where(:not(.html *))::before { content: "> "; }
.sb .chips:where(:not(.html *)) { text-align: left; padding-left: 1ch; }
.main:where(:not(.html *)) { flex: none; }
.r.im:where(:not(.html *)) { overflow: hidden; }
.ph:where(:not(.html *)) { display: inline-flex; align-items: center; justify-content: center; text-align: center; white-space: normal; vertical-align: top;
  background: color-mix(in srgb, var(--muted) 35%, transparent); color: var(--text); }
.im .eg:where(:not(.html *)) { display: inline-block; vertical-align: top; }
.im img:where(:not(.html *)) { display: inline-block; vertical-align: top; object-fit: cover; background: #5f5b5f; filter: saturate(0.85) contrast(1.05); }

/* the contact form, laid on the grid */
.cf { display: block; white-space: pre; }
.cf label { display: inline-block; vertical-align: top; }
/* each field fills its rows exactly, so the grid stays put; a clear border shows the panel between them */
.cf input, .cf textarea { font: inherit; line-height: var(--lh); color: var(--text); border: 3px solid transparent;
  background: color-mix(in srgb, var(--panel) 62%, #000) padding-box;
  padding: 0 8px; margin: 0; resize: none; vertical-align: top; }   /* room before the text; the rows set the height */
.cf input { height: calc(var(--lh) * 1em); line-height: calc(var(--lh) * 1em - 6px); }
.cf textarea { height: calc(var(--lh) * 4em); }
.cf input:focus, .cf textarea:focus { outline: 1px solid #fff; outline-offset: -3px; }
.cf button { background: #fff; color: #000; margin: 4px 0; }
.cf output { color: var(--text); }
.cf .hp { position: absolute; left: -9999px; }

/* ---- the file row: four files in a brushed metal tray (art/file-tray.blend) */
#files, dialog { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#files { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 10vh 16px 0; }
#files[hidden] { display: none; }
.tray:where(:not(#stage *)) { width: min(860px, 100%); aspect-ratio: 1240 / 496; padding: 5% 5.5%; background: url("img/tray-wide.webp") center / 100% 100% no-repeat; }
.row:where(:not(#stage *)) { height: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: center; }
.file:where(:not(#stage *)) { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 14px; }
.file.sel:where(:not(#stage *)) { background: rgba(255, 255, 255, 0.13); }
.file.changed:where(:not(#stage *))::after { content: "edited"; position: absolute; top: 4px; right: 6px; font-size: 11px; font-weight: 600; color: #fff; background: #3f8a46; padding: 1px 7px; border-radius: 99px; }
/* an icon is stacked layers: the render, then the mockup's thumbnail and its badge, or the font's own "Aa" */
.file .icon:where(:not(#stage *)) { position: relative; width: min(118px, 100%); aspect-ratio: 1; border-radius: 14px; container-type: inline-size; transition: transform 0.15s; }
.file .icon:hover:where(:not(#stage *)) { transform: translateY(-3px); }
.file .icon:focus-visible:where(:not(#stage *)) { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }
.file .icon img:where(:not(#stage *)) { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.file .icon img:first-child:where(:not(#stage *)) { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.file .icon .thumb:where(:not(#stage *)) { left: 15.6%; top: 23.4%; width: 68.8%; height: 53.1%; object-fit: cover; object-position: top; border-radius: 1px; }
.aa:where(:not(#stage *)) { position: absolute; left: 0; right: 0; top: 23%; text-align: center; font: 700 31cqw/1 "SiteFont", system-ui, sans-serif; color: #f2f2f2;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35); pointer-events: none; }
/* the file's name on a pill */
/* at most two lines: each half of the name (app.js) stays whole, and the pill widens for one a wider system font draws
   wider, rather than a third line or a cut */
.file .name:where(:not(#stage *)) { font: 600 12px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #17181b; white-space: normal; text-align: center; line-height: 1.15;
  display: block; height: calc(2.3em + 8px); padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.3); align-content: center; }
.file .name .ln:where(:not(#stage *)) { white-space: nowrap; }
@media (max-width: 800px) {   /* below this, six across leaves a long name too little room */
  .tray:where(:not(#stage *)) { width: min(440px, 100%); aspect-ratio: 740 / 800; padding: 9% 7%; background-image: url("img/tray-tall.webp"); }
  .row:where(:not(#stage *)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .file .name:where(:not(#stage *)) { font-size: 11px; padding: 3px 5px; }
}
@media (max-width: 340px) { .file .name:where(:not(#stage *)) { font-size: 10px; padding: 3px 4px; } }   /* the smallest phones */
/* the Jane's Walk photo at the bottom, over the contact button */
.walk:where(:not(#stage *)) { width: min(360px, 100%); margin: 0; text-align: center; }
.walk img:where(:not(#stage *)) { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.walk figcaption:where(:not(#stage *)) { margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--dim); }
/* a build or change taking a while: the stopwatch over the question */
dialog .slow { text-align: center; }
dialog .slow img { display: block; width: 110px; height: auto; margin: 0 auto 10px; }
.hint:where(:not(#stage *)) { color: var(--dim); text-align: center; max-width: 56ch; line-height: 1.5; font-size: 15px; }
.big:where(:not(#stage *)) { font-weight: 600; font-size: 16px; color: #17181b; padding: 10px 28px; border-radius: 99px;
  background: linear-gradient(#f2f3f6, #b7b9c0); box-shadow: inset 0 1px 0 #fff, 0 2px 10px rgba(0, 0, 0, 0.5); }
.big:hover:where(:not(#stage *)) { background: linear-gradient(#fff, #c9cbd1); }
.notfound h1 { margin: 0; font-size: 28px; font-weight: 600; text-align: center; }   /* web/404.html */
a.big { text-decoration: none; }
.buttons:where(:not(#stage *)) { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.big.alt:where(:not(#stage *)) { color: var(--fg); background: none; box-shadow: inset 0 0 0 1px #6d6f76; }
.big.alt:hover:where(:not(#stage *)) { background: #1c1d20; }
#bar.pre .logs, #bar.pre .bot { display: none; }
.big:active:where(:not(#stage *)) { transform: translateY(1px); }

/* ---- the modals */
dialog { background: #1b1c1f; color: var(--fg); border: 1px solid #3a3b40; border-radius: 12px; padding: 0; width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-weight: 600; border-bottom: 1px solid #333; }
dialog header button { font-size: 20px; line-height: 1; color: var(--dim); }
dialog .body { padding: 14px 16px; overflow: auto; max-height: calc(100vh - 150px); }
dialog footer { display: flex; gap: 10px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid #333; }
dialog footer button { padding: 6px 16px; border-radius: 99px; border: 1px solid #4a4b52; }
dialog footer button:last-child { background: var(--fg); color: #000; border-color: var(--fg); }
dialog footer button:hover { filter: brightness(1.2); }
dialog img { max-width: 100%; display: block; margin: 0 auto; }
.fontpv:where(:not(#stage *)) { font-family: "Preview", var(--mono); }
/* the thank-you when the queries are used up: James's photo on the left, his note beside it, the contact form below */
.thanks:where(:not(#stage *)) { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 14px 20px; align-items: center; line-height: 1.5; }
.thanks .face:where(:not(#stage *)) { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin: 6px 0;
  box-shadow: 0 0 0 3px #1b1c1f, 0 0 0 5px var(--coord), 0 8px 24px rgba(0, 0, 0, 0.5); }
.thanks p:where(:not(#stage *)) { margin: 0; }
.thanks .thanksform:where(:not(#stage *)) { grid-column: 1 / -1; }
@media (max-width: 480px) { .thanks .face { width: 76px; height: 76px; } .thanks { gap: 12px 14px; } }
.thanksform:where(:not(#stage *)) { display: grid; gap: 10px; text-align: left; }
.thanksform label:where(:not(#stage *)) { display: grid; gap: 4px; font-size: 13px; color: var(--dim); }
.thanksform input:where(:not(#stage *)), .thanksform textarea:where(:not(#stage *)) { font: inherit; font-size: 15px; color: var(--fg); background: #0f1012; border: 1px solid #3a3b40;
  border-radius: 8px; padding: 10px 12px; resize: vertical; }
.thanksform input:focus:where(:not(#stage *)), .thanksform textarea:focus:where(:not(#stage *)) { outline: 2px solid var(--coord); outline-offset: 0; border-color: transparent; }
.thanksform .send:where(:not(#stage *)) { display: flex; align-items: center; gap: 10px; }
.thanksform button:where(:not(#stage *)) { padding: 7px 20px; border-radius: 99px; background: var(--coord); color: #17181b; font-weight: 600; }
.thanksform output:where(:not(#stage *)) { color: var(--dim); font-size: 13px; }
.thanksform .hp:where(:not(#stage *)) { position: absolute; left: -9999px; }
.fontpv p:where(:not(#stage *)) { margin: 0 0 8px; overflow-wrap: anywhere; }
.md:where(:not(#stage *)) { display: flex; flex-direction: column; height: 62vh; border-radius: 8px; overflow: hidden; }
.md .TMCommandBar:where(:not(#stage *)) { flex: none; }
.md-area:where(:not(#stage *)) { flex: 1; overflow: auto; background: #121316; }
/* the markdown editor, light on dark */
.md .TinyMDE:where(:not(#stage *)) { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 12px 16px; background: #121316; color: #e8e6e3; caret-color: #fff; }
.md .TMMark:where(:not(#stage *)), .md .TMMark_TMTask:where(:not(#stage *)) { color: #70737b; }
.md .TMMark_TMH1:where(:not(#stage *)), .md .TMMark_TMH2:where(:not(#stage *)), .md .TMMark_TMOL:where(:not(#stage *)), .md .TMMark_TMUL:where(:not(#stage *)) { color: #ff9b8f; }
.md .TMCode:where(:not(#stage *)), .md .TMFencedCodeBacktick:where(:not(#stage *)), .md .TMFencedCodeTilde:where(:not(#stage *)), .md .TMIndentedCode:where(:not(#stage *)) { background: #26272c; border-color: #3a3b40; }
.md .TMBlockquote:where(:not(#stage *)) { border-left-color: #4a4b52; color: #c9c7c4; }
.md .TMLink:where(:not(#stage *)) { text-decoration-color: #8ab4f8; } .md .TMLinkDestination:where(:not(#stage *)), .md .TMInfoString:where(:not(#stage *)) { color: #8ab4f8; }
.md .TMLinkLabel_Valid:where(:not(#stage *)) { color: #7ece78; } .md .TMImage:where(:not(#stage *)) { text-decoration-color: #7ece78; }
.md .TMCommandBar:where(:not(#stage *)) { background: #1b1c1f; border-color: #1b1c1f; border-bottom: 1px solid #333; }
.md .TMCommandButton:where(:not(#stage *)) { color: #c9c9cc; fill: #c9c9cc; border-radius: 4px; }
.md .TMCommandButton_Inactive:where(:not(#stage *)) { background: #1b1c1f; }
.md .TMCommandButton_Active:where(:not(#stage *)) { background: #34406a; color: #dfe6ff; fill: #dfe6ff; }
.md .TMCommandButton_Active:hover:where(:not(#stage *)), .md .TMCommandButton_Inactive:hover:where(:not(#stage *)) { background: #2c2d33; fill: #fff; }
.md .TMCommandDivider:where(:not(#stage *)) { border-left-color: #3a3b40; border-right-color: #1b1c1f; }
/* the mockup's and font's choices, as pills in their popup */
/* the build mode's popup: the two modes side by side, each its glyph and what it makes */
.modes { display: grid; gap: 10px; }
dialog:has(.modes) { width: min(540px, calc(100vw - 32px)); }   /* just wide enough for the two modes */
.modeopt { display: flex; gap: 14px; align-items: center; text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid #3a3b40;
  color: var(--dim); font-size: 14px; line-height: 1.45; }
.modeopt img { width: 64px; height: 64px; flex: none; }
.modeopt b { color: var(--fg); font-size: 15px; text-transform: capitalize; }
.modeopt:hover { background: #222327; }
.modeopt.on { border-color: var(--coord); background: color-mix(in srgb, var(--coord) 10%, #1b1c1f); }
.modenote { margin: 4px 2px 0; color: var(--dim); font-size: 13px; }
/* picking a mockup offers its font and background, in the page's brushed metal tray */
dialog:has(.looks) { width: min(460px, calc(100vw - 32px)); }
.looks p { margin: 0 2px 14px; line-height: 1.45; text-align: center; }
.looks p:last-child { margin: 14px 2px 0; }
.looks .tray { width: 100%; aspect-ratio: auto; display: flex; justify-content: center; gap: 8%; padding: 22px 24px 24px; background-image: url("img/tray-wide.webp"); }
.looks .file { width: 40%; }
.looks .file .icon { width: min(104px, 100%); pointer-events: none; }
.looks .file .icon img { margin: 0; }   /* not centred like the dialog's other pictures, which pulls the thumbnail off its frame */
.pills:where(:not(#stage *)) { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pills button:where(:not(#stage *)) { padding: 5px 14px; border-radius: 99px; border: 1px solid #4a4b52; color: var(--fg); font-size: 14px; }
.pills button:hover:where(:not(#stage *)) { background: #2a2b30; }
.pills label { display: inline-flex; align-items: center; gap: 8px; padding: 2px 6px 2px 14px; border-radius: 99px; border: 1px solid #4a4b52; font-size: 14px; cursor: pointer; }
.pills label.on { border-color: var(--fg); }
.pills input[type="color"] { width: 26px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.pills button.on:where(:not(#stage *)) { background: var(--fg); color: #000; border-color: var(--fg); }
.md-plain:where(:not(#stage *)) { width: 100%; height: 100%; font: 14px/1.5 var(--mono); background: #000; color: #fff; border: 1px solid #333; }

/* ---- the status bar */
#bar { position: fixed; left: 0; right: 0; bottom: 0; background: #0d0d0d; border-top: 1px solid #333; font-size: 14px; z-index: 5;
  padding-bottom: env(safe-area-inset-bottom); }   /* clear of an iPhone's home bar */
#bar.collapsed #grip, #bar.collapsed .logs { display: none; }   /* tucked away: the log goes, the controls and the prompt stay */
/* the tab on the panel's top edge that hides and shows it, big enough for a finger, with a chevron pointing where it goes */
#hidebar { position: absolute; right: 16px; bottom: 100%; width: 44px; height: 18px; padding: 0; margin-bottom: 1px; border: 1px solid #333;
  border-bottom: 0; border-radius: 8px 8px 0 0; background: #0d0d0d; color: var(--dim); }
#hidebar::before { content: ""; position: absolute; inset: -10px -10px 0; }   /* a bigger area to hit */
#hidebar::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border: solid currentColor;
  border-width: 0 2px 2px 0; transform: translate(-50%, -75%) rotate(45deg); }
#bar.collapsed #hidebar::after { transform: translate(-50%, -25%) rotate(-135deg); }
#hidebar:hover, #hidebar:focus-visible { color: var(--fg); outline: none; }
/* the handle on the panel's top edge, which drags it taller or shorter (app.js) */
#grip { flex: none; height: 12px; margin: -6px 0 -4px; display: flex; align-items: center; justify-content: center; cursor: ns-resize;
  touch-action: none; position: relative; z-index: 1; }
#grip::before { content: ""; width: 44px; height: 4px; border-radius: 99px; background: #3a3a3e; transition: background 0.15s; }
#grip:hover::before, #grip:focus-visible::before, #bar.dragging #grip::before { background: var(--dim); }
#grip:focus-visible { outline: none; }
#bar.dragging { user-select: none; }
.ctl:where(:not(#stage *)) { padding: 8px 16px; display: flex; gap: 2ch; align-items: center; flex-wrap: wrap; border-top: 1px solid #222; }
#log { height: var(--logh, 9.5em); overflow-y: auto; padding: 6px 16px; font-size: 12px; line-height: 1.45; color: #9a979a; overscroll-behavior: contain; }
#log .l { white-space: pre-wrap; overflow-wrap: anywhere; }
.logs:where(:not(#stage *)) { display: flex; }
#log { flex: 1; min-width: 0; }
#todo { width: 38ch; height: var(--logh, 9.5em); overflow-y: auto; padding: 6px 14px; border-left: 1px solid #222; font-size: 12px; line-height: 1.45; overscroll-behavior: contain; }
#todo:empty, #todo[hidden] { display: none; }
#todo b { display: block; font-weight: normal; margin-top: 2px; }
#todo ul { list-style: none; margin: 0 0 6px; padding: 0; }
#todo li { color: #6e6b6e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#todo li.s-in_progress { color: #fff; }
#todo li.s-completed { color: #91d185; }
#log .l b { font-weight: normal; display: inline-block; min-width: 7ch; }
#log .act { color: #d6d3d6; }
#log .read { color: #8fb8d9; }
#log .cmd { color: #e6c07b; }
#log .tool { color: #b48fe0; }
#log .add { color: #91d185; }
#log .del { color: #d98a8a; }
#log .ok { color: #91d185; }
#log .err { color: #e06c6c; }
#log .st { color: #fff; }
#log .dim { color: #6e6b6e; }
/* the visitor and the Coordinator talking: rounded bubbles down the left that stand out from the bots' work */
#log .chat, .faq .chat { display: flex; margin: 7px 0; white-space: normal; }
#log .bubble, .faq .bubble { max-width: 88%; padding: 6px 12px; border-radius: 14px; line-height: 1.45; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
#log .you .bubble { background: #2c2e34; border-bottom-left-radius: 4px; }
#log .you .bubble::before { content: "You"; display: block; font-size: 0.85em; color: var(--dim); margin-bottom: 1px; }
#log .them .bubble, .faq .bubble { background: color-mix(in srgb, var(--c) 14%, #141416); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  border-bottom-left-radius: 4px; }
#log .them .bubble::before, .faq .bubble::before { content: attr(data-name); display: block; font-size: 0.85em; color: var(--c); margin-bottom: 1px; }
/* the questions and answers under the files, as Coordinator bubbles in the log's type */
.faq:where(:not(#stage *)) { width: min(640px, 100%); font: 12px/1.45 var(--mono); color: #9a979a; --c: var(--coord); }
.faq .chat:where(:not(#stage *)) { justify-content: center; }   /* each bubble centred on the page, its text still left-aligned */
.faq .bubble:where(:not(#stage *)) { white-space: normal; text-align: left; min-width: 88%; }   /* as wide as the longest, so they line up */
.faq a:where(:not(#stage *)) { color: var(--c); text-underline-offset: 2px; }
/* the model's logo before its name, and the line its licence asks for */
.faq a.muse img { height: 1.1em; width: auto; margin-right: 0.35em; vertical-align: -0.2em; }
.faq .built { display: block; margin-top: 8px; color: var(--dim); }
#log .thinking .bubble i { display: inline-block; width: 6px; height: 6px; margin: 4px 3px 2px 0; border-radius: 50%; background: var(--c);
  animation: dot 1.2s ease-in-out infinite; }
#log .thinking .bubble i:nth-child(2) { animation-delay: 0.15s; }
#log .thinking .bubble i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { #log .thinking .bubble i { animation: none; opacity: 0.6; } }
#bar[hidden] { display: none; }
/* how fast a recorded build replays */
/* the panel's buttons: the file names' pills (font, rounded ends, top highlight and shadow) in dark grey, and the
   replay speeds as one of them, with the speed in use a lighter pill inside, all the same height */
.ctl .pill, #speed { height: 27px; font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; white-space: nowrap; border-radius: 99px;
  color: #e4e2e4; background: linear-gradient(#45464c, #34353a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 3px rgba(0, 0, 0, 0.6); }
.ctl .pill { display: inline-flex; align-items: center; justify-content: center; padding: 4px 12px 5px; line-height: 1; }
@supports (text-box: trim-both cap alphabetic) {   /* the letters themselves centred, not the line they sit in */
  .ctl .pill { text-box: trim-both cap alphabetic; padding: 7px 12px; }
  #speed button { text-box: trim-both cap alphabetic; padding: 5px 9px; }
}
.ctl .pill:hover, .ctl .pill:focus-visible { background: linear-gradient(#55565c, #404146); color: #fff; outline: none; }
.ctl .pill[hidden] { display: none; }
/* the panel's "cancel" on a live build */
.ctl .pill.red { color: #fff; background: linear-gradient(#c94a42, #a3322b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 3px rgba(0, 0, 0, 0.6); }
.ctl .pill.red:hover, .ctl .pill.red:focus-visible { background: linear-gradient(#d65a52, #b13a33); color: #fff; }
/* the question when a change needs to go past the framework, its answers as the panel's pills */
#rawask { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-basis: 100%; color: var(--coord); font-size: 13px; }
#rawask[hidden] { display: none; }
#rawask span { margin-right: 4px; }
/* what a live build was changed from: the Coordinator's gold, with the same highlight and shadow */
.ctl .pill.gold { color: #17181b; background: linear-gradient(#f9c564, #e09a2c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 3px rgba(0, 0, 0, 0.6);
  max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
.ctl .pill.gold:hover, .ctl .pill.gold:focus-visible { background: linear-gradient(#fbd27e, #eaa83a); color: #17181b; }
#speed { display: inline-flex; align-items: center; gap: 2px; padding: 2px; }
#speed[hidden] { display: none; }
#speed > span { padding: 0 6px 0 10px; color: #a9a7ab; }
#speed button { padding: 2px 9px; border-radius: 99px; color: #c9c7cb; font: inherit; }
#speed button:hover { color: #fff; }
#speed button.on { color: #17181b; background: rgba(255, 255, 255, 0.78); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.4); }
.bot:where(:not(#stage *)) { display: flex; align-items: center; gap: 8px; opacity: 0.45; }
.bot[hidden]:where(:not(#stage *)) { display: none; }
.bot.busy:where(:not(#stage *)), .bot.done:where(:not(#stage *)) { opacity: 1; }
.bot img:where(:not(#stage *)) { width: 28px; height: 28px; border-radius: 4px; }
.bot.busy img:where(:not(#stage *)) { outline: 2px solid var(--c); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { outline-color: transparent; } }
.bot b:where(:not(#stage *)) { color: var(--c); font-weight: normal; }
#msg { flex: 1; min-width: 20ch; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* where the visitor types a change once the page is built: the text, and a blinking block cursor like the page's */
#askbox { position: relative; flex: 1; min-width: 20ch; display: flex; align-items: center; }
#askbox[hidden] { display: none; }
/* the prompt box wraps and grows with what's typed, up to six lines (app.js), and a hidden copy of its text, laid out
   the same way, says where the block cursor goes */
#ask, .askmirror { font: inherit; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; padding: 0; border: 0; }
#ask { flex: 1; min-width: 0; color: var(--fg); caret-color: transparent; background: none; outline: 0; resize: none; overflow: hidden; display: block; }
.askmirror { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
#ask { -webkit-appearance: none; appearance: none; border-radius: 0; }   /* no styling of the phone's own to measure around */
/* A phone's browser zooms the whole page into a text field set smaller than 16px, and leaves it zoomed, so on touch
   screens the prompt box and the popups' fields are 16px */
@media (pointer: coarse) {
  #askbox { font-size: 16px; }
  dialog input, dialog textarea, .md .TinyMDE { font-size: 16px !important; }
}
dialog:focus { outline: none; }
#ask::placeholder { color: #5c5c61; opacity: 1; }
#ask:placeholder-shown { text-indent: 1.6ch; }
#askbox .k { position: absolute; left: 0; top: 0; width: 1ch; height: 1.35em; pointer-events: none; }
/* the send button: the Coordinator's colour, with the pills' top highlight and shadow */
#send { flex: none; align-self: flex-end; width: 32px; height: 32px; margin-left: 10px; border-radius: 50%; color: #17181b;
  background: linear-gradient(#f9c564, #e09a2c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 3px rgba(0, 0, 0, 0.6);
  display: grid; place-items: center; transition: background 0.15s, opacity 0.15s; }
#send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#send:hover:not(:disabled), #send:focus-visible { background: linear-gradient(#fbd27e, #eaa83a); outline: none; }
#send:disabled { opacity: 0.35; cursor: default; }
#ask:not(:focus) ~ .k, #ask:disabled ~ .k { visibility: hidden; }
/* today's free builds, as a ring that fills as they're used, with the details on hover or tap */
#quota { position: relative; width: 18px; height: 18px; flex: none; margin-left: auto; cursor: help; border-radius: 50%; }
#quota[hidden] { display: none; }
#quota svg { width: 18px; height: 18px; transform: rotate(-90deg); }
#quota circle { fill: none; stroke-width: 2.5; }
#quota .track { stroke: #3a3a3e; }
#quota .arc { stroke: #5b9cf5; stroke-linecap: round; stroke-dasharray: 44; stroke-dashoffset: calc(44 * (1 - var(--used, 0))); transition: stroke-dashoffset 0.5s; }
#quota.out .arc { stroke: #e06c6c; }
#quota::after { content: attr(data-tip); position: absolute; right: -6px; bottom: calc(100% + 10px); width: max-content; max-width: min(300px, 80vw);
  padding: 7px 10px; border-radius: 6px; background: #1b1b1e; border: 1px solid #3a3a3e; color: var(--fg); font-size: 12px; line-height: 1.4;
  white-space: normal; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transition: opacity 0.15s; pointer-events: none; z-index: 6; }
#quota:hover::after, #quota:focus-visible::after, #quota:focus::after { opacity: 1; visibility: visible; }
#quota:focus-visible { outline: 2px solid var(--dim); outline-offset: 2px; }

/* ---- the working bot, in the middle of the page while a session starts or a tool runs */
#busy { position: fixed; left: 50%; top: 42%; z-index: 4; width: fit-content; min-width: min(240px, 58vw); max-width: calc(100vw - 24px); padding: 12px 12px 10px; text-align: center;
  background: rgba(13, 13, 13, 0.9); border: 1px solid #333; border-radius: 14px; font-size: 13px; color: var(--c, var(--fg));
  pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.25s, transform 0.25s, visibility 0s 0.25s; }
#busy.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition: opacity 0.25s, transform 0.25s; }
#busy img { display: block; width: min(216px, calc(58vw - 24px)); margin: 0 auto 6px; }
#busy span { display: block; }
#busy button { margin-top: 8px; padding: 2px 10px; font-size: 11px; white-space: nowrap; color: var(--dim); border: 1px solid #333; border-radius: 999px; }
#busy.on button { pointer-events: auto; }
#busy button:hover, #busy button:focus-visible { color: var(--fg); border-color: var(--dim); }
@media (max-width: 520px) {
  #busy { top: 33%; min-width: min(190px, 55vw); font-size: 11px; }
  #busy img { width: min(166px, calc(55vw - 24px)); }   /* as wide as its skip button needs, whatever the phone's font */
  #bar { font-size: 12px; }
  .ctl { gap: 1ch; padding: 6px 10px; }
  #log { height: 6.5em; font-size: 11px; padding: 4px 10px; }
  .faq { font-size: 11px; }
  /* the whole bar stays within a third of the screen: the plan and log share what the controls leave */
  #bar { max-height: 33vh; display: flex; flex-direction: column; }
  .ctl { flex: none; }
  .logs { flex: 1; min-height: 0; flex-direction: column-reverse; }
  #log { height: auto; min-height: 0; flex: 1; }
  #todo { width: auto; height: auto; max-height: 4.4em; flex: none; font-size: 11px; padding: 4px 10px; border-left: 0; border-bottom: 1px solid #222; }
  body { padding-bottom: 34vh; }
  #bar.sized { max-height: none; }          /* dragged: the visitor's height, not a third of the screen */
  #bar.sized .logs { flex: none; height: var(--logh); }
  .bot span { display: none; }
  #msg, #askbox { order: 9; flex-basis: 100%; }
}

/* the fold, where the browser morphs from the long page to the tabs (fold() in app.js) */
::view-transition-group(*) { animation-duration: 0.75s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.5s; }
::view-transition-new(fold-panel) { animation-delay: 0.3s; animation-fill-mode: backwards; }

/* The static pre-built page for search engines and readers without JavaScript */
.live:where(:not(#stage *)) { max-width: 100ch; margin: 0 auto 24px; padding: 0 16px; color: var(--dim); }
.live a:where(:not(#stage *)) { color: var(--blue); }
.snapshot:where(:not(#stage *)) { padding-bottom: 48px; }
