/* LayerShop home. The page wears the editor's chrome: a document window, panels, a node graph,
   a dialog. Shared tokens come from site.css. */

:root {
  --bar: 48px;
  --app: #2a2b2e;
  --app-2: #313236;
  --app-field: #1f2023;
  --app-line: #3d3e43;
  --paste: #1b1c1e;
  --t-model: #b39ddb;
  --t-clip: #ffd500;
  --t-vae: #ff6e6e;
  --t-image: #64b5f6;
  --t-cond: #ffa931;
  --t-latent: #ff9cf9;
}

/* Menu links jump cut here: a smooth scroll would scrub every pinned act between the two sections. */
html { scroll-behavior: auto; }

/* —— Scroll cue: after a jump into a pinned act, says the act plays as you scroll. —— */
.scroll-cue { position: fixed; z-index: 40; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 11px 18px 11px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 15px/1.2 var(--sans); white-space: nowrap; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transform: translate(-50%, 16px); pointer-events: none; transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out), visibility 0s 0.35s; }
.scroll-cue.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.cue-mouse { position: relative; flex: none; width: 18px; height: 27px; border: 2px solid currentColor; border-radius: 9px; }
.cue-mouse::after { content: ""; position: absolute; left: 50%; top: 5px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: currentColor; animation: cue-wheel 1.5s var(--ease-out) infinite; }
@keyframes cue-wheel { 0% { opacity: 0; transform: translateY(-2px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(8px); } }
.cue-touch { display: none; }
@media (pointer: coarse) { .cue-wheel { display: none; } .cue-touch { display: inline; } }

/* —— Pinned acts: the stage sticks under the menu bar while --p runs 0 to 1. —— */
[data-pin] { position: relative; height: calc(var(--span, 2) * 100svh); scroll-margin-top: calc(var(--bar) - 64px); }
.pin-stage { position: sticky; top: var(--bar); height: calc(100svh - var(--bar)); overflow: hidden; }

/* —— 1 · Workspace —— */
.ws { padding: clamp(28px, 4.4vw, 56px) 0 clamp(56px, 7vw, 96px); }
.ws-intro, .ws-stage { width: min(100% - 32px, 1400px); margin-inline: auto; }
.ws-intro { display: grid; gap: 20px; margin-bottom: clamp(24px, 3vw, 36px); }
.ws-title { font-size: clamp(2.4rem, 4.9vw, 4.6rem); font-weight: 700; font-stretch: 116%; letter-spacing: -0.045em; line-height: 0.98; }
.ws-title span { color: var(--accent); }
.ws-aside { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px; }
.ws-sub { font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.5; color: var(--muted); max-width: 50%; }
/* The download, beside the line under the title: the button, and under it what it gets you. */
.ws-cta { display: grid; justify-items: start; gap: 10px; margin-left: auto; }
.ws-cta small { font-size: 13.5px; line-height: 1.45; color: var(--dim); font-variant-numeric: tabular-nums; }

.app { --pos: 50%; border-radius: var(--radius); background: var(--app); border: 1px solid #0d0d0f; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 40px 80px -32px rgba(0, 0, 0, 0.85), 0 3px 10px rgba(0, 0, 0, 0.35); overflow: hidden; }

/* The scene selectors: real buttons, centred, the active one filled and pulsing. While the demo
   plays by itself, a thin bar in the active button runs down to the next scene. */
.app-tabs { display: flex; justify-content: center; gap: 8px; padding: 10px 12px; background: #1e1f22; border-bottom: 1px solid #111214; overflow-x: auto; scrollbar-width: none; }
.app-tabs::-webkit-scrollbar { display: none; }
.app-tabs [role="tab"] { all: unset; position: relative; flex: none; display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 6px; border: 1px solid #3a3b40; background: #2a2b2f; font: 550 13.5px/1 var(--sans); color: #d4d2cd; cursor: pointer; overflow: hidden; isolation: isolate; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.35); transition: color 0.15s var(--ease-out), background-color 0.15s var(--ease-out), border-color 0.15s var(--ease-out), transform 0.12s var(--ease-out); }
.app-tabs [role="tab"] img { width: 36px; height: 24px; border-radius: 3px; object-fit: cover; opacity: 0.8; transition: opacity 0.15s var(--ease-out); }
.app-tabs [role="tab"]:hover { color: var(--text); background: #34353a; border-color: #4c4d53; }
.app-tabs [role="tab"]:hover img { opacity: 1; }
.app-tabs [role="tab"]:active { transform: translateY(1px); }
.app-tabs [role="tab"][aria-selected="true"] { color: var(--accent-ink); background: var(--accent); border-color: #ffb07a; animation: tab-pulse 2.2s var(--ease-out) infinite; }
.app-tabs [role="tab"][aria-selected="true"] img { opacity: 1; box-shadow: 0 0 0 1px rgba(27, 13, 3, 0.35); }
.app-tabs [role="tab"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tab-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(27, 13, 3, 0.45); transform-origin: left; transform: scaleX(0); z-index: -1; }
.app-tabs.autoplay [role="tab"][aria-selected="true"] .tab-timer { animation: tab-timer var(--autoplay, 6500ms) linear forwards; }
@keyframes tab-pulse {
  0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 0 rgba(255, 138, 61, 0.55); }
  70% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 9px rgba(255, 138, 61, 0); }
  100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 0 rgba(255, 138, 61, 0); }
}
@keyframes tab-timer { to { transform: scaleX(1); } }
@media (max-width: 1000px) { .app-tabs { justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) { .app-tabs [role="tab"][aria-selected="true"] { animation: none; } }

.app-body { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 24vw, 340px); }
.app-canvas { display: grid; grid-template-rows: 1fr auto; background: var(--paste); min-width: 0; }

.ba { position: relative; margin: clamp(10px, 1.6vw, 22px); aspect-ratio: 3 / 2; overflow: hidden; background: #000; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-after { clip-path: inset(0 0 0 var(--pos)); }
.ba.hide-after .ba-after { visibility: hidden; }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); pointer-events: none; }
.ba-knob { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; color: #16171a; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); transition: transform 0.15s var(--ease-out); }
.ba-knob svg { width: 20px; height: 20px; }
.ba:hover .ba-knob, .ba.dragging .ba-knob { transform: scale(1.08); }
.ba:has(.ba-range:focus-visible) .ba-knob { outline: 3px solid var(--accent); outline-offset: 3px; }
.ba-lab { position: absolute; top: 12px; padding: 5px 8px; border-radius: 3px; background: rgba(18, 18, 20, 0.78); font: 600 11px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: #f2f1ee; pointer-events: none; transition: opacity 0.2s var(--ease-out); }
.ba-lab-l { left: 12px; }
.ba-lab-r { right: 12px; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.ba.hide-after .ba-line, .ba.hide-after .ba-lab-r { opacity: 0; }
.ba-run { position: absolute; left: 50%; bottom: 18px; width: min(260px, 60%); transform: translate(-50%, 8px); padding: 10px 12px; border-radius: 4px; background: rgba(24, 25, 27, 0.92); font: 500 12.5px/1 var(--sans); color: var(--text); opacity: 0; pointer-events: none; transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out); }
.ba-run i { display: block; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--run, 0)); }
.ba.running .ba-run { opacity: 1; transform: translate(-50%, 0); }
.ba.running .ba-lab, .ba.running .ba-line { opacity: 0; }

.app-status { display: flex; gap: 18px; padding: 7px 14px; border-top: 1px solid #111214; background: #232427; font: 400 12px/1.3 var(--sans); color: #a5a39e; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.app-status-run { margin-left: auto; color: #cfcdc8; text-overflow: ellipsis; overflow: hidden; }

.app-side { display: grid; grid-template-rows: auto 1fr; border-left: 1px solid #111214; background: var(--app); min-width: 0; }
.pnl + .pnl { border-top: 1px solid #111214; }
.pnl-tabs { display: flex; background: #26272a; border-bottom: 1px solid #1a1b1d; font: 450 12.5px/1 var(--sans); color: #9b9994; }
.pnl-tabs span { padding: 10px 12px; }
.pnl-tabs .on { color: var(--text); background: var(--app); }
.pnl-body { display: grid; gap: 10px; padding: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 5px; background: var(--app-field); font: 500 12.5px/1 var(--sans); color: #a5a39e; text-align: center; }
.seg span { padding: 7px 0; border-radius: 3px; }
.seg .on { background: #45464b; color: var(--text); }
.fld { border: 1px solid var(--app-line); background: var(--app-field); border-radius: 4px; padding: 8px 10px; font-size: 13px; line-height: 1.45; color: var(--text); }
.fld-model { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 500; }
.fld-model b { font: 600 10.5px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: #8fd9a8; background: rgba(111, 207, 151, 0.12); padding: 4px 6px; border-radius: 3px; }
.fld-prompt { margin: 0; min-height: 7.6em; max-height: 9.8em; overflow: auto; font: 400 12.5px/1.5 var(--mono); color: #dcdad5; scrollbar-width: thin; }
.gen-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gen-meta { font-size: 12px; color: #a5a39e; }
.gen { all: unset; padding: 9px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 13.5px/1 var(--sans); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); transition: transform 0.12s var(--ease-out), background-color 0.12s var(--ease-out); }
.gen:hover { background: #ff9852; }
.gen:active { transform: scale(0.97); }
.gen:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gen[disabled] { opacity: 0.55; cursor: default; }

.layers { list-style: none; margin: 0; padding: 4px 0; }
.ly { display: grid; grid-template-columns: 28px 48px auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 10px 6px 6px; font-size: 12.5px; color: #cfcdc8; }
.ly-top { background: #3a4150; color: var(--text); }
.ly:not(.ly-top) { grid-template-columns: 28px 48px minmax(0, 1fr); }
.eye { all: unset; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 3px; color: #d6d4cf; cursor: pointer; }
.eye svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.eye[aria-pressed="false"] svg { opacity: 0.18; }
.eye:hover { background: rgba(255, 255, 255, 0.08); }
.eye:focus-visible { outline: 2px solid var(--accent); }
span.eye { cursor: default; }
.thumb { width: 48px; height: 32px; background: #000; outline: 1px solid #111; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.mask { width: 48px; height: 32px; outline: 1px solid #111; background: linear-gradient(90deg, #000 var(--pos, 50%), #fff var(--pos, 50%)); }
.ly-top.off .mask, .ly-top.off .thumb { opacity: 0.45; }
.ly-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ws-note { margin-top: 14px; font-size: 13.5px; line-height: 1.5; color: var(--dim); max-width: 92ch; }

@media (max-width: 1000px) {
  .app-body { grid-template-columns: 1fr; }
  .app-side { grid-template-columns: 1fr 1fr; grid-template-rows: none; border-left: 0; border-top: 1px solid #111214; }
  .pnl + .pnl { border-top: 0; border-left: 1px solid #111214; }
}
@media (max-width: 700px) {
  .ws-title { font-size: clamp(2.2rem, 10.4vw, 3rem); max-width: none; }
  .ws-aside { gap: 18px; }
  .ws-sub { max-width: none; }
  .ws-cta { margin-left: 0; }
  .ba { margin: 8px; aspect-ratio: 4 / 3.4; }
  .app-side { grid-template-columns: 1fr; }
  .pnl + .pnl { border-left: 0; border-top: 1px solid #111214; }
  .pnl-gen .seg { display: none; }
  .fld-prompt { min-height: 0; max-height: 6.2em; }
  .app-status span:nth-child(-n + 2) { display: none; }
  .app-status-run { margin-left: 0; }
}

/* —— 3 · Aimed: five documents replayed from their History panels ——
   The canvas is the document's real layers stacked (each a picture cropped to its pixels, placed in
   % of the canvas) over Photoshop's checkerboard, so hiding a layer shows what is underneath. The
   selection marches as ants along its exported outline. */
.tw { padding: clamp(56px, 7vw, 104px) 0 clamp(56px, 7vw, 96px); border-top: 1px solid var(--line); background: #17181b; }
.tw-intro, .tw-stage { width: min(100% - 32px, 1400px); margin-inline: auto; }
.tw-intro { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 56px; margin-bottom: clamp(24px, 3vw, 36px); }
.tw-title { font-size: clamp(2rem, 3.4vw, 3.1rem); font-weight: 700; font-stretch: 114%; letter-spacing: -0.04em; line-height: 1; max-width: 45%; }
.tw-sub { font-size: clamp(1.02rem, 1.3vw, 1.15rem); line-height: 1.6; color: var(--muted); max-width: 56ch; }

.tw-view { position: relative; margin: clamp(10px, 1.6vw, 22px); aspect-ratio: 3 / 2; display: grid; place-items: center; min-width: 0; }
.tw-doc { position: relative; isolation: isolate; height: 100%; aspect-ratio: var(--ar, 3 / 2); max-width: 100%; overflow: hidden; background: repeating-conic-gradient(#cdcdcd 0 25%, #fff 0 50%) 0 0 / 16px 16px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9); transition: aspect-ratio 0.5s var(--ease-out); }
.tw-ly { position: absolute; display: block; max-width: none; transition: opacity 0.35s var(--ease-out); }
.tw-ly.enter { animation: ly-in 0.45s var(--ease-out) both; }
@keyframes ly-in { from { opacity: 0; } }
.tw-ants { position: absolute; inset: 0; pointer-events: none; -webkit-mask: var(--sel) 0 0 / 100% 100% no-repeat; mask: var(--sel) 0 0 / 100% 100% no-repeat; background: conic-gradient(#fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 8px 8px; animation: ants 0.9s linear infinite; }
@keyframes ants { to { background-position: 8px 8px; } }
.tw-note { position: absolute; z-index: 2; left: 12px; bottom: 12px; max-width: min(78%, 560px); margin: 0; padding: 8px 11px; border-radius: 4px; background: rgba(18, 18, 20, 0.86); font: 500 12.5px/1.45 var(--sans); color: #f2f1ee; pointer-events: none; }
.tw-note:empty { display: none; }
/* The nudge: shown once when the demo first comes into view, pointing at the History panel. */
.app-tools .app-body { position: relative; }
.tw-tip { position: absolute; z-index: 4; top: 64px; right: calc(clamp(280px, 24vw, 340px) + 18px); display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: 600 14.5px/1.3 var(--sans); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); opacity: 0; transform: translateX(10px); pointer-events: none; transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out); }
.tw-tip svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tw-tip::after { content: ""; position: absolute; top: 50%; right: -7px; width: 14px; height: 14px; border-radius: 2px; background: var(--accent); transform: translateY(-50%) rotate(45deg); }
.tw-tip.show { opacity: 1; transform: none; }
.tw-tip.show::after { animation: tw-tip-nudge 0.9s ease-in-out infinite; }
@keyframes tw-tip-nudge { 50% { right: -12px; } }
@media (max-width: 1000px) { .tw-tip { display: none; } } /* panels stack under the canvas here; the hint below the demo covers it */
@media (prefers-reduced-motion: reduce) { .tw-tip, .tw-tip.show::after { transition: none; animation: none; } }
.tw-hint { display: flex; align-items: flex-start; gap: 10px; width: fit-content; max-width: 100%; margin: 16px auto 0; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 15px; line-height: 1.5; color: var(--muted); }
.tw-hint svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--accent-2); }
.tw-hint strong { color: var(--text); font-weight: 600; }
.tw-run { position: absolute; z-index: 3; left: 50%; bottom: 18px; width: min(280px, 64%); transform: translate(-50%, 8px); padding: 10px 12px; border-radius: 4px; background: rgba(24, 25, 27, 0.94); font: 500 12.5px/1 var(--sans); color: var(--text); opacity: 0; pointer-events: none; transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out); }
.tw-run i { display: block; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--run, 0)); }
.tw-view.running .tw-run { opacity: 1; transform: translate(-50%, 0); }
.tw-view.running .tw-note { opacity: 0; }

.app-tools .app-side { grid-template-rows: auto minmax(0, 1fr); align-content: start; }
.hist { position: relative; list-style: none; margin: 0; padding: 4px 0; max-height: 300px; overflow: auto; scrollbar-width: thin; }
.hist button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 9px; width: 100%; padding: 6px 12px; font-size: 12.5px; color: #cfcdc8; cursor: pointer; }
.hist button svg { width: 15px; height: 15px; color: #9b9994; }
.hist button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist button:hover { background: rgba(255, 255, 255, 0.05); }
.hist button[aria-current="step"] { background: #3a4150; color: var(--text); }
.hist button[aria-current="step"] svg { color: var(--accent); }
.hist li.later button { color: #6f6e6a; }
.hist li.later button svg { color: #5c5b58; }
.hist button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.tl { display: grid; grid-template-columns: 28px 48px auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 10px 6px 6px; font-size: 12.5px; color: #cfcdc8; }
.tl.on { background: #3a4150; color: var(--text); }
.tl .thumb { background: repeating-conic-gradient(#cdcdcd 0 25%, #fff 0 50%) 0 0 / 8px 8px; display: grid; place-items: center; }
.tl .thumb img { object-fit: contain; }
.tl .thumb svg { width: 20px; height: 20px; color: #2a2b2f; }
.tl .mask-t { width: 48px; height: 32px; outline: 1px solid #111; background: #000; }
.tl .mask-t img { width: 100%; height: 100%; object-fit: contain; }
.tl .ly-op { color: #9b9994; font-variant-numeric: tabular-nums; }
.tl.off .thumb, .tl.off .mask-t, .tl.off .ly-name { opacity: 0.45; }
.tl-adj .thumb { background: #e8e6e1; }

@media (max-width: 1000px) {
  .tw-title { max-width: 15ch; }
  .hist { max-height: 220px; }
  .tl { grid-template-columns: 26px 40px auto minmax(0, 1fr); gap: 6px; }
  .tl .thumb, .tl .mask-t { width: 40px; height: 27px; }
}
@media (max-width: 640px) {
  .app-tools .app-side { grid-template-columns: 1fr; }
  .app-tools .pnl + .pnl { border-left: 0; border-top: 1px solid #111214; }
  .tw-note { left: 8px; right: 8px; bottom: 8px; max-width: none; font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .tw-ants { animation: none; }
  .tw-ly.enter { animation: none; }
}

/* —— The feature card ——
   Both carousels open each document with its name, large, over the canvas: the kicker, then the
   title a word at a time, held, then gone (about 1.9 s; home.js waits for it). */
.fcard { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: clamp(10px, 1.4vw, 16px); padding: 24px; text-align: center; background: radial-gradient(ellipse at center, rgba(12, 12, 14, 0.82) 0%, rgba(12, 12, 14, 0.6) 70%); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; pointer-events: none; }
.fcard.play { visibility: visible; animation: fcard 1.9s linear both; }
@keyframes fcard { 0% { opacity: 0; } 14% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; } }
.fcard-kicker { font: 650 clamp(11px, 1vw, 13.5px)/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.fcard-kicker::after { content: ""; display: block; height: 2px; margin-top: 10px; background: var(--accent); transform-origin: center; }
.fcard-title { max-width: 14ch; font-size: clamp(1.9rem, 4.6vw, 4.4rem); font-weight: 700; font-stretch: 116%; letter-spacing: -0.045em; line-height: 0.98; color: #fff; text-wrap: balance; }
.fcard-title i { display: inline-block; font-style: normal; }
.fcard.play .fcard-kicker { animation: fcard-rise 0.5s var(--ease-out) 0.05s both; }
.fcard.play .fcard-kicker::after { animation: fcard-line 0.6s var(--ease-out) 0.15s both; }
.fcard.play .fcard-title i { animation: fcard-rise 0.6s var(--ease-out) both; animation-delay: calc(0.15s + var(--i, 0) * 0.07s); }
@keyframes fcard-rise { from { opacity: 0; transform: translateY(0.5em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fcard-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .fcard { display: none; } }

/* —— 4 · References ——
   One document window: the canvas at the document's own 16:9, and the AI Gen panel on Edit with its
   Refs row. home.js sets the variables from the scroll and adds .refs-live; without it (phones,
   reduced motion, no JS) the markup is the finished state: the edit, both references, every step's
   words. The blue is the app's own for references; the Background layer is a dark grey, as the
   page is. */
.refs { --ref: #5b9dff; --refs-bg: #3a3b40; background: var(--bg-2); border-top: 1px solid var(--line); }
.refs-stage { display: grid; grid-template-rows: auto minmax(0, 1fr); align-content: center; gap: clamp(14px, 2.6vh, 28px); width: min(100% - 32px, 1400px); margin-inline: auto; padding-block: clamp(14px, 3vh, 34px); }
.refs-head { list-style: none; margin: 0; padding: 0; display: grid; }
.refs-app { width: min(100%, calc((100svh - var(--bar) - 250px) * 16 / 9 + clamp(280px, 24vw, 340px))); margin-inline: auto; align-self: start; }
.refs-app .app-side { grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }

.refs-view { margin: clamp(10px, 1.4vw, 18px); }
.refs-doc { position: relative; isolation: isolate; aspect-ratio: 16 / 9; overflow: hidden; background: var(--refs-bg); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9); }
.refs-pic { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.refs-pic[data-r="portrait"] { opacity: var(--portrait, 0); }
.refs-pic[data-r="result"] { clip-path: inset(0 calc((1 - var(--result, 1)) * 100%) 0 0); }
.refs-card { position: absolute; margin: 0; opacity: var(--o, 1); transform: scale(calc(0.94 + 0.06 * var(--o, 1))); transform-origin: 0 0; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.7); transition: outline-color 0.2s var(--ease-out); outline: 3px solid transparent; outline-offset: -1px; }
.refs-card img { display: block; width: 100%; height: auto; }
.refs-card.hot { outline-color: var(--ref); }
.refs-tag { position: absolute; left: 8px; top: 8px; padding: 5px 8px; border-radius: 4px; background: var(--ref); color: #06142b; font: 650 clamp(10px, 1vw, 13px)/1 var(--sans); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); opacity: var(--tag, 1); transform: translateY(calc((1 - var(--tag, 1)) * -6px)); }
.refs-run { position: absolute; z-index: 3; left: 50%; bottom: 14px; width: min(280px, 64%); transform: translate(-50%, calc((1 - var(--run-o, 0)) * 8px)); padding: 10px 12px; border-radius: 4px; background: rgba(24, 25, 27, 0.94); font: 500 12.5px/1 var(--sans); color: var(--text); opacity: var(--run-o, 0); pointer-events: none; }
.refs-run i { display: block; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--run, 0)); }

.refs-panel { gap: 9px; }
.refs-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 12.5px; color: #a5a39e; opacity: var(--o, 1); }
.refs-sel { min-width: 0; padding: 6px 9px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dcdad5; }
.refs-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 28px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 7px 2px 3px; border: 1px solid var(--ref); border-radius: 4px; background: rgba(91, 157, 255, 0.08); color: var(--ref); font: 500 12.5px/1 var(--sans); opacity: var(--o, 1); transform: scale(calc(0.8 + 0.2 * var(--o, 1))); transition: background-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out); }
.chip img { width: 26px; height: 20px; object-fit: cover; border-radius: 2px; }
.chip i { font-style: normal; color: #9b9994; }
.chip.hot { background: rgba(91, 157, 255, 0.26); box-shadow: 0 0 0 3px rgba(91, 157, 255, 0.22); }
.chip-add { padding: 3px 7px; border-radius: 4px; font: 500 16px/1 var(--sans); color: #a5a39e; transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out); }
.chip-add.down { background: #45464b; color: var(--text); }
.refs-editor { display: grid; gap: 9px; opacity: var(--o, 0); max-height: calc(var(--o, 0) * 84px); margin-block: calc((var(--o, 0) - 1) * 4.5px); overflow: hidden; }
.refs-name { display: flex; align-items: center; min-height: 1.45em; padding: 6px 9px; font-size: 12.5px; }
.refs-caret { width: 1.5px; height: 1.15em; margin-left: 1px; background: var(--text); opacity: var(--caret, 0); }
.refs-prompt { min-height: 6em; max-height: 7.6em; overflow: hidden; }
.refs-prompt .tok { font-weight: 500; color: var(--ref); background: rgba(91, 157, 255, 0.16); border-radius: 3px; padding: 0 2px; }
.refs-gen { transform: scale(calc(1 - var(--down, 0) * 0.06)); cursor: default; }
.refs-layers .ly { opacity: var(--o, 1); transition: background-color 0.2s var(--ease-out); }
.refs-layers .ly.sel { background: #3a4150; color: var(--text); }
.refs-layers .ly.off .eye svg { opacity: 0.18; }
.refs-layers .ly.off .thumb { opacity: 0.45; }
.refs-layers .eye { cursor: default; }
.refs-layers .eye:hover { background: none; }
.refs-white { background: var(--refs-bg); }

/* Pinned and live: one step's words at a time. */
.refs-live .refs-beat { grid-area: 1 / 1; }
/* At rest: the first step's heading leads, the other three are a row of numbered steps. */
.refs:not(.refs-live)[data-pin] { height: auto; }
.refs:not(.refs-live) .pin-stage { position: static; height: auto; overflow: visible; padding-block: clamp(56px, 7vw, 96px); }
.refs:not(.refs-live) .refs-head { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px clamp(20px, 3vw, 40px); counter-reset: refs; }
.refs:not(.refs-live) .refs-beat { --o: 1; grid-area: auto; display: grid; align-content: start; gap: 8px; counter-increment: refs; }
.refs:not(.refs-live) .refs-beat:first-child { grid-column: 1 / -1; display: flex; margin-bottom: 8px; counter-increment: none; }
.refs:not(.refs-live) .refs-beat:not(:first-child) .refs-title { max-width: none; font-size: clamp(1.15rem, 1.6vw, 1.35rem); letter-spacing: -0.02em; }
.refs:not(.refs-live) .refs-beat:not(:first-child) .refs-title::before { content: counter(refs) "  "; color: var(--accent); white-space: pre; }
.refs:not(.refs-live) .refs-beat:not(:first-child) .refs-note { font-size: 0.98rem; }
.refs:not(.refs-live) .refs-app { width: 100%; }
@media (max-height: 820px) and (min-width: 1001px) { .refs-live .refs-layers { display: none; } }
@media (max-width: 1000px) {
  .refs:not(.refs-live) .refs-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .refs-app .app-side { overflow: visible; }
}
@media (max-width: 640px) {
  .refs:not(.refs-live) .refs-head { grid-template-columns: 1fr; }
  .refs-app .app-side { grid-template-columns: 1fr; }
  .refs-app .pnl + .pnl { border-left: 0; border-top: 1px solid #111214; }
  .refs-tag { left: 5px; top: 5px; padding: 3px 5px; }
}

/* —— 4b · Regions ——
   The references act's frame and steps (.refs, .refs-live), with the canvas drawn as the app draws
   regions: a box in the region's colour with a faint fill, its number tab sitting on the top edge,
   and what goes in it in a dark caption inside. The tabs of boxes at the top edge stand above the
   picture, so the canvas is not clipped and has room above. home.js sets each box's place and
   z-index, --g (how far it is drawn), --o and the list rows' order; without it the markup is the
   finished document. Background is white, as the document's was. */
.rgn { border-top: 1px solid var(--line); }
.rgn .refs-view { margin-top: clamp(22px, 2.4vw, 28px); }
.rgn-doc { overflow: visible; background: #fff; }
.rgn-pic { position: absolute; inset: 0; display: block; width: 100%; height: 100%; clip-path: inset(0 calc((1 - var(--w, 1)) * 100%) 0 0); }
.rgn-boxes { position: absolute; inset: 0; opacity: var(--bo, 1); pointer-events: none; }
.rgn-box { --fs: clamp(8.5px, 0.8vw, 12px); position: absolute; box-sizing: border-box; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); opacity: var(--o, 1); transition: box-shadow 0.2s var(--ease-out); }
.rgn-box.hot { box-shadow: 0 0 0 1px var(--c), 0 0 18px -2px color-mix(in srgb, var(--c) 60%, transparent); }
.rgn-tab { position: absolute; left: -1.5px; bottom: 100%; padding: 0.3em 0.5em; border-radius: 2px 2px 0 0; background: var(--c); color: #121314; font: 500 var(--fs)/1 var(--sans); white-space: nowrap; }
.rgn-tab b { font-weight: 650; margin-right: 0.2em; }
.rgn-cap { position: absolute; left: 0.45em; top: 0.45em; max-width: calc(100% - 0.9em); padding: 0.35em 0.5em; border-radius: 3px; background: rgba(22, 23, 25, 0.86); color: #f1efea; font: 400 var(--fs)/1.15 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rgn-cap:empty { display: none; }
.rgn-size { position: absolute; left: 100%; top: 100%; margin: 4px 0 0 4px; padding: 0.3em 0.45em; border-radius: 2px; background: rgba(22, 23, 25, 0.9); color: #f1efea; font: 400 var(--fs)/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: var(--so, 0); }
.rgn .refs-run { z-index: 30; }

.rgn-panel { gap: 8px; }
.rgn-sub { display: flex; gap: 16px; padding-left: 8px; font: 450 12.5px/1 var(--sans); color: #9b9994; }
.rgn-sub span { padding: 3px 0 6px; }
.rgn-sub .on { color: var(--text); box-shadow: inset 0 -2px 0 #4c9bff; }
.rgn-model { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.rgn-model .fld-model { padding-block: 6px; }
.rgn-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 3px; color: #a5a39e; }
.rgn-model > .rgn-ico { width: 30px; height: 30px; border: 1px solid var(--app-line); background: var(--app-field); }
.rgn-ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rgn-ico.down { background: #45464b; color: var(--text); }
.rgn-lab { margin-bottom: -4px; font-size: 12px; color: #a5a39e; }
.rgn-scene { margin: 0; min-height: 3.2em; padding-block: 6px; font-size: 12.5px; color: #dcdad5; }
.rgn-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: #cfcdc8; }
.rgn-tools { display: flex; }
.rgn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-height: calc(8 * 22px + 7 * 2px); }
.rgn-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; height: 22px; padding: 0 6px 0 3px; border-radius: 3px; font-size: 12px; color: #dcdad5; opacity: var(--o, 1); transform: translateX(calc((1 - var(--o, 1)) * -6px)); transition: background-color 0.2s var(--ease-out); }
.rgn-list li b { display: grid; place-items: center; height: 17px; border-radius: 3px; background: var(--c); color: #121314; font: 650 11px/1 var(--sans); }
.rgn-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rgn-list li.sel { background: #3a3b40; }
.rgn-white { background: #fff; }

@media (max-height: 860px) and (min-width: 1001px) { .rgn.refs-live .refs-layers { display: none; } }
/* Short screens: the panel must not be taller than the canvas beside it. */
@media (max-height: 860px) {
  .rgn.refs-live .rgn-panel { gap: 6px; padding-block: 9px; }
  .rgn.refs-live .rgn-sub, .rgn.refs-live .rgn-lab { display: none; }
  .rgn.refs-live .rgn-scene { min-height: 0; padding-block: 5px; }
  .rgn.refs-live .rgn-list { gap: 1px; min-height: calc(8 * 19px + 7 * 1px); }
  .rgn.refs-live .rgn-list li { height: 19px; }
  .rgn.refs-live .rgn-list li b { height: 15px; }
}
@media (max-width: 640px) {
  .rgn-box { --fs: 7.5px; border-width: 1px; }
  .rgn-cap { display: none; }
}

/* —— 4b' · Remove BG ——
   The references act's frame and steps again (.refs, .refs-live). The document is not 16:9, so it
   sits in the middle of the canvas area over Photoshop's checkerboard, its layers stacked: the lime
   fill (--lum darkens or lightens it), the portrait, its cut-out, the room and its two cut-outs, each
   shown by --o. In the panel, Edit › Remove BG: the Keep, Type and Output menus open over the rows
   below them (--m on the field, .hl on the option under the pointer); Describe it and Click on it
   each add their own row. The Layers panel shows the copies with their masks. At rest (phones,
   reduced motion) it is the portrait on lime, and the four results under the app. */
.rmbg { border-top: 1px solid var(--line); }
.rmbg-view { position: relative; aspect-ratio: 16 / 9; }
.rmbg-doc { position: absolute; top: 0; bottom: 0; left: 50%; height: 100%; aspect-ratio: 1490 / 1280; transform: translateX(-50%); isolation: isolate; overflow: hidden; background: repeating-conic-gradient(#cdcdcd 0 25%, #fff 0 50%) 0 0 / 16px 16px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9); }
.rmbg-lime { position: absolute; inset: 0; background: rgb(228, 255, 182); opacity: var(--o, 1); filter: brightness(var(--lum, 1)); }
.rmbg-pic { position: absolute; inset: 0; display: block; width: 100%; height: 100%; opacity: var(--o, 1); }
.rmbg-pic[data-pic="girl"], .rmbg-pic[data-pic="room"], .rmbg-pic[data-pic="mirror"], .rmbg-pic[data-pic="pouf"] { opacity: var(--o, 0); }
.rmbg-dot { position: absolute; z-index: 2; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #35c46a; box-shadow: 0 0 0 2px #fff, 0 1px 6px rgba(0, 0, 0, 0.6); opacity: var(--o, 0); transform: scale(calc(0.4 + 0.6 * var(--o, 0))); }
.rmbg .refs-run { z-index: 5; }

.rmbg-panel { gap: 8px; }
.rmbg-panel .refs-row { grid-template-columns: 50px minmax(0, 1fr); }
.rmbg-layer { padding-left: 1px; font-size: 12.5px; color: #dcdad5; }
.rmbg-sel { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 9px; font-size: 12.5px; color: #dcdad5; }
.rmbg-sel > svg { flex: none; width: 13px; height: 13px; fill: none; stroke: #a5a39e; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rmbg-menu { position: absolute; z-index: 6; left: -1px; right: -1px; top: calc(100% + 3px); display: grid; gap: 1px; padding: 4px; border: 1px solid #111214; border-radius: 4px; background: #3a3b40; box-shadow: 0 12px 26px -8px rgba(0, 0, 0, 0.8); opacity: var(--m, 0); transform: translateY(calc((1 - var(--m, 0)) * -4px)); pointer-events: none; }
.rmbg-menu span { padding: 6px 8px; border-radius: 3px; white-space: nowrap; }
.rmbg-menu .hl { background: #3b82f6; color: #fff; }
.rmbg-describe { margin: 0; display: flex; align-items: center; min-height: 1.45em; padding: 5px 9px; font-size: 12.5px; color: #dcdad5; border-color: #8d8b86; }
.rmbg-hint { display: grid; gap: 3px; font-size: 11.5px; line-height: 1.35; color: #a5a39e; }
.rmbg-clicks { color: #8d8b86; font-variant-numeric: tabular-nums; }
.rmbg-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #cfcdc8; }
.rmbg-check i { width: 12px; height: 12px; border: 1px solid #8d8b86; border-radius: 2px; }
.rmbg-panel .gen-meta { font-size: 11.5px; line-height: 1.35; }
.rmbg-gen { flex: none; }

.rmbg-layers .ly { grid-template-columns: 28px auto minmax(0, 1fr); padding-block: 4px; }
.rmbg-th { display: flex; align-items: center; gap: 5px; }
.rmbg-th .thumb { width: 37px; height: 32px; }
.rmbg-mask { position: relative; width: 37px; height: 32px; outline: 1px solid #111; background: #000; }
.rmbg-mask::before { content: ""; position: absolute; left: -4px; top: 50%; width: 3px; height: 7px; margin-top: -3.5px; border: 1px solid #8d8b86; border-radius: 2px; box-sizing: border-box; }
.rmbg-mask img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rmbg-lime-th { background: rgb(228, 255, 182); }
.refs-layers .ly.off .rmbg-mask { opacity: 0.45; }
.refs-layers .ly.off .ly-name { color: #8d8b86; }

.rmbg-grid { display: none; }
.rmbg:not(.refs-live) .rmbg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.rmbg-grid figure { margin: 0; display: grid; gap: 8px; }
.rmbg-grid img { display: block; width: 100%; height: auto; aspect-ratio: 1490 / 1280; border-radius: 4px; }
.rmbg-grid figcaption { font-size: 0.92rem; color: var(--muted); }
.rmbg-on-lime { background: rgb(228, 255, 182); }
.rmbg-on-checker { background: repeating-conic-gradient(#cdcdcd 0 25%, #fff 0 50%) 0 0 / 14px 14px; }

@media (max-height: 860px) and (min-width: 1001px) { .rmbg.refs-live .refs-layers { display: none; } }
/* Short screens: the panel must not be taller than the canvas beside it. */
@media (max-height: 860px) {
  .rmbg.refs-live .rmbg-panel { gap: 6px; padding-block: 9px; }
  .rmbg.refs-live .rgn-sub { display: none; }
  .rmbg.refs-live .rmbg-check { display: none; }
}
@media (max-width: 1000px) { .rmbg:not(.refs-live) .rmbg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* —— 4c · LoRAs ——
   The references act's frame and steps again (.refs, .refs-live). Four runs of one prompt and seed
   stacked on the canvas, each wiping in over the last (--w); in the panel, Advanced › LoRAs with a
   row per LoRA: its eye, its name, its strength (--v: the slider's 0–2 as 0–1) and its bin. At
   rest (phones, reduced motion) the four pictures are also shown side by side under the app. */
.lora { border-top: 1px solid var(--line); }
.lora-doc { background: #fff; }
.lora-pic { position: absolute; inset: 0; display: block; width: 100%; height: 100%; clip-path: inset(0 calc((1 - var(--w, 1)) * 100%) 0 0); }
.lora-panel { gap: 8px; }
.lora-prompt { min-height: 0; max-height: none; overflow: hidden; }
.lora-ptext { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.lora-adv { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: #cfcdc8; }
.lora-adv svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lora-seed, .lora-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; align-items: center; gap: 8px; font-size: 12.5px; color: #a5a39e; }
.lora-seed .fld { padding: 5px 9px; font-size: 12px; font-variant-numeric: tabular-nums; color: #dcdad5; }
.lora-lock { color: #4c9bff; }
.lora-count { font-size: 12px; color: #8d8b86; font-variant-numeric: tabular-nums; }
.lora-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-height: calc(3 * 26px + 2 * 4px); }
.lora-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(48px, 30%) 42px 24px; align-items: center; gap: 5px; height: 26px; font-size: 12px; color: #dcdad5; opacity: var(--o, 1); transform: translateX(calc((1 - var(--o, 1)) * -6px)); }
.lora-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lora-track { position: relative; height: 3px; margin-inline: 6px; border-radius: 2px; background: #55565b; }
.lora-track i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v, 0.5) * 100%); border-radius: 2px; background: #4c9bff; }
.lora-track b { position: absolute; left: calc(var(--v, 0.5) * 100%); top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: #e8e6e1; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.lora-val { padding: 3px 6px; font-size: 12px; line-height: 1.3; text-align: right; font-variant-numeric: tabular-nums; }
.lora-grid { display: none; }
.lora:not(.refs-live) .lora-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lora-grid figure { margin: 0; display: grid; gap: 8px; }
.lora-grid img { display: block; width: 100%; height: auto; border-radius: 4px; }
.lora-grid figcaption { font-size: 0.92rem; color: var(--muted); }

@media (max-height: 860px) and (min-width: 1001px) { .lora.refs-live .refs-layers { display: none; } }
/* Short screens: the panel must not be taller than the canvas beside it. */
@media (max-height: 860px) {
  .lora.refs-live .lora-panel { gap: 6px; padding-block: 9px; }
  .lora.refs-live .rgn-sub { display: none; }
  .lora.refs-live .lora-prompt { padding-block: 5px; }
  .lora.refs-live .lora-ptext { -webkit-line-clamp: 2; line-clamp: 2; }
}
@media (max-width: 1000px) { .lora:not(.refs-live) .lora-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* —— 4d · New in 0.20 ——
   The references act's frame and steps again (.refs, .refs-live). Seven runs stacked on the canvas,
   each wiping in over the last (--w); the Style picker over the canvas (--o, a thumbnail .hot under
   the pointer, .sel when chosen). In the panel, the 0.20 AI Gen row: Enhance prompt beside the model;
   the prompt box, its prompts crossed over (--o) and, while a text model writes, its busy card
   (--bo, --sh the shimmer, --pr the bar); Style, the batch menu and Generate; the canvas line with
   Enhance again. At rest (phones, reduced motion) the markup is the finished document, and the
   seven pictures are shown in three groups under the app. */
.wn { border-top: 1px solid var(--line); }
.wn-kicker { display: block; margin-bottom: 0.45em; font: 650 clamp(0.78rem, 0.9vw, 0.9rem)/1 var(--sans); font-stretch: 100%; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.wn-doc { background: #fff; }
.wn-pic { position: absolute; inset: 0; display: block; width: 100%; height: 100%; clip-path: inset(0 calc((1 - var(--w, 1)) * 100%) 0 0); }
.wn .refs-run { z-index: 5; }
/* Seven layers by the end: the list must not make the app taller than the canvas beside it. */
.wn.refs-live .refs-layers { contain: size; }

.wn-panel { gap: 8px; }
.wn-model { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.wn-model .fld-model { min-width: 0; padding-block: 6px; }
.wn-model .fld-model > span:not(.sr) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wn-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; box-sizing: border-box; border: 1px solid var(--app-line); border-radius: 4px; background: var(--app-field); font: 500 12px/1 var(--sans); color: #dcdad5; white-space: nowrap; transition: background-color 0.15s var(--ease-out), border-color 0.15s var(--ease-out); }
.wn-btn svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wn-btn.down { background: #45464b; color: var(--text); }
.wn .wn-spark { fill: #6fb1ff; stroke: none; }
.wn-enh.busy { opacity: 0.5; }

.wn-prompt { position: relative; height: calc(1.5em * 8 + 16px); min-height: 0; max-height: none; overflow: hidden; }
.wn-ptext { position: absolute; inset: 8px 10px; overflow: hidden; opacity: var(--o, 0); -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
.wn-ptext[data-p="anime"] { --o: 1; }
.wn-busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 7px; padding: 10px; text-align: center; font: 400 11.5px/1.35 var(--sans); color: #a5a39e; opacity: var(--bo, 0); background: linear-gradient(90deg, transparent, rgba(76, 155, 255, 0.2), transparent) no-repeat; background-size: 45% 100%; background-position: calc(var(--sh, 0) * 180% - 40%) 0; }
.wn-busy b { display: flex; align-items: center; gap: 7px; font-weight: 500; font-size: 12.5px; color: #e8e6e1; }
.wn-dot { width: 7px; height: 7px; border-radius: 50%; background: #4c9bff; }
.wn-cancel { margin-top: 3px; padding: 4px 13px; border: 1px solid #cfcdc8; border-radius: 999px; font-size: 12px; color: #e8e6e1; }
.wn-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: #4c9bff; transform-origin: left; transform: scaleX(var(--pr, 0)); }

.wn-gen-row { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.wn-gen-row .gen { padding: 9px 15px; font-size: 13px; }
.wn-style { min-width: 0; }
.wn-style > span { overflow: hidden; text-overflow: ellipsis; }
.wn-style.on { border-color: #4c9bff; background: rgba(76, 155, 255, 0.13); color: var(--text); }
.wn-batch-wrap { position: relative; }
.wn-batch { gap: 7px; padding-right: 7px; font-variant-numeric: tabular-nums; }
.wn-menu { position: absolute; z-index: 2; left: 0; bottom: calc(100% + 4px); min-width: 100%; margin: 0; padding: 4px; list-style: none; border: 1px solid #111214; border-radius: 4px; background: #2f3034; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.8); font: 400 12px/1 var(--sans); color: #dcdad5; font-variant-numeric: tabular-nums; opacity: var(--o, 0); transform: translateY(calc((1 - var(--o, 0)) * 6px)); pointer-events: none; }
.wn-menu li { padding: 3px 8px; border-radius: 3px; }
.wn-menu li.hot { background: #4c9bff; color: #fff; }
.wn-line { position: relative; display: flex; align-items: center; min-height: 18px; font-size: 11.5px; color: #8d8b86; white-space: nowrap; overflow: hidden; }
.wn-line > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.wn-again { position: absolute; right: 0; top: 50%; display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 3px; background: #2c3a4f; color: #8cc0ff; opacity: var(--o, 0); transform: translateY(-50%); box-shadow: -10px 0 8px var(--app); }
.wn-again svg { width: 13px; height: 13px; }
.wn-again.down { background: rgba(76, 155, 255, 0.2); }

/* The Style picker, over the canvas as the app opens it: a tab row and the 24 thumbnails. */
.wn-picker { position: absolute; z-index: 4; inset: 4% 3.5%; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: clamp(5px, 0.8vw, 10px); padding: clamp(8px, 1.2vw, 16px); border: 1px solid #111214; border-radius: 6px; background: rgba(42, 43, 46, 0.97); box-shadow: 0 20px 50px -14px rgba(0, 0, 0, 0.85); overflow: hidden; opacity: var(--o, 0); transform: translateY(calc((1 - var(--o, 0)) * 10px)) scale(calc(0.985 + 0.015 * var(--o, 0))); pointer-events: none; }
.wn-picker-h { font: 600 clamp(11px, 1.1vw, 14px)/1 var(--sans); color: var(--text); }
.wn-tabs { display: flex; gap: clamp(8px, 1.4vw, 18px); font: 450 clamp(9px, 0.9vw, 12.5px)/1 var(--sans); color: #a5a39e; white-space: nowrap; overflow: hidden; }
.wn-tabs span { padding-bottom: 5px; }
.wn-tabs .on { color: var(--text); box-shadow: inset 0 -2px 0 #4c9bff; }
.wn-thumbs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(4px, 0.7vw, 10px); align-content: start; }
.wn-thumbs figure { margin: 0; display: grid; gap: 3px; min-width: 0; }
.wn-thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 3px; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color 0.15s var(--ease-out), transform 0.15s var(--ease-out); }
.wn-thumbs figcaption { font: 400 clamp(7.5px, 0.72vw, 11px)/1.15 var(--sans); color: #cfcdc8; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wn-thumbs .hot img { outline-color: rgba(255, 255, 255, 0.75); transform: scale(1.04); }
.wn-thumbs .sel img { outline-color: #4c9bff; }

/* At rest: the seven pictures, in their three features. */
.wn-grid { display: none; }
.wn:not(.refs-live) .wn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px clamp(20px, 3vw, 40px); }
.wn-group { display: grid; gap: 10px; align-content: start; }
.wn-group:last-child { grid-column: 1 / -1; }
.wn-group h3 { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; }
.wn-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; }
.wn-row figure { margin: 0; display: grid; gap: 8px; align-content: start; }
.wn-row img { display: block; width: 100%; height: auto; border-radius: 4px; }
.wn-row figcaption { font-size: 0.92rem; color: var(--muted); }
.wn:not(.refs-live) .refs-head { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-height: 860px) and (min-width: 1001px) { .wn.refs-live .refs-layers { display: none; } }
/* Short screens: the panel must not be taller than the canvas beside it. */
@media (max-height: 860px) {
  .wn.refs-live .wn-panel { gap: 6px; padding-block: 9px; }
  .wn.refs-live .rgn-sub { display: none; }
  .wn.refs-live .wn-prompt { height: calc(1.5em * 6 + 16px); }
}
@media (max-height: 720px) { .wn.refs-live .wn-prompt { height: calc(1.5em * 4 + 16px); } }

/* —— 4e · Animated GIFs ——
   The references act's frame and steps again (.refs, .refs-live). The canvas holds the 16 frames
   stacked, one shown (.on); before Generate it is the empty document (a checkerboard) and the frames
   wipe in together (--w). The Timeline floats over the bottom of the picture (--tl), its playhead at
   --h. In the panel, Advanced › Animate (GIF): the tick, then Time, Play, Save GIF and the Frames and
   Interval menus, which show once it is ticked (--more). At rest the frames are also a film strip. */
.gf { border-top: 1px solid var(--line); }
.gf-doc { background: repeating-conic-gradient(#cdcdcd 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.gf-frames { position: absolute; inset: 0; clip-path: inset(0 calc((1 - var(--w, 1)) * 100%) 0 0); }
.gf-pic { position: absolute; inset: 0; display: block; width: 100%; height: 100%; opacity: 0; }
.gf-pic.on { opacity: 1; }
.gf-tl { position: absolute; z-index: 4; left: 50%; bottom: clamp(6px, 1.4vw, 14px); width: min(560px, 74%); display: grid; gap: clamp(4px, 0.6vw, 8px); padding: clamp(6px, 0.8vw, 10px) clamp(8px, 1vw, 14px); box-sizing: border-box; border: 1px solid #111214; border-radius: 5px; background: rgba(42, 43, 46, 0.95); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.85); font: 500 clamp(9.5px, 0.95vw, 12.5px)/1 var(--sans); color: #dcdad5; opacity: var(--tl, 1); transform: translate(-50%, calc((1 - var(--tl, 1)) * 12px)); pointer-events: none; }
.gf-tl-h { font-weight: 600; color: var(--text); }
.gf-tl-row { display: flex; align-items: center; gap: clamp(6px, 1vw, 14px); white-space: nowrap; overflow: hidden; }
.gf-tl-row svg { width: clamp(11px, 1.1vw, 14px); height: clamp(11px, 1.1vw, 14px); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.gf-tl-play, .gf-tl-ico { display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 3px; }
.gf-tl-play.on { background: #45464b; color: #fff; }
.gf-tl-fr, .gf-tl-t { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gf-tl-fr b { display: inline-block; min-width: 2ch; font-weight: 500; text-align: right; }
.gf-tl-x { margin-left: auto; padding: 0.45em 0.7em; border: 1px solid var(--app-line); border-radius: 3px; background: var(--app-field); }
.gf-tl-fps { color: #a5a39e; }
.gf-tl-bar { position: relative; height: 4px; margin: 0.5em 0.5em 0.35em; border-radius: 2px; background: #55565b; }
.gf-tl-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--h, 0) * 100%); border-radius: 2px; background: #4c9bff; }
.gf-tl-bar i::after { content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #e8e6e1; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.gf .refs-run { z-index: 5; }
.gf-panel { gap: 8px; }
.gf-prompt { min-height: 4.6em; max-height: none; }
.gf-seed { padding: 5px 9px; font-size: 12px; color: #8d8b86; }
.gf-anim { display: flex; align-items: center; gap: 8px; min-height: 24px; font-size: 12.5px; color: #dcdad5; }
.gf-check { display: inline-grid; place-items: center; flex: none; width: 15px; height: 15px; box-sizing: border-box; border: 1px solid #77787d; border-radius: 3px; transform: scale(calc(1 - var(--down, 0) * 0.15)); }
.gf-check svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.gf-check.on { border-color: #4c9bff; background: #4c9bff; }
.gf-check.on svg { opacity: 1; }
.gf-time { margin-left: auto; font-size: 12px; color: #a5a39e; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gf-panel [data-gf-more] { opacity: var(--more, 1); }
.gf-anim .rgn-ico.on { background: #2c3a4f; color: #8cc0ff; }
.gf-opts { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; font-size: 12.5px; color: #a5a39e; transform: translateY(calc((1 - var(--more, 1)) * -4px)); }
.gf-dd { justify-content: space-between; height: 27px; font-variant-numeric: tabular-nums; }
.gf-empty { background: repeating-conic-gradient(#cdcdcd 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.gf-strip { display: none; }
.gf:not(.refs-live) .gf-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: gf; }
.gf-strip li { position: relative; counter-increment: gf; }
.gf-strip li::after { content: counter(gf); position: absolute; left: 4px; top: 4px; padding: 2px 5px; border-radius: 3px; background: rgba(24, 25, 27, 0.8); font: 500 11px/1.2 var(--mono); color: #e8e6e1; }
.gf-strip img { display: block; width: 100%; height: auto; border-radius: 3px; }

@media (max-height: 860px) and (min-width: 1001px) { .gf.refs-live .refs-layers { display: none; } }
/* Short screens: the panel must not be taller than the canvas beside it. */
@media (max-height: 860px) {
  .gf.refs-live .gf-panel { gap: 6px; padding-block: 9px; }
  .gf.refs-live .rgn-sub { display: none; }
  .gf.refs-live .gf-prompt { min-height: 0; padding-block: 5px; }
}
@media (max-width: 1000px) { .gf:not(.refs-live) .gf-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gf-tl-fps, .gf-tl-h { display: none; } .gf-tl { width: 88%; } }
@media (max-width: 1000px) {
  .wn:not(.refs-live) .refs-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wn:not(.refs-live) .wn-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wn:not(.refs-live) .refs-head { grid-template-columns: 1fr; }
  .wn-row { gap: 8px; }
  .wn-row figcaption { font-size: 0.85rem; }
  .wn-prompt { height: calc(1.5em * 6 + 16px); }
}

/* —— 2 · Familiar ——
   Three beats, each a title with its note beside it, stacked in one place and crossed over by
   home.js. Below, two screenshots of one document in a frame sized to the screen. home.js sizes
   .zoom-pan to cover the frame and moves it as a camera (translate and scale), so the frame can
   close in on the AI Gen panel; the SVG on top is drawn in the screenshots' own pixels (3840 x
   2114) and moves with them. Without the script: the last screenshot, whole. */
.zoom { background: var(--bg); border-top: 1px solid var(--line); }
.zoom-stage { display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 2.4vh, 26px); width: min(100% - 32px, 1400px); margin-inline: auto; }
.zoom-head { display: grid; }
.zoom-beat, .refs-beat { grid-area: 1 / 1; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 56px; opacity: var(--o, 0); transform: translateY(calc((1 - var(--o, 0)) * 10px)); }
.zoom-title, .refs-title { margin: 0; max-width: 23ch; font-size: clamp(1.9rem, 3.4vw, 3.1rem); font-weight: 700; font-stretch: 112%; letter-spacing: -0.035em; line-height: 1.02; }
.zoom-note, .refs-note { margin: 0; width: min(100%, 46ch); font-size: clamp(1rem, 1.25vw, 1.14rem); line-height: 1.55; color: var(--muted); }
.zoom-note b, .refs-note b { color: var(--text); font-weight: 600; }
.zoom-shot { margin: 0 auto; width: min(100%, calc((100svh - var(--bar) - 215px) * 1.8165)); }
.zoom-frame { position: relative; aspect-ratio: 3840 / 2114; overflow: hidden; border-radius: var(--radius); border: 1px solid #0d0d0f; box-shadow: 0 40px 80px -32px rgba(0, 0, 0, 0.85); background: #262626; }
.zoom-pan { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.zoom-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 46.5% 30%; }
/* The screenshots change over at a point in the scroll, as a quick fade: scrubbing a blend of two
   states of the panel would leave them overlapping. */
.zoom-live [data-shot] { opacity: 0; transition: opacity 0.45s var(--ease-out); }
.zoom-live [data-shot].on { opacity: 1; }
.zoom-fx { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.fx-cover rect { fill: #454545; }
.fx-caret { fill: #eeeeee; opacity: var(--caret, 0); }
.fx-caret.blink { animation: fx-blink 1s steps(1) infinite; }
@keyframes fx-blink { 50% { fill: transparent; } }
/* A pointer in the style of the History nudge above: an accent pill whose arrow touches a point
   of the screenshot, which home.js sets as --tx/--ty in the frame. Phones show the panel full
   width, with no room beside it, so there the titles carry it. */
.zoom-tip { position: absolute; z-index: 2; left: 0; top: 0; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: 600 14.5px/1.3 var(--sans); white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); pointer-events: none; opacity: var(--to, 0); transform: translate(calc(var(--tx, 0px) - 100% - 20px - (1 - var(--to, 0)) * 10px), calc(var(--ty, 0px) - 50%)); }
.zoom-tip svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* The arrow: a longer point than the History nudge's, reaching 16px out of the pill to the spot. */
.zoom-tip::after { content: ""; position: absolute; top: 50%; right: -16px; width: 18px; height: 22px; background: var(--accent); clip-path: polygon(0 0, 100% 50%, 0 100%); transform: translateY(-50%); animation: zoom-tip-nudge 0.9s ease-in-out infinite; }
@keyframes zoom-tip-nudge { 50% { transform: translate(4px, -50%); } }
@media (max-width: 860px) { .zoom-tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .zoom-tip { display: none; } }
.fx-btn { fill: #000; opacity: calc(var(--down, 0) * 0.28); }
.fx-press { fill: none; stroke: #fff; stroke-width: 3px; vector-effect: non-scaling-stroke; opacity: var(--press-o, 0); transform-box: fill-box; transform-origin: center; transform: scale(var(--press-s, 0.2)); }
.zoom-shot figcaption { margin-top: 10px; font-size: 13px; color: var(--dim); }
/* Phones: a taller frame that shows part of the window at a time: the picture, then the panel as
   the camera closes in on it. */
@media (max-width: 860px) {
  .zoom-beat { gap: 12px; }
  .zoom-title { font-size: clamp(1.6rem, 7vw, 2.1rem); }
  .zoom-note { font-size: 0.98rem; }
  .zoom-shot { width: min(100%, calc((100svh - var(--bar) - 300px) * 0.8)); }
  .zoom-frame { aspect-ratio: 4 / 5; }
}

/* —— 6 · The round trip ——
   The LayerShop window is centred in the scene. Generate detaches as a pill, the pill opens into
   a portal onto ComfyUI's canvas, the graph builds and runs inside it, and the portal closes back
   into the pill, which lands in the panel again. home.js drives every part from one progress. */
.graph { background: #121315; }
.graph-stage { display: grid; grid-template-rows: auto 1fr; gap: clamp(10px, 2vh, 22px); padding: clamp(16px, 3vh, 34px) 0 clamp(12px, 2vh, 22px); width: min(100% - 32px, 1400px); margin-inline: auto; }
.graph-copy { display: grid; }
.g-line { grid-area: 1 / 1; margin: 0; font-size: clamp(1.4rem, 2.5vw, 2.15rem); font-weight: 640; font-stretch: 112%; letter-spacing: -0.03em; line-height: 1.1; max-width: 34ch; opacity: var(--o, 0); transform: translateY(calc((1 - var(--o, 0)) * 10px)); }
.scene { position: relative; min-height: 0; }

/* The portal: full size, clipped to the pill or to the whole scene. */
.portal { position: absolute; inset: 0; z-index: 2; clip-path: var(--clip, inset(50% 50% 50% 50% round 999px)); background-color: #19191b; background-image: radial-gradient(circle at 1px 1px, #2e2f33 1px, transparent 1.4px); background-size: 22px 22px; visibility: var(--pv, hidden); }
.portal-rim { position: absolute; inset: 0; z-index: 2; pointer-events: none; visibility: var(--pv, hidden); }
.portal-rim rect { fill: none; stroke: var(--accent); stroke-width: 2; }
.portal-skin { position: absolute; inset: 0; background: var(--accent); opacity: var(--skin, 1); }
.portal-hud { position: absolute; left: 18px; top: 14px; z-index: 1; display: flex; align-items: baseline; gap: 12px; font: 500 13px/1 var(--sans); color: #a5a39e; font-variant-numeric: tabular-nums; opacity: var(--hud, 0); }
.portal-hud b { font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: #6fcf97; }

.board { --bw: 1300; --bh: 690; position: absolute; left: 0; top: 0; width: calc(var(--bw) * 1px); height: calc(var(--bh) * 1px); transform-origin: 0 0; transform: translate(var(--bx, 0px), var(--by, 0px)) scale(var(--s, 1)); }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: var(--wo, 1); }
.wires path { fill: none; stroke-width: 3; stroke-linecap: round; }
.gn { position: absolute; left: var(--x); top: var(--y); width: 210px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; padding-bottom: 10px; border-radius: 8px; background: #353535; border: 1px solid #4a4a4a; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); font: 400 12.5px/1 var(--sans); color: #ddd; opacity: var(--no, 0); transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(var(--ns, 1)); transform-origin: 50% 50%; }
.gn.run { border-color: #6fcf97; box-shadow: 0 0 0 2px rgba(111, 207, 151, 0.55), 0 8px 18px rgba(0, 0, 0, 0.45); }
.gn-wide { width: 270px; }
.gn b { grid-column: 1 / -1; padding: 9px 12px; margin-bottom: 8px; background: #2a2a2a; border-radius: 8px 8px 0 0; font-weight: 600; font-size: 13px; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn .in, .gn .out { position: relative; padding: 4px 12px; font-size: 12px; color: #c9c9c9; }
.gn .in { grid-column: 1; }
.gn .out { grid-column: 2; text-align: right; }
.gn .in::before, .gn .out::after { content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--c); }
.gn .in::before { left: -5px; }
.gn .out::after { right: -5px; }
.gn [data-t="MODEL"] { --c: var(--t-model); }
.gn [data-t="CLIP"] { --c: var(--t-clip); }
.gn [data-t="VAE"] { --c: var(--t-vae); }
.gn [data-t="IMAGE"] { --c: var(--t-image); }
.gn [data-t="CONDITIONING"] { --c: var(--t-cond); }
.gn [data-t="LATENT"] { --c: var(--t-latent); }
.gn i { grid-column: 1 / -1; margin: 8px 10px 0; padding: 6px 8px; border-radius: 5px; background: #222; font: 400 11.5px/1.4 var(--mono); font-style: normal; color: #bdbdbd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn i.txt { white-space: normal; height: 4.4em; }
.gn img { grid-column: 1 / -1; justify-self: center; width: 150px; height: auto; margin-top: 8px; border-radius: 4px; }
.gn-prog { grid-column: 1 / -1; display: block; height: 4px; margin: 8px 10px 0; border-radius: 2px; background: #222; overflow: hidden; }
.gn-prog i { display: block; height: 100%; margin: 0; padding: 0; border-radius: 0; background: #6fcf97; transform-origin: left; transform: scaleX(var(--k, 0)); }

/* The LayerShop window, drawn at a fixed design width and scaled by home.js. */
.lsw { position: absolute; left: 0; top: 0; z-index: 1; width: 900px; transform-origin: 0 0; transform: translate(var(--lx, 0px), var(--ly, 0px)) scale(var(--ls, 1)); opacity: var(--lo, 1); border-radius: 10px; background: var(--app); border: 1px solid #0d0d0f; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 50px 90px -30px rgba(0, 0, 0, 0.95), 0 4px 14px rgba(0, 0, 0, 0.5); overflow: hidden; }
.lsw-bar { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px; background: #1e1f22; border-bottom: 1px solid #111214; font: 500 13px/1 var(--sans); color: #cfcdc8; }
.lsw-bar svg { width: 16px; height: 16px; }
.lsw-app { margin-left: auto; color: #8c8984; }
.lsw-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.lsw-canvas { padding: 14px; background: var(--paste); }
.lsw-pic { position: relative; aspect-ratio: 3 / 2; overflow: hidden; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.9); }
.lsw-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lsw-after { clip-path: inset(0 calc((1 - var(--w, 0)) * 100%) 0 0); }
.lsw-side { display: grid; grid-template-rows: auto 1fr; border-left: 1px solid #111214; }
.lsw-pnl { display: grid; gap: 9px; padding: 0 12px 12px; }
.lsw-head { display: flex; margin: 0 -12px; background: #26272a; border-bottom: 1px solid #1a1b1d; font: 450 12.5px/1 var(--sans); color: #9b9994; }
.lsw-head span { padding: 9px 12px; }
.lsw-head .on { color: var(--text); background: var(--app); }
.lsw-model { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border: 1px solid var(--app-line); border-radius: 4px; background: var(--app-field); font-size: 13px; font-weight: 500; }
.lsw-model b { font: 600 10.5px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: #8fd9a8; background: rgba(111, 207, 151, 0.12); padding: 4px 6px; border-radius: 3px; }
.lsw-prompt { margin: 0; height: 10.6em; padding: 8px 10px; border: 1px solid var(--app-line); border-radius: 4px; background: var(--app-field); font: 400 12.5px/1.5 var(--mono); color: #e4e2dd; overflow: hidden; }
.lsw-caret { display: inline-block; width: 7px; height: 1.1em; margin-left: 1px; vertical-align: text-bottom; background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.lsw-gen-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lsw-status { font-size: 12px; color: #a5a39e; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lsw-gen { padding: 8px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 13.5px/1 var(--sans); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); transform: scale(var(--gs, 1)); visibility: var(--gv, visible); }
.lsw-prog { height: 3px; border-radius: 2px; background: var(--app-field); overflow: hidden; }
.lsw-prog i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--k, 0)); }
.lsw-layers { list-style: none; margin: 0; padding: 6px 0; border-top: 1px solid #111214; align-self: start; }
.lsw-layers li { display: grid; grid-template-columns: 44px auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 5px 12px; font-size: 12px; color: #cfcdc8; }
.lsw-layers li:last-child { grid-template-columns: 44px minmax(0, 1fr); }
.lsw-layers li span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsw-new { background: #3a4150; color: var(--text); opacity: var(--r, 0); transform: translateY(calc((1 - var(--r, 0)) * -10px)); }
.lsw-thumb { width: 44px; height: 29px; outline: 1px solid #111; }
.lsw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lsw-mask { width: 44px; height: 29px; background: #fff; outline: 1px solid #111; }

/* The pill: the Generate button off on its errand. */
.pill { position: absolute; left: 0; top: 0; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 15px/1 var(--sans); white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 14px 34px -10px rgba(0, 0, 0, 0.85); opacity: var(--po, 0); transform: translate(var(--px, 0px), var(--py, 0px)) translate(-50%, -50%) scale(var(--ps, 1)); pointer-events: none; }
.pill img { display: none; width: 30px; height: 20px; margin-left: -12px; border-radius: 999px; object-fit: cover; }
.pill.with-result img { display: block; }
.trace { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.trace path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.ripple { position: absolute; left: 0; top: 0; z-index: 3; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; border: 2px solid var(--accent); opacity: var(--ro, 0); transform: translate(var(--rx, 0px), var(--ry, 0px)) scale(var(--rs, 0.4)); pointer-events: none; }
.cursor { position: absolute; left: 0; top: 0; z-index: 5; width: 26px; height: 26px; opacity: var(--co, 0); transform: translate(var(--cx, 0px), var(--cy, 0px)) scale(var(--cs, 1)); transform-origin: 4px 2px; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.cursor path { fill: #fff; stroke: #111; stroke-width: 1.2; stroke-linejoin: round; }

@media (max-width: 760px) {
  .board { --bw: 640; --bh: 1060; }
  .gn { left: var(--mx, var(--x)); top: var(--my, var(--y)); width: 290px; }
  .gn-wide { width: 290px; }
  .lsw { width: 440px; }
  .lsw-body { grid-template-columns: 1fr; }
  .lsw-side { border-left: 0; border-top: 1px solid #111214; }
  .lsw-prompt { height: 7.6em; }
}

/* 6b · Straight out of the graph, on its ground; the model manager (6c) follows on the same. */
.after-graph { padding: clamp(64px, 8vw, 112px) 0 clamp(40px, 5vw, 72px); background: #121315; }
.ag-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.ag-list { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.ag-list p { color: var(--muted); line-height: 1.6; }
.ag-list b { display: block; color: var(--text); font-weight: 620; margin-bottom: 4px; }
.ag-list a { color: var(--accent-2); }
@media (max-width: 900px) {
  .ag-grid, .ag-list { grid-template-columns: 1fr; }
}

/* —— 5 · Four prompts —— */
.rail-act { background: var(--bg-2); border-top: 1px solid var(--line); }
.rail-stage { display: grid; grid-template-rows: auto 1fr; gap: clamp(20px, 4vh, 40px); padding-top: clamp(28px, 6vh, 64px); }
.rail-head { width: min(100% - 32px, 1400px); margin-inline: auto; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 48px; }
.rail-head .lede { max-width: 48ch; }
.rail-head .lede a { color: var(--accent-2); white-space: nowrap; }
.rail-view { overflow: hidden; min-height: 0; }
.rail { list-style: none; margin: 0; padding: 0 max(16px, calc((100vw - 1400px) / 2)); display: flex; gap: clamp(16px, 2vw, 28px); width: max-content; transform: translateX(calc(var(--rx, 0) * -1px)); will-change: transform; }
.step-card { width: clamp(300px, 40vw, 620px); display: grid; gap: 12px; align-content: start; }
.step-card > img { width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; border-radius: 4px; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.8); }
.sc-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.sc-meta h3 { font-size: 1.3rem; font-stretch: 110%; }
.sc-meta span { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.sc-prompt { font: 400 13px/1.55 var(--mono); color: #c9c7c2; max-width: 62ch; }
.sc-note { font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 52ch; }
@media (max-width: 760px) {
  .rail-act[data-pin] { height: auto; }
  .rail-stage { position: static; height: auto; padding: 64px 0; }
  .rail-view { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .rail { transform: none; padding: 0 16px; }
  .step-card { width: 82vw; scroll-snap-align: center; }
}

/* —— 7 · Free —— */
.free { padding: clamp(80px, 10vw, 144px) 0 clamp(64px, 8vw, 112px); }
.free-title { font-size: clamp(2.3rem, 6.4vw, 5.4rem); font-weight: 720; font-stretch: 118%; letter-spacing: -0.045em; line-height: 0.98; margin-bottom: clamp(32px, 5vw, 64px); }
.free-title span { display: inline-block; }
.free-title span:nth-child(2) { color: var(--accent); }
.free-lede { font-size: clamp(1.08rem, 1.5vw, 1.25rem); line-height: 1.6; color: var(--muted); max-width: 58ch; }
.models { margin-top: clamp(56px, 7vw, 96px); }
.models-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 48px; margin-bottom: 18px; }
.models-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-stretch: 112%; letter-spacing: -0.03em; }
.models-head p { color: var(--muted); max-width: 56ch; }
.models-prompt { margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.models-prompt summary { cursor: pointer; padding: 11px 14px; font-size: 14px; color: var(--muted); list-style: none; }
.models-prompt summary::-webkit-details-marker { display: none; }
.models-prompt summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--accent); font-weight: 700; }
.models-prompt[open] summary::before { content: "−"; }
.models-prompt summary:hover { color: var(--text); }
.mp-body { display: grid; gap: 10px; padding: 0 14px 14px 32px; font: 400 12.5px/1.6 var(--mono); color: #c9c7c2; max-width: 110ch; }
.mgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.mtile { all: unset; box-sizing: border-box; display: grid; gap: 3px; width: 100%; cursor: zoom-in; }
.mtile img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; margin-bottom: 8px; box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.85); transition: transform 0.2s var(--ease-out), filter 0.2s var(--ease-out); }
.mt-name { font-weight: 620; font-size: 15px; color: var(--text); }
.mt-sub { font-size: 13px; color: var(--dim); }
@media (hover: hover) and (pointer: fine) { .mtile:hover img { transform: translateY(-2px); filter: brightness(1.06); } }
.mtile:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.mnote { display: grid; align-content: center; padding: clamp(16px, 2vw, 24px); border-radius: 4px; border: 1px dashed #45464c; aspect-ratio: auto; }
.mnote p { font-size: 14px; line-height: 1.55; color: var(--muted); }
.mnote b { display: block; color: var(--text); margin-bottom: 4px; }
@media (max-width: 1000px) { .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .mt-sub { display: none; } }

.lightbox { width: min(96vw, 1400px); max-height: 94vh; padding: 0; border: 1px solid #0d0d0f; border-radius: var(--radius); background: var(--app); color: var(--text); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8); overflow: hidden; }
.lightbox::backdrop { background: rgba(10, 10, 12, 0.82); }
.lightbox img { width: 100%; height: auto; max-height: calc(94vh - 56px); object-fit: contain; background: #000; }
.lb-cap { padding: 14px 18px; font-size: 14px; color: var(--muted); }
.lb-close { all: unset; position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(20, 20, 22, 0.85); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.lb-close:focus-visible { outline: 2px solid var(--accent); }
.lightbox[open] { animation: lb-in 0.22s var(--ease-out); }
@keyframes lb-in { from { opacity: 0; transform: scale(0.97); } }

/* —— 8 · Requirements, 9 · Setup, 10 · Questions —— */
.reqs { padding: clamp(64px, 8vw, 112px) 0; border-top: 1px solid var(--line); }
.reqs .models-head { margin-bottom: clamp(20px, 2.4vw, 28px); }
.setup { padding: clamp(72px, 9vw, 128px) 0; background: var(--bg-2); border-block: 1px solid var(--line); }
.setup-head { display: grid; gap: 16px; max-width: 760px; margin-bottom: clamp(32px, 4vw, 52px); }
.setup-note { margin-top: 16px; font-size: 14px; color: var(--dim); }
.setup-note a { color: var(--accent-2); }
.faq-act { padding: clamp(72px, 9vw, 128px) 0; }
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.faq-grid .faq { max-width: none; margin: 0; }
@media (max-width: 860px) { .faq-grid { grid-template-columns: 1fr; } }

/* —— 11 · Close ——
   Three app windows: Download across the top, Keep it free and Custom development beneath. While
   pinned, home.js starts them as the logo's three layers (orange over two greys) and lets them
   come apart and land flat. Unpinned (phones, short screens, reduced motion) they simply rise in. */
.close { background: var(--bg); border-top: 1px solid var(--line); }
.close-stage { display: grid; align-items: center; }
.close[data-unpinned] { height: auto; }
.close[data-unpinned] .close-stage { position: static; height: auto; overflow: visible; padding: clamp(64px, 8vw, 112px) 0; }
.close-grid { position: relative; width: min(100% - 32px, 1400px); margin-inline: auto; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 1.6vw, 22px); }
.cw { position: relative; display: flex; flex-direction: column; border-radius: 10px; background: var(--app); border: 1px solid #0d0d0f; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 40px 80px -36px rgba(0, 0, 0, 0.9), 0 3px 10px rgba(0, 0, 0, 0.35); transform-origin: 50% 50%; will-change: transform; }
.cw > :not(.cw-skin) { opacity: var(--co, 1); }
.cw-dl { grid-column: 1 / -1; z-index: 3; }
.cw-donate { z-index: 2; }
.cw-custom { z-index: 1; }
.cw-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: #232427; border-bottom: 1px solid #111214; border-radius: 10px 10px 0 0; font: 500 13px/1 var(--sans); color: #c9c7c2; }
.cw-bar svg { width: 17px; height: 17px; color: var(--accent); }
.cw-body { display: grid; gap: 14px; align-content: start; padding: clamp(20px, 2.6vw, 34px); flex: 1; }
.cw-body p { color: var(--muted); line-height: 1.6; max-width: 58ch; }
.cw-body-dl { grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); align-items: center; gap: clamp(20px, 3vw, 48px); }
.cw-main { display: grid; gap: 18px; }
.cw-title { font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 700; font-stretch: 114%; letter-spacing: -0.04em; line-height: 1; }
.cw-text { font-size: clamp(1.02rem, 1.3vw, 1.15rem); }
.cw-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cw-art img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.9); transform: translateY(calc(var(--art, 0) * var(--d, 0) * 1px)); }
.cw-art img:nth-child(1) { --d: 14; }
.cw-art img:nth-child(2) { --d: -10; }
.cw-art img:nth-child(3) { --d: 20; }
.cw-art img:nth-child(4) { --d: -16; }
.cw-art img:nth-child(5) { --d: 8; }
.cw-art img:nth-child(6) { --d: -12; }
.cw-h { font-size: clamp(1.35rem, 2vw, 1.75rem); font-stretch: 110%; letter-spacing: -0.03em; }
.cw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }
.cw-actions small { font-size: 13px; color: var(--dim); }
/* The layer surface: the logo's colours while stacked, gone once the windows land. */
.cw-skin { position: absolute; inset: -1px; border-radius: 10px; opacity: var(--skin, 0); pointer-events: none; }
.cw-dl .cw-skin { background: linear-gradient(115deg, #ffc24d, #ff8a3d 50%, #ff5d6c); }
.cw-donate .cw-skin { background: #cbcfd6; }
.cw-custom .cw-skin { background: #7c828d; }
.close[data-unpinned] .cw { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.close[data-unpinned] .cw.cw-in { opacity: 1; transform: none; }
.close[data-unpinned] .cw-donate { transition-delay: 0.08s; }
.close[data-unpinned] .cw-custom { transition-delay: 0.16s; }
@media (max-width: 900px) {
  .close-grid { grid-template-columns: 1fr; }
  .cw-body-dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .close[data-unpinned] .cw { opacity: 1; transform: none; transition: none; }
}

/* —— Reduced motion: no pinning, every state shown at rest. —— */
@media (prefers-reduced-motion: reduce) {
  [data-pin] { height: auto; }
  .pin-stage { position: static; height: auto; overflow: visible; padding-block: 72px; }
  .zoom-head { gap: 28px; }
  .zoom-beat { grid-area: auto; --o: 1 !important; }
  .graph-copy { gap: 12px; min-height: 0; }
  .g-line { grid-area: auto; --o: 1 !important; }
  .rail-view { overflow-x: auto; }
  .rail { transform: none; }
}

/* —— 6c · The model manager, straight after 6b (.after-graph) —— */
.own { padding: clamp(32px, 4vw, 56px) 0 clamp(72px, 9vw, 128px); background: #121315; border-bottom: 1px solid var(--line); }
.own-grid { width: min(100% - 32px, 1400px); display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: clamp(28px, 4.5vw, 72px); align-items: center; }
.own-lede { margin: 18px 0 26px; font-size: 1.08rem; line-height: 1.6; color: var(--muted); max-width: 46ch; }
.own-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.own-list li { position: relative; padding: 12px 14px 12px 30px; border-radius: 6px; font-size: 15px; line-height: 1.55; color: var(--muted); cursor: default; transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out); }
.own-list li::before { content: ""; position: absolute; left: 12px; top: 1.15em; width: 7px; height: 7px; border-radius: 50%; background: #55565c; transition: background-color 0.15s var(--ease-out); }
.own-list li b { color: var(--text); font-weight: 620; }
.own-list li:hover { background: var(--surface); }
.own-list li.on { background: var(--accent); color: rgba(27, 13, 3, 0.82); }
.own-list li.on b { color: var(--accent-ink); }
.own-list li.on::before { background: var(--accent-ink); }
.own-list li:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.own-shot { margin: 0; }
.own-frame { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid #0d0d0f; box-shadow: 0 40px 80px -32px rgba(0, 0, 0, 0.85); }
.own-frame img { width: 100%; height: auto; }
.spot { position: absolute; left: var(--sx, 0); top: var(--sy, 0); width: var(--sw, 0); height: var(--sh, 0); border-radius: 6px; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(12, 12, 14, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease-out); }
.own-frame.spotted .spot { opacity: 1; animation: spot-in 0.25s var(--ease-out); }
@keyframes spot-in { from { transform: scale(1.04); } }
.own-shot figcaption { margin-top: 12px; font-size: 13px; color: var(--dim); }
@media (max-width: 1000px) {
  .own-grid { grid-template-columns: 1fr; }
  .own-shot { order: -1; }
}

/* Short laptop screens: a tighter close, so the three windows still fit on one screen and pin. */
@media (min-width: 901px) and (max-height: 860px) {
  .close-grid { gap: 12px; }
  .cw-bar { padding: 7px 12px; }
  .cw-body { padding: 16px 22px 18px; gap: 10px; }
  .cw-body-dl { gap: 28px; }
  .cw-main { gap: 12px; }
  .cw-title { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
  .cw-text { font-size: 1rem; }
  .cw-body p { line-height: 1.5; font-size: 0.95rem; }
  .cw-h { font-size: 1.3rem; }
  .cw-art { gap: 6px; max-width: 520px; justify-self: end; }
  .cw-actions .btn, .cw-main .btn-lg { padding: 12px 18px; font-size: 15px; }
}

/* The wordmark over the logo stack at the start of the close: the brand's name in the display face,
   lit from above, rising and fading as the layers come apart. */
.close-mark { position: absolute; left: 50%; top: 0; z-index: 4; margin: 0; white-space: nowrap; pointer-events: none; font: 760 clamp(3.2rem, 6.4vw, 6rem)/1 var(--sans); font-stretch: 118%; letter-spacing: -0.045em; color: #ecebe8; background: linear-gradient(180deg, #fbfaf8 0%, #e2e0dc 46%, #9d9b97 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); opacity: var(--mo, 0); transform: translate(-50%, var(--my, 0px)) scale(var(--ms, 1)); transform-origin: 50% 100%; }
.close[data-unpinned] .close-mark { display: none; }
.cw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cw-list li { position: relative; padding-left: 18px; text-wrap: pretty; color: var(--muted); line-height: 1.5; font-size: 0.97rem; }
.cw-list li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cw-list b { color: var(--text); font-weight: 600; }
@media (min-width: 901px) and (max-height: 860px) {
  .cw-list { gap: 3px; }
  .cw-list li { font-size: 0.92rem; line-height: 1.45; }
}

/* —— Entrances (home.js adds .in as each part scrolls into view, staggering the ones that arrive
   together): headings from the left, their notes from the right, pictures growing from their
   centres, rows rising, questions sliding in. Without JS or with reduced motion everything shows. */
.tw, .free, .own, .reqs, .faq-act { overflow-x: clip; }
.js [data-in] { opacity: 0; transition: opacity 0.75s var(--ease-out), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: var(--in-delay, 0ms); }
.js [data-in="left"] { transform: translateX(-72px); }
.js [data-in="right"] { transform: translateX(72px); }
.js [data-in="up"] { transform: translateY(26px); }
.js [data-in="zoom"] { transform: scale(0.78); transform-origin: 50% 40%; }
.js [data-in="slide"] { transform: translate(-28px, 8px); transition-duration: 0.6s, 0.7s; }
.js [data-in].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-in] { opacity: 1; transform: none; transition: none; }
}
