Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

114 KB
Raw Blame
@import "@fontsource-variable/inter";

/* Neutral grey ground and white cards lifted by a soft shadow (monochrome like the mark);
   --surface* are grey tints for fills and hovers. */
:root {
  --scroll: rgba(0, 0, 0, 0.2);
  --scroll-hi: rgba(0, 0, 0, 0.38);
  --ground: #f4f4f4;
  --bg: #ffffff;
  --surface: #ededed;
  --surface-2: #e4e4e4;
  --surface-3: #d7d7d7;
  /* selected text: clearly apart from every surface it can sit on */
  --selection: #c4c4c4;
  --border: rgba(0, 0, 0, 0.08);
  --border-2: rgba(0, 0, 0, 0.14);
  --text: #0d0d0d;
  --text-2: #555555;
  --text-3: #737373;
  /* the cocoon's threads and the solid logo a result hatches from */
  --mark: #0d0d0d;
  --invert-bg: #0d0d0d;
  --invert-text: #ffffff;
  --scrim: rgba(244, 244, 244, 0.84);
  /* depth: a resting card, a floating panel (menus, dialogs), the image laid on the page, and
     the choice inside a segmented control (even all round, so it sits centred) */
  --lift: 0 1px 0 rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 28px -12px rgba(0, 0, 0, 0.16);
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.05), 0 24px 56px -18px rgba(0, 0, 0, 0.24);
  --print: 0 2px 4px rgba(0, 0, 0, 0.06), 0 30px 60px -28px rgba(0, 0, 0, 0.38);
  --pick: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 0 6px rgba(0, 0, 0, 0.06);
  --pick-bg: #ffffff;
  --glow: rgba(255, 255, 255, 0.95);
  --checker: #ebebeb;
  /* the light that runs across an image still loading */
  --sheen: rgba(255, 255, 255, 0.55);
  --sidebar: transparent;
  --radius: 14px;
  --radius-img: 14px;
  /* motion: the cocoon's curve (things arrive out of a soft blur) */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: "Inter Variable", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

/* data-theme is set before the first paint by public/theme.js (OS setting or Settings → General). */
:root[data-theme="dark"] {
  --scroll: rgba(255, 255, 255, 0.18);
  --scroll-hi: rgba(255, 255, 255, 0.34);
  --ground: #0a0a0a;
  --bg: #151515;
  --surface: #1c1c1c;
  --surface-2: #252525;
  --surface-3: #313131;
  --selection: #5a5a5a;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #f2f2f2;
  --text-2: #a8a8a8;
  --text-3: #858585;
  /* softer than --text: a big near-white logo flashing on a dark screen hurts the eyes */
  --mark: #9a9a9a;
  --invert-bg: #f2f2f2;
  --invert-text: #0a0a0a;
  --scrim: rgba(10, 10, 10, 0.85);
  --lift: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 10px 28px -12px rgba(0, 0, 0, 0.7);
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 24px 60px -18px rgba(0, 0, 0, 0.8);
  --print: 0 2px 6px rgba(0, 0, 0, 0.5), 0 34px 70px -24px rgba(0, 0, 0, 0.9);
  --pick: none;
  --pick-bg: #333333;
  --glow: rgba(255, 255, 255, 0.045);
  --checker: #181818;
  --sheen: rgba(255, 255, 255, 0.07);
  --sidebar: transparent;
  color-scheme: dark;
}

/* Mac screens show these greys close to black; a step lighter matches macOS's own dark apps. */
:root[data-theme="dark"][data-platform="mac"] {
  --ground: #161616;
  --bg: #1f1f1f;
  --surface: #262626;
  --surface-2: #2f2f2f;
  --surface-3: #3a3a3a;
  --selection: #636363;
  --checker: #222222;
  --scrim: rgba(22, 22, 22, 0.85);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  overflow: hidden;
}
input, textarea, select, button { font: inherit; color: inherit; }
textarea, input[type="text"], input[type="number"] { user-select: text; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: 0.4; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
/* Written out, and with alpha 0.99: WebKitGTK (Linux) ignores var() inside ::selection and turns an opaque selection
   background into its own colour (a dark theme's grey came out near-black, #41); a translucent one it draws as given.
   Keep them in step with --selection and --text above. */
::selection, input::selection, textarea::selection { background: rgba(196, 196, 196, 0.99); color: #0d0d0d; }
:root[data-theme="dark"] ::selection, :root[data-theme="dark"] input::selection,
:root[data-theme="dark"] textarea::selection { background: rgba(90, 90, 90, 0.99); color: #f2f2f2; }
:root[data-theme="dark"][data-platform="mac"] ::selection, :root[data-theme="dark"][data-platform="mac"] input::selection,
:root[data-theme="dark"][data-platform="mac"] textarea::selection { background: rgba(99, 99, 99, 0.99); }
svg { display: block; flex: none; }

.app { display: flex; height: 100%; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- sidebar: the mark, new / all images / projects (on the paper, no panel) ---------- */
.sidebar { width: 256px; flex: none; background: var(--sidebar); display: flex; flex-direction: column; min-height: 0; padding-left: 4px; }
.side-head { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 16px; flex: none; }
.wordmark { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; font-weight: 640; font-size: 15px; letter-spacing: -0.03em; color: var(--text); }
.wordmark .kokon-mark svg { width: 18px; height: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 2px 8px 10px; }
.side-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-size: 14px; text-align: left; transition: background 0.15s, box-shadow 0.2s, color 0.15s; }
.side-item:hover { background: var(--surface); color: var(--text); }
.side-item.on { background: var(--bg); color: var(--text); box-shadow: var(--lift); font-weight: 500; }
.side-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 12px 2px 8px; }
/* "Projects": a row like New image / All images (its folder icon at the same place); it and the day
 * headings fold their list (Sidebar.tsx), the chevron turns when folded. */
.side-fold { flex: 1; min-width: 0; }
.side-group { display: inline-flex; align-items: center; gap: 4px; border-radius: 7px; color: var(--text-3); font-weight: 600; transition: color 0.15s, background 0.15s; }
.side-group:hover { color: var(--text); background: var(--surface); }
.side-fold .fold-chev, .side-group svg { opacity: 0; color: var(--text-3); transition: opacity 0.15s, transform 0.2s var(--ease); }
.side-fold:hover .fold-chev, .side-group:hover svg, .side-fold.closed .fold-chev, .side-group.closed svg, .side-fold:focus-visible .fold-chev, .side-group:focus-visible svg { opacity: 1; }
.side-fold.closed .fold-chev, .side-group.closed svg { transform: rotate(-90deg); }
/* Under "Projects": a trunk from its folder icon (centre 8 + 12 + 8 px), a rounded branch to each
 * day heading; the last heading's branch ends the trunk. */
/* Opaque (mixed into the sidebar's colour): where the trunk and a branch overlap it is not darker. */
.side-tree { --tree-line: color-mix(in srgb, var(--text) 16%, var(--ground)); display: flex; flex-direction: column; margin-left: 19px; }
.side-sec { position: relative; display: flex; flex-direction: column; gap: 2px; padding-left: 14px; }
.side-sec::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--tree-line); }
.side-sec:last-child::before { bottom: auto; height: 9px; }
.side-sec:first-child:last-child::before { height: 3px; }
.side-sec > .side-group { position: relative; }
.side-sec > .side-group::before { content: ""; position: absolute; left: -14px; top: calc(50% - 10px); width: 11px; height: 10px; border-left: 2px solid var(--tree-line); border-bottom: 2px solid var(--tree-line); border-bottom-left-radius: 9px; pointer-events: none; }
/* Always visible: a small outlined button, not text that shows on hover. */
.side-select { height: 24px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; border: 1px solid var(--border-2); font-size: 11.5px; font-weight: 500; color: var(--text-2); transition: background 0.15s, color 0.15s, border-color 0.15s; }
.side-select:hover { background: var(--surface); color: var(--text); }
.sidebar.selecting .side-select { background: var(--invert-bg); color: var(--invert-text); border-color: transparent; }
.side-list { flex: 1; overflow-y: auto; padding: 2px 8px 12px; display: flex; flex-direction: column; }
.proj { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 14px; cursor: pointer; position: relative; outline-offset: -2px; transition: background 0.15s, box-shadow 0.2s; }
.proj:hover { background: var(--surface); }
.proj.on { background: var(--bg); box-shadow: var(--lift); }
.proj .cover { width: 46px; height: 46px; border-radius: 11px; overflow: hidden; background: var(--surface-3); flex: none; }
.proj .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* One line, cut with an ellipsis: the hover buttons only shorten it, never wrap it. */
.proj-title { font-size: 13.5px; font-weight: 500; line-height: 1.3; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Today, Yesterday...: the list's headings (Sidebar.tsx) */
.side-group { align-self: flex-start; font-size: 11.5px; height: 22px; padding: 0 6px; margin: 8px 0 2px 0; }
.side-sec:first-child > .side-group { margin-top: 2px; }
.proj-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.proj-rm { width: 24px; height: 24px; border-radius: 7px; display: none; place-items: center; color: var(--text-2); flex: none; }
.proj:hover .proj-rm { display: grid; }
.proj-rm:hover { background: var(--surface-2); color: var(--text); }

/* ---------- top bar ---------- */
.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 0 16px; flex: none; }
.topbar:has(.window-controls) { padding-right: 0; }
.topbar .toolbar { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
/* the status capsule: a card in the top bar; a small cocoon spins while images are made */
.status { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 11px; border-radius: 999px; background: var(--bg); box-shadow: var(--lift); color: var(--text); font-size: 12.5px; font-weight: 400; }
.status .silk-spin { margin: 0 -2px 0 -3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.dot.ready { background: var(--text); }
.dot.busy { background: transparent; border: 1.5px solid var(--text); animation: pulse 1.2s ease-in-out infinite; }
.dot.error { background: transparent; border: 1.5px solid var(--text-2); }
@keyframes pulse { 50% { opacity: 0.3; } }
.toolbar { display: flex; gap: 2px; align-items: center; flex: none; }
.toolbar .status { margin-right: 8px; }
.brand { min-width: 0; gap: 4px; }
.brand .project-title { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 8px; min-width: 0; max-width: 100%; }
.brand button.project-title:hover { background: var(--surface); }
.brand .project-title.placeholder { color: var(--text-3); font-weight: 400; }
.project-title .title-pencil { opacity: 0; color: var(--text-3); }
.project-title:hover .title-pencil { opacity: 1; }
.name-field { font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--text-3); border-radius: 6px; padding: 2px 6px; outline: none; min-width: 0; width: 100%; user-select: text; }
.name-field.title-field { font-size: 14px; font-weight: 500; height: 32px; padding: 0 8px; width: min(480px, 50vw); }

.icon-btn { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); transition: background 0.15s, color 0.15s; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn.active { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.has-badge { position: relative; }
.override-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- main ---------- */
.main { flex: 1; display: flex; min-height: 0; position: relative; overflow-x: clip; }
.stage { container: stage / inline-size; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 24px 12px; position: relative; isolation: isolate; }
/* a soft light on the paper behind the image */
.stage::before { content: ""; position: absolute; left: 50%; top: 44%; width: 100%; height: 80%; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 62%); pointer-events: none; z-index: -1; }
.stage-frame { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.stage-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-img); background-image: conic-gradient(var(--checker) 25%, transparent 0 50%, var(--checker) 0 75%, transparent 0); background-size: 16px 16px; }
/* the line under the image: version, what made it, compare, actions */
/* under the image: what it is (one centred line), then what you can do with it */
.stage-bar { width: 100%; max-width: 820px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; position: relative; z-index: 3; }
/* the image laid on the page like a print */
.stage .image-box, .stage .compare-box { border-radius: var(--radius-img); box-shadow: var(--print); }
.stage-meta { max-width: 100%; justify-content: center; min-height: 24px; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.stage-meta .ver { font-weight: 620; color: var(--text); font-size: 13px; letter-spacing: -0.01em; flex: none; }
.stage-meta .mode { flex: none; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text-2); font-size: 11.5px; line-height: 18px; }
.stage-meta .stage-prompt { flex: 0 1 auto; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-meta .dims { flex: none; }
.stage-meta .dims-seg { flex: none; padding: 2px; border-radius: 8px; }
.stage-meta .dims-seg button { height: 20px; border-radius: 6px; font-size: 11.5px; padding: 0 7px; }

.actions { display: flex; gap: 2px; flex: none; }
.actions .sep { width: 1px; background: var(--border); margin: 6px 4px; }
/* what you can do with the image: one card under it */
.stage-bar .actions { padding: 4px; border-radius: 16px; background: var(--bg); box-shadow: var(--lift); animation: rise 0.6s var(--ease) backwards; }
.stage-bar .actions .icon-btn { width: 32px; height: 32px; }
/* main actions: icon + word */
.act { height: 32px; padding: 0 11px; border-radius: 11px; transition: background 0.15s, color 0.15s; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.act:hover, .act.active { background: var(--surface); color: var(--text); }
@container stage (max-width: 600px) {
  .act { width: 34px; padding: 0; justify-content: center; }
  .act-label { display: none; }
}

.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--text-3); text-align: center; }
.empty { animation: rise 0.9s var(--ease) both; }
.empty h1 { font-size: 30px; font-weight: 640; letter-spacing: -0.03em; color: var(--text); margin: 0; }
.empty p { margin: 0; font-size: 14px; }
.empty p.tip { font-size: 12px; max-width: 420px; text-align: center; opacity: 0.75; }
.empty .hint { display: flex; gap: 18px; font-size: 12px; margin-top: 4px; }
.empty .hint span { display: flex; gap: 6px; align-items: center; }

/* pending job */
.pending { position: relative; max-width: 100%; max-height: 100%; border-radius: var(--radius-img); background: var(--bg); box-shadow: var(--lift); overflow: hidden; display: grid; place-items: center; isolation: isolate; container: pending / size; }
/* the cocoon (components/Cocoon.tsx): silk on a canvas, the edit's source inside it */
.cocoon { position: absolute; inset: 0; z-index: 0; transition: opacity 0.8s; }
.cocoon.dim { opacity: 0.32; }
.cocoon canvas { position: absolute; inset: 0; display: block; }
.cocoon-src { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter 0.9s ease-out, opacity 0.9s ease-out; }
/* silk spinner (Cocoon.tsx SilkSpin): a tiny cocoon, threads winding round a capsule that fills */
.silk-spin { color: var(--text); flex: none; overflow: visible; }
.silk-spin ellipse { fill: none; stroke: currentColor; transform-box: fill-box; transform-origin: center; animation: silk-wind 2.6s ease-in-out infinite alternate; }
.silk-spin ellipse:nth-of-type(2) { animation-duration: 3.4s; animation-delay: -1s; }
.silk-spin ellipse:nth-of-type(3) { animation-duration: 2.1s; animation-delay: -0.4s; }
.silk-spin ellipse:nth-of-type(4) { animation-duration: 4s; animation-delay: -2s; }
.silk-spin .silk-fill { transition: y 0.3s, height 0.3s; }
@keyframes silk-wind { from { transform: rotate(-32deg); } to { transform: rotate(32deg); } }
@media (prefers-reduced-motion: reduce) { .silk-spin ellipse { animation: none; } }
/* a fresh result seen through the logo, which grows until it is the image (Hatch) */
.hatch { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; }
.hatch-body { position: relative; z-index: 1; flex: 1; min-width: 0; min-height: 0; display: flex; }
.hatch-canvas { position: absolute; z-index: 0; border-radius: var(--radius-img); background: var(--bg); box-shadow: var(--lift); }
.hatch-veil { position: absolute; z-index: 2; border-radius: var(--radius-img); overflow: hidden; pointer-events: none; }
.hatch-veil svg { display: none; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; will-change: opacity, filter; }
.hatch-veil path { fill: var(--bg); }
.hatch-ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.hatch-ink path { fill: var(--mark); }
.pending-title { color: var(--text); font-weight: 600; font-size: 14px; }
/* The title shares the top row with Stop: it keeps clear of it on both sides (so it stays centred)
   and shortens to one line. */
.progress-phase .pending-title { box-sizing: border-box; max-width: 100%; min-width: 0; padding-inline: calc(3cqw + 82px); line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-info { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-2); font-size: 13px; padding: 24px; text-align: center; }
/* The mark takes the band from 19 % to 67 % of the card's height (Cocoon.tsx markLayout): the title
   fits above it and the percentage under it at any card size, in container units. */
.progress-phase { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3.5cqh 6cqw 5.5cqh; color: var(--text-2); font-size: 13px; text-align: center; animation: phase-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes phase-in { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }
.progress-phase.resumed { animation: none; }
.progress-phase .stop-corner { position: absolute; top: 3.5cqh; right: 3cqw; height: 28px; font-size: 12px; }
.progress-foot { display: flex; flex-direction: column; align-items: center; gap: clamp(4px, 1.6cqh, 8px); width: 100%; }
.progress-detail { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-pct { font-size: clamp(18px, min(12cqw, 9cqh), 52px); font-weight: 650; letter-spacing: -0.03em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.job-pct small { font-size: 0.42em; font-weight: 500; margin-left: 2px; color: var(--text-2); letter-spacing: 0; }
.progress-foot .progress { width: min(240px, 60%); }
.progress-foot .progress > i { transition: width 0.12s linear; }
.progress { width: 220px; height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; background: var(--text); border-radius: 2px; transition: width 0.3s; }
.progress.indeterminate > i { width: 30%; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { left: -30%; } to { left: 100%; } }
.notes { color: var(--text-3); font-size: 12px; max-width: 360px; }
.progress-foot .notes { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
@container pending (max-width: 440px) {
  .progress-phase .stop-corner { width: 28px; padding: 0; justify-content: center; }
  .progress-phase .stop-label { display: none; }
  .progress-phase .pending-title { padding-inline: calc(3cqw + 36px); }
}
@container pending (max-width: 360px) {
  .progress-detail .detail-size { display: none; }
}
@container pending (max-height: 520px) or (max-width: 380px) {
  .progress-foot .notes { display: none; }
}
/* prompt enhancer: its prompt fills the frame while it is written, then fades for the percentage */
.prompt-stage { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; gap: 14px; padding: clamp(18px, 5%, 44px); transition-property: opacity, transform, filter; transition-timing-function: ease-in; }
.prompt-stage.leaving { opacity: 0; transform: scale(0.97); filter: blur(8px); }
.prompt-text { flex: 1; min-height: 0; overflow: auto; scrollbar-width: none; display: flex; flex-direction: column; white-space: pre-wrap; user-select: text; color: var(--text); font-size: clamp(14px, min(4.2cqw, 5.5cqh), 22px); line-height: 1.5; letter-spacing: -0.005em; text-shadow: 0 1px 18px color-mix(in srgb, var(--bg, #000) 70%, transparent); }
.prompt-flow { margin: auto 0; }
.prompt-stage .btn.ghost { align-self: center; }
.enhanced-label { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; letter-spacing: 0.02em; }
/* each word arrives out of a soft blur */
.prompt-text .w { animation: word-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
/* Already read before the card came back (Stage.tsx PromptPhase). */
.prompt-text .w.seen { animation: none; }
@keyframes word-in { from { opacity: 0; filter: blur(6px); } 40% { opacity: 0.55; } to { opacity: 1; filter: blur(0); } }
.shimmer { background: linear-gradient(90deg, var(--text-3) 0%, var(--text-3) 35%, var(--text) 50%, var(--text-3) 65%, var(--text-3) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2s linear infinite; }
.shimmer svg { color: var(--text-2); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.enhanced-wait { display: block; text-align: center; font-size: 0.8em; }
.prompt-text .caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -3px; border-radius: 1px; background: var(--text); box-shadow: 0 0 10px var(--text); animation: caret 1.1s ease-in-out infinite; }
@keyframes caret { 50% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) {
  .prompt-text .w, .shimmer, .prompt-text .caret, .progress-phase { animation: none; }
  .shimmer { color: var(--text-3); background: none; }
}
.stage-meta .enhanced-mark { flex: none; display: inline-flex; color: var(--text-2); }
.pill.toggle.on, .pill.toggle.on:hover { background: var(--invert-bg); color: var(--invert-text); border-color: transparent; }
.pill.toggle.on .lora-count { background: var(--invert-text); color: var(--invert-bg); }
.lora-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
.lora-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover .opt:disabled { opacity: 0.5; cursor: default; }
.failed { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 460px; text-align: center; color: var(--text-2); }
.failed strong { color: var(--text); font-weight: 600; }
/* Sign-in in a browser on another device (Login.tsx). */
.login { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(340px, calc(100vw - 32px)); text-align: center; color: var(--text-2); }
.login strong { color: var(--text); font-size: 17px; font-weight: 600; }
.login .input { width: 100%; box-sizing: border-box; }
.login .btn { width: 100%; justify-content: center; }
.login-error { color: var(--text); font-weight: 500; }
.remote-open { align-items: flex-start; gap: 16px; }
.qr { width: 148px; height: 148px; flex: none; border-radius: 10px; }
.remote-url { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--text); user-select: all; }

/* version timeline: a line per image and the versions made from it; arcs join versions made
   from earlier ones or from several */
.timeline { flex: none; display: flex; max-width: 100%; overflow-x: auto; padding: 0 8px 4px; margin: 14px 0 10px; }
/* A thin bar under a timeline wider than the stage, clearer on hover. */
.timeline.overflow { padding-bottom: 8px; margin-bottom: 6px; }
.timeline.overflow::-webkit-scrollbar-thumb { background-color: var(--scroll); }
.timeline.overflow:hover::-webkit-scrollbar-thumb { background-color: var(--scroll-hi); }
.track { position: relative; display: flex; align-items: flex-start; width: max-content; }
.arcs { position: absolute; left: 0; top: 0; width: 100%; overflow: visible; pointer-events: none; }
.arcs path { fill: none; stroke: var(--text-3); stroke-opacity: 0.45; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke-opacity 0.15s; }
.arcs path.hot { stroke: var(--text); stroke-opacity: 1; stroke-width: 2; }
.joint { flex: none; }
/* versions joined by a straight line; it stops where the ring or outline round a thumbnail
   sits (5 px out), so lines and rings meet without crossing */
.joint.link { position: relative; width: 22px; height: 50px; }
.joint.link::before { content: ""; position: absolute; left: 3px; right: 3px; top: 24.25px; border-top: 1.5px solid var(--text-3); opacity: 0.5; transition: opacity 0.15s, border-color 0.15s; }
.joint.link.dashed::before { border-top-style: dashed; }
.joint.link.hot::before { border-top-color: var(--text); opacity: 1; }
.joint.gap { width: 16px; }
/* a new image: the line breaks */
.joint.break { width: 29px; height: 32px; margin-top: 9px; background: linear-gradient(var(--border-2), var(--border-2)) center / 1px 100% no-repeat; }
.frame { flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0 2px; color: var(--text-3); }
.frame-box { position: relative; display: block; }
.frame-img { width: 50px; height: 50px; border-radius: 13px; overflow: hidden; background: var(--bg); box-shadow: var(--lift); position: relative; display: grid; place-items: center; outline: 2px solid transparent; outline-offset: 3px; transition: outline-color 0.15s, transform 0.2s var(--ease); }
.frame-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-img img.dim { opacity: 0.25; filter: blur(2px) grayscale(1); }
.frame-state { position: relative; color: var(--text); display: grid; place-items: center; }
.frame-pct { position: relative; font-size: 12px; font-weight: 650; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.frame-pct small { font-size: 0.75em; font-weight: 500; color: var(--text-2); margin-left: 1px; }
.frame:hover .frame-img { transform: translateY(-1px); }
.frame:hover:not(.sel) .frame-img { outline-color: var(--surface-3); }
/* the shown version: a still ring; a version being made: a thread runs round it */
.frame-silk { position: absolute; left: -5px; top: -5px; width: 60px; height: 60px; overflow: visible; pointer-events: none; color: var(--text); }
.frame-silk rect { fill: none; stroke: currentColor; }
.frame-silk .ring { stroke-width: 1.6; }
.frame-silk.making .ring { stroke-width: 1; stroke-opacity: 0.25; }
.frame-silk .run { stroke-width: 1.7; stroke-linecap: round; stroke-dasharray: 46 154; animation: silk-orbit 3.6s linear infinite; }
@keyframes silk-orbit { to { stroke-dashoffset: -200; } }
@media (prefers-reduced-motion: reduce) {
  .frame-silk .run { animation: none; }
  .frame-silk.making .ring { stroke-opacity: 0.6; }
}
/* what the shown version was made from */
.frame.src .frame-img { outline: 1.6px dashed var(--text-3); outline-offset: 3.2px; }
/* picked with Ctrl/⌘-click (Delete removes them): a solid outline and a tick */
.frame.picked .frame-img, .frame.picked:hover .frame-img { outline: 2px solid var(--text); outline-offset: 3px; }
.frame.picked { position: relative; }
.frame-pick { position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--invert-bg); color: var(--invert-text); box-shadow: var(--lift); pointer-events: none; }
.frame.sel { color: var(--text); }
.frame-label { display: flex; align-items: center; gap: 3px; font-size: 11px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.frame-badge { position: absolute; right: 3px; bottom: 3px; width: 17px; height: 17px; border-radius: 6px; background: var(--invert-bg); color: var(--invert-text); display: grid; place-items: center; }

/* things arrive out of a soft blur, like the words of the prompt enhancer */
@keyframes rise { from { opacity: 0; filter: blur(6px); transform: translateY(4px); } to { opacity: 1; filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stage-bar .actions, .empty { animation: none; } }

/* ---------- composer ---------- */
.composer-wrap { flex: none; padding: 0 24px 20px; display: flex; justify-content: center; }
.composer { width: 100%; max-width: 820px; background: var(--bg); border-radius: 26px; padding: 10px 10px 8px 14px; position: relative; box-shadow: var(--shadow); }
/* while you write, a silk thread runs round the prompt box */
@property --silk-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.composer::before { content: ""; position: absolute; inset: -1px; border-radius: 27px; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity 0.5s var(--ease);
  background: conic-gradient(from var(--silk-a), transparent 0deg 220deg, color-mix(in srgb, var(--text) 22%, transparent) 290deg, var(--text) 332deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: silk-run 4.5s linear infinite; }
.composer:has(.prompt:focus)::before { opacity: 1; }
@keyframes silk-run { to { --silk-a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .composer::before { animation: none; background: color-mix(in srgb, var(--text) 30%, transparent); } }
.composer.drag { outline: 2px dashed var(--text-2); outline-offset: 3px; }
/* what the prompt works on */
.target { display: flex; align-items: center; gap: 10px; padding: 2px 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); min-width: 0; }
.target .spacer { flex: 1; }
/* Edit image | New image */
.mode-switch { display: flex; flex: none; background: var(--surface); border-radius: 13px; padding: 3px; gap: 2px; }
.mode-switch button { height: 30px; padding: 0 11px; border-radius: 10px; transition: background 0.2s, box-shadow 0.2s, color 0.15s; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.mode-switch button:hover:not(.on) { color: var(--text); }
.mode-switch button.on { background: var(--pick-bg); color: var(--text); box-shadow: var(--pick); font-weight: 500; }
.target-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--surface); display: grid; place-items: center; color: var(--text-2); flex: none; }
.target-text { display: flex; flex-direction: column; min-width: 0; }
.target-text .what { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target-text .sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-group { display: inline-flex; align-items: center; flex: none; }
.tool { height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--border-2); transition: background 0.15s, color 0.15s; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; flex: none; }
.tool:hover { background: var(--surface); color: var(--text); }
.tool.on { background: var(--surface-2); color: var(--text); border-color: transparent; }

.tool-group .tool.on { border-radius: 15px 0 0 15px; padding-right: 6px; }
.tool-x { height: 30px; padding: 0 9px 0 4px; border-radius: 0 15px 15px 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
.tool-x:hover { color: var(--text); }
/* The Layers lab (experimental): gold, as its Experimental badge. */
.tool.lab { color: var(--okay); background: var(--okay-bg); border-color: color-mix(in srgb, var(--okay) 35%, transparent); }
.tool.lab:hover { color: var(--okay); background: color-mix(in srgb, var(--okay) 20%, transparent); border-color: color-mix(in srgb, var(--okay) 55%, transparent); }
.refs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: none; max-width: 45%; padding: 6px 6px 0 0; margin-top: -6px; }
.ref { position: relative; width: 40px; height: 40px; border-radius: 10px; overflow: visible; flex: none; cursor: grab; }
.ref img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; box-shadow: var(--lift); display: block; background: var(--surface-2); }
.ref .num { position: absolute; left: 3px; top: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--invert-bg); color: var(--invert-text); font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.ref .rm { position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); color: var(--text); box-shadow: var(--shadow); display: none; place-items: center; }
.ref:hover .rm { display: grid; }
.ref .badge { position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; border-radius: 5px; background: var(--scrim); display: grid; place-items: center; }
.ref.dragging { opacity: 0.35; }
.ref.drop-before::before { content: ""; position: absolute; left: -5px; top: 4px; bottom: 4px; width: 2px; background: var(--text); border-radius: 1px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--surface-2); font-size: 12px; color: var(--text); }
.chip button { color: var(--text-2); }

.prompt { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 15.5px; line-height: 1.5; padding: 4px 2px; max-height: 200px; min-height: 26px; }
.prompt::placeholder { color: var(--text-3); }
/* Prompt+ review: its prompt streams into the box, read-only until it is done */
.prompt.writing { color: var(--text-2); cursor: progress; }
.prompt.writing::placeholder { animation: writing-pulse 1.6s ease-in-out infinite; }
@keyframes writing-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .prompt.writing::placeholder { animation: none; } }
.enhanced-from { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 0 2px; color: var(--text-3); font-size: 12px; min-width: 0; }
.enhanced-from .text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enhanced-from button.link { display: inline-flex; align-items: center; gap: 3px; text-decoration: none; color: var(--text-2); flex-shrink: 0; }
.enhanced-from button.link:hover { color: var(--text); text-decoration: underline; }
.controls { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.controls .spacer { flex: 1; }
.plan-hint { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 6px; }
.pill { height: 32px; padding: 0 10px; border-radius: 16px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s; }
/* the composer's settings: outlined capsules; a switch that is on is filled with ink */
.controls .pill { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-2); font-size: 12.5px; }
.pill:hover { background: var(--surface); color: var(--text); }
.pill.on { color: var(--text); background: var(--surface); }
.send { width: 36px; height: 36px; flex: none; padding: 0; aspect-ratio: 1; border-radius: 50%; background: var(--invert-bg); color: var(--invert-text); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(13, 13, 13, 0.5); transition: transform 0.2s var(--ease), opacity 0.2s; }
.send:hover:not(:disabled) { transform: translateY(-1px); }
.send:disabled { opacity: 0.25; box-shadow: none; }

/* popovers */
.popover { position: absolute; z-index: 40; min-width: 200px; background: var(--bg); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; animation: pop-in 0.22s var(--ease) both; }
@keyframes pop-in { from { opacity: 0; filter: blur(4px); transform: translateY(4px) scale(0.985); } to { opacity: 1; filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) { .popover { animation: none; } }
.popover .opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left; font-size: 13px; }
.popover .opt:hover { background: var(--surface); }
.popover .opt .sub { color: var(--text-3); font-size: 12px; margin-left: auto; padding-left: 16px; }
.popover .opt .check { width: 16px; }
.add-menu { width: 300px; }
.add-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px 8px 8px; max-height: 240px; overflow-y: auto; }
.add-grid button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--text-2); }
.add-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface); outline: 2px solid transparent; outline-offset: 1px; }
.add-grid button:hover img { outline-color: var(--text-2); }
.popover .label { font-size: 11px; color: var(--text-3); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: 0.04em; }

.panel { width: 360px; padding: 14px; display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow-y: auto; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-row > span { font-size: 12px; color: var(--text-2); }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* buttons beside a setting keep one line and one width, with room from the text */
.field-row > .btn { flex: none; min-width: 84px; justify-content: center; white-space: nowrap; margin-left: 12px; }
.setting-card { display: flex; align-items: center; gap: 20px; padding: 16px 18px; border-radius: 14px; background: var(--ground); box-shadow: inset 0 0 0 1px var(--border); }
.setting-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.setting-card-text strong { font-size: 13.5px; font-weight: 600; }
.setting-card .btn { flex: none; white-space: nowrap; }
.input, .select { height: 32px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--bg); padding: 0 10px; outline: none; min-width: 0; }
.input:focus, .select:focus { border-color: var(--text-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent); }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 60px; }
.seg { display: flex; background: var(--surface); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 28px; border-radius: 8px; font-size: 12px; color: var(--text-2); padding: 0 6px; white-space: nowrap; }
.seg button.on { background: var(--pick-bg); color: var(--text); box-shadow: var(--pick); }
input[type="range"] { width: 100%; accent-color: var(--text); }
.switch { width: 34px; height: 20px; border-radius: 10px; background: var(--surface-3); position: relative; flex: none; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); transition: left 0.15s; }
.switch.on { background: var(--text); }
.switch.on::after { left: 17px; }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }
.btn { height: 34px; padding: 0 14px; border-radius: 11px; background: var(--surface); transition: background 0.15s, opacity 0.15s; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn.primary { background: var(--invert-bg); color: var(--invert-text); }
.btn.primary:hover:not(:disabled) { opacity: 0.88; background: var(--invert-bg); }
.muted { color: var(--text-3); font-size: 12px; }

/* ---------- overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 30; background: var(--ground); display: flex; flex-direction: column; animation: fade 0.3s ease-out both; }
.overlay-head { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; flex: none; }
.overlay-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.overlay-head .spacer { flex: 1; }
.modal-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(13, 13, 12, 0.34); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; animation: fade 0.25s ease-out both; }
.modal { width: min(760px, 92vw); height: min(640px, 88vh); background: var(--bg); border-radius: 22px; animation: welcome-in 0.35s var(--ease) both; box-shadow: var(--shadow); display: flex; overflow: hidden; position: relative; }
/* Settings: leaving with unsaved changes (Settings.tsx). */
.modal-ask { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; background: rgba(13, 13, 12, 0.28); animation: fade 0.15s ease-out both; }
.modal-ask-box { width: min(360px, 100%); display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--bg); border-radius: 16px; box-shadow: var(--shadow); font-size: 13px; }
.modal-ask-box strong { font-size: 15px; font-weight: 600; }
.modal-ask-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.modal-nav { width: 190px; padding: 14px 8px; background: var(--ground); display: flex; flex-direction: column; gap: 2px; }
.modal-nav button { text-align: left; padding: 8px 12px; border-radius: 11px; transition: background 0.15s, box-shadow 0.2s, color 0.15s; color: var(--text-2); display: flex; gap: 10px; align-items: center; }
.modal-nav button:hover:not(.on) { background: var(--surface); color: var(--text); }
.modal-nav button.on { background: var(--bg); color: var(--text); box-shadow: var(--lift); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-body h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.path-row { display: flex; gap: 6px; }
.path-row .input { flex: 1; font-size: 12px; }
pre.diag { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11px; background: var(--surface); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-all; user-select: text; margin: 0; flex: 1; overflow: auto; }
.check-list { display: flex; flex-direction: column; gap: 2px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.check-item .what { flex: 1; min-width: 0; }
.check-item .detail { font-size: 12px; color: var(--text-3); word-break: break-all; }

/* gallery */
.gallery-bar { display: flex; gap: 8px; align-items: center; padding: 0 16px 12px; }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--bg); box-shadow: var(--lift); border-radius: 12px; padding: 0 10px; height: 34px; color: var(--text-3); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--text); }
.grid { flex: 1; overflow-y: auto; padding: 4px 16px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-content: start;
  /* Without this, Chromium/WebView2 squeezes the implicit rows to fit the scroll box when the
     window is short (e.g. 150% display scaling) and the square cards overlap the next row. */
  grid-auto-rows: max-content; }
.card { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg); box-shadow: var(--lift); aspect-ratio: 1; cursor: pointer; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); animation: rise 0.5s var(--ease) backwards; }
.card:hover { transform: translateY(-2px); box-shadow: var(--print); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .card-actions { position: absolute; right: 6px; top: 6px; display: none; gap: 4px; }
.card:hover .card-actions, .card .card-actions.fav { display: flex; }
.card .card-actions button { width: 28px; height: 28px; border-radius: 8px; background: var(--scrim); display: grid; place-items: center; color: var(--text); }
.card .card-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.6)); display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:hover .card-meta { display: block; }

/* editors */
.editor-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px 24px; position: relative; overflow: hidden; }
.editor-tools { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px 18px; flex-wrap: wrap; }
.editor-tools .group { display: flex; align-items: center; gap: 4px; background: var(--bg); box-shadow: var(--lift); border-radius: 14px; padding: 4px; }
.editor-tools .slider { display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 12px; color: var(--text-2); }
.editor-tools .slider input { width: 110px; }
.mask-wrap { position: relative; touch-action: none; }
.mask-wrap img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.mask-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: difference; opacity: 0.75; cursor: none; }
.brush-cursor { position: absolute; pointer-events: none; border: 1.5px solid #fff; mix-blend-mode: difference; border-radius: 50%; transform: translate(-50%, -50%); }

/* layers lab (LayersEditor.tsx) */
.layers-status { font-size: 12px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The zoom viewport fills its stage edge to edge (inset 0): here the stage is a framed area with a
   gap on both sides, so a zoomed image never runs into the window edge or the right bar. */
.layers-body { flex: 1; min-height: 0; display: flex; gap: 16px; padding: 0 16px; }
.layers-body .editor-stage { flex: 1; min-width: 0; padding: 0; border-radius: var(--radius); background: var(--surface); }
.layers-body .mask-wrap canvas { mix-blend-mode: normal; opacity: 1; }
/* Inpaint with colours: the marks as they go to the model (opaque), a little see-through here. */
.mask-wrap canvas.marks { mix-blend-mode: normal; opacity: 0.85; }
/* One area: pink with a light edge, as the painted area in the layers lab. */
.mask-wrap canvas.area { mix-blend-mode: normal; opacity: 0.5; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
.inpaint-kind { flex: none; background: transparent; padding: 0; }
.inpaint-kind button { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; }
.marks-panel { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 16px 0; }
.marks-help { margin: 0; font-size: 12px; color: var(--text-2); text-align: center; max-width: 560px; }
.marks-want { display: flex; align-items: center; gap: 8px; width: min(480px, 100%); }
.marks-want input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.marks-want input:focus { outline: none; border-color: var(--border-2); }
.marks-want.on-stage { position: absolute; z-index: 2; width: 320px; padding: 4px 4px 4px 8px; border-radius: 10px; background: var(--surface); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); cursor: auto; }
.marks-want.on-stage input { height: 28px; }
.marks-colours { gap: 6px; padding: 5px 8px; }
.layers-panel { width: 300px; flex: none; display: flex; flex-direction: column; gap: 6px; padding: 0 0 4px; overflow-y: auto; font-size: 12px; }
.layers-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.layers-title .spacer { flex: 1; }
.layer-row { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 8px; border-radius: 10px; background: var(--bg); box-shadow: var(--lift); cursor: pointer; border: 1.5px solid transparent; }
.layer-row.on { border-color: var(--text); }
.layer-row.bg { cursor: default; color: var(--text-2); padding: 8px; }
.layer-row .swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; background: repeating-conic-gradient(var(--checker) 0 25%, var(--bg) 0 50%) 0 0 / 6px 6px; }
.layer-row input { flex: 1; min-width: 0; border: none; background: transparent; color: var(--text); font: inherit; padding: 2px 4px; border-radius: 6px; }
.layer-row input:focus { outline: 1px solid var(--border-2); }
.doc-name { flex: 1; min-width: 0; padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-pct { color: var(--text-3); font-variant-numeric: tabular-nums; }
.layers-view { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.layers-view span { color: var(--text-2); margin-right: 4px; }
.layers-opt { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.layers-opt input[type="range"] { flex: 1; }
.layers-help { color: var(--text-3); line-height: 1.45; margin: 4px 0; }
.layers-split { margin-top: auto; }
.doc-frame { background: repeating-conic-gradient(var(--checker) 0 25%, var(--bg) 0 50%) 0 0 / 24px 24px; overflow: hidden; }
.mask-wrap img.doc-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.doc-hit { position: absolute; inset: 0; }
.mask-wrap img.doc-mask { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mask-wrap div.doc-layer { position: absolute; inset: 0; pointer-events: none; }
.mask-wrap img.doc-crop-mask { position: absolute; pointer-events: none; }
.doc-mask-chip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 6px 12px; border-radius: 999px; background: #ff3b6b; color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; box-shadow: var(--lift); }
.doc-sel { position: absolute; border: 1.5px dashed #fff; outline: 1px solid rgba(0, 0, 0, 0.45); pointer-events: none; box-sizing: border-box; }
.doc-handle { position: absolute; background: #fff; border: 1.5px solid #000; border-radius: 2px; pointer-events: auto; cursor: nwse-resize; box-sizing: border-box; }
.doc-handle.tr, .doc-handle.bl { cursor: nesw-resize; }
.brush-cursor.pencil { mix-blend-mode: normal; }
.doc-sel-part { border-style: solid; outline: none; opacity: 0.6; }
.layers-body .mask-wrap canvas.doc-marks { pointer-events: none; opacity: 0.9; }
.doc-group { display: flex; color: var(--text-3); }
.doc-actions-title { display: flex; align-items: center; gap: 6px; }
.doc-want { display: flex; align-items: center; gap: 8px; }
.doc-want input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.doc-want input:focus { outline: none; border-color: var(--border-2); }
.doc-swatch { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.doc-colour { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); cursor: pointer; padding: 0; }
.doc-colour.on { border-color: var(--bg); box-shadow: 0 0 0 2px var(--text); }
.doc-grid .doc-wide { grid-column: 1 / -1; }
.doc-row { position: relative; }
.lab-frame { position: relative; max-width: 100%; max-height: 100%; height: 100%; padding: 0; border: none; background: repeating-conic-gradient(var(--checker) 0 25%, var(--bg) 0 50%) 0 0 / 24px 24px; border-radius: var(--radius-img); overflow: hidden; box-shadow: var(--print); display: grid; place-items: center; }
.lab-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lab-frame img.lab-marks { position: absolute; inset: 0; opacity: 0.9; pointer-events: none; }
.mask-wrap img.doc-marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.9; }
.lab-open { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: none; border-radius: 999px; background: var(--invert-bg); color: var(--invert-text); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; box-shadow: var(--lift); opacity: 0.92; transition: opacity 0.15s; }
.lab-open:hover, .lab-open:focus-visible { opacity: 1; }
.lab-jobs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.lab-jobs.on-stage { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2; justify-content: center; }
.lab-progress { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--invert-bg); color: var(--invert-text); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: var(--lift); }
.lab-progress.failed { background: #b42318; color: #fff; white-space: normal; }
.lab-dismiss { display: grid; place-items: center; border: none; background: transparent; color: inherit; padding: 0; margin-left: 2px; cursor: pointer; opacity: 0.8; }
.lab-dismiss:hover { opacity: 1; }
.doc-running { display: inline-flex; align-items: center; gap: 4px; }
.doc-row.dragging { opacity: 0.5; }
.doc-row.drop-above { box-shadow: 0 -2px 0 0 var(--text), var(--lift); }
.doc-row.drop-below { box-shadow: 0 2px 0 0 var(--text), var(--lift); }
.doc-running { color: var(--text); font-weight: 600; }
.doc-row .grip { display: flex; color: var(--text-3); cursor: grab; touch-action: none; padding: 2px 0; }
.doc-thumb { width: 40px; height: 30px; flex: none; border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(var(--checker) 0 25%, var(--bg) 0 50%) 0 0 / 8px 8px; }
.doc-thumb img { max-width: 100%; max-height: 100%; display: block; }
/* Stickers being made (LayerDoc): objects on transparency, the background fading back at the end. */
.mask-wrap img.doc-layer { transition: opacity 0.6s; }
.doc-frame.stickering { background: repeating-conic-gradient(var(--checker) 0 25%, var(--bg) 0 50%) 0 0 / 24px 24px; }
.mask-wrap img.doc-layer.st-hide { opacity: 0; }
.mask-wrap img.doc-layer.st-waiting { opacity: 0.4; }
.mask-wrap img.doc-layer.st-making { filter: drop-shadow(0 0 2px #ff3b6b) drop-shadow(0 0 8px rgba(255, 59, 107, 0.6)); }
.mask-wrap img.doc-layer.st-done { animation: sticker-in 0.6s ease-out; }
@keyframes sticker-in { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }
.sticker-ring { position: absolute; pointer-events: none; display: grid; place-items: center; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.sticker-ring.waiting { opacity: 0.8; }
.sticker-progress .track { fill: rgba(0, 0, 0, 0.45); stroke: rgba(255, 255, 255, 0.25); stroke-width: 4; }
.sticker-progress .bar { fill: none; stroke: #ff3b6b; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.4s; }
.sticker-progress text { fill: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sticker-strip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--invert-bg); color: var(--invert-text); font-size: 12px; font-weight: 500; white-space: nowrap; box-shadow: var(--lift); font-variant-numeric: tabular-nums; }
/* The strip is inverted (dark on light themes, light on dark): its buttons follow it, not the page. */
.sticker-strip .btn { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 999px; background: color-mix(in srgb, var(--invert-text) 12%, transparent); color: var(--invert-text); }
.sticker-strip .btn:hover { background: color-mix(in srgb, var(--invert-text) 22%, transparent); }
.doc-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.doc-actions-title { font-weight: 600; font-size: 12px; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.doc-grid .btn { justify-content: center; height: 34px; min-width: 0; white-space: nowrap; }
.doc-grid > :only-child { grid-column: 1 / -1; }
/* The lab's commands: the tool buttons' corners (.icon-btn, .btn), not a pill. */
.editor-tools .pill.doc-cmd { color: var(--text); font-weight: 500; height: 34px; padding: 0 12px; border-radius: 11px; }
.exp-tag { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; vertical-align: middle; color: var(--okay); background: var(--okay-bg); }
.editor-tools .pill.doc-cmd.stale { box-shadow: inset 0 0 0 1.5px var(--okay); }
.editor-tools .pill.doc-cmd.primary { background: var(--invert-bg); color: var(--invert-text); }
.editor-tools .pill.doc-cmd.primary:hover:not(:disabled) { opacity: 0.88; background: var(--invert-bg); }
.editor-tools .pill:disabled { opacity: 0.45; cursor: default; }
.editor-tools .slider .doc-cmd-val { min-width: 36px; color: var(--text); font-variant-numeric: tabular-nums; }
.editor-tools.locked .group, .layers-panel.locked { pointer-events: none; opacity: 0.5; transition: opacity 0.2s; }
/* Automatic shadows being made: the stage is held, the progress in the middle of the image. */
.doc-lock { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: color-mix(in srgb, #000 22%, transparent); cursor: progress; }
.doc-lock-card { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 16px; background: var(--invert-bg); color: var(--invert-text); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; box-shadow: var(--lift); }
.doc-lock-card span { display: flex; flex-direction: column; gap: 2px; }
.doc-lock-card small { font-size: 12px; font-weight: 400; opacity: 0.7; }
.doc-none { margin-top: 10px; }
.layers-panel > * { flex-shrink: 0; }
.doc-versions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px; border-radius: 12px; background: var(--bg); box-shadow: var(--lift); }
.doc-version { min-width: 0; border: 1.5px solid transparent; border-radius: 8px; padding: 2px; background: repeating-conic-gradient(var(--checker) 0 25%, var(--bg) 0 50%) 0 0 / 8px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--text-2); }
.doc-version.on { border-color: var(--text); }
.doc-version img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; }

.expand-area { position: relative; }
.expand-canvas { position: absolute; border: 1.5px dashed var(--text-2); border-radius: 4px; background-image: conic-gradient(var(--checker) 25%, transparent 0 50%, var(--checker) 0 75%, transparent 0); background-size: 16px 16px; }
.expand-src { position: absolute; }
.expand-src.movable { cursor: grab; touch-action: none; }
.expand-src.movable:active { cursor: grabbing; }
/* Place the image: 3x3 dots, the image's spot filled (ExpandEditor.tsx). */
.anchor-grid { display: grid; grid-template-columns: repeat(3, 12px); grid-template-rows: repeat(3, 12px); gap: 2px; padding: 3px 6px; }
.anchor-grid button { display: grid; place-items: center; border-radius: 3px; }
.anchor-grid button span { width: 6px; height: 6px; border-radius: 2px; background: var(--text-3); opacity: 0.5; transition: opacity 0.15s, background 0.15s, transform 0.15s; }
.anchor-grid button:hover:not(:disabled) span { opacity: 1; background: var(--text); }
.anchor-grid button.on span { opacity: 1; background: var(--text); transform: scale(1.35); }
.anchor-grid button:disabled { cursor: default; }
.anchor-grid button:disabled span { opacity: 0.2; }
.expand-src img { width: 100%; height: 100%; display: block; }
.handle { position: absolute; background: var(--text); border-radius: 3px; z-index: 2; }
.handle.h { width: 6px; height: 40px; cursor: ew-resize; transform: translate(-50%, -50%); }
.handle.v { width: 40px; height: 6px; cursor: ns-resize; transform: translate(-50%, -50%); }
.num-input { width: 74px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); padding: 0 8px; text-align: right; outline: none; }
.expand-fields { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.expand-fields label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { animation: toast-in 0.35s var(--ease) both; background: var(--invert-bg); color: var(--invert-text); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.toast .body { flex: 1; min-width: 0; }
.toast .sugg { opacity: 0.75; margin-top: 2px; }
.toast pre { white-space: pre-wrap; word-break: break-all; font-size: 11px; max-height: 160px; overflow: auto; opacity: 0.8; margin: 8px 0 0; user-select: text; }
.toast button { color: inherit; opacity: 0.7; font-size: 12px; }
/* Settings → General: where Kokon lives (the repository), at the top */
.repo-card { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.repo-card .github-mark { flex: none; color: var(--text); }
.repo-card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.4; }
.repo-card .btn { flex: none; }
.support-card { background: transparent; }
.support-card .support-mark { flex: none; color: var(--text-2); margin: 0 2px; }
.star-prompt { animation: toast-in 0.35s var(--ease) both; background: var(--bg); color: var(--text); border: 0; border-radius: 14px; padding: 14px 14px 12px 16px; box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.star-prompt .body { flex: 1; min-width: 0; }
.star-prompt .sugg { color: var(--text-2); margin-top: 2px; }
.star-prompt > button { color: var(--text-3); }
.star-actions { display: flex; gap: 6px; margin-top: 10px; }
.star-actions .btn { height: 30px; padding: 0 12px; }

.drop-hint { position: absolute; inset: 12px; z-index: 35; border: 2px dashed var(--text-2); border-radius: 18px; display: grid; place-items: center; background: var(--scrim); pointer-events: none; font-size: 15px; color: var(--text); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.private-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--invert-bg); color: var(--invert-text); font: inherit; font-size: 13px; cursor: pointer; }
.update-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--bg); box-shadow: var(--lift); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.update-pill:hover:not(:disabled) { background: var(--surface); }
.update-pill:disabled { cursor: default; color: var(--text-2); }
.setup { flex: 1; display: flex; justify-content: center; overflow-y: auto; padding: 40px 24px 0; }
/* Bottom room inside the scroller (padding on the scroller itself is dropped by Chromium). */
.setup-inner { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 20px; padding-bottom: 72px; height: fit-content; }
.setup h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 6px; }
.setup-lead { font-size: 14px; color: var(--text-2); margin: 0; line-height: 1.5; }
.setup-card { display: flex; gap: 10px; align-items: center; padding: 14px 16px; background: var(--bg); box-shadow: var(--lift); border-radius: 14px; }
.setup-gpu { flex-direction: column; align-items: flex-start; gap: 2px; }
.setup-note { font-size: 13px; color: var(--text-2); padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; line-height: 1.45; }
.setup-failure { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border); font-size: 12px; word-break: break-word; }
.setup-failure strong { color: var(--text); font-size: 13px; }
.setup-progress { flex-direction: column; align-items: stretch; gap: 10px; padding: 18px 18px 16px; }
.setup-progress-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.setup-progress .pct { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.setup-progress .muted { font-variant-numeric: tabular-nums; }
.progress.thick { width: 100%; height: 6px; border-radius: 3px; }
.progress.thick > i { border-radius: 3px; }
.setup-ready { font-size: 14px; }
.setup-toggle { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13px; color: var(--text-2); padding: 2px 0; background: none; border: 0; cursor: pointer; }
.setup-toggle:hover { color: var(--text); }
.setup-files { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.setup-file { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; padding: 9px 14px; font-size: 13px; border-top: 1px solid var(--border); }
.setup-file:first-child { border-top: 0; }
.setup-file .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-file .state { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.setup-file.is-present, .setup-file.is-done { color: var(--text-2); }
.setup-file.is-failed .state { color: var(--text); font-weight: 600; }
/* Always in view at the foot of the window (Start/Done was below the fold), the page scrolling under it. */
.setup-actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 -24px; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); background: var(--ground); border-top: 1px solid var(--border); }
.btn.big { height: 42px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
.btn.ghost { background: transparent; color: var(--text-2); }
.setup-foot { margin: 0; line-height: 1.5; }

/* before / after comparison */
.compare-bar { display: flex; gap: 8px; align-items: center; flex: none; }
.compare-bar .seg { min-width: 260px; }
/* comparison views, on the image itself */
.compare-overlay { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2; opacity: 0.85; transition: opacity 0.15s; }
.compare-overlay:hover { opacity: 1; }
.compare-overlay .compare-bar { gap: 4px; }
.compare-overlay .seg { min-width: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px); border-radius: 10px; }
.compare-overlay .seg button { height: 26px; padding: 0 10px; color: rgba(255, 255, 255, 0.8); }
.compare-overlay .seg button:hover { color: #fff; }
.compare-overlay .seg button.on { background: rgba(255, 255, 255, 0.92); color: #111; box-shadow: none; }
/* The checkerboard (transparent areas) is on the result image itself: while it loads, the box
   shows its developing placeholder instead (Develop.tsx). */
.compare-box { position: relative; border-radius: var(--radius-img); overflow: hidden; touch-action: none; user-select: none; }
.compare-img { background-image: conic-gradient(var(--checker) 25%, transparent 0 50%, var(--checker) 0 75%, transparent 0); background-size: 16px 16px; }
.compare-box.slider { cursor: ew-resize; }
/* the area painted for the next edit, drawn like in the inpaint editor */
/* The painted area (pink, see useMaskTint) or the coloured marks of the next edit. */
.stage-mask { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius-img); opacity: 0.9; pointer-events: none; }
.compare-box.slider.zoomed { cursor: inherit; }
.compare-img, .compare-diff { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Areas the original did not cover (expanded edges) show the checkerboard. */
.compare-before { position: absolute; inset: 0; background-color: var(--ground); background-image: conic-gradient(var(--checker) 25%, transparent 0 50%, var(--checker) 0 75%, transparent 0); background-size: 16px 16px; }
.compare-before img { position: absolute; display: block; }
.compare-handle { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); cursor: ew-resize; }
/* a wider grab area, so the handle can be dragged while zoomed in */
.compare-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: -14px; right: -14px; }
.compare-handle span { position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.compare-handle span::before, .compare-handle span::after { content: ""; position: absolute; top: 9px; border: 5px solid transparent; }
.compare-handle span::before { left: 2px; border-right-color: #333; }
.compare-handle span::after { right: 2px; border-left-color: #333; }
.compare-tag { position: absolute; top: 8px; padding: 2px 8px; border-radius: 6px; font-size: 11px; color: #fff; background: rgba(0, 0, 0, 0.55); pointer-events: none; }
.compare-tag.left { left: 8px; }
.compare-tag.right { right: 8px; }

/* An image developing into view (Develop.tsx): hidden until decoded, over a blurred thumbnail or a
   slow sheen, then it sharpens in while the placeholder fades off. Replaces the checkerboard
   that used to show while a picture loaded. */
.develop-ph { position: absolute; inset: 0; z-index: 1; overflow: hidden; border-radius: var(--radius-img); background: var(--surface); pointer-events: none; transition: opacity 0.55s var(--ease); }
.develop-ph.out { opacity: 0; }
.develop-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(16px) saturate(1.15); transform: scale(1.1); opacity: 0; transition: opacity 0.4s ease-out; }
.develop-ph img.on { opacity: 1; }
/* the sheen starts after a moment, so a quick load never flickers */
.develop-ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, var(--sheen) 50%, transparent 70%) no-repeat; background-size: 220% 100%; opacity: 0; animation: develop-sheen 1.9s 0.3s ease-in-out infinite; }
@keyframes develop-sheen { 0% { opacity: 1; background-position: 130% 0; } 100% { opacity: 1; background-position: -30% 0; } }
.develop-wait { opacity: 0; }
.develop-in { animation: develop-in 0.75s var(--ease) both; }
@keyframes develop-in { from { opacity: 0; filter: blur(14px) saturate(1.2); transform: scale(1.025); } 45% { opacity: 1; } to { opacity: 1; filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .develop-ph::after { animation: none; }
  .develop-in { animation: develop-fade 0.3s both; }
}
@keyframes develop-fade { from { opacity: 0; } to { opacity: 1; } }

/* image box + full-screen button */
.image-box { position: relative; }
/* LUT preview: the LUT image over the result, its opacity = the intensity. */
.lut-overlay { position: absolute; inset: 0; pointer-events: none; background: none; }
.lut-loading { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--bg); color: var(--text-2); }
.lut-bar { align-items: center; flex-wrap: wrap; justify-content: center; }
.lut-bar .btn.primary { margin-left: 4px; }
.lut-current { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.lut-intensity { display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lut-intensity input { width: 140px; }
.lut-intensity span { width: 38px; text-align: right; }
.lut-list { width: 300px; padding: 4px; display: flex; flex-direction: column; max-height: 360px; overflow: auto; }
.lut-list-title { padding: 6px 10px 4px; }
.lut-row { display: flex; align-items: center; gap: 2px; }
.lut-row .opt { flex: 1; min-width: 0; }
.lut-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-img.fill { width: 100%; height: 100%; max-width: none; max-height: none; display: block; }
.fullscreen-btn { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, 0.5); opacity: 0.75; transition: opacity 0.15s; }
.fullscreen-btn:hover, .fullscreen-btn:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.7); }
.compare-tag.right { right: 46px; }

/* full-screen viewer */
.viewer { position: fixed; inset: 0; z-index: 200; background: #000; }
.viewer-scroll { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.viewer-scroll.zoomed { display: block; overflow: auto; cursor: grab; scrollbar-width: none; }
.viewer-scroll.zoomed:active { cursor: grabbing; }
.viewer-img { max-width: 100vw; max-height: 100vh; object-fit: contain; display: block; cursor: zoom-in; user-select: none; }
/* zoom and pan (full screen and the inpaint editor): components/ZoomPan.tsx */
.zoom-pan-viewport { position: absolute; inset: 0; overflow: hidden; }
.zoom-pan-content { position: absolute; top: 0; left: 0; }
.zoom-pan-img { display: block; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.zoom-controls { position: absolute; bottom: 16px; left: 50%; z-index: 10; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; color: #fff; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px); transform: translateX(-50%); transition: opacity 0.2s; }
.zoom-controls.hidden { opacity: 0; pointer-events: none; }
.zoom-btn { height: 28px; min-width: 28px; border-radius: 8px; display: grid; place-items: center; color: rgba(255, 255, 255, 0.8); }
.zoom-btn.text { padding: 0 10px; font-size: 12px; }
.zoom-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); color: #fff; }
.zoom-pct { width: 52px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.zoom-minimap { position: absolute; right: 16px; bottom: 16px; z-index: 10; border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px); cursor: crosshair; touch-action: none; }
.zoom-minimap-img { display: block; width: 100%; height: 100%; opacity: 0.7; pointer-events: none; }
.zoom-minimap-viewport { position: absolute; border: 1.5px solid #fff; border-radius: 3px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4); pointer-events: none; }
/* comparison full screen: the frame leaves room for the view switch at the bottom */
.viewer-frame { position: absolute; inset: 60px 12px 64px; display: flex; align-items: center; justify-content: center; }
/* Viewer.tsx SwipeNav: fills its place, the page in it too (children keep their own positions) */
.swipe-nav, .swipe-nav-page { position: absolute; inset: 0; }
.swipe-nav { touch-action: pan-y; }
.swipe-nav-page.enter-right { animation: page-right 0.46s var(--ease) both; }
.swipe-nav-page.enter-left { animation: page-left 0.46s var(--ease) both; }
.viewer-compare-bar { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; }
.viewer-compare-bar .compare-bar { margin: 0; padding: 4px; border-radius: 12px; background: rgba(20, 20, 20, 0.85); }
/* the viewer is black in both themes: the switch too (the theme's light segments glared) */
.viewer-compare-bar .seg { background: transparent; }
.viewer-compare-bar .seg button { color: rgba(255, 255, 255, 0.7); }
.viewer-compare-bar .seg button.on { color: #fff; background: rgba(255, 255, 255, 0.2); box-shadow: none; }
/* full screen is viewed from further away: larger view switch and zoom bar */
.viewer-compare-bar .seg button { height: 34px; padding: 0 16px; font-size: 13px; }
.viewer .zoom-btn { height: 36px; min-width: 36px; }
.viewer .zoom-btn.text { padding: 0 14px; }
.viewer .zoom-btn.text, .viewer .zoom-pct { font-size: 13px; }
.viewer .zoom-pct { width: 60px; }
.viewer-bar { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 10px; }
.viewer-hint, .viewer-tag { font-size: 12px; color: rgba(255, 255, 255, 0.8); background: rgba(0, 0, 0, 0.55); padding: 4px 10px; border-radius: 8px; }
.viewer-tag { color: #fff; font-weight: 600; }
.viewer-close { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, 0.12); }
.viewer-close:hover { background: rgba(255, 255, 255, 0.22); }
/* previous / next on the sides of a picture; shown while the mouse moves */
.nav-arrow { position: absolute; top: 50%; z-index: 3; width: 48px; height: 48px; margin-top: -24px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, 0.5); transition: opacity 0.2s, background 0.15s; }
.nav-arrow.left { left: 14px; }
.nav-arrow.right { right: 14px; }
.nav-arrow:hover { background: rgba(0, 0, 0, 0.72); }
.nav-arrow.hidden { opacity: 0; }
/* A touch screen swipes instead (Viewer.tsx SwipeNav): the hidden arrows would only catch the
   swipes that start near an edge. */
@media (hover: none) and (pointer: coarse) { .nav-arrow { display: none; } }
.nav-arrow:focus-visible { opacity: 1; }

/* gallery preview: one image over the grid */
.preview { position: absolute; inset: 0; z-index: 5; background: var(--ground); display: flex; flex-direction: column; }
.preview-prompt { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-pos { font-size: 13px; font-variant-numeric: tabular-nums; }
.preview-stage { position: relative; flex: 1; min-height: 0; }
.preview-img { position: absolute; top: 0; bottom: 0; left: 76px; width: calc(100% - 152px); height: 100%; user-select: none; }
.preview-img > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-img .develop-ph { background: none; }
.preview-img .develop-ph img { object-fit: contain; }
.preview-bar { display: flex; align-items: center; gap: 6px; padding: 10px 16px 14px; flex: none; }
.preview-bar .spacer { flex: 1; }
.preview-bar .btn.primary { margin-left: 6px; }

/* ---------- aspect ratio and size menus ---------- */
.popover.wide { min-width: 0; }
/* the width is a class, not inline, so phones can widen it (sheet) */
/* Everything in it can be copied. In the stylesheet, not inline: the build adds -webkit-user-select,
   which WebKit (macOS, Linux, iPhone) needs to undo the body's; an inline style gets no prefix. */
.info-panel { width: 340px; user-select: text; }
.info-prompt { display: flex; align-items: flex-start; gap: 4px; }
.info-prompt > div { flex: 1; min-width: 0; }
.upscale-menu { width: 300px; }
/* Prompt+ menu: one line per choice */
.popover.prompt-plus { width: 280px; }
.popover.prompt-plus .opt > span:not(.check) { white-space: nowrap; }
.popover.prompt-plus .opt .check { flex: none; }
/* The menu's own title (Prompt+), above its sections' small labels (Detail). */
.popover .menu-title { font-size: 13px; font-weight: 600; color: var(--text); padding: 6px 10px 4px; }
.popover .menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.ratio-icon { display: inline-grid; place-items: center; flex: none; }
.ratio-icon i { display: block; border: 1.5px solid currentColor; border-radius: 3px; box-sizing: border-box; }
.aspect-menu { width: 296px; display: flex; flex-direction: column; gap: 6px; }
.aspect-auto { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 13px; text-align: left; }
.aspect-auto:hover, .aspect-auto.on { background: var(--surface); }
.aspect-auto .sub { color: var(--text-3); font-size: 12px; margin-left: auto; }
.aspect-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.aspect-grid button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px 6px; border-radius: 9px; font-size: 12px; color: var(--text-2); }
.aspect-grid button:hover { background: var(--surface); color: var(--text); }
.aspect-grid button.on { background: var(--invert-bg); color: var(--invert-text); }
.aspect-custom { display: flex; align-items: center; gap: 8px; padding: 6px 4px 2px 10px; border-top: 1px solid var(--border); font-size: 12px; }
.aspect-custom .btn { height: 30px; margin-left: auto; }
.pair { display: inline-flex; align-items: center; gap: 6px; }
.pair .input { width: 72px; height: 30px; padding: 0 8px; }
.ratio-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.res-menu { width: 340px; }
.res-custom { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 9px; }
.res-custom.on { background: var(--surface); }
.res-custom-head { display: flex; align-items: center; gap: 10px; font-size: 13px; text-align: left; }
.res-custom-head .check { width: 16px; display: grid; place-items: center; }
.res-custom-row { display: flex; align-items: center; gap: 6px; padding-left: 26px; }
.size-presets { flex-wrap: wrap; }
.size-presets button { height: 26px; padding: 0 10px; border-radius: 13px; background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.size-presets button:hover:not(:disabled):not(.on) { color: var(--text); }
.size-presets button.on { background: var(--invert-bg); color: var(--invert-text); }
.res-foot { padding: 8px 10px 4px; border-top: 1px solid var(--border); margin-top: 4px; font-size: 12px; }
.expand-size { width: 280px; display: flex; flex-direction: column; gap: 8px; padding: 6px; font-size: 12px; }
.expand-final { color: var(--text); font-weight: 600; }
.editor-tools .group .pill:hover { background: var(--surface-2); }

/* a thumbnail dragged from the timeline */
.drag-ghost { position: fixed; z-index: 100; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; pointer-events: none; transform: translate(-50%, -60%) rotate(-3deg); box-shadow: var(--shadow); opacity: 0.85; }
.drag-ghost.over { opacity: 1; transform: translate(-50%, -60%) scale(1.08); }

/* Welcome (first launch), showcase (while downloading), ready tips (end of setup). */
.kokon-mark { display: inline-flex; color: var(--text); }
.kokon-mark svg { display: block; }
.welcome { width: min(620px, 92vw); max-height: 90vh; overflow-y: auto; background: var(--bg); border-radius: 22px; box-shadow: var(--shadow); padding: 36px 36px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; animation: welcome-in 0.35s ease-out; }
.welcome h1 { font-size: 26px; letter-spacing: -0.02em; margin: 4px 0 0; }
.welcome-lead { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.55; max-width: 500px; text-wrap: balance; }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin: 8px 0 6px; text-align: left; }
.welcome-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border-radius: 14px; font-size: 13px; line-height: 1.45; }
.welcome-item svg { margin-bottom: 4px; }
.welcome-item strong { font-size: 14px; }
.welcome-item span { color: var(--text-2); }
.welcome .btn.big { min-width: 200px; justify-content: center; }
.welcome-foot { font-size: 12px; }
/* The update buttons stay in view while the notes scroll (the dialog's bottom padding is 26px). */
.welcome-actions { position: sticky; bottom: -26px; width: calc(100% + 72px); margin: 0 -36px -26px; padding: 14px 36px 22px; background: var(--bg); border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.welcome-buttons { display: flex; gap: 10px; }
/* A phone has no room for two 200 px buttons side by side: stacked, full width, Update first. */
@media (max-width: 560px) {
  .welcome-actions { width: calc(100% + 40px); margin: 0 -20px -20px; padding: 12px 20px 18px; bottom: -20px; }
  .welcome-buttons { flex-direction: column; align-self: stretch; }
  .welcome-buttons .btn.big { min-width: 0; width: 100%; }
}
.update-offers { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; }
.update-offer { display: flex; gap: 10px; align-items: flex-start; }
.update-offer > input { margin-top: 3px; flex: none; }
.update-offer > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.update-offer strong { color: var(--text); font-size: 14px; }
.update-offer .model-files .update-detail { font-size: 12px; color: var(--text-2); line-height: 1.45; margin-top: 4px; }
/* In a short window the dialog scrolls instead of squeezing its parts (logo, button). */
.welcome > * { flex-shrink: 0; }
/* Scrolls without a visible bar (wheel and touchpad still work). */
.welcome { scrollbar-width: none; }
.welcome::-webkit-scrollbar { display: none; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .welcome-grid { grid-template-columns: 1fr; } .welcome { padding: 28px 20px 20px; } }

.showcase { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; }
.showcase-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.showcase-media { position: relative; aspect-ratio: 2 / 1; border-radius: 10px; overflow: hidden; background: var(--surface); }
.showcase-media img, .showcase-media video { width: 100%; height: 100%; object-fit: contain; display: block; animation: welcome-fade 0.4s ease-out; }
.showcase-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--text); box-shadow: var(--shadow); opacity: 0; transition: opacity 0.15s; }
.showcase-media:hover .showcase-nav { opacity: 0.92; }
.showcase-nav.prev { left: 10px; }
.showcase-nav.next { right: 10px; }
.showcase-caption { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.showcase-caption span { color: var(--text-2); }
.showcase-dots { display: flex; gap: 6px; justify-content: center; }
.showcase-dots button { width: 6px; height: 6px; padding: 0; border-radius: 50%; background: var(--surface-3); }
.showcase-dots button.on { background: var(--text); }
@keyframes welcome-fade { from { opacity: 0; } to { opacity: 1; } }

.ready-tips { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; background: var(--surface); border-radius: 14px; font-size: 13px; line-height: 1.5; }
.ready-tips ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .welcome, .showcase-media img, .showcase-media video { animation: none; } }

/* Startup: continues the HTML splash of index.html. */
/* Same box as the index.html splash (full window, mark centred); the text sits under the
   mark without moving it, so the hand-over from the HTML splash does not jump. */
.boot-splash { position: relative; width: 100%; height: 100vh; display: grid; place-items: center; }
.boot-splash .kokon-mark svg { width: 56px; height: 56px; }
.boot-splash .kokon-mark { animation: boot-breathe 1.6s ease-in-out infinite; opacity: 0.9; }
.boot-text { position: absolute; top: calc(50% + 48px); left: 0; right: 0; text-align: center; font-size: 13px; opacity: 0; transition: opacity 0.4s; }
.boot-text.on { opacity: 1; }
@keyframes boot-breathe { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .boot-splash .kokon-mark { animation: none; } }
.welcome-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.welcome-check input { width: 15px; height: 15px; accent-color: var(--text); margin: 0; }

/* first-run tour: the target stays lit, a card explains it */
.tour { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); outline: 2px solid var(--text); outline-offset: 0; transition: left 0.25s, top 0.25s, width 0.25s, height 0.25s; }
.tour-dim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); }
.tour-card { position: fixed; pointer-events: auto; background: var(--bg); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; transition: left 0.25s, top 0.25s; }
.tour-head { display: flex; align-items: center; gap: 8px; }
.tour-head strong { flex: 1; font-size: 14px; }
.tour-x { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); }
.tour-x:hover { background: var(--surface); color: var(--text); }
.tour-card p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tour-dots { flex: 1; display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3); }
.tour-dots i.on { background: var(--text); }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; } }

/* Upscalers: separator in the Advanced menu and the comparison dialog. */
.menu-sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.upscaler-compare { width: min(880px, 94vw); max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 22px; animation: welcome-in 0.35s var(--ease) both; box-shadow: var(--shadow); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.upscaler-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.upscaler-grid figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.upscaler-grid img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; border-radius: 10px; background: var(--surface); }
.upscaler-grid figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.4; color: var(--text-2); }
.upscaler-grid figcaption strong { color: var(--text); font-size: 13px; }
@media (max-width: 760px) { .upscaler-grid { grid-template-columns: repeat(2, 1fr); } }

/* prompt tips (lightbulb in the composer) */
:root { --good: #1a7f37; --good-bg: rgba(26, 127, 55, 0.1); --bad: #c62828; --bad-bg: rgba(198, 40, 40, 0.09); --okay: #9a6700; --okay-bg: rgba(191, 135, 0, 0.12); }
:root[data-theme="dark"] { --good: #7ee2a0; --good-bg: rgba(74, 222, 128, 0.12); --bad: #ff8f8f; --bad-bg: rgba(255, 99, 99, 0.12); --okay: #f5d77a; --okay-bg: rgba(245, 197, 24, 0.12); }

button.link { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; padding: 0; }
button.link:hover { color: var(--text); }
.tips { width: min(860px, 94vw); max-height: 90vh; display: flex; flex-direction: column; gap: 12px; background: var(--bg); border-radius: 22px; box-shadow: var(--shadow); padding: 22px 24px 18px; animation: welcome-in 0.25s ease-out; }
.tips-head { display: flex; align-items: center; gap: 10px; }
.tips-head h1 { font-size: 20px; letter-spacing: -0.02em; margin: 0; }
.tips-head .spacer { flex: 1; }
.tips-lead { margin: -4px 0 0; color: var(--text-2); font-size: 13.5px; }
.tips-tabs { align-self: flex-start; }
.tips-tabs button { flex: none; padding: 0 14px; }
.tips-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; margin: 0 -6px; padding: 0 6px; }
.tips-rule { background: var(--surface); border-radius: 16px; padding: 14px 16px; }
/* keyboard shortcuts panel ("?") */
.shortcuts { width: min(760px, 94vw); }
.shortcuts-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-content: start; }
.shortcuts-body h2 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
/* "Check an image" for AI marking (Settings → General) */
.ai-check { width: min(560px, 94vw); }
.ai-check .tips-body > p { margin: 0; font-size: 13px; line-height: 1.45; }
.ai-check-pick { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ai-check-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-check-result { background: var(--surface); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-check-result h2 { margin: 0; font-size: 16px; }
.ai-check-result p { margin: -4px 0 0; font-size: 12.5px; }
.ai-check-result dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.ai-check-result dt { color: var(--text-2); }
.ai-check-result dd { margin: 0; overflow-wrap: anywhere; }
.ai-check-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.ai-check-foot .btn { display: inline-flex; align-items: center; gap: 6px; }
.ai-marking-card { background: transparent; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; color: var(--text-2); }
.shortcut-row .keys { display: flex; align-items: center; gap: 4px; flex: none; font-size: 12px; }
kbd { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; display: inline-grid; place-items: center; font: inherit; font-size: 11.5px; color: var(--text); background: var(--bg); box-shadow: inset 0 -1px 0 var(--border), 0 0 0 1px var(--border); }
.tips-rule h2 { font-size: 15px; margin: 0; display: flex; gap: 8px; align-items: baseline; }
.tips-num { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tips-why { margin: 4px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.tips-pair { display: grid; gap: 10px; margin-top: 10px; }
.tips-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tips-side img { width: 100%; height: auto; border-radius: 10px; background: var(--surface-2); }
.tips-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tips-tag.bad { color: var(--bad); background: var(--bad-bg); }
.tips-tag.good { color: var(--good); background: var(--good-bg); }
.tips-tag.ok { color: var(--okay); background: var(--okay-bg); }
.tips-tag.src { color: var(--text-2); background: var(--surface-2); }
.tips-prompt { font-size: 12px; line-height: 1.45; background: var(--bg); border-radius: 8px; padding: 6px 8px; overflow-wrap: anywhere; user-select: text; }
.tips-note { font-size: 12px; color: var(--text-2); }
.tips-try { align-self: flex-start; height: 26px; font-size: 12px; padding: 0 10px; }
.tips-lesson { margin: 10px 0 0; font-size: 13px; font-weight: 500; }
.tips-check { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.tips-check li { display: flex; gap: 6px; align-items: center; }
.tips-check svg { color: var(--good); flex: none; }
.tips-more { align-self: center; flex: none; margin-top: 2px; }
@media (max-width: 640px) { .tips-check { grid-template-columns: 1fr; } }
/* Setup: where the model comes from (two cards), and the user's own files (#14) */
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; }
.choice-card:hover { background: var(--surface); }
.choice-card.on { border-color: var(--text-2); background: var(--surface); color: var(--text); }
.choice-card svg { flex: none; margin-top: 2px; }
.choice-card strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 3px; }
.choice-card span { font-size: 12px; line-height: 1.4; }
.own-start { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 24px 20px; border: 1px dashed var(--border); border-radius: 12px; color: var(--text-2); }
.own-start strong { font-size: 15px; color: var(--text); }
.own-start .muted { max-width: 440px; line-height: 1.45; }
.own-start .btn { margin-top: 6px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.own-models { display: flex; flex-direction: column; gap: 12px; }
.own-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.own-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.own-head strong { font-size: 14px; }
.own-head .muted { font-size: 12px; }
.own-head .btn { flex: none; }
.own-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.own-row { border-top: 1px solid var(--border); }
.own-row:first-child { border-top: 0; }
.own-row-main { display: grid; grid-template-columns: 16px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; }
.own-row-main > svg { color: var(--text-2); }
.own-row.bad .own-row-main > svg, .own-row.bad .own-row-value { color: var(--text); font-weight: 600; }
.own-row-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.own-row-label { font-size: 12px; color: var(--text-2); }
.own-row-value { font-size: 13px; overflow-wrap: anywhere; }
.own-row-path { font-size: 11px; color: var(--text-3); overflow-wrap: anywhere; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.own-options { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 10px 42px; }
.own-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; background: transparent; border: 1px solid transparent; font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer; }
.own-option > span:first-child { display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.own-option .muted { font-size: 12px; flex: none; }
.own-option:hover { background: var(--surface); }
.own-option.on { border-color: var(--border); background: var(--surface); }
.own-download { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 12px; }
.own-download strong { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.own-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.own-actions .muted { font-size: 12px; }
@media (max-width: 560px) { .choice-cards { grid-template-columns: 1fr; } }
.setup-repair { display: flex; flex-direction: column; gap: 8px; }
.setup-repair strong { color: var(--text); font-size: 14px; }
.setup-repair .missing { font-size: 12px; word-break: break-word; }
.setup-repair .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.setup-repair .actions { align-items: center; }
.repair-result { font-size: 12px; color: var(--text); }
.repair-options { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.repair-options > .muted { font-size: 12px; margin-bottom: 2px; }
.repair-option { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: transparent; font: inherit; color: var(--text); cursor: pointer; }
.repair-option:hover:not(:disabled) { background: var(--surface); }
.repair-option:disabled { opacity: 0.5; cursor: default; }
.repair-option > svg { flex: none; margin-top: 2px; color: var(--text-2); }
.repair-option > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.repair-option strong { font-size: 13px; font-weight: 600; }
.repair-option .muted { font-size: 12px; overflow-wrap: anywhere; }
.model-files summary { cursor: pointer; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.model-files span { display: block; font-size: 11px; color: var(--text-3); overflow-wrap: anywhere; }

/* Settings → LoRA */
.lora-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.lora-head { display: flex; gap: 8px; align-items: center; }
.lora-head .input { flex: 1; font-weight: 600; }
.lora-strength { display: flex; align-items: center; gap: 10px; }
.lora-strength input[type="range"] { width: 180px; }
.lora-strength .muted { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.lora-warn { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--text-2); }
.lora-warn svg { flex: none; margin-top: 2px; }
.lora-meta { font-size: 12px; word-break: break-all; }

/* shared entrances (the cocoon's curve); none under reduced motion */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; filter: blur(6px); transform: translateY(10px) scale(0.98); } to { opacity: 1; filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .overlay, .modal-scrim, .modal, .modal-ask, .upscaler-compare, .toast, .star-prompt, .card { animation: none; }
  .card:hover { transform: none; }
}

/* ---------- the window: Kokon's own title bar (components/TitleBar.tsx) ---------- */
.window-controls { display: flex; align-self: stretch; margin-left: 4px; position: relative; z-index: 55; }
.win-btn { width: 46px; height: 100%; display: grid; place-items: center; color: var(--text-2); transition: background 0.12s, color 0.12s; }
.win-btn:hover { background: var(--surface-2); color: var(--text); }
.win-btn:active { background: var(--surface-3); }
.win-btn.close:hover { background: #c42b1c; color: #fff; }
.win-btn.close:active { background: #b22a1b; color: #fff; }
.bare-titlebar { position: fixed; top: 0; left: 0; right: 0; height: 44px; display: flex; justify-content: flex-end; z-index: 5; }
/* the drag regions take the click, not the text inside them */
.wordmark *, .brand > span.project-title { pointer-events: none; }
/* macOS keeps its traffic lights over the top-left corner */
:root[data-traffic-lights]:not([data-fullscreen]) .side-head { padding-left: 86px; }
:root[data-traffic-lights]:not([data-fullscreen]) .app:not(:has(.sidebar)) .topbar { padding-left: 86px; }

/* ---------- scrollbars: a thin rounded thumb, no arrows, shown while the pointer is over the
   list (WebView2, WebKit); the track stays invisible ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { background-color: transparent; border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; min-height: 32px; }
:hover::-webkit-scrollbar-thumb { background-color: var(--scroll); }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--scroll-hi); }

/* ---------- selecting several projects / images to remove them at once ---------- */
.pick-mark { position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.28); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9); backdrop-filter: blur(4px); }
.proj .cover { position: relative; }
.proj .pick-mark { left: 50%; top: 50%; margin: -10px 0 0 -10px; }
.proj.picked { background: var(--bg); box-shadow: var(--lift); }
.proj.picked .pick-mark, .card.picked .pick-mark { background: var(--invert-bg); color: var(--invert-text); box-shadow: 0 0 0 1.5px var(--invert-text); }
.card.picked { outline: 2.5px solid var(--text); outline-offset: 2px; }
.card.picked img { transform: scale(0.96); border-radius: 10px; }
.card img { transition: transform 0.2s var(--ease), border-radius 0.2s; }
.overlay.selecting .card .card-actions, .overlay.selecting .card .card-meta { display: none; }
.select-bar { flex: none; display: flex; align-items: center; gap: 8px; margin: 6px 8px 10px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); animation: rise 0.3s var(--ease) both; font-size: 13px; }
.select-bar .spacer { flex: 1; }
.select-count { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gallery-select { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; min-width: min(560px, calc(100% - 32px)); z-index: 6; animation: none; }
.gallery-bar .spacer { flex: 1; }
.btn.danger { background: #c42b1c; color: #fff; }
.btn.danger:hover:not(:disabled) { background: #b02418; }
@media (prefers-reduced-motion: reduce) { .select-bar { animation: none; } }

/* the mark and name in the top bar while the sidebar is hidden */
.brand .wordmark { flex: none; padding: 0 10px 0 2px; }

/* Linux: GNOME-like round window buttons instead of the Windows ones */
.window-controls.linux { gap: 12px; align-items: center; padding: 0 16px 0 8px; }
.window-controls.linux .win-btn { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text); }
.window-controls.linux .win-btn:hover { background: var(--surface-3); }
.window-controls.linux .win-btn:active, .window-controls.linux .win-btn.close:active { background: var(--border-2); color: var(--text); }
.window-controls.linux .win-btn.close:hover { background: var(--surface-3); color: var(--text); }

/* ---------- a narrow window: the prompt box keeps every control, words give way to icons ---------- */
.composer-wrap { container: composer / inline-size; }
@container composer (max-width: 780px) {
  .tool .lbl, .controls .pill .lbl { display: none; }
  .tool { padding: 0 9px; }
  .target-text .sub { display: none; }
}
@container composer (max-width: 700px) {
  .plan-hint { display: none; }
}
@container composer (max-width: 600px) {
  .controls .pill .chev, .mode-switch .lbl { display: none; }
  .controls { gap: 3px; }
}

/* Settings, fixed at the foot of the sidebar */
.side-foot { flex: none; padding: 8px 8px 12px; border-top: 1px solid var(--border); }
.side-item.settings { width: 100%; height: 42px; font-size: 14.5px; gap: 11px; }

.modal-save { display: none; }

/* ---------- phone-sized screens (Kokon in a browser on another device) ----------
   The phone's own layout is in phone.css; these cover what it shares with the desktop one
   (setup, Settings, menus, the gallery). */
@media (max-width: 720px) {
  /* during setup the usual bar stays (mark, status, Settings), without the shortcuts */
  .topbar { padding: env(safe-area-inset-top) 6px 0 12px; }
  .topbar .icon-btn[title="Shortcuts (?)"] { display: none; }
  /* iOS zooms the page into any field under 16 px */
  textarea, input:not([type]), input[type="text"], input[type="password"], input[type="number"], input[type="search"], .input, .select, .prompt, .name-field, .name-field.title-field { font-size: 16px; }
  /* no double-tap zoom on buttons */
  body { touch-action: manipulation; }
  /* Added to the home screen, the bottom inset is the home bar (34 px on an iPhone): keep clear
     of it without the full gap Safari's own toolbar doesn't need. */
  .preview-bar { padding: 10px 12px max(14px, calc(env(safe-area-inset-bottom) - 6px)); }
  .preview-img { left: 0; width: 100%; }
  .toasts { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); max-width: none; }
  .modal { width: 100vw; height: 100dvh; border-radius: 0; flex-direction: column; }
  .modal-nav { width: auto; flex: none; flex-direction: row; align-items: center; overflow-x: auto; gap: 4px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; scrollbar-width: none; }
  .modal-nav > button { flex: none; white-space: nowrap; }
  .modal-nav > span { flex: none !important; }
  .modal-nav .nav-save { display: none; }
  .modal-save { display: flex; position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: auto -16px calc(-16px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
  .modal-save .btn { flex: 1; justify-content: center; height: 42px; }
  /* menus: a sheet along the bottom of the screen (ui.tsx Popover) */
  .sheet-scrim { position: fixed; inset: 0; z-index: 59; background: rgba(0, 0, 0, 0.45); animation: fade 0.2s ease-out both; }
  /* the menus' own fixed widths (.panel, .aspect-menu, .add-menu, Prompt+) give way to the screen's */
  .popover.sheet { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 60; width: auto; min-width: 0; max-width: none; max-height: min(72dvh, 600px); overflow-y: auto; overflow-x: hidden; padding: 8px; border-radius: 20px; }
  .popover.sheet.panel { padding: 14px; }
  .popover.sheet .aspect-menu, .popover.sheet .add-menu, .popover.sheet > * { width: auto; max-width: 100%; }
  .popover.sheet .opt { padding: 11px 12px; font-size: 15px; }
  .modal-body { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .path-row { flex-wrap: wrap; }
  .gallery-bar { padding: 0 10px 10px; flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 4px 10px calc(20px + env(safe-area-inset-bottom)); }
}

/* Split into layers: how the objects are cut out (SplitChoice) */
.split-choice { position: relative; width: min(680px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; background: var(--bg); border-radius: 22px; box-shadow: var(--shadow); padding: 30px 30px 22px; display: flex; flex-direction: column; gap: 10px; animation: welcome-in 0.3s ease-out; }
.split-choice h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.split-choice-lead { margin: 0 0 8px; color: var(--text-2); line-height: 1.5; max-width: 56ch; }
.split-choice-close { position: absolute; top: 14px; right: 14px; }
.split-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 18px; border-radius: 16px; background: var(--ground); border: 1.5px solid transparent; color: var(--text); cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.2s; }
.split-card:hover { background: var(--bg); border-color: var(--border-2); box-shadow: var(--lift); transform: translateY(-1px); }
.split-card:focus-visible { outline: none; border-color: var(--text); }
.split-card.last { border-color: var(--border-2); }
.split-card-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--bg); box-shadow: var(--lift); }
.split-card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.split-card-tag { font-size: 11px; font-weight: 500; color: var(--text-2); background: var(--surface); padding: 2px 8px; border-radius: 999px; }
.split-card-text { color: var(--text-2); line-height: 1.45; }
.split-card-points { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--text); font-size: 12.5px; }
.split-card-points li { display: flex; gap: 6px; align-items: flex-start; line-height: 1.4; }
.split-card-points svg { flex: none; margin-top: 2px; color: var(--text-3); }
.split-card-time { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.split-choice-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; color: var(--text-3); font-size: 12.5px; }
@media (max-width: 560px) { .split-cards { grid-template-columns: 1fr; } .split-choice { padding: 24px 18px 18px; } }
/* Blend into scene: what the AI read per object, to check (BlendChoice). */
.blend-rows { display: flex; flex-direction: column; gap: 10px; }
.blend-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--ground); }
.blend-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.blend-row-name { font-weight: 600; }
.blend-row-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.blend-row-state.warn { color: var(--okay); }
.blend-fields { display: grid; grid-template-columns: 1.2fr 1fr 1.1fr; gap: 10px; }
.blend-fields.waiting { opacity: 0.5; }
.blend-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.blend-fields .select { width: 100%; }
.blend-prompt summary { cursor: pointer; font-size: 12px; color: var(--text-3); }
.blend-prompt p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.blend-buttons { display: flex; gap: 8px; }
@media (max-width: 560px) { .blend-fields { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .split-choice, .split-card { animation: none; transition: none; } }
/* Help menu ("?" in the top bar): shortcuts, prompt tips, the video guides. */
.popover.help-menu { width: 300px; }
.popover.help-menu .opt > span:not(.check):not(.sub) { flex: 1; min-width: 0; }
.popover.help-menu .opt .check { flex: none; color: var(--text-2); }
.welcome-item .link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; vertical-align: baseline; }
.welcome-item .link-btn svg { margin: 0; }
.row-btns { display: flex; gap: 6px; flex: none; }