/* flff shell: the same tokens as www.flff.fi and the sign-in pages. */
:root {
  --bg: #fafaf9; --fg: #1c1917; --muted: #57534e; --line: #e7e5e4; --card: #ffffff;
  --accent: #4f46e5; --accent-fg: #ffffff; --hover: #f5f5f4; --current: #eef2ff; --error: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1917; --fg: #f5f5f4; --muted: #a8a29e; --line: #44403c; --card: #292524;
          --accent: #818cf8; --accent-fg: #1c1917; --hover: #292524; --current: #1e1b4b; --error: #f87171; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; display: grid; grid-template-columns: minmax(18rem, 22rem) 1fr; background: var(--bg); color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select { font: inherit; }

/* sidebar */
.side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--fg); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
#site-switch { min-width: 0; max-width: 12rem; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); }
main { flex: 1; overflow-y: auto; padding: 1rem; min-height: 0; }
.center { text-align: center; margin-top: 3rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
h1.title { font-size: 1.2rem; margin: .25rem 0 1rem; letter-spacing: -.01em; }

.signin { text-align: center; padding: 2.5rem .5rem; }
.signin h1 { font-size: 1.25rem; margin: 0 0 .5rem; letter-spacing: -.01em; }
button.primary { background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 0; padding: .65rem 1.2rem; font-weight: 600; margin: 1rem 0; cursor: pointer; }
.notice { border: 1px solid var(--line); border-radius: 0; padding: 1rem; background: var(--card); }
.notice.error p { color: var(--error); margin-top: 0; }
.notice.free { margin: 0 0 .9rem; padding: .55rem .75rem; font-size: .85rem; border-color: #f59e0b; background: #fffbeb; color: #78350f; }
@media (prefers-color-scheme: dark) { .notice.free { background: #2b2112; color: #fcd34d; border-color: #b45309; } }
.notice button { background: none; border: 1px solid var(--line); border-radius: 0; padding: .4rem .9rem; color: var(--fg); cursor: pointer; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: .5rem .6rem; }
.stat .label { color: var(--muted); font-size: .75rem; }
.stat .value { font-size: 1.05rem; font-weight: 650; letter-spacing: -.02em; }

.crumbs { font-size: .9rem; margin-bottom: .4rem; word-break: break-all; }
.crumbs .sep { color: var(--muted); margin: 0 .25rem; }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 0; overflow: hidden; background: var(--card); }
.list li { position: relative; display: grid; grid-template-columns: 1rem 1fr auto 4.8rem; gap: .45rem; align-items: center; padding: .4rem .65rem; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li:hover { background: var(--hover); }
.list li.current { background: var(--current); }
.list .icon { color: var(--muted); font-size: .8rem; text-align: center; }
/* A picture's thumbnail (hud.js rowIcon): the row grows a little for it. */
.list li:has(.has-thumb) { grid-template-columns: 2rem 1fr auto 4.8rem; padding-top: .25rem; padding-bottom: .25rem; }
.list .has-thumb { display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; }
.list .thumb { width: 2rem; height: 2rem; object-fit: contain; image-rendering: auto; border: 1px solid var(--line); background: repeating-conic-gradient(var(--hover) 0 25%, var(--card) 0 50%) 0 0 / 8px 8px; }
.list .name { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .dir .name { font-weight: 600; }
.list .meta { color: var(--muted); font-size: .78rem; text-align: right; white-space: nowrap; }
/* A name that doesn't fit: the size and date step aside (hud.js fitRows) and come out under the row on hover. */
.list li.tight { grid-template-columns: 1rem 1fr auto; }
.list li.tight:has(.has-thumb) { grid-template-columns: 2rem 1fr auto; }
.list li.tight .meta { display: none; }
.row-full { position: fixed; z-index: 60; pointer-events: none; display: flex; align-items: baseline; gap: 1rem; padding: .35rem .65rem; box-sizing: border-box;
  background: var(--card); color: var(--fg); border: 1px solid var(--accent); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); white-space: nowrap; }
.row-full .rf-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row-full.dir .rf-name { font-weight: 600; }
.row-full .rf-meta { flex: none; margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: .72rem; }
/* ".." : up a folder */
.list li.up { grid-template-columns: 1rem 1fr; }
.list li.up .name { font-weight: 600; font-family: var(--mono); letter-spacing: .1em; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: .75rem .9rem; }
.card-title { font-weight: 650; font-size: 1.05rem; }

.foot { display: flex; justify-content: space-between; gap: .75rem; padding: .6rem 1rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* preview */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.address { display: flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-bottom: 1px solid var(--line); font: .85rem/1.4 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; color: var(--muted); }
#address-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panes { flex: 1; display: flex; min-height: 0; }
#preview { flex: 1; width: 100%; min-width: 0; border: 0; background: #fff; }
.placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); opacity: .8; }

/* file actions: over the size and date on hover or keyboard focus; on touch
   screens always shown, in place of the size and date */
.acts { display: none; gap: .25rem; position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  padding-left: .5rem; background: var(--hover); }
.list li.current .acts { background: var(--current); }
.list li:hover .acts, .list li:focus-within .acts { display: flex; }
@media (hover: none) {
  .list li { grid-template-columns: 1rem 1fr auto; }
  .list li:has(.has-thumb) { grid-template-columns: 2rem 1fr auto; }
  .list .meta { display: none; }
  .acts { display: flex; position: static; transform: none; padding: 0; background: none; }
}
button.act { background: none; border: 1px solid var(--line); border-radius: 0; padding: .05rem .4rem; font-size: .75rem; color: var(--fg); cursor: pointer; }
button.act:hover { background: var(--card); border-color: var(--muted); }
button.act.danger { color: var(--error); }
.tools { display: flex; flex-wrap: wrap; gap: .35rem; margin: .1rem 0 .5rem; }
button.tool { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: .25rem .65rem; font-size: .82rem; color: var(--fg); cursor: pointer; }
button.tool:hover { border-color: var(--muted); }
.status { min-height: 1.2em; margin: .4rem 0 0; color: var(--muted); }
.status.ok, .editor-status.ok { color: #15803d; }
.status.error, .editor-status.error { color: var(--error); }
@media (prefers-color-scheme: dark) { .status.ok, .editor-status.ok { color: #4ade80; } }
body.dropping .side { outline: 3px dashed var(--accent); outline-offset: -6px; }
body.dropping .side::after { content: "Drop to upload into this folder"; position: fixed; left: 1rem; bottom: 3.2rem; padding: .4rem .7rem;
  border-radius: 0; background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: .85rem; }

/* history */
.history { margin-top: 1rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); padding: .6rem .75rem; }
.history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
ul.versions { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow-y: auto; }
ul.versions li { padding: .35rem 0; border-top: 1px solid var(--line); }
ul.versions li:first-child { border-top: 0; }
ul.versions .act { margin-left: .4rem; }
.v-change { font-size: .85rem; word-break: break-all; }

/* editor: a transparent textarea over a highlighted copy of its text */
.editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: var(--card); }
.editor-bar { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; border-bottom: 1px solid var(--line); }
.editor-name { font: 600 .85rem/1.4 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-status { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.small-btn { margin: 0; padding: .3rem .9rem; font-size: .85rem; }
button.primary:disabled { opacity: .45; cursor: default; }
.editor-versions { max-height: 40%; overflow-y: auto; padding: .4rem .75rem; border-bottom: 1px solid var(--line); }
.code { position: relative; flex: 1; min-height: 12rem; }
.code pre, .code textarea {
  position: absolute; inset: 0; margin: 0; padding: .75rem .9rem; border: 0; tab-size: 2;
  font: 13px/1.55 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; white-space: pre; overflow-wrap: normal;
}
.code pre { overflow: hidden; pointer-events: none; color: var(--fg); }
.code textarea { width: 100%; height: 100%; resize: none; overflow: auto; background: transparent; color: transparent;
  caret-color: var(--fg); outline: none; }
.code textarea::selection { background: rgba(79, 70, 229, .25); color: transparent; }

/* Prism tokens, light and dark */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6b7280; font-style: italic; }
.token.tag, .token.selector, .token.important, .token.keyword { color: #7c3aed; }
.token.attr-name, .token.property, .token.function { color: #0369a1; }
.token.attr-value, .token.string, .token.url, .token.char { color: #15803d; }
.token.number, .token.boolean, .token.constant, .token.unit { color: #b45309; }
.token.punctuation, .token.operator { color: #57534e; }
.token.entity, .token.regex, .token.variable { color: #be185d; }
.token.title, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }
@media (prefers-color-scheme: dark) {
  .token.comment, .token.prolog, .token.doctype, .token.cdata { color: #9ca3af; }
  .token.tag, .token.selector, .token.important, .token.keyword { color: #c4b5fd; }
  .token.attr-name, .token.property, .token.function { color: #7dd3fc; }
  .token.attr-value, .token.string, .token.url, .token.char { color: #86efac; }
  .token.number, .token.boolean, .token.constant, .token.unit { color: #fcd34d; }
  .token.punctuation, .token.operator { color: #d6d3d1; }
  .token.entity, .token.regex, .token.variable { color: #f9a8d4; }
}

/* a new file or folder being named in the list, and a new file not yet saved */
.list li.ghost { grid-template-columns: 1rem 1fr; background: var(--current); }
.ghost-name { width: 100%; font: inherit; padding: .15rem .4rem; border: 1px solid var(--accent); border-radius: 0;
  background: var(--card); color: var(--fg); outline: none; }
.ghost-name[aria-invalid="true"] { border-color: var(--error); }
.ghost-hint { color: var(--error); margin-top: .2rem; }
.ghost-hint:empty { display: none; }
.list li.draft .name { font-style: italic; }

/* the brain (bar, drawer, latest reply: see the layout below) */
.ai-title { font-size: .9rem; }
#ai-model { min-width: 0; max-width: 13rem; padding: .2rem .4rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); font-size: .82rem; }
/* Today's brain spending, of the daily allowance: a thin bar (tap it for the amounts). */
.ai-spend-slot { flex: 1; min-width: 2.5rem; display: flex; align-items: center; }
/* The brainpower meter: a gauge with no frame (a level line, the needle
   turning above it), BRAIN and $ on top, the
   warning light and POWER below; the needle shows the credit left (or, on
   invoicing, today's allowance left). */
.ai-meter { position: relative; display: block; width: 3.9rem; height: 3.15rem; margin: -.4rem 0; padding: 0; border: 0; background: none; color: var(--fg); cursor: pointer; box-sizing: border-box; }
.ai-meter-word { position: absolute; font: 500 .52rem/1 var(--mono, ui-monospace, monospace); letter-spacing: .04em; color: var(--muted); }
.ai-meter-tl { top: 2px; left: 3px; } .ai-meter-tr { top: 2px; right: 3px; } .ai-meter-br { bottom: 2px; right: 3px; }
.ai-meter-dial { position: absolute; left: 3%; top: 16%; width: 94%; height: 62%; overflow: visible; }
.ai-meter-arc { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.ai-meter-red { fill: none; stroke: var(--error); stroke-width: 2.8; stroke-linecap: round; }
.ai-meter-needle { stroke: var(--fg); stroke-width: 2.2; stroke-linecap: round; transform-origin: 32px 33px; transform: rotate(-63deg); transition: transform .4s ease; }
/* The dollar scale (brain.js spend): 0 3 6 9, $10 at the end of the ticks, more just past it. */
.ai-meter-scale text { font: 500 4.6px/1 var(--mono, ui-monospace, monospace); fill: var(--muted); text-anchor: middle; }
.ai-meter-ticks { stroke: var(--muted); stroke-width: .7; }
.ai-meter.no-scale .ai-meter-scale { display: none; }
/* A click shows the balance itself for a few seconds, in the gauge's place. */
.ai-meter-amount { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: none; text-align: center; font: 600 .9rem/1 var(--mono, ui-monospace, monospace); color: var(--fg); }
.ai-meter.show-amount .ai-meter-dial { visibility: hidden; }
.ai-meter.show-amount .ai-meter-amount { display: block; }
.ai-meter.show-amount.low .ai-meter-amount { color: var(--ops, #d97706); }
.ai-meter.show-amount.out .ai-meter-amount { color: var(--error); }
.ai-meter-pivot { fill: var(--fg); }
.ai-meter-light { position: absolute; left: 3px; bottom: 2px; width: .4rem; height: .4rem; border-radius: 50%; border: 1px solid var(--muted); box-sizing: border-box; }
.ai-meter.low .ai-meter-light { background: var(--ops, #d97706); border-color: var(--ops, #d97706); }
.ai-meter.out .ai-meter-light { background: var(--error); border-color: var(--error); }
.ai-meter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ai-meter-needle { transition: none; } }
/* The brainpower popup. */
.power-box { min-width: 15rem; max-width: 21rem; }
.power-now { margin: .1rem 0 .6rem; }
.power-h { margin: .6rem 0 .3rem; font-size: .85rem; font-weight: 650; }
.power-packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; }
.power-packs button { font: inherit; padding: .4rem .5rem; text-align: left; }
.power-packs button small, .power-inv small { display: block; color: var(--muted); font-size: .72rem; }
.power-inv { display: block; width: 100%; font: inherit; padding: .45rem .5rem; text-align: left; }
.power-box button:disabled { opacity: .5; cursor: not-allowed; }
.power-box .power-on { border-color: var(--accent); }
.ai-log { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .6rem; }
/* A scrolling flex column squeezes its children to fit unless told not to:
   long chats then drew messages over each other. */
.ai-log > * { flex-shrink: 0; }
.ai-divider { display: flex; align-items: center; gap: .6rem; margin: .4rem 0; color: var(--muted); font-size: .74rem; text-align: center; }
.ai-divider::before, .ai-divider::after { content: ""; flex: 1; min-width: 1rem; border-top: 1px solid var(--line); }
.ai-earlier { align-self: center; }
.ai-msg { max-width: 92%; padding: .5rem .7rem; border-radius: 0; font-size: .9rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-fg); }
.ai-msg.brain { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.ai-msg.streaming .ai-text::after { content: "▍"; color: var(--muted); }
.ai-tools { list-style: none; margin: 0; padding: 0; font: .78rem/1.5 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; color: var(--muted); }
.ai-tools:empty { display: none; }
.ai-tools li::before { content: "… "; }
.ai-tools li.ok::before { content: "✓ "; color: #15803d; }
.ai-tools li.failed::before { content: "✗ "; color: var(--error); }
.ai-tools li.declined::before { content: "– "; }
.ai-tools li.declined { text-decoration: line-through; }
/* The brain asks before it goes on (brain_policy.go). */
.ai-approve { margin-top: .5rem; padding: .55rem .65rem; border: 1px solid var(--line); border-left: 3px solid #b45309; background: var(--card); }
.ai-approve-head { margin: 0 0 .4rem; font-weight: 600; }
.ai-approve-item { margin: .3rem 0; }
.ai-approve-sum { font: .78rem/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.ai-approve-detail { margin: .3rem 0 0; padding: .4rem; max-height: 14rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .75rem; background: var(--bg); border: 1px solid var(--line); }
.ai-approve-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.ai-approve-row .tool { padding: .3rem .7rem; }
.ai-approve-yes { font-weight: 650; }
.ai-approve.answered { border-left-color: var(--line); }
.ai-approve-said { margin: .4rem 0 0; font-size: .78rem; color: var(--muted); }
.ai-tools + .ai-text:not(:empty) { margin-top: .35rem; }
/* Your sites (hud.js renderDashboard): big cards in the middle; the sidebar folds into a top bar */
body.home { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
body.home #gutter-side, body.home #view, body.home #panes, body.home #address, body.home #files-open { display: none !important; }
body.home .side, body.home.files-hidden .side { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
  max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
body.home .side::before { display: none; }
body.home .bar, body.home .foot { border: 0; }
.home { flex: 1; min-height: 0; overflow-y: auto; padding: 1.5rem clamp(1rem, 4vw, 3rem) 3rem; }
.home-head { max-width: 75rem; margin: 0 auto 1rem; }
.home-head .title { margin: 0; }
.home-empty { max-width: 75rem; margin: 2rem auto; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; max-width: 75rem; margin: 0 auto; }
.site-card { display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line); color: var(--fg); overflow: hidden; }
.site-card:hover { border-color: var(--muted); text-decoration: none; }
.site-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc-thumb { position: relative; aspect-ratio: 16 / 10; background: var(--bg); border-bottom: 1px solid var(--line); overflow: hidden; }
.sc-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* What the person is on the site (hud.js, from /shell/api/work): chips on the thumbnail */
.site-card { position: relative; }
.sc-roles { position: absolute; top: .5rem; left: .5rem; z-index: 1; display: flex; flex-wrap: wrap; gap: .3rem; max-width: calc(100% - 1rem); pointer-events: none; }
.sc-role { font: 600 .68rem var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: .15rem .45rem; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.15); backdrop-filter: blur(4px); }
.sc-role.owner { color: var(--muted); }
.sc-role.collaborator { border-color: var(--science, var(--accent)); }
.sc-role.role { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.role-card .sc-thumb { aspect-ratio: 16 / 6; }
.sc-role.private { background: var(--fg); color: var(--card); border-color: var(--fg); }
/* Your sites: the Private switch, top right under the thumbnail (hud.js privateSwitch) */
.site-block { position: relative; }
.sc-private-anchor { position: absolute; top: 0; left: 0; right: 0; aspect-ratio: 16 / 10; pointer-events: none; z-index: 2; }
.sc-private { position: absolute; right: .6rem; top: calc(100% + .7rem); pointer-events: auto; }
.has-private .sc-name { padding-right: 7.5rem; }
.ps-row { display: flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.priv-switch { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: none; padding: .15rem; cursor: pointer; color: var(--fg); font: 600 .78rem var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.ps-track { position: relative; width: 2.3rem; height: 1.3rem; border-radius: 999px; background: var(--line); transition: background .15s; }
.ps-knob { position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.priv-switch[aria-checked="true"] .ps-track { background: var(--fg); }
.priv-switch[aria-checked="true"] .ps-knob { transform: translateX(1rem); }
.priv-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ps-opts { border: 0; background: none; color: var(--accent); font-size: .78rem; cursor: pointer; text-decoration: underline; padding: 0; }
.ps-opts[hidden], .ps-pop[hidden] { display: none; }
.ps-pop { position: absolute; right: 0; top: calc(100% + .4rem); width: min(22rem, 80vw); max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: .8rem .9rem; z-index: 5; text-align: left; }
.ps-close { position: absolute; top: .35rem; right: .45rem; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .95rem; }
/* Your sites, Private (hud.js privatePane) */
.priv-form { display: grid; gap: .55rem; margin-top: .4rem; }
.priv-form label { display: grid; gap: .2rem; }
.priv-form .priv-role, .priv-form .priv-pwline { display: flex; align-items: center; gap: .35rem; }
.priv-form .priv-go { justify-self: start; }
/* The shell: a private site's padlock beside the address */
.private-mark { display: inline-flex; align-items: center; gap: .3rem; margin-left: .4rem; padding: .15rem .5rem; border-radius: 999px; background: var(--fg); color: var(--card); font: 600 .68rem var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.private-mark[hidden] { display: none; }
.pm-lock { width: 8px; height: 7px; border: 1.5px solid currentColor; border-radius: 1.5px; position: relative; top: 2px; }
.pm-lock::before { content: ''; position: absolute; left: 0; top: -6px; width: 5px; height: 5px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
.sc-thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; background: #fff; }
.sc-initial { display: flex; align-items: center; justify-content: center; height: 100%; font: 700 3.2rem/1 var(--display); color: var(--muted); opacity: .5; }
.sc-body { display: flex; flex-direction: column; gap: .3rem; padding: .85rem 1rem 1rem; min-width: 0; }
.sc-name { font: 700 1.2rem/1.15 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.sc-title { font-weight: 600; overflow-wrap: anywhere; }
.sc-desc { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc-url { font: .8rem var(--mono); color: var(--science); overflow-wrap: anywhere; }
.sc-stats, .sc-change { font-size: .8rem; color: var(--muted); }
.sc-change { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-badge { align-self: flex-start; font: 600 .7rem var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: .1rem .35rem; border: 1px solid var(--line); color: var(--muted); }
.sc-badge.free { border-color: var(--ops); color: var(--fg); }

/* the shell's Feedback dialog (feedback.js) */
.fb-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.fb-form { background: var(--card); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,.25); width: min(34rem, 100%); max-height: 90vh; overflow: auto;
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.fb-form h2 { margin: 0; font-size: 1.05rem; }
.fb-form select, .fb-form textarea { font: inherit; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); padding: .45rem .55rem; }
.fb-form textarea { resize: vertical; min-height: 6rem; }
.fb-include { display: flex; gap: .4rem; align-items: flex-start; }
.fb-details pre { max-height: 14rem; overflow: auto; font: .72rem/1.4 var(--mono, ui-monospace, Menlo, Consolas, monospace); background: var(--bg); border: 1px solid var(--line); padding: .5rem; margin: .4rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-row { display: flex; justify-content: flex-end; gap: .5rem; }
.fb-said:empty { display: none; }
.fb-said.ok { color: #15803d; } .fb-said.error { color: var(--error); }
/* the admin panel's Feedback tab */
.fb-item { background: var(--card); border: 1px solid var(--line); padding: .7rem .8rem; margin-bottom: .6rem; }
.fb-item.done { opacity: .6; }
.fb-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; font-size: .82rem; color: var(--muted); }
.fb-kind { font: 600 .7rem var(--mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .06em; padding: .1rem .35rem; border: 1px solid var(--line); color: var(--fg); }
.fb-kind.bug { border-color: var(--error); color: var(--error); }
.fb-msg { margin: .45rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-item pre { max-height: 18rem; overflow: auto; font: .72rem/1.4 var(--mono, ui-monospace, Menlo, Consolas, monospace); background: var(--bg); border: 1px solid var(--line); padding: .5rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .4rem; }
.fb-actions input { flex: 1; min-width: 12rem; font: inherit; font-size: .85rem; padding: .3rem .45rem; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); }
.ai-msg.brain .ai-text { white-space: normal; }
/* QR codes the brain makes (brain.js): a card in the reply, full screen on a tap */
.ai-qr { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; padding: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 0; cursor: zoom-in; text-align: left; max-width: 100%; }
.ai-qr img { display: block; width: 160px; height: 160px; image-rendering: pixelated; }
.ai-qr-text { color: #111; overflow-wrap: anywhere; }
.qr-full { position: fixed; inset: 0; z-index: 60; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
.qr-full img { width: min(86vw, 70vh); height: auto; image-rendering: pixelated; cursor: zoom-out; }
.qr-full-text { margin: 0; color: #111; font: 600 1rem/1.4 system-ui, sans-serif; overflow-wrap: anywhere; text-align: center; max-width: 90vw; }
.qr-full-row { display: flex; gap: .6rem; }
.qr-full .tool { color: #111; background: #fff; border-color: #ccc; }
/* Markdown in the brain's replies (brain.js) */
.ai-text p, .ai-text ul, .ai-text ol, .ai-text pre, .ai-text blockquote, .ai-text .md-h { margin: .45rem 0; }
.ai-text > :first-child { margin-top: 0; }
.ai-text > :last-child { margin-bottom: 0; }
.ai-text ul, .ai-text ol { padding-left: 1.3rem; }
.ai-text li + li { margin-top: .15rem; }
.ai-text .md-h { font-weight: 650; }
.ai-text .md-h1 { font-size: 1.05rem; }
.ai-text .md-h2 { font-size: 1rem; }
.ai-text code { font: .82em var(--mono, ui-monospace, Menlo, Consolas, monospace); background: var(--card); border: 1px solid var(--line); padding: 0 .25em; }
.ai-text pre { background: var(--card); border: 1px solid var(--line); padding: .5rem .6rem; overflow-x: auto; white-space: pre; }
.ai-text pre code { border: 0; padding: 0; background: none; }
.ai-text blockquote { border-left: 3px solid var(--line); padding-left: .6rem; color: var(--muted); }
.ai-text hr { border: 0; border-top: 1px solid var(--line); margin: .6rem 0; }
.ai-meta { margin-top: .35rem; font-size: .72rem; color: var(--muted); white-space: normal; }
.ai-form { display: flex; gap: .5rem; align-items: flex-end; padding: .6rem .75rem; border-top: 1px solid var(--line); }
.ai-form textarea { flex: 1; resize: vertical; min-height: 2.6rem; max-height: 12rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 0;
  background: var(--bg); color: var(--fg); font: inherit; font-size: .9rem; }
.ai-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.ai-form .ai-mic { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4rem; min-height: 2.1rem; padding: 0 .5rem; }
.ai-form .ai-mic[hidden] { display: none; }
.ai-form .ai-mic.on { background: var(--accent); border-color: var(--accent); color: #fff; animation: ai-mic-pulse 1.2s ease-in-out infinite; }
@keyframes ai-mic-pulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .ai-form .ai-mic.on { animation: none; } }
.ai-note { margin: 0; padding: 0 .75rem .5rem; color: var(--muted); }
.ai-note:empty { display: none; }
.ai-note.error { color: var(--error); }

/* ---- The flff look: orderly like a bridge, dense like a parts catalog, a
   little Detroit grit on solid colours (the same tokens as www.flff.fi and the
   sign-in pages). Kept last, so it overrides the neutral defaults above. ---- */
@font-face { font-family: "Antonio"; src: url("fonts/display-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Antonio"; src: url("fonts/display-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --bg: #f6f7f9; --fg: #111827; --muted: #4b5563; --line: #e5e7eb; --card: #ffffff;
  --accent: #b42318; --accent-fg: #ffffff; --hover: #eef0f3; --current: #e8f1f5; --error: #b42318;
  --ops: #e3a52f; --science: #1a6a8a; --hull: #141a22;
  --display: "Antonio", "Arial Narrow", sans-serif; --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --grit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.6 1.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.38'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --fg: #e6edf3; --muted: #9aa4b1; --line: #262d37; --card: #151b23;
          --accent: #f97066; --accent-fg: #0d1117; --hover: #1a212b; --current: #10283a; --error: #f97066;
          --ops: #f2c14e; --science: #5cbfe0; --hull: #0a0e13; }
}
body { font-size: 14px; }
a { color: var(--science); }
.side::before, .stage::before { content: ""; display: block; flex: none; height: 7px; margin: 4px 4px 0; border-radius: 0;
  background-color: var(--band, #dcd9d5); background-image: var(--grit); }   /* light grey, with noise (was the brand's colour stripes) */
@media (prefers-color-scheme: dark) { :root { --band: #3b3734; } }
.brand { font: 700 1.3rem/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
h1.title, .signin h1 { font: 700 1.6rem/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
button.primary { border-radius: 0; background-image: var(--grit); }
button.tool, button.act { border-radius: 0; font-weight: 500; }
.stat .label { font: 500 .66rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.stat .value { font: 700 1.25rem/1.1 var(--display); letter-spacing: .02em; }
.crumbs, .list .meta, .ai-meta, .address, .foot { font-family: var(--mono); }
.list .meta, .ai-meta { font-size: .72rem; }
.card-title { font: 700 1.15rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--fg); }
.editor-name, .ai-title, .history-head strong { font-family: var(--mono); font-weight: 500; }
.notice.free { border: 1px solid var(--ops); border-left: 4px solid var(--ops); background: var(--card); color: var(--fg); }
.ai-msg { border-radius: 0; }
.ai-msg.user { background: var(--hull); color: #e6edf3; }

/* your own domain (domains.js) */
.domains .domain { border-top: 1px solid var(--line); padding: .6rem 0; }
.domain-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.dbadge { font: 500 .66rem/1 var(--mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .05em; padding: .25rem .45rem; border-radius: 0; background: var(--hover); color: var(--muted); }
.dbadge.verified { background: #e3f1f7; color: #0f5873; } .dbadge.active { background: #e6f4ea; color: #146c2e; }
@media (prefers-color-scheme: dark) { .dbadge.verified { background: #0e2a36; color: #7fd2ee; } .dbadge.active { background: #12301d; color: #7ee2a0; } }
.checklist { list-style: none; padding: 0; margin: .3rem 0; }
.checklist li::before { content: "○ "; color: var(--muted); }
.checklist li.ok::before { content: "✓ "; color: #15803d; }
.methods summary { cursor: pointer; font-size: .85rem; color: var(--science, var(--accent)); margin: .3rem 0; }
.methods h4 { font-size: .82rem; margin: .7rem 0 .2rem; }
table.records { width: 100%; border-collapse: collapse; font-size: .78rem; margin: .2rem 0; }
table.records td { padding: .25rem .3rem; border-top: 1px solid var(--line); vertical-align: top; word-break: break-all; }
table.records .rtype { font-family: var(--mono, ui-monospace, monospace); color: var(--muted); width: 3.2rem; }
table.records code { font-size: .76rem; }
.rnote { display: block; color: var(--muted); font-size: .72rem; word-break: normal; }
.row-actions { display: flex; gap: .4rem; margin-top: .4rem; }
.domain-form { display: flex; gap: .4rem; margin-top: .6rem; }
.domain-input { flex: 1; min-width: 0; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); font: inherit; }

/* the private viewer (files in _u, for the owner only) */
.private-view { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--card); }
.pv-open #preview { display: none; }
.pv-body { flex: 1; overflow: auto; padding: 1rem; }
.pv-body img { max-width: 100%; height: auto; background: repeating-conic-gradient(var(--hover) 0% 25%, transparent 0% 50%) 50% / 16px 16px; }
.pv-text { margin: 0; font: .8rem/1.5 var(--mono, ui-monospace, monospace); white-space: pre-wrap; overflow-wrap: anywhere; }
a.tool { display: inline-block; text-decoration: none; color: var(--fg); padding: .25rem .65rem; font-size: .82rem; }
.pv-body:has(.pv-pdf) { padding: 0; }
.pv-pdf { width: 100%; height: 100%; border: 0; display: block; background: #525659; }

/* the Admin panel (admin.js, admin.html): a page of its own, for platform admins */
.stage { position: relative; }
body.admin-page { display: flex; flex-direction: column; height: auto; min-height: 100%; }
.ap-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .6rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.ap-title { font: 700 1rem/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.ap-who { color: var(--muted); margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.ap-back { white-space: nowrap; }
.ap-tabs { position: sticky; top: 3.4rem; z-index: 1; padding: .5rem 1rem; background: var(--bg); border-bottom: 1px solid var(--line);
  overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.ap-tabs[hidden] { display: none; }
.ap-tabs button { flex: none; }
.ap-main { flex: 1; min-width: 0; }
body.admin-page .admin-body { overflow: visible; }
body.admin-page .admin-table { display: block; overflow-x: auto; max-width: 100%; }
@media (max-width: 560px) {
  .ap-head { gap: .5rem; padding: .5rem .75rem; }
  .ap-who { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .ap-tabs { top: 0; position: static; padding: .4rem .75rem; }
  body.admin-page .admin-body { padding: .5rem .75rem 2rem; }
  /* Tables keep readable columns and scroll sideways, rather than squeeze words letter by letter. */
  body.admin-page .admin-table td, body.admin-page .admin-table th { overflow-wrap: normal; min-width: 6.5rem; }
  body.admin-page .admin-table td:first-child { min-width: 11rem; overflow-wrap: anywhere; }
}
.admin-tabs { display: flex; gap: .25rem; flex: 1; }
.admin-tabs button.current { background: var(--current); border-color: var(--accent); }
.admin-note { margin: 0; padding: .4rem 1rem 0; min-height: 1.2rem; }
.admin-note.error { color: var(--error); }
.admin-note.ok { color: var(--muted); }
.admin-body { flex: 1; overflow: auto; padding: .5rem 1rem 2rem; }
.admin-form, .admin-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .25rem 0 1rem; }
.admin-inline { margin: .4rem 0 0; flex-basis: 100%; }
.admin-form input, .admin-form select, .admin-inline input, .admin-inline select { padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); font: inherit; font-size: .85rem; }
.admin-form input.num { width: 5rem; }
.admin-form .primary { margin: 0; }
.admin-host { display: inline-flex; align-items: center; gap: .2rem; font-size: .85rem; color: var(--muted); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 0; font-size: .88rem; }
.admin-table th { text-align: left; font-weight: 600; font-size: .75rem; color: var(--muted); padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
.admin-table td { padding: .45rem .6rem; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.admin-table tr.disabled td { opacity: .55; }
.admin-table .actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.admin-table .actions button { white-space: nowrap; }
.invite-message { flex-basis: 100%; min-height: 2.4rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); font: inherit; font-size: .88rem; resize: vertical; }
.invite-send { margin-top: .5rem; }
.admin-fresh .ok, .invite-send .ok { color: #15803d; }
.admin-fresh .error, .invite-send .error { color: var(--error); }
.admin-table button.armed { border-color: var(--error); color: var(--error); }
.admin-fresh code { font-size: .8rem; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: .7rem; padding: .05rem .4rem; border-radius: 0; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.accent { border-color: var(--accent); color: var(--accent); }
.badge.error { border-color: var(--error); color: var(--error); }
.badge.ok { color: var(--fg); }
.admin-table td:first-child a { white-space: nowrap; }

/* the layout (layout.js): the files | the stage (tabs over the open file),
   and the brain's bar along the bottom, under both */
body { grid-template-columns: var(--side-w, 20rem) 6px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
body > .side { grid-row: 1 / -1; grid-column: 1; }
body > #gutter-side { grid-row: 1 / -1; grid-column: 2; }
body > .stage { grid-row: 1; grid-column: 3; }
body > .brain { grid-row: 2; grid-column: 3; }
body.files-hidden { grid-template-columns: minmax(0, 1fr); }
body.files-hidden > .stage, body.files-hidden > .brain { grid-column: 1; }
.files-hidden .side, .files-hidden #gutter-side { display: none; }
.side { border-right: 0; }
.icon-btn { min-width: 2rem; padding: .2rem .45rem; line-height: 1; font-size: 1rem; }
.bar #files-toggle { margin-left: auto; }
#files-open { display: none; flex: none; align-self: center; margin: 0 .25rem .3rem 0; }
.files-hidden #files-open { display: inline-block; }

/* the tab strip: the open files */
.address { padding: .35rem .5rem 0; align-items: flex-end; gap: .35rem; }
.tabs { display: flex; gap: .1rem; flex: 0 1 auto; min-width: 0; margin-bottom: -1px; overflow-x: auto; scrollbar-width: thin; }
.ftab { display: flex; align-items: center; gap: .35rem; flex: none; max-width: 15rem; padding: .4rem .35rem .4rem .65rem; cursor: pointer;
  font: 500 .8rem/1.2 var(--mono, ui-monospace, monospace); color: var(--muted); border: 1px solid transparent; border-bottom: 0; user-select: none; }
.ftab:hover { color: var(--fg); background: var(--hover); }
.ftab.on { color: var(--fg); background: var(--card); border-color: var(--line); box-shadow: inset 0 2px 0 var(--accent); }
.ftab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ftab-icon { font-size: .8rem; opacity: .75; }
.ftab-preview .ftab-icon { color: var(--science, var(--accent)); opacity: 1; }
.ftab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftab-dot { display: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ops, #b45309); flex: none; }
.ftab.dirty .ftab-dot { display: inline-block; }
.ftab-x { border: 0; background: none; color: inherit; padding: 0 .25rem; font-size: .95rem; line-height: 1; cursor: pointer; opacity: .55; }
.ftab-x:hover { opacity: 1; background: var(--hover); }
.ftab.dirty:not(:hover) .ftab-x { display: none; }
#tab-new { flex: none; align-self: center; margin-bottom: .3rem; }
#address-text { flex: 1; min-width: 0; padding: 0 .25rem .5rem .75rem; align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#address-open { padding-bottom: .5rem; align-self: center; }
#address-open[hidden] { display: none; }

/* the open file: one view at a time */
.panes { position: relative; }
.panes > .editor, .panes > .private-view, .panes > #preview { flex: 1 1 0; min-width: 0; border-right: 0; }
.tabs-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 2rem; text-align: center; }
.tabs-empty[hidden] { display: none; }

/* handles */
.gutter { position: relative; z-index: 3; flex: none; touch-action: none; background: transparent; }
.gutter[hidden] { display: none !important; }
.gutter-v { width: 6px; cursor: col-resize; }
.gutter::after { content: ""; position: absolute; background: var(--line); transition: background .1s; }
.gutter-v::after { top: 0; bottom: 0; left: 2px; width: 1px; }
.gutter:hover::after, .gutter:focus-visible::after, .resizing .gutter::after { background: var(--accent); }
.gutter-v:hover::after, .gutter-v:focus-visible::after { left: 1px; width: 3px; }
.gutter:focus-visible { outline: none; }
.resizing { user-select: none; }
.resizing iframe { pointer-events: none; }   /* the preview would swallow the drag */
.resizing-v, .resizing-v * { cursor: col-resize !important; }
.resizing-h, .resizing-h * { cursor: row-resize !important; }

/* the brain: a bar along the bottom */
.brain { position: relative; display: flex; flex-direction: column; min-width: 0; border-top: 1px solid var(--line); background: var(--card); z-index: 10; }
.brain[hidden] { display: none; }
.brain .ai-form { align-items: center; gap: .4rem; padding: .4rem .6rem; border-top: 0; }
.ai-icon { flex: none; font-size: 1.35rem; line-height: 1; padding: 0 .15rem; }
.brain .ai-form textarea { min-height: 2.1rem; height: 2.1rem; max-height: 10rem; resize: none; overflow-y: auto; padding: .35rem .55rem; line-height: 1.35; }
.ai-controls { display: flex; align-items: center; gap: .4rem; flex: none; }
.ai-controls .ai-spend-slot { flex: none; width: auto; }
.ai-controls #ai-model { min-width: 0; max-width: 10rem; }
#ai-history[aria-expanded="true"] { background: var(--current); border-color: var(--accent); }
.brain .ai-note { margin: 0; padding: 0 .75rem; }
.brain .ai-note:empty { display: none; }
.brain .ai-note:not(:empty) { padding-bottom: .35rem; }
.ai-pics { border-top: 0; padding: .5rem .75rem 0 3rem; }

/* the chat: a drawer up from the bar, over the stage */
.ai-drawer { position: absolute; left: 0; right: 0; bottom: 100%; height: var(--drawer-h, 45vh); display: flex; flex-direction: column;
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, .14); }
.ai-drawer[hidden] { display: none; }
.ai-grip { flex: none; height: 8px; cursor: row-resize; touch-action: none; position: relative; }
.ai-grip::after { content: ""; position: absolute; left: 50%; top: 3px; width: 3rem; height: 3px; margin-left: -1.5rem; background: var(--line); }
.ai-grip:hover::after, .ai-grip:focus-visible::after, .resizing-h .ai-grip::after { background: var(--accent); }
.ai-grip:focus-visible { outline: none; }
.ai-drawer-head { flex: none; display: flex; align-items: center; gap: .5rem; padding: 0 .75rem .35rem; border-bottom: 1px solid var(--line); }
.ai-drawer-head #ai-drawer-close { margin-left: auto; }
.ai-drawer .ai-log { flex: 1; max-width: 60rem; width: 100%; margin: 0 auto; box-sizing: border-box; }

/* the latest reply, over the open file in small print */
.ai-latest { position: absolute; right: .75rem; bottom: .75rem; z-index: 6; width: min(26rem, calc(100% - 1.5rem)); max-height: 45%;
  display: flex; flex-direction: column; background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); font-size: .78rem; line-height: 1.4; }
.ai-latest[hidden] { display: none; }
.ai-latest-x { position: absolute; top: .2rem; right: .2rem; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .85rem; padding: .15rem .35rem; }
.ai-latest-x:hover { color: var(--fg); background: var(--hover); }
.ai-latest-body { overflow-y: auto; padding: .5rem 1.8rem .55rem .7rem; }
.ai-latest-ask { color: var(--muted); margin-bottom: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-latest-ask::before { content: "You: "; font-weight: 600; }
.ai-latest-reply { white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-latest-reply .ai-tools { font-size: .72rem; }
.ai-latest-reply.streaming .ai-text::after { content: "▍"; color: var(--muted); }
.ai-latest-reply .ai-meta { display: none; }
.ai-latest-reply .qr-card { display: none; }

/* Your sites: no brain bar, the sidebar folded into a top bar */
body.home { grid-template-rows: auto minmax(0, 1fr); }
body.home > .stage { grid-row: 2; grid-column: 1 / -1; }
body.home > .side { grid-row: 1; grid-column: 1 / -1; }
body.home #files-toggle, body.home > .brain { display: none !important; }

/* phones: the stage takes the screen; the files open over it from the left */
@media (max-width: 760px) {
  html, body { height: 100%; height: 100dvh; }
  body, body.files-hidden { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  body > .stage, body > .brain { grid-column: 1; }
  #files-open { display: inline-block; }
  #files-open.on { background: var(--current); border-color: var(--accent); }
  body:not(.files-hidden):not(.home) > .side { display: flex; position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; width: min(88vw, 24rem);
    max-height: none; background: var(--bg); box-shadow: 8px 0 24px rgba(0, 0, 0, .25); border-bottom: 0; }
  #address-text { display: none; }
  .ftab { max-width: 10rem; padding: .5rem .35rem .5rem .55rem; }
  .ftab-x { padding: .1rem .4rem; font-size: 1.1rem; }
  .ai-controls { flex-basis: 100%; justify-content: flex-end; }
  .brain .ai-form { flex-wrap: wrap; }
  .ai-controls #ai-model { max-width: 8rem; }
  .ai-drawer { height: min(var(--drawer-h, 45vh), 75dvh); }
  .ai-latest { left: .5rem; right: .5rem; width: auto; bottom: .5rem; max-height: 40%; }
}

/* traffic in the admin panel (admin.js): one series, the chart colour */
:root { --chart: #b42318; }
@media (prefers-color-scheme: dark) { :root { --chart: #ec5f54; } }
.chart-bar { fill: var(--chart); }
.chart-hit { fill: transparent; }
.chart-col.on .chart-hit { fill: var(--hover); }
.chart-base { stroke: var(--line); stroke-width: 1; }
.chart-axis text { fill: var(--muted); font: 11px var(--mono, ui-monospace, monospace); }
.spark { display: inline-flex; align-items: center; gap: .45rem; background: none; border: 1px solid transparent; padding: .1rem .3rem; cursor: pointer; color: var(--fg); font: inherit; }
.spark:hover, .spark:focus-visible { border-color: var(--line); background: var(--hover); }
.spark-n { min-width: 2.2rem; text-align: right; font-variant-numeric: tabular-nums; }
.traffic-title { margin: 0 .5rem; font-size: 1.1rem; }
/* the admin panel's Brain tab */
.brain-stats { grid-template-columns: repeat(3, 1fr); margin: .25rem 0 .5rem; }
.brain-stats .value { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.admin-h { margin: 1.2rem 0 .4rem; font-size: .95rem; }
.admin-h2 { margin: 1.8rem 0 .6rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: 1.05rem; }
.admin-h2:first-of-type { margin-top: .4rem; padding-top: 0; border-top: 0; }
.admin-table th.num { text-align: right; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spend-bar { display: block; position: relative; width: 5rem; height: 5px; margin: .3rem 0 0 auto; background: var(--line); }
.spend-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--science); }
.spend-bar.high .spend-fill { background: var(--ops); }
.spend-bar.full .spend-fill { background: var(--error); }
.traffic-stats { grid-template-columns: repeat(5, 1fr); margin: .25rem 0 1rem; }
.traffic-stats .value { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.traffic-chart { background: var(--card); border: 1px solid var(--line); padding: .6rem .8rem .4rem; }
.traffic-svg { width: 100%; height: auto; display: block; }
.traffic-readout { margin: 0 0 .3rem; color: var(--fg); font-variant-numeric: tabular-nums; }
.traffic-h { font-size: .85rem; margin: 0 0 .4rem; }
.traffic-table { margin: .6rem 0 1rem; }
.traffic-table summary { cursor: pointer; color: var(--muted); }
.traffic-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .traffic-stats { grid-template-columns: repeat(2, 1fr); } .traffic-lists { grid-template-columns: 1fr; } }

/* text edited in the preview (textedit.js): save and discard over its top right */
.te-preview-tools { position: absolute; z-index: 4; display: flex; gap: 2px; }
.te-preview-tools[hidden] { display: none; }
.te-preview-tools button { height: 34px; min-width: 34px; padding: 0 .55rem; border-radius: 0; cursor: pointer; font: 600 .8rem/1 system-ui, sans-serif;
  display: inline-flex; align-items: center; gap: .35rem; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.te-save { background: var(--accent); color: var(--accent-fg); border: 1px solid var(--accent); }
.te-save:disabled { background: var(--card); color: var(--muted); border-color: var(--line); opacity: .75; cursor: default; box-shadow: none; }
.te-count:empty { display: none; }
.te-discard { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
@media (pointer: coarse) { .te-preview-tools button { height: 42px; min-width: 42px; } }
.te-preview-tools { flex-wrap: wrap; justify-content: flex-end; max-width: min(24rem, 90vw); }
.te-note { flex-basis: 100%; background: var(--card); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.18);
  padding: .55rem .65rem; font-size: .82rem; margin-top: 4px; }
.te-note[hidden] { display: none; }
.te-note p { margin: 0 0 .35rem; }
.te-note ul { margin: 0 0 .5rem; padding-left: 1.1rem; }
.te-note li { overflow-wrap: anywhere; }
.te-note-muted { color: var(--muted); }
.te-note-row { display: flex; gap: .35rem; justify-content: flex-end; }
.te-note-row button { height: auto; padding: .35rem .7rem; box-shadow: none; }
.te-ask { background: var(--accent); color: var(--accent-fg); border: 1px solid var(--accent); }
.te-drop { background: var(--card); color: var(--fg); border: 1px solid var(--line); }

/* space in the admin panel */
.space-bar { display: inline-block; width: 4rem; height: .45rem; background: var(--hover); border: 1px solid var(--line); vertical-align: middle; }
.space-bar > span { display: block; height: 100%; background: var(--chart); }
.space-bar.full > span { background: var(--error); }
.admin-total.error { color: var(--error); }
.small-tool { padding: .1rem .45rem; font-size: .75rem; margin-top: .2rem; }
.admin-table td.space { min-width: 10rem; }
.small-tool { white-space: nowrap; }

/* Collaborators (collab.js) and shared sites. */
.notice.shared { margin: 0 0 .9rem; padding: .55rem .75rem; font-size: .85rem; border: 1px solid var(--science); border-left: 4px solid var(--science); background: var(--card); color: var(--fg); }
.sc-badge.shared { border-color: var(--science); color: var(--fg); text-transform: none; letter-spacing: 0; }
ul.collabs { list-style: none; margin: .5rem 0; padding: 0; }
li.collab { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--line); font-size: .85rem; }
li.collab:first-child { border-top: 0; }
.collab-email { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); }
.collab-role { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.collab-role.owner { color: var(--fg); font-weight: 600; }
.collab-mfa { font-size: .7rem; white-space: nowrap; border: 1px solid var(--line); padding: .05rem .35rem; }
.collab-mfa.none { color: var(--muted); border-style: dashed; }
.collab-mfa-box { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .7rem; }
.collab-mfa-box p { margin: .3rem 0 .5rem; }
li.collab.pending .collab-email { color: var(--muted); }
.collab-form { margin-top: .4rem; }
.collab-message { width: 100%; margin-top: .4rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); font: inherit; font-size: .85rem; resize: vertical; }
.collab-link { display: flex; gap: .4rem; align-items: center; margin-top: .35rem; }
.collab-link code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .75rem; }
.ai-note.busy { color: var(--fg); border-left: 3px solid var(--science); padding-left: .5rem; }

/* --- the order form for a new site (order.js) --- */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.home-head .order-open { margin: 0; }
.order { max-width: 75rem; margin: 0 auto; }
.order-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.order-head .title { margin: 0; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; align-items: start; }
@media (max-width: 960px) { .order-grid { grid-template-columns: 1fr; } }
.order-sec { margin-bottom: 1.75rem; }
.order-h2 { font: 700 1.05rem var(--display, inherit); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .6rem; }
.order-h3 { font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .9rem 0 .4rem; }
.order-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; }
.order-plan, .order-tmpl, .order-feat { text-align: left; font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: .8rem .9rem; cursor: pointer; display: flex; flex-direction: column; gap: .25rem; }
.order-plan:hover, .order-tmpl:hover, .order-feat:not(.included):not(:disabled):hover { border-color: var(--muted); }
.order-plan.on, .order-tmpl.on, .order-feat.on { border-color: var(--command, var(--accent)); box-shadow: inset 0 0 0 1px var(--command, var(--accent)); }
.order-plan-name { font-weight: 700; }
.order-plan-price { font: 600 1.1rem var(--mono); color: var(--command, var(--accent)); }
.order-plan-sum { color: var(--muted); }
.order-name { display: flex; align-items: center; gap: .35rem; max-width: 28rem; }
.order-name input { flex: 1; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); font: 1rem var(--mono); }
.order-name input:focus, .order-space input:focus-visible { outline: 2px solid var(--science, var(--accent)); outline-offset: 1px; }
.order-space { display: flex; align-items: center; gap: .8rem; max-width: 34rem; color: var(--muted); }
.order-space input[type=range] { flex: 1; accent-color: var(--command, var(--accent)); }
.order-space input[type=range]:disabled { opacity: .45; }
.order-space-out { font: 600 1.1rem var(--mono); color: var(--fg); min-width: 4.5rem; text-align: right; }
.order-tmpl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .6rem; }
.order-tmpl-name { font-weight: 600; }
.order-tmpl .sc-badge { margin-top: .2rem; }
.order-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; }
.order-feat { align-items: center; text-align: center; padding: .9rem .6rem; }
.order-feat svg { color: var(--fg); }
.order-feat.on svg { color: var(--command, var(--accent)); }
.order-feat:disabled { opacity: .5; cursor: default; }
.order-feat.included { cursor: default; background: transparent; border-style: dashed; }
.order-feat.included svg { color: var(--science, var(--muted)); }
.order-feat-name { font-weight: 600; font-size: .88rem; }
.order-sum { position: sticky; top: 1rem; max-height: calc(100vh - 11rem); overflow-y: auto; border: 1px solid var(--line); background: var(--card); padding: 1rem 1.1rem; }
.order-lines { list-style: none; margin: 0 0 .6rem; padding: 0; }
.order-lines li, .order-total { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; }
.order-lines li { border-bottom: 1px solid var(--line); font-size: .9rem; }
.order-lines .num, .order-total .num { font-family: var(--mono); white-space: nowrap; }
.order-total strong { font-size: 1.15rem; }
.order-code { margin: .6rem 0 .2rem; }
.order-code-row { display: flex; gap: .4rem; }
.order-code-in { flex: 1; min-width: 0; text-transform: uppercase; font: inherit; padding: .35rem .5rem; border: 1px solid var(--line, #ccc); border-radius: 6px; background: var(--bg, transparent); color: inherit; }
.order-code-in:disabled { opacity: .8; }
.order-code-note { margin: .3rem 0 0; }
.order-code-note:empty { display: none; }
.order-discount .num { color: var(--ok, #2f7d32); }
.order-free-note { margin: .4rem 0 0; }
.order-credit { display: flex; gap: .5rem; align-items: flex-start; border-left: 3px solid var(--science, var(--accent)); padding: .4rem .6rem; margin: .8rem 0; }
.order-credit svg { flex: none; width: 20px; height: 20px; color: var(--science, var(--accent)); }
.order-sum .primary { width: 100%; margin: .5rem 0 .25rem; }
.order .ok { color: var(--science, inherit); }
.order .error { color: var(--error); }
.order-done { max-width: 40rem; }
.order-done .row { display: flex; gap: .75rem; align-items: center; margin-top: 1.2rem; }
.order-done .primary-link { background: var(--accent); background-image: var(--grit); color: var(--accent-fg); padding: .65rem 1.2rem; font-weight: 600; }

/* --- setting up a new site (order.js, site_setup.go) --- */
.setup { max-width: 40rem; margin: 0 auto; }
.setup-bar { position: relative; height: 10px; background: var(--line); margin: 1.2rem 0 1rem; overflow: hidden; }
.setup-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 4%; background: var(--command, var(--accent)); background-image: var(--grit); transition: width .6s ease; }
/* While waiting, a light band moves along the bar, so it's visibly alive. */
.setup-bar:not(.done)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; left: -30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: setup-sweep 1.6s linear infinite; }
@keyframes setup-sweep { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .setup-bar::after { animation: none; display: none; } .setup-fill { transition: none; } }
.setup-bar.done .setup-fill { background-color: var(--science, var(--accent)); }
.setup-steps { list-style: none; padding: 0; margin: 0 0 1rem; }
.setup-step { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; }
.setup-step.todo { color: var(--muted); }
.setup-step.now { font-weight: 600; }
.setup-mark { width: 1.3rem; height: 1.3rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); font: 700 .8rem var(--mono); }
.setup-step.done .setup-mark { background: var(--science, var(--accent)); border-color: var(--science, var(--accent)); color: var(--accent-fg); }
.setup-step.now .setup-mark { border-color: var(--command, var(--accent)); border-top-color: transparent; border-radius: 50%; animation: setup-spin .9s linear infinite; }
@keyframes setup-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .setup-step.now .setup-mark { animation: none; border-top-color: var(--command, var(--accent)); } }
.setup-note:not(:empty) { border-left: 3px solid var(--ops, var(--accent)); padding: .4rem .6rem; }
.setup .row { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; }
.setup .primary-link { background: var(--accent); background-image: var(--grit); color: var(--accent-fg); padding: .65rem 1.2rem; font-weight: 600; }

/* --- the style editor (styles.js) --- */
.editor.styles-mode .code, .editor.csv-mode .code { display: none; }
/* The table editor (csvedit.js): a .csv file as a table */
.csv-view { flex: 1; min-height: 12rem; display: flex; flex-direction: column; overflow: hidden; }
.csv-view[hidden] { display: none; }
.csv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .45rem .6rem; border-bottom: 1px solid var(--line); background: var(--bg); }
.csv-find { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--fg); min-width: 12rem; }
.csv-count { margin-left: auto; }
.csv-scrollbox { flex: 1; overflow: auto; }
.csv-grid { border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.csv-grid th { position: sticky; top: 0; z-index: 1; background: var(--bg); border-bottom: 2px solid var(--line); text-align: left; padding: 0; }
.csv-grid td { border-bottom: 1px solid var(--line); padding: 0; }
.csv-grid tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 55%, var(--card)); }
.csv-grid tbody tr:hover td { background: var(--hover); }
.csv-th { display: flex; align-items: center; }
.csv-head, .csv-cell { font: inherit; color: var(--fg); background: transparent; border: 1px solid transparent; border-radius: 4px; padding: .3rem .45rem; margin: 1px; min-width: 3rem; }
.csv-head { font-weight: 700; font-family: var(--mono, ui-monospace, monospace); font-size: .8rem; }
.csv-head:hover, .csv-cell:hover { border-color: var(--line); }
.csv-head:focus, .csv-cell:focus { outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.csv-grid .num .csv-cell { text-align: right; font-variant-numeric: tabular-nums; }
.csv-rownum { color: var(--muted); font: .72rem var(--mono, ui-monospace, monospace); text-align: right; padding: 0 .5rem !important; user-select: none; }
.csv-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: .2rem .35rem; opacity: 0; border-radius: 4px; }
.csv-grid th:hover .csv-del, .csv-grid tr:hover .csv-del, .csv-del:focus-visible { opacity: 1; }
.csv-del:hover { color: var(--error); background: var(--hover); }
.csv-pager { display: flex; align-items: center; gap: .6rem; justify-content: center; padding: .4rem; border-top: 1px solid var(--line); }
.style-view { flex: 1; min-height: 12rem; overflow: auto; padding: .5rem .6rem 2rem; }
.style-head { position: sticky; top: -.5rem; z-index: 1; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .5rem 0; margin-top: -.5rem; background: var(--card); }
.style-search { flex: 1 1 12rem; min-width: 0; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); font: inherit; }
.style-rule { border: 1px solid var(--line); margin: .35rem 0; background: var(--bg); }
.style-rule.at { border-style: dashed; }
.style-rule > summary { display: flex; align-items: center; gap: .45rem; padding: .4rem .5rem; cursor: pointer; list-style: none; }
.style-rule > summary::-webkit-details-marker { display: none; }
.style-rule > summary::before { content: "\25B8"; color: var(--muted); font-size: .8rem; width: .8rem; flex: none; }
.style-rule[open] > summary::before { content: "\25BE"; }
.style-rule > summary:hover { background: var(--hover); }
.style-sel { font: 600 .86rem var(--mono); overflow-wrap: anywhere; flex: 1; min-width: 0; }
.style-rule.at > summary .style-sel { color: var(--science, var(--accent)); }
.style-sel-input { flex: 1; min-width: 0; font: 600 .86rem var(--mono); padding: .2rem .35rem; border: 1px solid var(--accent); border-radius: 0; background: var(--card); color: var(--fg); }
.style-dots { display: inline-flex; gap: 2px; flex: none; }
.style-dot { width: .7rem; height: .7rem; border: 1px solid var(--line); }
.style-count { flex: none; font-family: var(--mono); }
.style-act { flex: none; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; padding: .1rem .35rem; border-radius: 0; font-size: .8rem; }
.style-act:hover { border-color: var(--line); color: var(--fg); }
.style-act.danger:hover, .style-act.armed { color: var(--error); border-color: var(--error); }
.style-body { padding: .2rem .5rem .55rem 1.6rem; display: flex; flex-direction: column; gap: .25rem; }
.style-body > .style-rule { margin: .2rem 0; }
.style-decl { display: flex; align-items: center; gap: .3rem; }
.style-decl input[type=text] { font: .84rem var(--mono); padding: .25rem .4rem; border: 1px solid transparent; border-radius: 0; background: transparent; color: var(--fg); min-width: 0; }
.style-decl input[type=text]:hover { border-color: var(--line); }
.style-decl input[type=text]:focus { border-color: var(--accent); background: var(--card); outline: none; }
.style-prop { flex: 0 1 11rem; color: var(--science, var(--accent)); }
.style-val { flex: 1 1 10rem; }
.style-colon { color: var(--muted); }
.style-swatches { display: inline-flex; gap: 3px; flex: none; }
.style-color { width: 1.6rem; height: 1.4rem; padding: 0; border: 1px solid var(--line); border-radius: 0; background: none; cursor: pointer; }
.style-color::-webkit-color-swatch-wrapper { padding: 1px; }
.style-color::-webkit-color-swatch { border: 0; border-radius: 0; }
.style-new { margin-top: .2rem; padding-top: .3rem; border-top: 1px dashed var(--line); }
.style-new input[type=text] { border-color: var(--line); }
.style-at { flex: 1; color: var(--muted); }
.style-add { align-self: flex-start; }

/* --- layout mode's button (layoutmode.js) --- */
.address .layout-btn { margin-left: .5rem; padding: .2rem .55rem; font-size: .8rem; }
.address .layout-save { margin: 0 0 0 .35rem; padding: .25rem .6rem; font-size: .8rem; }
body.layout-on .te-preview-tools { display: none !important; }
.address .layout-btn.on { background: var(--command, var(--accent)); color: var(--accent-fg); border-color: transparent; }

/* Orders waiting on payment, on Your sites (order.js). */
.order-notes { display: grid; gap: .5rem; margin: 0 0 1rem; }
.order-note { border: 1px solid var(--line); background: var(--card); padding: .6rem .8rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.order-note.ok { border-left: 4px solid #15803d; }
.order-note.unpaid { border-left: 4px solid #b45309; }
.order-note .primary { padding: .3rem .8rem; }

/* Pictures for the brain (brain.js): waiting to send, and sent. */
.ai-pics { display: flex; gap: .5rem; flex-wrap: wrap; padding: .6rem .75rem 0; border-top: 1px solid var(--line); }
.ai-pics:not([hidden]) + .ai-form { border-top: 0; }
.ai-pics[hidden] { display: none; }
.ai-pic { position: relative; width: 4rem; height: 4rem; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; }
.ai-pic img { width: 100%; height: 100%; object-fit: cover; }
.ai-pic-x { position: absolute; top: -.45rem; right: -.45rem; width: 1.3rem; height: 1.3rem; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; line-height: 1; }
.ai-msg-pics { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .3rem; }
.ai-msg-pics img { max-width: 7rem; max-height: 5rem; object-fit: cover; border: 1px solid rgba(255,255,255,.4); }
.ai-drop { outline: 3px dashed var(--accent); outline-offset: -6px; }
.brain .ai-form textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the preview's buttons: open the page in a window of its own, beside Save */
.te-open { background: var(--card); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); display: inline-flex; align-items: center; justify-content: center; }
.te-open:hover { border-color: var(--accent); color: var(--accent); }
.te-preview-tools .te-open { min-width: 38px; }

/* All sites, beside the site picker */
.all-sites { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; border: 1px solid var(--line); background: var(--card); }
.all-sites[hidden] { display: none; }
.all-sites:hover { border-color: var(--accent); text-decoration: none; }
.bar { flex-wrap: nowrap; gap: .5rem; }
.bar #site-switch { flex: 1 1 auto; min-width: 5.75rem; max-width: none; } /* room for a site's name, the cash register beside it or not */
.bar .all-sites { margin-left: auto; padding: .3rem .55rem; font-size: .82rem; }
.bar #site-switch:not([hidden]) ~ .all-sites { margin-left: 0; }
.bar #files-toggle { margin-left: 0; flex: none; }

/* breadcrumbs: where the file list is, as a bar */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; margin: 0 0 .6rem; padding: .3rem .45rem; background: var(--current);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); font-size: .88rem; word-break: break-all; }
.crumbs a, .crumbs .crumb { padding: .1rem .35rem; color: var(--accent); }
.crumbs a:hover { background: var(--card); text-decoration: none; }
.crumbs .here { color: var(--fg); font-weight: 600; }
.crumbs .crumb-home { display: inline-flex; align-items: center; padding: .15rem .3rem; }
.crumbs .crumb-home.here { color: var(--accent); }
.crumbs .sep { color: var(--muted); margin: 0 .05rem; font-size: 1.05rem; line-height: 1; }

/* Your sites: each site a block, its card on top and its areas below, opening downward */
.site-cards { align-items: start; }
.site-block { display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line); }
.site-block:hover { border-color: var(--muted); }
.site-block > .site-card { border: 0; }
.sc-areas { border-top: 1px solid var(--line); }
.sc-areas[hidden] { display: none; }
.sc-area-row { display: flex; }
.sc-area-btn { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .55rem .9rem; border: 0; border-right: 1px solid var(--line);
  background: none; color: var(--fg); font: 600 .82rem/1.2 system-ui, sans-serif; cursor: pointer; text-align: left; }
.sc-area-btn:last-child { border-right: 0; }
.sc-area-btn:hover { background: var(--hover); }
.sc-area-btn.on { background: var(--current); box-shadow: inset 0 -2px 0 var(--accent); }
.sc-area-arrow { color: var(--muted); transition: transform .15s; }
.sc-area-btn.on .sc-area-arrow { transform: rotate(180deg); }
.sc-area-panel { padding: .75rem .9rem 1rem; border-top: 1px solid var(--line); overflow-x: auto; }
.sc-area-panel[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .sc-area-arrow { transition: none; } }

/* the brain is the send button: round, a little taller than the bar, near the middle */
.brain .ai-form textarea { flex: 0 1 calc(50vw - 7.8rem); min-width: 8rem; }
.brain .ai-controls { margin-left: auto; }
.ai-send { flex: none; width: 3.3rem; height: 3.3rem; margin: -.65rem .1rem; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 2px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); cursor: pointer; position: relative; z-index: 1;
  font-size: 1.9rem; line-height: 1; transition: transform .12s ease, box-shadow .12s ease; }
.ai-send:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 3px 12px rgba(0, 0, 0, .25); }
.ai-send:active:not(:disabled) { transform: scale(.96); }
.ai-send:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ai-send:disabled { cursor: default; filter: grayscale(.8); opacity: .6; box-shadow: none; }
.ai-send.thinking { filter: none; opacity: 1; animation: ai-think 1.1s ease-in-out infinite; }
@keyframes ai-think { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .ai-send, .ai-send.thinking { transition: none; animation: none; } }
@media (max-width: 760px) {
  .brain .ai-form textarea { flex: 1 1 0; }
  .ai-send { width: 3rem; height: 3rem; font-size: 1.7rem; margin: -.5rem 0; }
}

/* invoices (order.js): the card after a purchase, beside the setting-up progress, and the list */
.purchase-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
@media (max-width: 960px) { .purchase-grid { grid-template-columns: minmax(0, 1fr); } }
.order-done.purchase { max-width: 64rem; }
.purchase-back { margin: .25rem 0 .5rem; }
.purchase-setup .setup { max-width: none; }
.invoice-card { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 1rem 1.15rem; }
.invoice-card.inv-paid { border-top-color: #15803d; }
.invoice-card.inv-void { border-top-color: var(--muted); opacity: .85; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.inv-label { font: 600 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.inv-number { font: 600 1.05rem var(--mono); }
.inv-status { font: 700 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: .15rem .45rem; border: 1.5px solid currentColor; color: #b45309; }
.inv-paid .inv-status { color: #15803d; }
.inv-void .inv-status { color: var(--muted); }
.inv-meta { margin: .35rem 0 .75rem; }
.inv-items { width: 100%; border-collapse: collapse; font-size: .88rem; }
.inv-items td { padding: .4rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv-items td.num, .inv-total .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-period { color: var(--muted); font-size: .78rem; padding: .45rem .5rem 0 !important; white-space: nowrap; }
.inv-totals { margin: .6rem 0 .4rem auto; max-width: 16rem; font-size: .88rem; }
.inv-total { display: flex; justify-content: space-between; gap: 1rem; padding: .12rem 0; }
.inv-total.total { font-weight: 700; border-top: 1px solid var(--fg); margin-top: .25rem; padding-top: .3rem; }
.inv-total.paid { color: #15803d; }
.inv-total.due { font-weight: 700; }
.inv-foot { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .6rem; }
@media (prefers-color-scheme: dark) { .invoice-card.inv-paid { border-top-color: #4ade80; } .inv-paid .inv-status, .inv-total.paid { color: #4ade80; } .inv-status { color: #fbbf24; } }
.invoices-open { margin-right: .5rem; }
.invoices-list { max-width: 75rem; margin: 0 auto 1.25rem; background: var(--card); border: 1px solid var(--line); padding: .75rem 1rem 1rem; }
.invoices-list[hidden] { display: none; }
.invoices-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.invoices-table th { text-align: left; font: 600 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .3rem .5rem .3rem 0; border-bottom: 1px solid var(--fg); }
.invoices-table td { padding: .4rem .5rem .4rem 0; border-bottom: 1px solid var(--line); }
.invoices-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.invoices-table a { font-family: var(--mono); }
.invoices-detail { margin-top: 1rem; max-width: 34rem; }
.home-head .invoices-open { margin: 0 0 0 auto; }
.home-head .invoices-open + .order-open { margin-left: .5rem; }

/* the bar, again (2026-11-20): the box fills the room; the brain, bare and a
   little taller than the bar, sends; the microphone and pictures after it */
.brain .ai-form textarea { flex: 1 1 auto; min-width: 8rem; min-height: 2.35rem; height: 2.35rem; font-size: 1.04rem; padding: .4rem .6rem; }
.brain .ai-controls { margin-left: 0; }
.ai-send { width: auto; height: auto; min-width: 3.4rem; margin: -1.1rem .05rem; padding: 0 .1rem; border: 0; border-radius: 0; background: none; box-shadow: none;
  font-size: 3.4rem; line-height: 1; }
.ai-send:hover:not(:disabled) { box-shadow: none; transform: scale(1.1); }
.ai-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: 4px; }
.ai-send:disabled { filter: grayscale(.85); opacity: .55; }
.brand-mark { height: 1.55em; width: auto; vertical-align: middle; margin: -.2em .05em -.2em -.1em; }
@media (max-width: 760px) {
  .brain .ai-form textarea { flex: 1 1 0; min-height: 3rem; height: 3rem; font-size: 16px; padding: .55rem .7rem; }
  .ai-send { font-size: 3.2rem; min-width: 3.2rem; margin: -.9rem 0; }
}
/* The brain is drawn bigger than the bar, but only its box inside the bar
   takes clicks: the part over the open file mustn't block the page there. */
.ai-send { position: relative; width: 3rem; min-width: 3rem; height: 2.35rem; margin: 0 .1rem; font-size: 0; overflow: visible; }
.ai-send > span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%); font-size: 3.4rem; line-height: 1; pointer-events: none; }
@media (max-width: 760px) { .ai-send { height: 3rem; margin: 0; } .ai-send > span { font-size: 3.2rem; } }
/* A narrow files pane keeps the site's name readable: All sites shows as its icon. */
.side { container-type: inline-size; container-name: side; }
@container side (max-width: 360px) { .all-sites .all-label { display: none; } .bar .all-sites { padding: .35rem .5rem; } }

/* the message box (brain.js): one line in the bar until it's in use, then
   growing upward over the page; the rest of the bar stays as it is */
.ai-input-wrap { position: relative; flex: 1 1 auto; min-width: 8rem; height: 2.35rem; align-self: center; }
.brain .ai-form .ai-input-wrap textarea { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; min-height: 0; margin: 0; box-sizing: border-box;
  resize: none; overflow: hidden; z-index: 2; background: var(--card); max-height: none; }
.ai-input-wrap.expanded textarea { overflow-y: auto !important; box-shadow: 0 -8px 22px rgba(0, 0, 0, .16); }
.ai-input-grip { display: none; position: absolute; left: 0; right: 0; bottom: calc(var(--ta-h, 2.35rem) - 6px); height: 12px; cursor: row-resize; z-index: 3; touch-action: none; }
.ai-input-grip::after { content: ""; position: absolute; left: 50%; top: 4px; width: 2.5rem; height: 3px; margin-left: -1.25rem; background: var(--line); border-radius: 2px; }
.ai-input-grip:hover::after, .resizing-h .ai-input-grip::after { background: var(--accent); }
.ai-input-wrap.expanded .ai-input-grip { display: block; }
.ai-input-peek { display: none; position: absolute; inset: 0; z-index: 3; pointer-events: none; padding: .4rem .6rem; border: 1px solid transparent; box-sizing: border-box;
  font-size: 1.04rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.ai-input-wrap.peeking .ai-input-peek { display: block; }
.ai-input-wrap.peeking textarea { color: transparent; }
/* a note arrived: an arrow drops into the box from above its left end */
.ai-note-arrow { position: absolute; left: .9rem; bottom: 100%; z-index: 4; pointer-events: none; color: var(--accent); }
.ai-note-arrow[hidden] { display: none; }
.ai-note-arrow::before { content: ""; display: block; width: 4px; height: 1.4rem; margin: 0 auto; background: currentColor; border-radius: 2px; }
.ai-note-arrow::after { content: ""; display: block; width: 0; height: 0; margin: -1px auto 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 11px solid currentColor; }
.ai-note-arrow.go { animation: ai-drop 1.2s ease-in forwards; }
@keyframes ai-drop { 0% { transform: translateY(-2.4rem); opacity: 0; } 20% { opacity: 1; } 75% { transform: translateY(.2rem); opacity: 1; } 100% { transform: translateY(.4rem); opacity: 0; } }
.ai-input-wrap.noted textarea { animation: ai-noted 1.3s ease-out; }
@keyframes ai-noted { 0% { box-shadow: 0 0 0 0 var(--accent); } 35% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .ai-note-arrow.go { animation-duration: .01s; } .ai-input-wrap.noted textarea { animation: none; } }
@media (max-width: 760px) {
  .ai-input-wrap { height: 3rem; flex: 1 1 0; }
  .ai-input-peek { font-size: 16px; padding: .55rem .7rem; }
}

/* the files pane's toggle and All sites: the same chunky outline icons */
.bar .side-btn, #files-open.side-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; height: 2.25rem; min-width: 2.4rem;
  padding: 0 .45rem; border: 1px solid var(--line); background: var(--card); color: var(--fg); font-size: .82rem; line-height: 1; flex: none; }
.side-btn svg { width: 20px; height: 20px; flex: none; }
.bar .side-btn:hover, #files-open.side-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.bar .all-sites[hidden] { display: none; }
#files-open.side-btn { display: none; margin: 0 .25rem .3rem 0; }
.files-hidden #files-open.side-btn { display: inline-flex; }
@media (max-width: 760px) { #files-open.side-btn { display: inline-flex; } }

/* the files pane (hud.js): History across the top, Undo and Redo at the ends
   of its header; the breadcrumbs with a fat + for adding */
.hist { margin: 0 0 .6rem; border: 1px solid var(--line); background: var(--card); }
.hist-head { display: flex; align-items: stretch; }
.hist-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; min-height: 2.3rem; padding: 0; border: 0;
  background: none; color: var(--fg); cursor: pointer; }
.hist-btn:hover:not(:disabled) { background: var(--hover); color: var(--accent); }
.hist-btn:disabled { color: var(--muted); opacity: .4; cursor: default; }
.hist-btn[hidden] { display: none; }
.hist-undo { border-right: 1px solid var(--line); }
.hist-redo { border-left: 1px solid var(--line); }
.hist-head .history-toggle { flex: 1; border: 0; background: none; font: 600 .82rem/1 var(--mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); display: flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; }
.hist-head .history-toggle::after { content: "\25BE"; font-size: .8rem; transition: transform .15s; }
.hist.open .history-toggle::after { transform: rotate(180deg); }
.hist-head .history-toggle:hover { color: var(--fg); background: var(--hover); }
.hist-body { border-top: 1px solid var(--line); padding: .4rem .7rem .6rem; max-height: 40vh; overflow-y: auto; }
.hist-body[hidden] { display: none; }
.hist-body .history { margin: 0; border: 0; padding: 0; }
.crumbs-row { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; }
.crumbs-row .crumbs { flex: 1; margin: 0; border-left: 1px solid var(--line); }
.crumbs .crumb-home svg { width: 20px; height: 20px; }
.add-menu { position: relative; flex: none; }
.add-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 0;
  background: var(--accent); color: var(--accent-fg); background-image: var(--grit); cursor: pointer; }
.add-btn:hover, .add-btn.on { filter: brightness(1.1); }
.add-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.add-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 12rem; display: flex; flex-direction: column; padding: .3rem;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
.add-pop[hidden] { display: none; }
.add-pop .add-item { text-align: left; border: 0; background: none; padding: .5rem .7rem; font-size: .88rem; }
.add-pop .add-item:hover, .add-pop .add-item:focus-visible { background: var(--hover); }

/* the brain bar: everything the bar's height; the chat toggle a bare speech bubble */
.ai-controls #ai-model { height: 2.35rem; box-sizing: border-box; }
.ai-controls #ai-model { padding: 0 .4rem; font-size: .9rem; }
.ai-controls .ai-spend-slot { height: 2.35rem; width: auto; box-sizing: border-box; }
.ai-chat-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.35rem; padding: 0; border: 0;
  background: none; color: var(--muted); cursor: pointer; transition: color .12s, transform .12s; }
.ai-chat-btn svg { width: 32px; height: 32px; }
.ai-chat-btn:hover { color: var(--fg); transform: scale(1.08); }
.ai-chat-btn[aria-expanded="true"] { color: var(--accent); }
.ai-chat-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: 4px; }
@media (max-width: 760px) {
  .ai-controls #ai-model, .ai-controls .ai-spend-slot, .ai-chat-btn { height: 2.75rem; }
}

/* The shell is the window: nothing scrolls the page itself (the panes scroll
   inside), and the brain, drawn above the bar, may overlap the open file. */
html, body { height: 100%; overflow: hidden; }
@supports (height: 100dvh) { html, body { height: 100dvh; } }
/* The Admin page is a document, not the window: it scrolls (a wheel, a
   swipe on a phone), with its header and tabs sticky at the top. */
html.admin-html, html.admin-html body.admin-page { height: auto; min-height: 100%; overflow: visible; }
/* Buttons keep to one line and their own height: a label that wraps
   ("7 days" in two lines) or a flex row's stretch made them tall. */
body.admin-page button, body.admin-page a.tool { white-space: nowrap; align-self: flex-start; }
body.admin-page .admin-form button, body.admin-page .admin-inline button, body.admin-page .ap-tabs button { align-self: center; }
body.admin-page .admin-table .actions { align-items: flex-start; }
body.admin-page .admin-table td select { padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); font-size: .82rem; }
.ai-send > span { transform: translate(-50%, -50%); }
/* A note arrived: the brain jumps. */
.ai-send.jump > span { animation: ai-jump .9s ease-out; }
@keyframes ai-jump { 0%, 100% { transform: translate(-50%, -50%); } 18% { transform: translate(-50%, -86%); } 36% { transform: translate(-50%, -46%); }
  52% { transform: translate(-50%, -70%); } 68% { transform: translate(-50%, -48%); } 82% { transform: translate(-50%, -56%); } }
@media (prefers-reduced-motion: reduce) { .ai-send.jump > span { animation: none; } }

/* onboarding (tips.js): a tip pointing at part of the shell, with the arrow */
.tip { position: fixed; z-index: 60; max-width: min(22rem, calc(100vw - 20px)); padding: .8rem .95rem .65rem; background: var(--fg); color: var(--bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28); font-size: .9rem; line-height: 1.45; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.tip.in { opacity: 1; transform: none; }
.tip-text { margin: 0 0 .6rem; }
.tip-row { display: flex; justify-content: flex-end; gap: .5rem; }
.tip-ok, .tip-skip { border: 0; padding: .35rem .8rem; font: 600 .82rem/1 system-ui, sans-serif; cursor: pointer; }
.tip-ok { background: var(--accent); color: var(--accent-fg); }
.tip-skip { background: none; color: inherit; opacity: .7; }
.tip-skip:hover { opacity: 1; }
.tip-skip[hidden] { display: none; }
.tip-arrow { position: fixed; z-index: 61; pointer-events: none; color: var(--accent); width: 18px; margin-left: -9px; }
.tip-arrow::before { content: ""; display: block; width: 4px; height: 1.3rem; margin: 0 auto; background: currentColor; border-radius: 2px; }
.tip-arrow::after { content: ""; display: block; width: 0; height: 0; margin: -1px auto 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 11px solid currentColor; }
.tip-arrow-above { transform: translateY(-100%); animation: tip-bob-down 1.2s ease-in-out infinite; }
.tip-arrow-below { transform: rotate(180deg); transform-origin: 50% 0; animation: tip-bob-up 1.2s ease-in-out infinite; }
.tip-arrow-right { transform: rotate(90deg); transform-origin: 50% 0; animation: tip-bob-left 1.2s ease-in-out infinite; }
@keyframes tip-bob-down { 0%, 100% { transform: translateY(-100%); } 50% { transform: translateY(calc(-100% + 6px)); } }
@keyframes tip-bob-up { 0%, 100% { transform: rotate(180deg); } 50% { transform: rotate(180deg) translateY(6px); } }
@keyframes tip-bob-left { 0%, 100% { transform: rotate(90deg); } 50% { transform: rotate(90deg) translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .tip-arrow { animation: none !important; } .tip { transition: none; } }

/* a template's tools (tips.js): "Getting started" in the files pane */
.tpl-tools { margin: 0 0 .6rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--card); }
.tpl-head { width: 100%; display: flex; align-items: baseline; gap: .5rem; padding: .55rem .7rem; border: 0; background: none; color: var(--fg); cursor: pointer; text-align: left; }
.tpl-head::after { content: "\25BE"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.tpl-tools.open .tpl-head::after { transform: rotate(180deg); }
.tpl-title { font: 600 .82rem/1 var(--mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .06em; }
.tpl-name { font-size: .8rem; color: var(--muted); }
.tpl-list { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 .7rem .7rem; }
.tpl-list[hidden] { display: none; }
.tpl-tool { border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: .35rem .65rem; font-size: .82rem; border-radius: 99px; cursor: pointer; }
.tpl-tool:hover { border-color: var(--accent); color: var(--accent); }

/* 2026-11-20, tidier: */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the chat drawer: as wide as the chat, opening above its speech bubble */
.ai-drawer { left: auto; right: .6rem; width: min(46rem, calc(100% - 1.2rem)); border: 1px solid var(--line); border-bottom: 0; }
.ai-drawer .ai-log { max-width: none; }

/* the tab strip: the files pane header's height and line */
.address { align-items: center; padding: .75rem .6rem; gap: .35rem; }
.tabs { margin-bottom: 0; align-items: center; }
.ftab { height: 2.25rem; box-sizing: border-box; padding: 0 .4rem 0 .7rem; border: 1px solid var(--line); background: var(--bg); }
.ftab.on { background: var(--card); border-color: var(--line); box-shadow: inset 0 -2px 0 var(--accent); }
#tab-new { display: inline-flex; align-items: center; justify-content: center; height: 2.25rem; min-width: 2.25rem; margin: 0; padding: 0 .5rem;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); font-size: 1.2rem; line-height: 1; }
#files-open.side-btn { margin: 0; }
#address-open { display: none !important; }

/* the preview's buttons: its path first, then Edit, open, discard, save */
.te-preview-tools #address-text { display: inline-flex; align-items: center; height: 34px; max-width: min(26rem, 50vw); padding: 0 .6rem; box-sizing: border-box;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); font: .8rem/1 var(--mono, ui-monospace, monospace);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); align-self: center; }
.te-preview-tools #address-text:empty { display: none; }
.te-edit { background: var(--card); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); display: inline-flex; align-items: center; justify-content: center; }
.te-edit:hover { border-color: var(--accent); color: var(--accent); }
@media (pointer: coarse) { .te-preview-tools #address-text { height: 42px; } }

/* breadcrumbs: plain, the house in the text's colour, / between; the + to match */
.crumbs, .crumbs-row .crumbs { background: var(--card); border: 1px solid var(--line); min-height: 2.25rem; box-sizing: border-box; padding: .15rem .4rem; }
.crumbs a, .crumbs .crumb, .crumbs .crumb-home, .crumbs .crumb-home.here { color: var(--fg); }
.crumbs a:hover { color: var(--accent); background: var(--hover); }
.crumbs .sep { color: var(--muted); font-size: .95rem; margin: 0 .1rem; }
.add-btn { width: 2.25rem; height: 2.25rem; background: var(--card); background-image: none; color: var(--fg); border: 1px solid var(--line); }
.add-btn svg { width: 18px; height: 18px; }
.add-btn:hover, .add-btn.on { filter: none; border-color: var(--accent); color: var(--accent); }

/* file rows: Edit and Delete as icons */
button.act.icon { display: inline-flex; align-items: center; justify-content: center; width: 1.85rem; height: 1.6rem; padding: 0; }
button.act.icon:hover { color: var(--accent); }
button.act.icon.danger:hover { color: var(--error); border-color: var(--error); }

/* the footer: you (with a menu to sign out), then Feedback and Admin */
.foot { display: flex; flex-direction: column; gap: .45rem; padding: .6rem 1rem .7rem; font-family: inherit; }
.foot-user { position: relative; }
.foot-who { width: 100%; display: flex; align-items: center; gap: .45rem; height: 2.25rem; padding: 0 .55rem; border: 1px solid var(--line); background: var(--card);
  color: var(--fg); cursor: pointer; font: .85rem/1 var(--mono, ui-monospace, monospace); text-align: left; }
.foot-who .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-who:hover, .foot-who[aria-expanded="true"] { border-color: var(--accent); }
.foot-caret { color: var(--muted); transition: transform .15s; }
.foot-who[aria-expanded="true"] .foot-caret { transform: rotate(180deg); }
.foot-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; padding: .3rem;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 -8px 22px rgba(0, 0, 0, .16); }
.foot-pop[hidden] { display: none; }
.foot-item { text-align: left; border: 0; background: none; padding: .5rem .6rem; font-size: .85rem; color: var(--fg); cursor: pointer; }
.foot-item:hover, .foot-item:focus-visible { background: var(--hover); }
.foot-row { display: flex; gap: .45rem; }
.foot-row .foot-btn { flex: 1; height: 2.25rem; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.foot-row .foot-btn:hover { border-color: var(--accent); color: var(--accent); }
.foot-row .foot-btn[hidden] { display: none; }
/* Your sites: the footer sits in the top bar, on one line */
body.home .foot { flex-direction: row; align-items: center; padding: 0; width: auto; }
body.home .foot-user { width: 16rem; }
body.home .foot-pop { bottom: auto; top: calc(100% + 4px); }

/* Your sites: the blocks in one row that scrolls sideways; the head (with
   Order a new site) stays put above it */
.site-cards { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 1.25rem; overflow-x: auto; overscroll-behavior-x: contain;
  max-width: none; margin: 0; padding: .25rem .25rem 1rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
.site-cards > .site-block { flex: 0 0 min(22rem, 85vw); scroll-snap-align: start; }
.home-head { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: .25rem 0 .75rem; margin-bottom: .5rem; max-width: none; }

/* Your account */
.account { max-width: 56rem; margin: 0 auto; }
.account .home-head { max-width: none; }
.account-back { text-decoration: none; }
.account-sec { background: var(--card); border: 1px solid var(--line); padding: 1rem 1.2rem 1.2rem; margin: 0 0 1.25rem; }
.account-sec > .order-h2 { margin-top: 0; }
.billing-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem 1.2rem; }
.billing-field { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; }
.billing-field > span { font-weight: 600; }
.billing-field input, .billing-field textarea { padding: .5rem .6rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; border-radius: 0; }
.billing-field textarea { resize: vertical; }
.billing-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.billing-actions .primary { margin: 0; }
.account .invoices-detail { margin-top: 1rem; max-width: 34rem; }
/* Two-step sign-in (order.js mfa) */
.account-mfa > p { margin: 0 0 .7rem; max-width: 42rem; }
.mfa-steps { padding-left: 1.3rem; margin: 0 0 .8rem; max-width: 42rem; }
.mfa-steps > li { margin: 0 0 .9rem; }
.mfa-qr { display: block; width: 200px; height: 200px; margin: .5rem 0; image-rendering: pixelated; background: #fff; border: 1px solid var(--line); }
.mfa-key { font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace); letter-spacing: .04em; overflow-wrap: anywhere; }
.mfa-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin: .5rem 0; }
.mfa-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; font-weight: 600; }
.mfa-form input { width: 13rem; padding: .5rem .6rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 1rem var(--mono, ui-monospace, Menlo, Consolas, monospace); letter-spacing: .08em; border-radius: 0; }
.mfa-form button { align-self: flex-end; height: 2.4rem; padding: 0 1rem; border: 1px solid var(--fg); background: var(--fg); color: var(--bg); cursor: pointer; font: inherit; font-size: .88rem; white-space: nowrap; }
.mfa-form button:disabled { opacity: .5; cursor: default; }
.mfa-codes { display: inline-block; columns: 2; column-gap: 2.5rem; margin: 0 0 .8rem; padding: .7rem 1rem; font: .95rem/1.7 var(--mono, ui-monospace, Menlo, Consolas, monospace); background: var(--bg); border: 1px solid var(--line); }

/* Getting started (tips.js): the ? at the right of the tab bar; open, it drops down over the preview */
.gs-btn { display: inline-flex; align-items: center; justify-content: center; height: 2.25rem; min-width: 2.25rem; padding: 0 .4rem; box-sizing: border-box;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; position: relative; }
.bar-tools .gs-btn { order: 2; }
.gs-btn:hover, .gs-btn[aria-expanded=true] { border-color: var(--accent); color: var(--accent); }
.gs-btn[aria-expanded=true] { box-shadow: inset 0 -2px 0 var(--accent); }
.gs-count { position: absolute; top: -.35rem; right: -.35rem; min-width: 1rem; height: 1rem; padding: 0 .2rem; box-sizing: border-box; border-radius: .5rem;
  background: var(--accent); color: var(--accent-fg); font: 700 .62rem/1rem system-ui, sans-serif; text-align: center; }
.gs-count:empty { display: none; }
.tpl-tools { position: fixed; z-index: 40; width: min(30rem, calc(100vw - 1rem)); max-height: calc(100vh - 9rem); overflow: auto; margin: 0;
  border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--card); box-shadow: 0 12px 34px rgba(0, 0, 0, .2); }
.tpl-tools[hidden] { display: none; }
.tpl-head { display: flex; align-items: center; gap: .6rem; width: auto; padding: .65rem .5rem .5rem .9rem; cursor: default; }
.tpl-head::after { content: none; }
.tpl-title { font-size: .9rem; }
.tpl-name { flex: 1; font-size: .8rem; color: var(--muted); }
.tpl-x { flex: none; width: 2rem; height: 2rem; border: 0; background: none; color: var(--muted); font-size: 1rem; cursor: pointer; }
.tpl-x:hover { color: var(--fg); background: var(--hover); }
.tpl-list { list-style: none; margin: 0; padding: 0 .9rem .5rem; display: flex; flex-direction: column; gap: .35rem; }
.tpl-tool { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%; padding: .5rem .7rem; text-align: left; font-size: .88rem;
  border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); cursor: pointer; }
.tpl-tool:hover { border-color: var(--accent); color: var(--fg); }
.tpl-tool .tpl-why { font-size: .76rem; color: var(--muted); font-weight: 400; }
.tpl-done { list-style: none; margin: 0; padding: .1rem .9rem .8rem; font-size: .8rem; color: var(--muted); }
.tpl-done li { padding: .1rem 0; text-decoration: line-through; }
.tpl-done li::before { content: "\2713  "; text-decoration: none; color: var(--science, var(--accent)); }
.tpl-foot { margin: 0; padding: 0 .9rem .8rem; font-size: .74rem; color: var(--muted); }
body.home .tpl-tools { display: none; }

/* the preview's buttons, at the right of the tab bar (off the preview); the tabs take the rest and scroll */
.bar-tools { display: flex; align-items: center; gap: .35rem; margin-left: auto; flex: none; position: relative; }
.bar-tools:empty { display: none; }
.address .tabs { flex: 0 1 auto; min-width: 0; overflow-x: auto; }
.address #tab-new { flex: none; }
.bar-tools .te-preview-tools { position: relative; flex-wrap: nowrap; max-width: none; gap: .35rem; }
.bar-tools .te-preview-tools button { height: 2.25rem; min-width: 2.25rem; box-shadow: none; }
.bar-tools .te-preview-tools #address-text { height: 2.25rem; max-width: min(16rem, 24vw); box-shadow: none; }
.bar-tools .te-note { position: absolute; z-index: 41; top: calc(100% + 6px); right: 0; width: min(24rem, 90vw); margin: 0; }
@media (max-width: 700px) { .bar-tools .te-preview-tools #address-text { display: none; } }

/* the style editor, condensed: a little bigger than a browser's developer tools */
.style-view { padding: .3rem .45rem 1.5rem; font-size: 12.5px; }
.style-head { padding: .3rem 0; gap: .3rem; }
.style-search { padding: .25rem .45rem; font-size: 12.5px; }
.style-rule { margin: .15rem 0; }
.style-rule > summary { padding: .18rem .4rem; gap: .35rem; }
.style-rule > summary::before { font-size: 10px; width: .6rem; }
.style-sel, .style-sel-input { font-size: 12.5px; }
.style-sel-input { padding: .05rem .3rem; }
.style-act { font-size: 11px; padding: 0 .3rem; }
.style-body { padding: .05rem .4rem .3rem 1.2rem; gap: 0; }
.style-body > .style-rule { margin: .1rem 0; }
.style-decl { gap: .2rem; }
.style-decl input[type=text] { font-size: 12.5px; padding: .05rem .3rem; line-height: 1.35; }
.style-prop { flex-basis: 9rem; }
.style-color { width: 1.1rem; height: 1rem; }
.style-dot { width: .55rem; height: .55rem; }
.style-new { margin-top: .1rem; padding-top: .15rem; }
.style-view .tool, .style-view button.small-btn { font-size: 11.5px; padding: .15rem .45rem; }

/* Your sites: the row fills the window down to its bottom, where its scrollbar
   stays; the blocks scroll up and down inside it, the head stays above */
.home.dash { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.home.dash > * { flex: none; }
.home.dash > .home-head { position: static; }
.home.dash > .site-cards { order: 10; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: .5rem; margin: 0 calc(-1 * clamp(1rem, 4vw, 3rem)); padding-left: clamp(1rem, 4vw, 3rem); padding-right: clamp(1rem, 4vw, 3rem); scroll-padding-left: clamp(1rem, 4vw, 3rem); }
/* scrollbars in the site's look: square, quiet, the accent when held */
.site-cards, .tabs, .home, .style-view, .ai-log { scrollbar-width: auto; scrollbar-color: var(--muted) var(--hover); }
.tabs { scrollbar-width: thin; }

/* index.html shown by name (hud.js); the editor's buttons in the preview's style */
.ed-tools { display: inline-flex; align-items: center; gap: .35rem; flex: none; margin-left: auto; }
.ed-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; height: 2.25rem; min-width: 2.25rem; padding: 0 .5rem; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--fg); cursor: pointer; font: 600 .8rem/1 system-ui, sans-serif; }
.ed-btn:hover:not(:disabled), .ed-btn[aria-expanded=true] { border-color: var(--accent); color: var(--accent); }
.ed-btn[hidden] { display: none; }
.ed-save { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.ed-save:hover:not(:disabled) { color: var(--accent-fg); filter: brightness(1.08); }
.ed-save:disabled { background: var(--card); color: var(--muted); border-color: var(--line); opacity: .75; cursor: default; }
.editor-bar { gap: .35rem; padding: .35rem .5rem; }
.editor-status { flex: 1 1 auto; }
.ed-mode { display: inline-flex; height: 2.25rem; padding: 0; border: 1px solid var(--line); background: var(--card); cursor: pointer; font: 600 .74rem/1 var(--mono, ui-monospace, monospace); }
.ed-mode[hidden] { display: none; }
.ed-mode span { display: inline-flex; align-items: center; padding: 0 .6rem; color: var(--muted); }
.ed-mode .ed-mode-css, .ed-mode.is-text .ed-mode-text { background: var(--fg); color: var(--card); }
.ed-mode.is-text .ed-mode-css { background: none; color: var(--muted); }
.ed-mode:hover { border-color: var(--accent); }
.bar-tools .te-preview-tools .te-ref, .bar-tools .te-preview-tools .te-hist { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.bar-tools .te-preview-tools .te-ref:hover, .bar-tools .te-preview-tools .te-hist:hover, .bar-tools .te-preview-tools .te-hist[aria-expanded=true] { border-color: var(--accent); color: var(--accent); }
.bar-tools .te-preview-tools button[hidden] { display: none; }

/* popovers under a button: a page's History, a Reference note */
.versions-pop, .ref-pop { position: fixed; z-index: 45; width: min(26rem, calc(100vw - 1rem)); max-height: min(28rem, calc(100vh - 8rem)); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); box-shadow: 0 12px 34px rgba(0, 0, 0, .2); padding: .6rem .8rem .8rem; }
.versions-head, .ref-head { margin: 0 0 .5rem; font: 600 .8rem/1.3 var(--mono, ui-monospace, monospace); overflow-wrap: anywhere; }
.ref-text { width: 100%; box-sizing: border-box; font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); resize: vertical; }
.ref-text:focus { outline: none; border-color: var(--accent); }
.ref-row { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .5rem; }
/* the ask panel (brain.js, flffBrain.pop): a Reference, a Getting started item */
.ask-pop .ref-row { flex-wrap: wrap; align-items: center; }
.ask-pop .ref-row button { white-space: nowrap; }
.ask-hint { margin: -.15rem 0 .45rem; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.ask-now { display: inline-flex; align-items: center; gap: .35rem; }
.ask-now-icon { width: 1.3rem; height: auto; vertical-align: -.25rem; }
body.home:has(#home.dash) { padding-bottom: 0; }
.home.dash > .home-head { width: 100%; max-width: none; margin-left: 0; margin-right: 0; box-sizing: border-box; }

/* Plans on Your account (order.js), and a paused site (dunning.go). */
.account-plans { display: flex; flex-direction: column; gap: .5rem; }
.plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem .85rem; border: 1px solid var(--line); background: var(--card); }
.plan-main { flex: 1 1 18rem; min-width: 0; }
.plan-state { margin: .2rem 0 0; color: var(--muted); }
.plan-past_due { border-left: 4px solid #f59e0b; }
.plan-grace { border-left: 4px solid var(--error); }
.plan-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.plan-actions button { box-sizing: border-box; height: 34px; min-height: 0; line-height: 1; padding: 0 .8rem; border: 1px solid var(--line); background: none; color: var(--fg); cursor: pointer; font: inherit; font-size: .85rem; }
.plan-actions button.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.plan-actions button:disabled { opacity: .5; cursor: default; }
.plan-row > p[role=status] { flex-basis: 100%; margin: 0; }
.plan-row > p[role=status]:empty { display: none; }
.notice.paused { margin: 0 0 .9rem; padding: .55rem .75rem; font-size: .85rem; border: 1px solid var(--error); border-left: 4px solid var(--error); background: var(--card); color: var(--fg); }
.sc-badge.paused { color: var(--error); border-color: var(--error); }

/* Payment methods (order.js) and the Collaborators add-on (collab.js). */
.account-methods { display: flex; flex-direction: column; gap: .5rem; }
.account-methods > p { margin: 0; }
.pm-actions { margin-top: .25rem; }
.collab-addon { border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: .55rem .7rem; margin: .5rem 0; background: var(--card); }
.collab-addon p { margin: 0 0 .4rem; }

/* Reporting one brain reply (brain.js): a faint flag under it, clearer on
   hover or focus; always shown on touch screens. */
.ai-report { display: block; margin: .15rem 0 0 auto; padding: 0 .3rem; border: 0; background: none; color: var(--muted);
  font-size: .8rem; line-height: 1.4; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ai-msg.brain:hover .ai-report, .ai-report:focus-visible, .ai-report[aria-expanded=true], .ai-report.sent { opacity: 1; }
.ai-report:hover { color: var(--accent); }
.ai-report.sent { color: var(--accent); }
@media (hover: none) { .ai-report { opacity: .7; } }
.ai-report-form { margin-top: .4rem; padding: .5rem; border: 1px solid var(--line); display: flex; flex-direction: column; gap: .4rem; white-space: normal; }
.ai-report-form textarea { font: inherit; font-size: .85rem; width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--line); padding: .35rem; background: inherit; color: inherit; }
.ai-report-form label { display: flex; gap: .4rem; align-items: flex-start; color: var(--muted); }
.ai-report-row { display: flex; gap: .4rem; justify-content: flex-end; }
.ai-report-done { margin: 0; color: var(--muted); }
.ai-report-row .go { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
/* Admin → Feedback: a report's attached brain conversation. */
.fb-convo-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .3rem 0; }
.fb-convo { flex-basis: 100%; max-height: 28rem; overflow: auto; border: 1px solid var(--line); padding: .5rem; font-size: .8rem; display: flex; flex-direction: column; gap: .3rem; }
.fb-convo[hidden] { display: none; }
.fb-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-line.note, .fb-line.result { color: var(--muted); }
.fb-line.tool, .fb-line.result { font-family: var(--mono); font-size: .72rem; }

/* Your sites: the Catalog and Order links (real routes: /catalog, /checkout). */
.home-actions { display: flex; gap: .5rem; align-items: center; }
a.primary { display: inline-block; background: var(--accent); color: var(--accent-fg); padding: .65rem 1.2rem; font-weight: 600; background-image: var(--grit); }
a.primary:hover { text-decoration: none; filter: brightness(1.05); }

/* Scheduled tasks (brain.js, Business backend): the clock on a message, its
   form, the list in the chat's head, and a task's run in the stream. */
.ai-sched { display: inline-block; margin-left: .35rem; padding: 0 .2rem; border: 0; background: none; color: var(--muted); cursor: pointer; vertical-align: middle; opacity: 0; transition: opacity .15s; }
.ai-msg.user:hover .ai-sched, .ai-sched:focus-visible, .ai-sched[aria-expanded=true] { opacity: 1; }
.ai-sched:hover { color: var(--accent); }
@media (hover: none) { .ai-sched { opacity: .7; } }
.ai-sched-form { margin-top: .45rem; padding: .5rem; border: 1px solid var(--line); background: var(--card); color: var(--fg); display: flex; flex-direction: column; gap: .4rem; white-space: normal; text-align: left; font-size: .85rem; }
.ai-sched-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.ai-sched-row[hidden] { display: none; }
.ai-sched-row input, .ai-sched-row select { font: inherit; font-size: .85rem; padding: .2rem .35rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.ai-sched-row input[type=text] { flex: 1; min-width: 10rem; }
.ai-sched-days { display: inline-flex; flex-wrap: wrap; gap: .2rem .5rem; }
.ai-sched-days[hidden], .ai-sched-row [hidden] { display: none; }
.ai-sched-days label { display: inline-flex; gap: .15rem; align-items: center; }
.ai-sched-note { margin: 0; color: var(--muted); }
.ai-sched-note.error { color: var(--error); }
.ai-tasks-btn { margin-left: auto; font-size: .8rem; }
.ai-tasks-btn + #ai-drawer-close { margin-left: .3rem; }
.ai-tasks-panel { border-bottom: 1px solid var(--line); padding: .5rem .75rem; max-height: 40vh; overflow: auto; background: var(--card); }
.ai-tasks-panel[hidden] { display: none; }
.ai-perms-list { list-style: none; margin: .4rem 0 0; padding: 0; }
.ai-perm { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.ai-perm-label { flex: 1; }
.ai-perm-mode { max-width: 12rem; }
.ai-perms-sub { margin: .8rem 0 .3rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ai-budget-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .25rem 0; }
.ai-budget-label { flex: 1 1 14rem; }
.ai-budget-input { width: 7rem; }
.ai-budget-actions { margin-top: .5rem; }
.ai-approve-notify { margin-left: auto; }
.ai-tasks-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .3rem; }
.ai-tasks-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.ai-task { padding: .4rem .5rem; border: 1px solid var(--line); }
.ai-task.paused { opacity: .65; }
.ai-task-title { font-weight: 600; }
.ai-task-status { overflow-wrap: anywhere; }
.ai-task-acts { display: flex; gap: .3rem; margin-top: .3rem; flex-wrap: wrap; }
.ai-runs-at { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .3rem; }
.ai-runs-at-label { color: var(--muted); }
.ai-level-select { flex: 1 1 10rem; min-width: 0; max-width: 100%; font: inherit; font-size: .85rem; padding: .15rem .3rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.ai-level-problem { flex-basis: 100%; margin-top: .1rem; }
.ai-links-head, .ai-other-head { margin-top: 1rem; }
.ai-link-cap-label { display: inline-flex; align-items: center; gap: .25rem; }
.ai-link-cap { width: 4.5rem; font: inherit; font-size: .85rem; padding: .1rem .25rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.ai-task-run { font-style: normal; }

/* The brain's level dial (brain.js): 1 to 3 instead of the models' names. */
/* Just the icons, big enough that the two rows fill the bar's height; the
   chosen level in the accent colour, drawn heavier. */
.ai-level { display: inline-grid; grid-template-columns: repeat(2, 1.5rem); grid-template-rows: repeat(2, 1.5rem); gap: .15rem; margin: -.4rem 0; padding: 0; min-width: 0; border: 0; background: none; box-sizing: border-box; align-self: center; }
.ai-lv { position: relative; display: grid; place-items: center; background: none; color: var(--muted); cursor: pointer; border-radius: 5px; }
.ai-lv svg { width: 1.3rem; height: 1.3rem; transition: color .12s, transform .12s; }
.ai-lv input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.ai-lv:hover { color: var(--fg); }
.ai-lv:hover svg { transform: scale(1.08); }
.ai-lv:has(input:checked) { color: var(--accent); }
.ai-lv:has(input:checked) svg { stroke-width: 2.4; }
.ai-lv:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 1; }
.ai-lv.locked { opacity: .55; }
@media (pointer: coarse) { .ai-level { grid-template-columns: repeat(2, 1.55rem); grid-template-rows: repeat(2, 1.55rem); } }
/* Admin → Sites: per-site feature switches (admin.js featureControls) */
.feat-controls { margin-top: .35rem; display: grid; gap: .2rem; }
.feat-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.feat-name { font-weight: 600; } .feat-name.on { color: var(--ok, #127a3a); }

/* The side panel's tabs (data.js): Files, Data, Tasks */
.side-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); padding: 0 .5rem; }
.side-tabs[hidden] { display: none; }
.side-tabs [role=tab] { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: .45rem .3rem; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; }
.side-tabs [role=tab][aria-selected=true] { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.side-tabs [role=tab][hidden] { display: none; }
.side[data-tab=data] #view, .side[data-tab=tasks] #view, .side[data-tab=inbox] #view { display: none; }
.side-pane { flex: 1; min-height: 0; overflow: auto; padding: .5rem .6rem; }
.side-pane[hidden] { display: none; }
.side-pane .pad { padding: .3rem 0; }
.data-head { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .5rem; }
.data-head-row { display: flex; align-items: center; gap: .4rem; }
.data-head-row .data-refresh { margin-left: auto; }
/* ↻ in the Data pane: the header (everything) and each list's summary */
.data-refresh { flex: none; width: 1.6rem; height: 1.6rem; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.data-refresh::before { content: "bb"; font-size: 1rem; line-height: 1; font-weight: 600; }
.data-refresh:hover { color: var(--fg); border-color: var(--line); background: var(--hover); }
.data-refresh:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.data-refresh.busy::before { animation: data-spin .8s linear infinite; }
@keyframes data-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .data-refresh.busy::before { animation: none; opacity: .5; } }
summary .data-refresh { width: 1.4rem; height: 1.4rem; }
summary .data-fold-count + .data-refresh { margin-left: .1rem; }
/* The Data pane (data.js): its admin pages as cards to press, its folds
   (Tables, Recent activity...) as bars, each table or file as a row; all
   with hover, focus and a press, so they read as things to open. */
.data-pages { list-style: none; margin: .1rem 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.data-page-btn { width: 100%; display: flex; align-items: center; gap: .55rem; text-align: left; font: inherit; cursor: pointer; text-transform: capitalize; color: var(--fg);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .65rem; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: border-color .12s, box-shadow .12s, transform .08s, background .12s; }
.data-page-btn::before { content: ''; flex: none; width: 12px; height: 15px; border: 1.5px solid currentColor; border-radius: 2px; opacity: .55;
  background: linear-gradient(currentColor, currentColor) 2px 4px / 6px 1.5px no-repeat, linear-gradient(currentColor, currentColor) 2px 8px / 6px 1.5px no-repeat; }
.data-page-btn::after { content: '\203A'; margin-left: auto; font-size: 1.15rem; line-height: 1; color: var(--muted); transition: transform .12s; }
.data-page-btn:hover { border-color: var(--accent); box-shadow: 0 3px 10px rgba(0,0,0,.08); transform: translateY(-1px); }
.data-page-btn:hover::after { transform: translateX(2px); color: var(--accent); }
.data-page-btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.data-page-btn:focus-visible, .data-fold > summary:focus-visible, .data-table > summary:focus-visible, .csv-table > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.data-page-btn.current { border-color: var(--accent); background: var(--current); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.tool.data-ask, .data-ask { margin: .2rem 0 .7rem; width: 100%; padding: .45rem .6rem; border: 1px dashed var(--accent); border-radius: 8px; color: var(--accent); background: transparent; cursor: pointer; font-weight: 600; }
.tool.data-ask:hover, .data-ask:hover { background: var(--current); border-style: solid; }
.data-sub { margin: .7rem 0 .25rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
.data-tables, .data-activity { list-style: none; margin: 0; padding: 0; }
.data-activity li { padding: .15rem 0; display: flex; flex-wrap: wrap; gap: .2rem; }
/* the folds (data.js fold): a bar with a chevron and a count */
.data-fold { margin: .55rem 0; }
.data-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .45rem; margin: 0; padding: .45rem .6rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--fg); font-weight: 600; transition: background .12s, border-color .12s; user-select: none; }
.data-fold > summary:hover { background: var(--hover); border-color: var(--muted); }
.data-fold[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.data-fold > summary::-webkit-details-marker, .data-table > summary::-webkit-details-marker, .csv-table > summary::-webkit-details-marker { display: none; }
.data-fold > summary::before, .data-table > summary::before, .csv-table > summary::before { content: ''; flex: none; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; opacity: .7; margin-right: .1rem; }
.data-fold[open] > summary::before, .data-table[open] > summary::before, .csv-table[open] > summary::before { transform: rotate(45deg); }
.data-fold > .data-tables, .data-fold > ul, .data-fold > div { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: .3rem; background: var(--card); }
.data-fold-count { text-transform: none; letter-spacing: 0; margin-left: auto; font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
/* each table (and CSV file): a row to open */
.data-table, .csv-table { margin: .1rem 0; }
.data-table > summary, .csv-table > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .45rem; padding: .4rem .5rem; border-radius: 6px; transition: background .12s; }
.data-table > summary:hover, .csv-table > summary:hover { background: var(--hover); }
.data-table[open] > summary, .csv-table[open] > summary { background: var(--current); }
.data-table > summary .data-fold-title { font-weight: 600; font-family: var(--mono, ui-monospace, monospace); font-size: .85rem; }
.data-table > summary .data-fold-count { background: var(--bg); }
.data-fold-count:empty { display: none; }
.data-cols { list-style: none; margin: .15rem 0 .4rem 1.1rem; padding: .25rem 0 .25rem .6rem; border-left: 2px solid var(--line); }
.data-cols li { padding: .1rem 0; }
.data-cols .csv-acts { display: flex; gap: .4rem; padding-top: .35rem; }
.data-col-name { font-family: var(--mono, ui-monospace, monospace); }
.data-activity li.error span:first-child { color: var(--error, #b42318); }
.data-problems { border-left: 3px solid var(--error, #b42318); padding: .3rem .5rem; margin: .4rem 0; }
.data-problems ul { margin: .2rem 0 .4rem; padding-left: 1rem; }
.side-pane .ai-tasks-head { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .4rem; }
.side-pane .ai-tasks-list { list-style: none; margin: 0; padding: 0; }
.side-pane .ai-task { padding: .45rem 0; border-top: 1px solid var(--line); }
/* An admin page, over the preview */
.data-view { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: var(--card); }
.data-view[hidden] { display: none; }
.dv-page { font: inherit; padding: .2rem .4rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.dv-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.panes { position: relative; }

/* The brain popped out (brain.js popOut): a window to drag and resize */
.brain.popped { position: fixed; z-index: 60; resize: both; overflow: hidden; min-width: 300px; min-height: 160px; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.brain.popped .ai-float-head { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem .3rem .7rem; border-bottom: 1px solid var(--line); cursor: move; user-select: none; touch-action: none; background: var(--bg); }
.brain.popped .ai-float-head .muted { flex: 1; }
.ai-float-head[hidden] { display: none; }
.brain.popped .ai-form { flex: 1; min-height: 0; flex-wrap: wrap; align-items: stretch; align-content: flex-start; }
.brain.popped .ai-input-wrap { flex: 1 1 100%; display: flex; min-height: 4rem; height: calc(100% - 6.2rem); }
.brain.popped .ai-form textarea { height: auto; max-height: none; flex: 1; }
.brain.popped .ai-input-grip { display: none; }
.brain.popped .ai-drawer { max-height: 45%; }
.ai-pop[aria-pressed=true] { color: var(--accent); }
/* Admin → Sites: a site's own log (admin.js logControl) */
.site-log { margin-top: .4rem; max-width: 46rem; }
.site-log[hidden] { display: none; }
.site-log-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .3rem; }
.site-log-text { max-height: 22rem; overflow: auto; margin: 0; padding: .5rem .6rem; font: .72rem/1.45 var(--mono, ui-monospace, Menlo, Consolas, monospace); background: var(--bg); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.site-log-text .mark { font-weight: 700; color: var(--accent); }
.site-log-text .err { color: var(--error, #b42318); }
/* Data → Secrets (data.js secretsBox) */
.data-secrets { margin: .4rem 0; }
.secret-row { border-left: 3px solid var(--line); padding: .35rem .5rem; margin: .35rem 0; display: grid; gap: .15rem; }
.secret-row.waiting { border-left-color: var(--accent); }
.secret-name { font: 600 .82rem var(--mono, ui-monospace, Menlo, Consolas, monospace); }
.secret-need { color: var(--accent); font-weight: 600; }
.data-roles { margin: .4rem 0; }
.role-row { border-left: 3px solid var(--line); padding: .35rem .5rem; margin: .45rem 0; display: grid; gap: .25rem; }
.role-row.waiting { border-left-color: var(--accent); }
.role-def { display: grid; gap: .1rem; }
.role-list { margin: 0; padding-left: 1.1rem; }
.role-list li { margin: .1rem 0; }
.role-why { font-style: italic; }
.role-need { color: var(--accent); font-weight: 600; }
.role-acts { display: flex; gap: .35rem; flex-wrap: wrap; }
.collab-roles { margin: .8rem 0 .4rem; }
.role-picks { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .3rem 0; font-size: .85rem; }
.role-pick { display: inline-flex; align-items: center; gap: .25rem; cursor: pointer; }
.collab.with-roles { flex-wrap: wrap; }
.secret-form { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .2rem; }
.secret-input { flex: 1; min-width: 8rem; padding: .3rem .4rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: .8rem var(--mono, ui-monospace, Menlo, Consolas, monospace); }

/* Your work (/work, work.js): people with roles on sites. */
.wk-main { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; padding: 0 1rem 1rem; min-height: calc(100vh - 4.5rem); }
.wk-side { border-right: 1px solid var(--line); padding-right: .8rem; }
.wk-view { display: flex; flex-direction: column; min-height: 70vh; }
.wk-frame { flex: 1; width: 100%; min-height: 70vh; border: 1px solid var(--line); background: #fff; }
.wk-site.current, .wk-side .data-page-btn.current { font-weight: 700; }
@media (max-width: 50rem) { .wk-main { grid-template-columns: 1fr; } .wk-side { border-right: 0; padding-right: 0; } }

/* History: how much space it takes, and freeing some (hud.js historySpace). */
.hist-space { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .4rem; }
.hist-space p { margin: .25rem 0; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.hist-days { font: inherit; font-size: .8rem; }

/* A picture in the file list can be dragged into the page (hud.js fileRow). */
li.file.can-drag { cursor: grab; }
li.file.can-drag:active { cursor: grabbing; }

/* Local models (hud.js localModelsDialog): the how-to, from Your sites. */
.local-dialog { max-width: 38rem; width: calc(100% - 2rem); max-height: calc(100vh - 2rem); overflow: auto; border: 1px solid var(--line); padding: 0 1.4rem 1.2rem; background: var(--bg); color: var(--fg); }
/* fluffrl's state, a bar across the top like the shell's header bars: green connected (serving), teal connected without a model, amber not connected or out of date, grey checking. */
.local-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: .6rem; margin: 0 -1.4rem 1rem; padding: .75rem 1.4rem; min-height: 2.25rem;
  border-bottom: 1px solid var(--line); font-weight: 600; background: linear-gradient(var(--hover), var(--hover)), var(--bg); color: var(--fg); }
.local-dot { flex: none; width: .7rem; height: .7rem; border-radius: 50%; background: var(--muted, #888); }
.local-bar.ok { background: linear-gradient(rgba(21, 128, 61, .14), rgba(21, 128, 61, .14)), var(--bg); border-bottom-color: rgba(21, 128, 61, .45); }
.local-bar.ok .local-dot { background: #15803d; }
.local-bar.ready { background: linear-gradient(rgba(13, 148, 136, .13), rgba(13, 148, 136, .13)), var(--bg); border-bottom-color: rgba(13, 148, 136, .45); }
.local-bar.ready .local-dot { background: #0d9488; }
.local-bar.off, .local-bar.old { background: linear-gradient(rgba(217, 119, 6, .15), rgba(217, 119, 6, .15)), var(--bg); border-bottom-color: rgba(217, 119, 6, .5); }
.local-bar.off .local-dot, .local-bar.old .local-dot { background: #d97706; }
.local-bar.checking .local-dot { animation: local-pulse 1.2s ease-in-out infinite; }
@keyframes local-pulse { 50% { opacity: .3; } }
.local-lead { line-height: 1.55; }
.local-guide { margin: 1rem 0 .5rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.local-guide > summary { cursor: pointer; font-weight: 650; padding: .3rem 0; }
.local-guide-body h3 { font-size: 1rem; margin: 1.1rem 0 .35rem; }
.local-guide-body ol, .local-guide-body ul { padding-left: 1.2rem; }
.local-guide-body li { margin: .3rem 0; }
.local-guide-body blockquote { margin: .5rem 0; padding: .5rem .8rem; border-left: 3px solid var(--line); background: var(--hover); font-style: italic; }
.local-guide-body code { font-size: .85em; }
.local-table { border-collapse: collapse; width: 100%; font-size: .9rem; margin: .4rem 0; }
.local-table th, .local-table td { text-align: left; padding: .3rem .45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.local-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.local-dialog h2 { margin: 0 0 .5rem; }
.local-steps { padding-left: 1.2rem; }
.local-steps li { margin: .5rem 0; }
.local-steps code { font-size: .85em; }
.local-status.ok { color: var(--science, #127a3a); font-weight: 600; }
.local-info { margin: .2rem 0 .6rem; padding-left: 1.1rem; }
.local-info li { margin: .15rem 0; }
.ai-local-pick { font: inherit; font-size: .78rem; max-width: 10rem; margin-left: .3rem; }

/* the send-to-the-brain button beside Save (textedit.js) */
.te-tobrain { background: var(--card); color: var(--fg); border: 1px solid var(--accent); }
.te-tobrain[hidden] { display: none; }
/* a small centered popup (brain.js, flffPopup): prompting locked, a prompt's error, unsaved edits */
.flff-popup { position: fixed; z-index: 60; left: 50%; top: 22%; transform: translateX(-50%); width: min(25rem, calc(100vw - 1rem));
  background: var(--card); color: var(--fg); border: 1px solid var(--line); border-top: 3px solid var(--accent); box-shadow: 0 16px 44px rgba(0, 0, 0, .28);
  padding: .7rem .85rem .8rem; font-size: .9rem; }
.flff-popup.error { border-top-color: var(--error); }
.flff-popup-head { margin: 0 1.6rem .4rem 0; font-weight: 600; }
.flff-popup.error .flff-popup-head { color: var(--error); }
.flff-popup-text { margin: 0 0 .3rem; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
.flff-popup-x { position: absolute; top: .35rem; right: .4rem; width: 1.8rem; height: 1.8rem; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.flff-popup-x:hover, .flff-popup-x:focus { color: var(--fg); }
.flff-popup .ref-row { flex-wrap: wrap; }

/* À la carte (hud.js aLaCarte): the recipes from the catalog, a mockup */
.carte-dialog { max-width: 52rem; width: calc(100% - 2rem); max-height: calc(100vh - 3rem); border: 1px solid var(--line); padding: 1.2rem 1.4rem; background: var(--bg); color: var(--fg); }
.carte-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.carte-dialog h2 { margin: 0 0 .4rem; }
.carte-intro { margin: 0 0 .8rem; color: var(--muted); }
.carte-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.carte-chip { border: 1px solid var(--line); background: var(--card); color: var(--fg); padding: .3rem .7rem; cursor: pointer; font: inherit; font-size: .85rem; }
.carte-chip.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.carte-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .7rem; }
.carte-card { border: 1px solid var(--line); background: var(--card); padding: .75rem .85rem; display: flex; flex-direction: column; gap: .35rem; }
.carte-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.carte-top h3 { margin: 0; font-size: 1rem; }
.carte-status { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: .1rem .4rem; border: 1px solid var(--line); white-space: nowrap; color: var(--muted); }
.carte-status.available { color: var(--accent); border-color: var(--accent); }
.carte-summary { margin: 0; font-size: .88rem; line-height: 1.4; }
.carte-pitch { margin: 0; }
.carte-meta { margin: 0; display: flex; flex-wrap: wrap; gap: .25rem .7rem; color: var(--muted); }
.carte-add { margin-top: auto; display: flex; gap: .4rem; align-items: center; padding-top: .3rem; }
.carte-site { flex: 1; min-width: 0; font: inherit; padding: .3rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.carte-levels { margin: 0; display: grid; gap: .1rem; }
.carte-levels dt { font-weight: 600; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-top: .25rem; }
.carte-levels dd { margin: 0; line-height: 1.4; }
.hist-big { list-style: none; margin: .2rem 0 .4rem; padding: 0; }
.hist-big li { margin: .2rem 0; overflow-wrap: anywhere; }
.local-download { font-weight: 650; }
#local-download-meta { overflow-wrap: anywhere; }
.hw-list { display: grid; gap: .6rem; margin: .6rem 0; }
.hw-card { border: 1px solid var(--line); padding: .6rem .8rem; }
.hw-card.on { border-left: 3px solid #15803d; }
.hw-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.hw-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #9ca3af; align-self: center; }
.hw-dot.on { background: #15803d; }
.hw-sites { border: 0; margin: .3rem 0 0; padding: 0; }
.hw-sites legend { padding: 0; margin-bottom: .15rem; }
.hw-sites-fold { margin-top: .3rem; }
.hw-sites-fold > summary { cursor: pointer; font-size: .9rem; }
.hw-site { display: inline-block; margin: .1rem .9rem .1rem 0; }
.hw-actions { display: flex; gap: .5rem; margin-top: .4rem; }
.hw-remove { color: #b42318; }
.hw-pair { border: 1px dashed var(--line); padding: .5rem .8rem; margin: .5rem 0; }
.hw-redeem { margin: .6rem 0; }
.hw-redeem summary { cursor: pointer; }
.hw-redeem input { font-family: var(--mono, monospace); min-width: 14em; }
.hw-waiting { margin: .3rem 0 0 1rem; padding: 0; }
.hw-code { font: 650 1.3rem ui-monospace, monospace; letter-spacing: .12em; }
.hw-pair code, .hw-pane code { overflow-wrap: anywhere; }
.hw-get { margin: 1.2rem 0 .4rem; font-size: 1.05rem; }
.hw-tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: .6rem; }
.hw-tab { font: inherit; padding: .4rem .8rem; border: 1px solid transparent; border-bottom: 0; background: none; color: inherit; cursor: pointer; margin-bottom: -1px; }
.hw-tab[aria-selected="true"] { border-color: var(--line); background: var(--bg); font-weight: 650; }
.hw-builds { padding-left: 1.2rem; }
.hw-builds li { margin: .25rem 0; overflow-wrap: anywhere; }
/* À la carte: recipes on their way (recipe_jobs.go). */
.carte-jobs { list-style: none; margin: .4rem 0 .8rem; padding: 0; display: grid; gap: .3rem; }
.carte-job { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .4rem .6rem; border: 1px solid var(--line); }
.carte-job.done { border-left: 3px solid #15803d; } .carte-job.failed { border-left: 3px solid var(--error); }
.carte-job .carte-summary-line { flex-basis: 100%; margin: .1rem 0 0; color: var(--muted); }
.carte-mark { font-weight: 700; } .carte-job.done .carte-mark { color: #15803d; } .carte-job.failed .carte-mark { color: var(--error); }
.carte-spin { display: inline-block; width: .9rem; height: .9rem; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: carte-spin .8s linear infinite; vertical-align: middle; }
@keyframes carte-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .carte-spin { animation-duration: 3s; } }
.carte-add { flex-wrap: wrap; }
.carte-confirm { flex: 1 1 100%; margin-top: .4rem; }
.carte-estimate { margin: 0 0 .3rem; }
.carte-busy { border-color: var(--accent); }

/* Handing a site over, offers, invites (pro.go). */
.handover { margin-top: .8rem; } .handover > summary { cursor: pointer; }
.handover-body { display: grid; gap: .4rem; margin-top: .4rem; max-width: 28rem; }
.transfer-offers { display: grid; gap: .5rem; margin: .6rem 0; }
.transfer-offer { border: 1px solid var(--accent); padding: .6rem .8rem; }
.transfer-offer p { margin: 0 0 .4rem; }
.invite-link { width: 100%; max-width: 30rem; font: .85rem var(--mono, ui-monospace, monospace); }
.invite-send { display: grid; gap: .4rem; max-width: 30rem; margin: .6rem 0; }

.handover-pay { border: 0; padding: 0; margin: 0; display: grid; gap: .2rem; }
.transfer-billing { display: grid; gap: .3rem; max-width: 26rem; margin: .4rem 0; }
/* The computer square's menu: the local models, or where to get one. */
.ai-local-menu { position: fixed; z-index: 60; min-width: 12rem; max-width: 18rem; padding: .35rem; border: 1px solid var(--line); background: var(--card); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.ai-local-head { margin: .1rem .3rem .3rem; color: var(--muted); }
.ai-local-item { display: block; width: 100%; text-align: left; font: inherit; font-size: .85rem; padding: .35rem .5rem; border: 0; background: none; color: inherit; cursor: pointer; }
.ai-local-item:hover, .ai-local-item:focus-visible { background: var(--hover); }
.ai-local-item.on { font-weight: 650; } .ai-local-item.on::before { content: "\2713  "; }
.ai-local-none { margin: .3rem .4rem; font-weight: 600; }
.ai-local-go { display: inline-block; margin: 0 .4rem .3rem; }

/* Chat sessions: tabs on the drawer and above the bar; windows (chat-windows.md). */
.ai-tabs { display: flex; gap: 2px; align-items: flex-end; overflow-x: auto; padding: .25rem .5rem 0; border-bottom: 1px solid var(--line); }
.ai-tabbar { position: absolute; left: .5rem; right: .5rem; bottom: 100%; border-bottom: 0; background: none; pointer-events: none; }
.ai-tabbar > * { pointer-events: auto; }
.ai-tab { display: inline-flex; align-items: center; gap: .3rem; max-width: 14rem; padding: .25rem .45rem; border: 1px solid var(--line); border-bottom: 0; background: var(--hover); font-size: .8rem; cursor: pointer; white-space: nowrap; }
.ai-tab.on { background: var(--card); font-weight: 650; }
.ai-tab.floating { font-style: italic; }
.ai-tab-label { overflow: hidden; text-overflow: ellipsis; }
.ai-tab-dot { flex: none; width: .45rem; height: .45rem; border-radius: 50%; background: var(--muted, #999); }
.ai-tab.active .ai-tab-dot, .ai-win.active .ai-tab-dot { background: #15803d; animation: local-pulse 1.2s ease-in-out infinite; }
.ai-tab-btn { border: 0; background: none; padding: 0 .1rem; font-size: .75rem; color: var(--muted); cursor: pointer; }
.ai-tab-btn:hover { color: var(--fg); }
.ai-tab-new { border: 1px dashed var(--line); background: none; padding: .15rem .5rem; cursor: pointer; font-size: .9rem; }
.ai-tab-rename { font: inherit; font-size: .8rem; width: 9rem; }
.ai-open-window { display: block; margin: .2rem auto .6rem; border: 0; background: none; color: var(--accent); cursor: pointer; }
.ai-win { position: fixed; width: 24rem; height: 26rem; min-width: 16rem; min-height: 12rem; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--card); box-shadow: 0 8px 28px rgba(0,0,0,.2); resize: both; overflow: hidden; }
.ai-win-head { display: flex; align-items: center; gap: .4rem; padding: .35rem .5rem; border-bottom: 1px solid var(--line); cursor: move; user-select: none; }
.ai-win-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.ai-win .ai-log { flex: 1; overflow: auto; max-height: none; }
.ai-win-foot { display: flex; gap: .3rem; padding: .35rem; border-top: 1px solid var(--line); }
.ai-win-input { flex: 1; font: inherit; resize: none; }
.ai-win-send { min-width: 2.2rem; }
.ai-session-hint { margin: 1rem; }
/* Business backend: a quiet mark, by the side tabs and on Your sites' cards. */
.biz-mark { font: 600 .62rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); padding: .15rem .3rem; white-space: nowrap; vertical-align: middle; }
.side-tabs .biz-mark { margin-left: auto; align-self: center; margin-right: .4rem; }
.sc-name .biz-mark { margin-left: .5rem; position: relative; top: -.12em; }
.seller-control { margin-top: .3rem; }
.seller-claims-list { margin: .3rem 0 0; padding-left: 1rem; max-height: 14rem; overflow-y: auto; min-width: 16rem; overflow-wrap: anywhere; }
.seller-claims-list li { margin: .15rem 0; }
.fb-reply { margin-top: .5rem; }
.fb-reply-box { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: .9rem; padding: .4rem .5rem; margin: .3rem 0; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.fb-reply.sent { border-left: 3px solid var(--ops, #127a3a); padding: .2rem .6rem; }
.fb-reply.sent p { margin: .2rem 0 0; white-space: pre-wrap; }
/* A member link's confirm page (run.html). */
.run-main { max-width: 40rem; margin: 2rem auto; padding: 0 1.2rem; }
.run-fields { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 1rem 0; }
.run-fields dt { font-weight: 600; }
.run-fields dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.run-out { white-space: pre-wrap; } .run-out.error { color: var(--error, #b42318); }
/* The Inbox tab (inbox.go): what wants the site's people's attention. */
.ib-links { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.ib-link.current, .ib-kind.current { border-color: var(--fg); font-weight: 600; }
.ib-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.ib-entries { list-style: none; margin: 0; padding: 0; }
.ib-entry { border-top: 1px solid var(--line); padding: .45rem 0; }
.ib-entry.done { opacity: .6; }
.ib-head { display: flex; gap: .5rem; align-items: center; color: var(--muted); }
.ib-head .ib-tick { margin-left: auto; }
.ib-status { font-family: var(--mono, monospace); font-size: .75rem; }
.ib-fields { display: grid; grid-template-columns: max-content 1fr; gap: .1rem .6rem; margin: .3rem 0 0; font-size: .9rem; }
.ib-fields dt { color: var(--muted); }
.ib-fields dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.ib-result { margin: .25rem 0 0; }
.ib-title { margin: .25rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.ib-body { margin: .2rem 0 .3rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
/* Business backend: a small cash register by the site picker (index.html). */
.biz-register { display: inline-flex; flex: none; align-items: center; color: var(--muted); margin-left: -.15rem; }
.biz-register[hidden] { display: none; }
/* An offer of Business backend in a pane (hud.js businessOffer). */
.biz-offer { border: 1px dashed var(--line); padding: .5rem .7rem; margin: .4rem 0 .7rem; }
.biz-offer p { margin: 0 0 .35rem; }
/* A site's Binder on Your sites: the recipes added to it. */
.binder-head { margin-bottom: .5rem; }
.binder-list { list-style: none; margin: 0; padding: 0; }
.binder-item { border-top: 1px solid var(--line); padding: .45rem 0; }
.binder-top { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.binder-summary { margin: .25rem 0 0; }
.binder-item.failed .binder-top span { color: var(--error, #b42318); }
/* The Data tab's CSV tables (/_u/data). */
.csv-tables { margin: .5rem 0; }
.csv-table { margin: .4rem 0; }
.csv-table > summary { font-weight: 600; }
.csv-scroll { overflow: auto; max-height: 22rem; border: 1px solid var(--line); margin-top: .3rem; }
.csv-scroll table { border-collapse: collapse; font-size: .82rem; }
.csv-scroll th, .csv-scroll td { padding: .2rem .45rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 18rem; overflow: hidden; text-overflow: ellipsis; }
.csv-scroll th { position: sticky; top: 0; background: var(--bg); }
/* The public recipe catalog (recipes.html). */
.rp-main { max-width: 64rem; margin: 1.5rem auto 3rem; padding: 0 1.2rem; }
.rp-intro { max-width: 46rem; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .8rem; margin-bottom: 1.6rem; }
.rp-card { display: block; border: 1px solid var(--line); padding: .8rem 1rem; color: inherit; text-decoration: none; background: var(--bg); }
.rp-card[href]:hover { border-color: var(--fg); }
.rp-card-top { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.rp-card h3 { margin: 0; font-size: 1.05rem; }
.rp-card-summary { margin: .4rem 0; }
.rp-card-meta { margin: 0; }
.rp-links { margin: 0 0 1rem; }
.rp-levels { margin: 1rem 0; }
.rp-text { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1rem; max-width: 50rem; }
.rp-text pre { overflow: auto; background: var(--panel, #f4f4f4); padding: .6rem; }
.rp-text code { overflow-wrap: anywhere; }
/* /features: the whole catalog (recipes.js). */
.ft-toc { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .5rem 0 1.4rem; }
.ft-cat { margin: 1.2rem 0; }
.ft-depth1 { margin-left: 1rem; border-left: 2px solid var(--line); padding-left: 1rem; }
.ft-feature { border-top: 1px solid var(--line); padding: .6rem 0; scroll-margin-top: 1rem; }
.ft-feature h5 { margin: 0; font-size: 1rem; }
.ft-feature p { margin: .3rem 0; }
.ft-feature:target { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.ft-anchor { margin-left: .4rem; color: var(--muted); text-decoration: none; font-weight: 400; }
.ft-detail { white-space: pre-line; }
.ft-note { border-left: 3px solid var(--ops, #b45309); padding-left: .5rem; }
.ft-table { border-collapse: collapse; margin: .5rem 0; }
.ft-table th, .ft-table td { text-align: left; padding: .3rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }

/* the bar (2026-11-25): beside the brain, New chat (top) and a picture (bottom)
   with the microphone a quarter bigger to their right: a triangle pointing
   right. Bare line icons, like the level dial. The brain is our own drawing
   (brain.svg), not the emoji, which looks different on every device. */
.ai-send > span img { display: block; width: 1.05em; height: auto; }
.ai-tri { flex: none; display: inline-grid; grid-template-columns: auto auto; grid-template-rows: 1.45rem 1.45rem; align-items: center; column-gap: .05rem;
  margin: -.4rem 0 -.4rem -.35rem; }
.ai-tri .ai-tri-btn { width: 1.45rem; height: 1.45rem; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color .12s, transform .12s; }
.ai-tri .ai-tri-btn svg { width: 1.1rem; height: 1.1rem; }
.ai-tri .ai-new { grid-column: 1; grid-row: 1; }
.ai-tri #ai-attach { grid-column: 1; grid-row: 2; }
.ai-tri .ai-tri-big { grid-column: 2; grid-row: 1 / span 2; width: 1.8rem; height: 1.8rem; }
.ai-tri .ai-tri-big svg { width: 1.375rem; height: 1.375rem; }
.ai-tri .ai-tri-btn[hidden] { display: none; }
.ai-tri .ai-tri-btn:hover { color: var(--fg); transform: scale(1.12); }
.ai-tri .ai-tri-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.ai-tri .ai-mic.on { background: none; color: var(--accent); }
.ai-tri .ai-mic.on svg { stroke-width: 2.4; }
.brain .ai-controls { margin-left: .9rem; }
@media (max-width: 760px) { .brain .ai-controls { margin-left: 0; } }

/* the files pane (2026-11-25): History at the top, under the tabs; the
   space in one line (used, a bar, free); the files' count small, right
   above the list. The pane runs to the bottom, the brain's bar beside it. */
.space-line { display: flex; align-items: center; gap: .75rem; margin: 0 0 .8rem; padding: 0 .1rem; font: 400 .74rem/1 var(--mono); color: var(--muted); }
.space-line .space-num { flex: none; white-space: nowrap; }
.space-line .space-num b { font-weight: 500; color: var(--fg); font-size: .84rem; }
.space-meter { flex: 1; min-width: 2.5rem; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.space-fill { display: block; height: 100%; background: var(--fg); border-radius: 3px; }
.space-meter.high .space-fill { background: var(--ops, #d97706); }
.space-meter.full .space-fill { background: var(--error); }
.files-count { margin: -.25rem 0 .3rem; font: 400 .7rem/1.2 var(--mono); color: var(--muted); }
.hist-size { margin: 0 0 .35rem; }

/* The popped-out brain (2026-11-25): the box fills down to one row of
   controls (38px, and the gap), so the space below matches the space above. */
.brain.popped .ai-form { padding: .5rem .6rem .55rem; }
.brain.popped .ai-input-wrap { height: calc(100% - 38px - .4rem); }
/* The popped-out brain with the chat on (2026-11-28): the chat fills the
   window's top, the message box keeps a few lines at the bottom. (As a
   drawer above the bar it sat outside the window and was clipped.) */
.brain.popped .ai-drawer { position: static; flex: 1 1 auto; min-height: 0; max-height: none; height: auto; width: auto;
  border: 0; border-bottom: 1px solid var(--line); box-shadow: none; }
.brain.popped .ai-drawer[hidden] { display: none; }
.brain.popped .ai-grip { display: none; }
.brain.popped .ai-drawer-head { padding-top: .35rem; }
.brain.popped.chat-on .ai-form { flex: none; }
.brain.popped.chat-on .ai-input-wrap { height: 4.5rem; min-height: 0; }
/* Phones: room under the bar, away from the system's buttons (and the
   home indicator, where the browser reports it). */
@media (max-width: 760px) {
  .brain:not(.popped) .ai-form { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
}

/* The order form (2026-11-25, order.js): name first; what the site starts
   from as the catalog's groups (tabs), then their recipes; add-ons as rows
   with a switch; what's included as a list of icons. */
.order-name { max-width: 34rem; border: 1px solid var(--line); background: var(--card); }
.order-name:focus-within { outline: 2px solid var(--science, var(--accent)); outline-offset: 1px; }
.order-name input { border: 0; font-size: 1.15rem; padding: .7rem .8rem; }
.order-name input:focus { outline: 0; }
.order-name-dom { flex: none; padding-right: .8rem; font: 1.05rem var(--mono); color: var(--muted); }
.order-start-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 .8rem; }
.order-start-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border: 1px solid var(--line); background: var(--card); color: var(--fg);
  font: 600 .85rem/1 inherit; cursor: pointer; border-radius: 999px; transition: border-color .12s, background .12s; }
.order-start-tab:hover { border-color: var(--muted); }
.order-start-tab[aria-selected="true"] { background: var(--fg); border-color: var(--fg); color: var(--card); }
.order-start-n { font: 500 .72rem/1 var(--mono); padding: .15rem .38rem; border-radius: 999px; background: var(--bg); color: var(--muted); }
.order-start-tab[aria-selected="true"] .order-start-n { background: rgba(255, 255, 255, .18); color: inherit; }
.order-start-tab.has-pick::after { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--command, var(--accent)); }
.order-tmpl { min-height: 6.5rem; }
.order-tmpl:disabled { opacity: .5; cursor: not-allowed; }
.order-tmpl-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; padding-top: .25rem; }
.order-tmpl-tags:empty { display: none; }
.sc-badge.biz { border-color: var(--science, var(--accent)); color: var(--science, var(--accent)); }
.order-coming { margin: .6rem 0 0; }
.order-coming:empty { display: none; }
.order-addons { display: grid; gap: .5rem; }
.order-addon { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .9rem; width: 100%; text-align: left; font: inherit; color: var(--fg);
  background: var(--card); border: 1px solid var(--line); padding: .75rem .9rem; cursor: pointer; transition: border-color .12s; }
.order-addon:hover:not(:disabled) { border-color: var(--muted); }
.order-addon.on { border-color: var(--command, var(--accent)); box-shadow: inset 3px 0 0 var(--command, var(--accent)); }
.order-addon:disabled { opacity: .55; cursor: default; }
.order-addon-icon svg { display: block; width: 26px; height: 26px; color: var(--muted); }
.order-addon.on .order-addon-icon svg { color: var(--command, var(--accent)); }
.order-addon-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.order-addon-name { font-weight: 650; }
.order-addon-why:empty { display: none; }
.order-addon-why { color: var(--science, var(--accent)); }
.order-addon-price { font: 600 .9rem var(--mono); white-space: nowrap; }
.order-addon[aria-checked="true"] .ps-track { background: var(--fg); }
.order-addon[aria-checked="true"] .ps-knob { transform: translateX(1rem); }
.order-incl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .45rem .9rem; }
.order-incl-item { display: flex; align-items: center; gap: .55rem; font-size: .88rem; }
.order-incl-item svg { flex: none; width: 20px; height: 20px; color: var(--science, var(--muted)); }
@media (max-width: 560px) {
  .order-addon { grid-template-columns: auto minmax(0, 1fr) auto; }
  .order-addon-price { grid-column: 2; grid-row: 2; }
}
.order-start-tab:focus { outline: 0; }
.order-start-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.order-start-tab:not([aria-selected="true"]):hover { background: var(--card); }

/* Backups on Your sites (hud.js backupPane) */
.bk-form { display: grid; gap: .55rem; margin-top: .4rem; max-width: 46rem; }
.bk-field { display: grid; gap: .2rem; }
.bk-field > span { color: var(--muted); }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .55rem .8rem; }
.bk-form .bk-save { justify-self: start; }
.bk-howto { border: 1px solid var(--line); border-radius: 6px; padding: .35rem .7rem; background: var(--surface, transparent); }
.bk-howto summary { cursor: pointer; font-size: .85rem; font-weight: 600; }
.bk-howto ol { margin: .4rem 0 .3rem 1.1rem; padding: 0; display: grid; gap: .25rem; }
.bk-list { list-style: none; margin: .3rem 0; padding: 0; display: grid; gap: .15rem; }
.bk-list code { font-size: .78rem; }
.bk-lock { font-weight: 600; }
.bk-nopass-line { display: flex; align-items: center; gap: .35rem; }
.bk-computer { border-top: 1px solid var(--line); padding-top: .55rem; margin-top: .7rem; }
/* four tabs on a narrow card: tighter, and they share the width */
.sc-area-btn { min-width: 0; padding: .55rem .6rem; }
.sc-area-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the order form's terms and US-billing boxes (order.js) */
.order-check { display: flex; gap: .45rem; align-items: flex-start; margin: .45rem 0; line-height: 1.4; }
.order-check input { margin-top: .2rem; flex: none; }

/* Sign in with flff (member.html) and the account's list of sites (order.js) */
.m-ask { max-width: 34rem; }
.m-h1 { font-size: 1.4rem; margin: .2rem 0 .8rem; }
.m-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; }
.m-legal { margin-top: 2rem; }
.signin-list { list-style: none; padding: 0; margin: .4rem 0; }
.signin-list li { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--line, #ddd); }

/* The free tier (hud.js, try.go): the countdown on a temporary site, and
   Your sites' "Try flff free" */
.try-bar { position: sticky; top: 0; z-index: 50; padding: .35rem 1rem; background: #fff4d6; color: #5c4400; border-bottom: 1px solid #f0d58a; font-size: .9rem; text-align: center; }
.try-bar a { font-weight: 600; margin-left: .3rem; }
.try-bar.warn { background: #b42318; color: #fff; border-color: #8f1c13; }
.try-bar.warn a { color: #fff; }
.try-empty { max-width: 38rem; padding: 1.2rem 1.4rem; border: 1px dashed var(--line, #ccc); border-radius: 10px; margin: 1rem 0; }
.try-empty h2 { margin: 0 0 .4rem; }
.order-from { margin-bottom: 1rem; }

/* A site's brand on Sign in with flff (member.js, brand.go) */
.m-brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem; }
.m-brand img { max-height: 36px; max-width: 150px; }
.m-branded #m-go { background: var(--m-accent, var(--command)); border-color: var(--m-accent, var(--command)); }

/* The brain's levels by a reference popup's Ask now (brain.js levelRow): the bar's four, kept in step */
.ref-go { display: inline-flex; align-items: center; gap: .3rem; margin-left: auto; }
.ref-levels { display: inline-flex; gap: 2px; }
.ref-levels[hidden] { display: none; }
.ref-lv { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line, #d6d3d1); background: var(--surface, #fff); color: inherit; border-radius: 0; cursor: pointer; }
.ref-lv svg { width: 16px; height: 16px; }
.ref-lv.on { background: var(--command, #b42318); border-color: var(--command, #b42318); color: #fff; }
.ref-lv.locked { opacity: .45; }
@media (pointer: coarse) { .ref-lv { width: 38px; height: 38px; } }
.c-folders { padding-left: 1.2rem; margin: .4rem 0 1rem; } .c-folders li { margin: .3rem 0; overflow-wrap: anywhere; }

/* Keyboard shortcuts (keys.js): the list ? opens */
.keys-dialog { width: min(40rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); overflow: auto; border: 1px solid var(--line); background: var(--card); color: var(--fg); padding: 1rem 1.2rem 1.2rem; }
.keys-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.keys-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.keys-head h2 { margin: 0; font-size: 1.15rem; }
.keys-dialog h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.1rem 0 .4rem; }
.keys-dialog dl { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .35rem 1rem; margin: 0; }
.keys-dialog dt { white-space: nowrap; }
.keys-dialog dd { margin: 0; }
.keys-dialog kbd, .keys-hint kbd { font: 12px/1 ui-monospace, Menlo, Consolas, monospace; padding: .15rem .4rem; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--bg); color: var(--fg); }
@media (max-width: 560px) { .keys-dialog dl { grid-template-columns: 1fr; } .keys-dialog dd { margin-bottom: .4rem; color: var(--muted); } }
/* Focus shows wherever the keyboard goes (buttons and links that set none of their own). */
.tool:focus-visible, .act:focus-visible, .list a.name:focus-visible, [role=tab]:focus-visible, .foot-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.keys-hint-kbd { font: 11px/1 ui-monospace, Menlo, Consolas, monospace; padding: .1rem .35rem; border: 1px solid var(--line); margin-left: .3rem; color: var(--muted); }

/* A file's actions (hud.js rowActions): one ⋯ button that spreads out Rename, Edit and Delete */
.acts-spread { display: inline-flex; gap: .25rem; }
.acts-spread[hidden] { display: none; }
.list li.acts-open .acts { display: flex; }
.list li.acts-open { background: var(--hover); }
button.act.icon.more[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.list li.renaming .acts, .list li.renaming .meta { display: none; }
.list li.renaming { grid-template-columns: 1rem 1fr; background: var(--current); }
.list li:has(.has-thumb).renaming { grid-template-columns: 2rem 1fr; }
.rename-wrap { display: grid; gap: .2rem; min-width: 0; }
.rename-wrap .ghost-name { width: 100%; }
.hw-syncs { margin-top: .5rem; display: flex; flex-direction: column; gap: .2rem; }
.hw-syncs-head { color: var(--muted); }
.ai-task-cost { text-align: center; margin: -.2rem 0 .6rem; }

/* The folder path on one line: the top folders fold into "…"; hovered (or
   touched) the whole path shows over everything (hud.js crumbs). */
.crumbs, .crumbs-row .crumbs { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; word-break: normal; }
.crumbs > * { flex: none; }
.crumbs [hidden] { display: none !important; }
.crumbs .crumb.here { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs .crumb-more { color: var(--muted); padding: 0 .2rem; }
.crumbs .crumb-more::before { content: "\2026"; }
.crumbs.collapsed { cursor: default; }
.crumbs-full { position: fixed; z-index: 60; margin: 0; overflow-x: auto; overflow-y: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); border-color: var(--accent) !important; }
.crumbs-full .crumb.here { overflow: visible; }

/* History at the right of the tab bar: Undo, and History's panel (hud.js siteHistory). */
.hist-tools { display: flex; align-items: stretch; order: 3; height: 2.25rem; border: 1px solid var(--line); background: var(--card); }
.hist-tools .hist-btn { width: 2.25rem; min-height: 0; border: 0; border-right: 1px solid var(--line); }
.hist-tools .hist-btn svg { width: 18px; height: 18px; }
.hist-tools .hist-btn[hidden] { display: none; }
.hist-tools .history-toggle { border: 0; background: none; color: var(--fg); padding: 0 .6rem; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem;
  font: 600 .78rem/1 var(--mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .05em; }
.hist-tools .history-toggle::after { content: "\25BE"; font-size: .8rem; transition: transform .15s; }
.hist-tools .history-toggle[aria-expanded=true]::after { transform: rotate(180deg); }
.hist-tools .history-toggle:hover, .hist-tools .history-toggle[aria-expanded=true] { color: var(--accent); background: var(--hover); }
@media (pointer: coarse) { .hist-tools { height: 42px; } .hist-tools .hist-btn { width: 42px; } }
.hist-panel { position: fixed; z-index: 45; width: min(26rem, calc(100vw - 1rem)); margin: 0; border-top: 3px solid var(--accent); box-shadow: 0 12px 34px rgba(0, 0, 0, .2); }
.hist-panel[hidden] { display: none; }
.hist-panel .hist-title { flex: 1; display: flex; align-items: center; justify-content: center; font: 600 .82rem/1 var(--mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hist-panel .hist-x { flex: none; width: 2.4rem; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.hist-panel .hist-x:hover { color: var(--fg); background: var(--hover); }
.hist-panel .hist-body { max-height: calc(100vh - 10rem); }

/* Synced folders (hud.js markSyncs; cloud_sync.go): a badge on the folder, a line inside it. */
.sync-badge { display: inline-block; margin-left: .45rem; padding: 0 .35rem; font-size: .7rem; line-height: 1.35; border: 1px solid var(--line); color: var(--muted); background: var(--card); white-space: nowrap; vertical-align: middle; }
.sync-badge::before { content: "\2601\FE0E"; margin-right: .25rem; }
.sync-badge.synced { color: var(--fg); }
.sync-badge.syncing::before { content: "\21BB"; display: inline-block; animation: sync-spin 1s linear infinite; }
.sync-badge.waiting::before { content: "\23F1\FE0E"; }
.sync-badge.paused, .sync-badge.problem { color: var(--error, #b91c1c); border-color: currentColor; }
.sync-badge.paused::before { content: "\23F8\FE0E"; }
.sync-badge.problem::before { content: "!"; font-weight: 700; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync-badge.syncing::before { animation: none; } }
.notice.sync { margin: 0 0 .9rem; padding: .45rem .75rem; font-size: .85rem; border: 1px solid var(--line); border-left: 4px solid var(--science, var(--line)); background: var(--card); color: var(--fg); display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.notice.sync .sync-badge { margin-left: 0; }
.list a.name.has-sync { display: flex; align-items: center; min-width: 0; }
.list a.name.has-sync .name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.list a.name.has-sync .sync-badge { flex: none; }

/* Paying on the page (pay.js): Stripe's Payment Element in a dialog. */
.pay-dialog { max-width: 30rem; width: calc(100% - 2rem); max-height: calc(100vh - 2rem); overflow: auto; border: 1px solid var(--line); padding: 1.2rem 1.4rem 1rem; background: var(--bg); color: var(--fg); }
.pay-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.pay-dialog h2 { margin: 0 0 .35rem; font-size: 1.2rem; }
.pay-total { margin: 0 0 1rem; font-weight: 600; }
.pay-contact, .pay-address { margin-bottom: .9rem; }
.pay-fields { min-height: 8rem; }
.pay-error:empty { display: none; }
.pay-actions { display: flex; gap: .6rem; align-items: center; margin-top: .4rem; }
.pay-actions .primary { margin: .6rem 0; min-width: 9rem; }
.pay-actions .primary:disabled { opacity: .55; cursor: default; }
.pay-cancel { background: none; border: 1px solid var(--line); border-radius: 0; padding: .6rem 1rem; color: var(--fg); cursor: pointer; }
.pay-secure { margin: .4rem 0 0; }
@media (max-width: 30rem) { .pay-dialog { padding: 1rem; } }

/* Promote this event (promote.js): the button in the tab bar, and the kit. */
.promote-btn { order: 2; align-self: center; margin-right: .5rem; padding: .35rem .75rem; border: 1px solid var(--accent); background: var(--card); color: var(--accent); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.promote-btn:hover { background: var(--accent); color: var(--accent-fg); }
.promote-btn[hidden] { display: none; }
.promote-dialog { max-width: 40rem; width: calc(100% - 2rem); max-height: calc(100vh - 2rem); overflow: auto; border: 1px solid var(--line); padding: 1rem 1.4rem 1.2rem; background: var(--bg); color: var(--fg); }
.promote-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.promote-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.promote-head h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.promote-head p { margin: 0; }
.promote-x { flex: none; border: 1px solid var(--line); background: none; color: var(--fg); width: 2rem; height: 2rem; cursor: pointer; }
.promote-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: .9rem 0 .4rem; border-bottom: 1px solid var(--line); }
.promote-tab { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); padding: .5rem .8rem; font: inherit; font-size: .88rem; cursor: pointer; }
.promote-tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.promote-pane > p { margin: .6rem 0; }
.promote-go { display: inline-block; padding: .5rem .9rem; background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.promote-field { margin: .7rem 0; }
.promote-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .2rem; }
.promote-row { display: flex; gap: .4rem; align-items: stretch; }
.promote-value { flex: 1; min-width: 0; font: inherit; font-size: .9rem; padding: .4rem .5rem; border: 1px solid var(--line); background: var(--card); color: var(--fg); resize: vertical; }
.promote-copy { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--fg); padding: 0 .8rem; cursor: pointer; font: inherit; font-size: .82rem; }
.promote-copy:disabled { opacity: .5; cursor: default; }
.promote-warn { display: block; color: var(--error); margin-top: .2rem; }
.promote-pic { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--hover); margin-bottom: .35rem; min-height: 4rem; }
.promote-download { margin-left: auto; font-weight: 600; }
.promote-checks { list-style: none; padding: 0; margin: .5rem 0; }
.promote-checks li { display: flex; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.promote-checks li.no { color: var(--muted); }
.promote-checks .promote-mark { width: 1rem; text-align: center; }
.promote-checks li.ok .promote-mark { color: #15803d; }
.promote-fix { margin: .4rem 0; }
