/* /create. Layout and measurements follow Vireo's generator (docs/ui-inventory.md and components/generator by
   Albert Shiney, used with permission), drawn in Sorrel's colors: black ground, bone type, Archivo, and sorrel
   orange only for Generate and active states.
   Vireo surface steps -> Sorrel: page #0f1113 -> #000, panel #131517 -> #0c0c0c, card #1c1e20 -> #161616,
   raised #23262a -> #1f1f1f, hover #2a2d32 -> #262626, lime -> sorrel. */
:root {
  --cr-panel: #0c0c0c;
  --cr-surface: #161616;
  --cr-raised: #1f1f1f;
  --cr-hover: #262626;
  --cr-hair: rgba(236, 232, 225, .05);
  --cr-line: rgba(236, 232, 225, .1);
  --cr-muted: #96938d;
  --cr-glass: rgba(24, 24, 24, .9);
  --cr-ease: cubic-bezier(.4, 0, .2, 1);
}
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cr-display { font-weight: 800; font-stretch: 88%; letter-spacing: -0.04em; line-height: 1; text-transform: uppercase; margin: 0; }

/* ---------- page shell: full-height workspace, no page scroll on desktop ---------- */
.cr-body { background: #000; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.cr-body .sh { flex-shrink: 0; }
.cr { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 8px 16px 16px; position: relative; }
[data-surface="image"] [data-ctl="video"], [data-surface="video"] [data-ctl="image"] { display: none !important; }

/* ---------- left control panel (video) ---------- */
.cr-panel { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--cr-panel); border: 1px solid var(--cr-hair); border-radius: 20px; }
.cr-modes { display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--cr-hair); flex-shrink: 0; }
.cr-modes button { position: relative; height: 44px; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 500; color: var(--cr-muted); cursor: pointer; white-space: nowrap; }
.cr-modes button.on { color: var(--bone); }
.cr-modes button.on::after { content: ''; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--bone); }
.cr-mode-link { display: inline-flex; align-items: center; gap: 4px; height: 44px; font-size: 14px; font-weight: 500; color: var(--cr-muted); text-decoration: none; white-space: nowrap; }
.cr-mode-link:hover { color: var(--bone); }
.cr-panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 8px 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
.cr-panel-go { flex-shrink: 0; padding: 8px; border-top: 1px solid var(--cr-hair); background: var(--cr-panel); }

/* model card: 131px, looping cover, display title, Change chip */
.cr-mcard { position: relative; height: 131px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: var(--cr-surface); }
.cr-mcard-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cr-mcard-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .75), transparent 60%); }
.cr-mcard-copy { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.cr-mcard-title { font-size: 20px; color: var(--sorrel); }
.cr-mcard-sub { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(236, 232, 225, .72); }
.cr-chip-glass { position: absolute; top: 8px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .06); background: rgba(20, 20, 20, .45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--bone); font-size: 12px; cursor: pointer; }
.cr-chip-glass:hover { background: rgba(20, 20, 20, .72); }
.cr-mcard-change { right: 8px; }
.cr-mcard-effect { left: 8px; }

/* start-frame slot: 120px dashed tile */
.cr-slot { position: relative; }
.cr-slot-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 120px; overflow: hidden; border-radius: 16px; border: 1px dashed rgba(236, 232, 225, .12); text-align: center; cursor: pointer; transition: border-color .2s var(--cr-ease), background .2s var(--cr-ease); }
.cr-slot-btn:hover, .cr-slot-btn.drag { border-color: rgba(236, 232, 225, .25); background: rgba(236, 232, 225, .02); }
.cr-slot-btn.drag { border-color: var(--sorrel); }
.cr-slot-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cr-slot-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.cr-slot-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--cr-hover); display: grid; place-items: center; color: var(--cr-muted); }
.cr-slot-empty b { font-size: 14px; font-weight: 500; color: rgba(236, 232, 225, .8); }
.cr-slot-empty small { font-size: 12px; color: var(--cr-muted); }
.cr-slot.need .cr-slot-empty small { color: var(--bone); }
.cr-slot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cr-slot.full .cr-slot-btn { border-style: solid; border-color: var(--cr-line); }
.cr-slot-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cr-consent { padding: 0 4px; font-size: 12px; }

/* prompt card */
.cr-promptcard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: var(--cr-surface); }
.cr-promptcard-label { font-size: 14px; color: var(--cr-muted); }
.cr-promptcard textarea { min-height: 96px; resize: none; border: 0; outline: none; background: transparent; color: var(--bone); font-size: 14px; line-height: 20px; padding: 0; }
.cr-promptcard textarea::placeholder, .cr-dock textarea::placeholder { color: var(--cr-muted); }
.cr-promptcard-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cr-mini { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 8px; border: 0; background: var(--cr-panel); color: var(--bone); font-size: 12px; font-weight: 600; cursor: pointer; }
.cr-mini[aria-checked="false"] { color: var(--cr-muted); }
.cr-mini-static { cursor: default; color: var(--cr-muted); font-weight: 500; }
.cr-count { margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--cr-muted); }
.cr-count.over { color: var(--error); }

/* model row */
.cr-modelrow { display: flex; align-items: center; gap: 12px; height: 48px; flex-shrink: 0; padding: 0 12px; border: 0; border-radius: 12px; background: var(--cr-surface); color: var(--bone); text-align: left; cursor: pointer; transition: background .2s var(--cr-ease); }
.cr-modelrow:hover { background: var(--cr-raised); }
.cr-modelrow-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cr-modelrow-copy small { font-size: 12px; color: var(--cr-muted); line-height: 1.3; }
.cr-modelrow-name { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 1.35; }
.cr-modelrow-name > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-modelrow > svg { color: var(--cr-muted); flex-shrink: 0; }

/* setting tiles: 40px, icon + value */
.cr-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-tiles:empty { display: none; }
.cr-tile { flex: 1 1 84px; display: flex; align-items: center; gap: 8px; height: 40px; min-width: 0; padding: 0 12px; border: 0; border-radius: 8px; background: var(--cr-surface); color: var(--bone); font-size: 15px; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; transition: background .2s var(--cr-ease); }
.cr-tile:hover, .cr-tile[aria-expanded="true"] { background: var(--cr-raised); }
.cr-tile > svg { color: var(--cr-muted); flex-shrink: 0; }
.cr-tile > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-tile.more { flex: 0 0 auto; font-size: 14px; color: var(--cr-muted); }
.cr-tile.more:hover { color: var(--bone); }

/* option row (watermark), Vireo's bitrate row */
.cr-optrow { display: flex; align-items: center; justify-content: space-between; height: 40px; flex-shrink: 0; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(236, 232, 225, .05); color: var(--bone); font-size: 14px; cursor: pointer; }
.cr-optrow-val { display: inline-flex; align-items: center; gap: 6px; color: var(--bone); }
.cr-optrow-val svg:first-child { color: var(--bone); }
.cr-optrow[aria-checked="false"] .cr-optrow-val { color: var(--cr-muted); }
.cr-optrow-val svg:last-child { color: var(--cr-muted); }

.cr-err { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 12px; border-radius: 12px; background: rgba(255, 138, 122, .1); color: var(--error); font-size: 12px; }
.cr-err span { flex: 1; }
.cr-err button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }

/* the keycap Generate: flat sorrel with a darker bottom lip */
.cr-keycap { border: 0; border-radius: 12px; color: var(--sorrel-ink); background-color: var(--sorrel); background-image: radial-gradient(#ec8b5f 40%, var(--sorrel) 100%); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .43); cursor: pointer; transition: background-color .2s var(--cr-ease), transform 80ms ease-out, opacity .2s; }
.cr-keycap:hover:not(:disabled) { background-image: none; background-color: color-mix(in oklab, var(--sorrel) 85%, white); }
.cr-keycap:active:not(:disabled) { box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .43); transform: translateY(1px); }
.cr-keycap:disabled { opacity: .55; cursor: not-allowed; }
.cr-go { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; font-size: 16px; font-weight: 600; }
.cr-go-cost { display: inline-flex; align-items: center; gap: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.cr-go-cost:empty { display: none; }
.cr-go-cost svg { width: 15px; height: 15px; }
.cr-reason { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--cr-muted); }
.cr-reason:empty { display: none; }

/* ---------- canvas ---------- */
.cr-canvas { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--cr-line); border-radius: 20px; }
.cr-toolbar { display: flex; align-items: center; gap: 12px; height: 48px; flex-shrink: 0; padding: 0 12px; }
.cr-views { display: flex; align-items: center; gap: 4px; }
.cr-views button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: rgba(236, 232, 225, .5); font-size: 12px; font-weight: 500; cursor: pointer; transition: color .2s var(--cr-ease), background .2s var(--cr-ease); white-space: nowrap; }
.cr-views button:hover { color: var(--bone); }
.cr-views button[aria-selected="true"] { background: rgba(236, 232, 225, .08); color: var(--bone); }
.cr-toolbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.cr-note { font-size: 12px; color: var(--cr-muted); white-space: nowrap; }
.cr-note.warn { color: var(--error); }
.cr-filter { height: 32px; padding: 0 8px; border: 1px solid var(--cr-hair); border-radius: 8px; background: rgba(236, 232, 225, .02); color: var(--bone); font-size: 12px; outline: none; }
.cr-size { display: inline-flex; align-items: center; gap: 8px; color: var(--cr-muted); }
.cr-size input { width: 104px; accent-color: var(--bone); }
.cr-private { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cr-muted); white-space: nowrap; }
.cr-canvas-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
[data-surface="image"] .cr-canvas-body { padding-bottom: var(--dock-h, 180px); }

/* how it works */
.cr-how { min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 40px; padding: 40px 48px; }
.cr-how-head { display: flex; flex-direction: column; gap: 12px; max-width: 48rem; }
.cr-how-head h1 { font-size: 48px; color: var(--bone); }
.cr-how-head p { margin: 0; font-size: 16px; color: var(--cr-muted); }
.cr-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.cr-step { display: flex; flex-direction: column; gap: 12px; }
.cr-step-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; background: var(--cr-surface); }
.cr-step-media img { width: 100%; height: 100%; object-fit: cover; }
.cr-step-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .4), transparent); }
.cr-step h2 { font-size: 20px; color: var(--bone); }
.cr-step p { margin: 0; font-size: 14px; color: var(--cr-muted); }

/* history feed */
.cr-history { padding: 4px 12px 12px; min-height: 100%; display: flex; flex-direction: column; }
.cr-feed { columns: var(--cols, 4) 140px; column-gap: 8px; }
.cr-feed:empty { display: none; }
.gen { position: relative; break-inside: avoid; margin: 0 0 8px; border-radius: 12px; overflow: hidden; background: var(--cr-surface); outline: none; }
.gen-frame { position: relative; }
.gen-frame > img, .gen-frame > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.gen.done { cursor: zoom-in; }
.gen:focus-visible { box-shadow: 0 0 0 2px var(--bone); }
.gen-badge { position: absolute; top: 8px; left: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gen-rail { position: absolute; top: 8px; right: 8px; z-index: 3; display: flex; flex-direction: column; gap: 6px; opacity: 0; transform: translateX(4px); transition: opacity .2s var(--cr-ease), transform .2s var(--cr-ease); }
.gen:hover .gen-rail, .gen:focus-within .gen-rail { opacity: 1; transform: none; }
.gen-rail button, .gen-rail a { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .5); backdrop-filter: blur(10px); color: var(--bone); cursor: pointer; }
.gen-rail button:hover, .gen-rail a:hover { background: rgba(0, 0, 0, .75); border-color: rgba(255, 255, 255, .3); }
.gen-rail .danger:hover { color: var(--error); }
.gen-cap { position: absolute; inset: auto 0 0 0; padding: 28px 10px 9px; background: linear-gradient(0deg, rgba(0, 0, 0, .85), transparent); font-size: 12px; line-height: 1.35; color: var(--bone); opacity: 0; transition: opacity .2s var(--cr-ease); pointer-events: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gen:hover .gen-cap, .gen:focus-visible .gen-cap { opacity: 1; }
.gen-state { position: relative; display: grid; place-items: center; text-align: center; padding: 16px; }
.gen-state > div { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gen-state b { font-size: 13px; font-weight: 600; }
.gen-state small { font-size: 12px; color: var(--cr-muted); max-width: 30ch; line-height: 1.4; }
.gen-wait { background: var(--cr-surface); }
.gen-wait::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(255, 255, 255, .02) 20%, rgba(255, 255, 255, .07) 40%, rgba(255, 255, 255, .02) 60%); background-size: 200% 100%; animation: cr-shimmer 1.6s linear infinite; }
.gen-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(236, 232, 225, .18); border-top-color: var(--sorrel); animation: cr-spin .9s linear infinite; }
.gen-time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--cr-muted); }
.gen-fail { background: #0e0e0e; }
.gen-fail .gen-ic { color: var(--error); }
.gen-blocked { background: repeating-linear-gradient(135deg, #0e0e0e 0 10px, #121212 10px 20px); }
.gen-blocked .gen-ic { color: var(--cr-muted); }
.gen-state-row { display: flex; gap: 6px; margin-top: 4px; }
.gen-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 8px; border: 0; background: rgba(236, 232, 225, .08); color: var(--bone); font-size: 12px; font-weight: 500; cursor: pointer; }
.gen-chip:hover { background: rgba(236, 232, 225, .14); }
@keyframes cr-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes cr-spin { to { transform: rotate(360deg); } }

.cr-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 48px 16px; text-align: center; }
.cr-empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--cr-surface); color: var(--cr-muted); margin-bottom: 8px; }
.cr-empty b { font-size: 16px; font-weight: 600; }
.cr-empty span { font-size: 15px; color: var(--cr-muted); }
.cr-ghostbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; margin-top: 10px; border: 0; border-radius: 10px; background: var(--cr-raised); color: var(--bone); font-size: 14px; font-weight: 500; cursor: pointer; }
.cr-ghostbtn:hover { background: var(--cr-hover); }

/* presets (canvas takeover) */
.cr-presets { padding: 4px 12px 16px; }
.cr-pr-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; background: #000; }
.cr-pr-cats { flex: 1; min-width: 0; display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.cr-pr-cats::-webkit-scrollbar { display: none; }
.cr-pr-cats button { position: relative; height: 36px; padding: 0; border: 0; background: none; color: var(--cr-muted); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.cr-pr-cats button:hover { color: var(--bone); }
.cr-pr-cats button[aria-selected="true"] { color: var(--bone); }
.cr-pr-cats button[aria-selected="true"]::after { content: ''; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--bone); }
.cr-search { display: flex; align-items: center; gap: 8px; width: 220px; height: 40px; flex-shrink: 0; padding: 0 12px; border-radius: 10px; background: var(--cr-surface); color: var(--cr-muted); }
.cr-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--bone); font-size: 14px; }
.cr-search input::placeholder { color: var(--cr-muted); }
.cr-search:focus-within { box-shadow: 0 0 0 1px var(--cr-line); }
.cr-pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
.pr { position: relative; display: block; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; border: 0; border-radius: 12px; background: var(--cr-surface); color: var(--bone); text-align: left; cursor: pointer; }
.pr-media, .pr-media img, .pr-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pr-media img { transition: transform .5s ease; }
.pr:hover .pr-media img { transform: scale(1.04); }
.pr::after { content: ''; position: absolute; inset: 0; border-radius: 12px; background: linear-gradient(0deg, rgba(0, 0, 0, .8) 5%, transparent 55%); pointer-events: none; }
.pr.on::after { box-shadow: inset 0 0 0 2px var(--sorrel); }
.pr-check { position: absolute; z-index: 2; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--sorrel); color: var(--sorrel-ink); }
.pr-kind { position: absolute; z-index: 2; top: 8px; right: 8px; height: 22px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 6px; background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px); font-size: 11px; font-weight: 600; }
.pr-copy { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.pr-copy b { font-weight: 800; font-stretch: 88%; letter-spacing: -0.04em; text-transform: uppercase; font-size: 20px; line-height: 1; }
.pr-copy small { font-size: 12px; color: rgba(236, 232, 225, .7); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pr-hover { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s var(--cr-ease); background: rgba(0, 0, 0, .35); }
.pr:hover .pr-hover, .pr:focus-visible .pr-hover { opacity: 1; }
.pr-hover span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px; background: rgba(236, 232, 225, .14); backdrop-filter: blur(8px); font-size: 13px; font-weight: 600; }
.cr-none { color: var(--cr-muted); text-align: center; padding: 48px 0; margin: 0; font-size: 14px; }

/* ---------- docked composer (image) ---------- */
.cr-dock { position: absolute; inset: auto 0 0 0; z-index: 5; display: flex; justify-content: center; padding: 0 24px 24px; pointer-events: none; }
.cr-dock-ring { pointer-events: auto; width: 100%; max-width: 1120px; padding: 2px; border-radius: 26px; background: rgba(8, 8, 8, .96) linear-gradient(115deg, rgba(60, 60, 60, .12) 27%, rgba(236, 232, 225, .12) 85%); }
.cr-dock-box { display: flex; align-items: stretch; gap: 16px; padding: 16px; border-radius: 24px; border: 1px solid rgba(236, 232, 225, .05); background: rgba(16, 16, 16, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cr-dock-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cr-dock-input { display: flex; align-items: flex-start; gap: 10px; }
.cr-dock-input textarea { flex: 1; min-height: 24px; max-height: 160px; padding: 4px 2px; resize: none; border: 0; outline: none; background: none; color: var(--bone); font-size: 15px; line-height: 22px; }
.cr-dock-add { position: relative; flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(236, 232, 225, .1); background: #1b1b1b; color: var(--bone); cursor: pointer; }
.cr-dock-add:hover, .cr-dock-add.drag { border-color: rgba(236, 232, 225, .3); }
.cr-dock-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cr-dock-thumb { position: relative; flex-shrink: 0; width: 44px; height: 44px; }
.cr-dock-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.cr-dock-thumb button { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--bone); color: #000; cursor: pointer; }
.cr-dock-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cr-dock-settings { display: contents; }
.cr-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid rgba(236, 232, 225, .05); border-radius: 10px; background: #1b1b1b; color: rgba(236, 232, 225, .85); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .2s var(--cr-ease), color .2s var(--cr-ease); font-variant-numeric: tabular-nums; }
.cr-pill:hover, .cr-pill[aria-expanded="true"] { background: #242424; color: var(--bone); }
.cr-pill > svg { color: var(--cr-muted); flex-shrink: 0; }
.cr-pill .end { margin-left: -2px; }
.cr-pill.on { color: var(--sorrel); }
.cr-pill.on > svg { color: var(--sorrel); }
.cr-pill[aria-checked="false"] { color: var(--cr-muted); }
.cr-dock .cr-count { align-self: center; }
.cr-dock .cr-reason { text-align: left; margin: -4px 0 0; }
.cr-dock-go { flex-shrink: 0; width: 144px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; }
.cr-dock-go .cr-display { font-size: 15px; letter-spacing: -0.01em; }
.cr-dock-go .cr-go-cost { font-size: 15px; }

/* ---------- popover ---------- */
.cr-pop { position: fixed; z-index: 70; min-width: 200px; max-width: 320px; max-height: min(420px, 70vh); overflow-y: auto; padding: 6px; border-radius: 12px; border: 1px solid rgba(236, 232, 225, .06); background: #141414; box-shadow: 0 4px 20px rgba(0, 0, 0, .35); }
.cr-pop-label { padding: 6px 10px 8px; font-size: 13px; color: var(--cr-muted); }
.cr-pop-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--bone); font-size: 14px; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.cr-pop-opt:hover, .cr-pop-opt:focus-visible { background: rgba(236, 232, 225, .05); outline: none; }
.cr-pop-opt[aria-selected="true"] { background: rgba(236, 232, 225, .05); }
.cr-pop-opt .check-ic { margin-left: auto; color: var(--sorrel); }
.cr-pop-opt small { color: var(--cr-muted); font-size: 12px; margin-left: auto; }
.cr-pop-opt[aria-selected="true"] small { margin-left: 0; }
.cr-pop .ar { width: 14px; height: 14px; display: grid; place-items: center; flex-shrink: 0; }
.cr-pop .ar i { display: block; border: 1.5px solid currentColor; border-radius: 2px; }
.cr-pop-group + .cr-pop-group { border-top: 1px solid var(--cr-hair); margin-top: 4px; padding-top: 4px; }
.cr-pop.slider { width: 288px; padding: 16px; border-radius: 16px; background: #000; border-color: rgba(236, 232, 225, .08); }
.cr-slide-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 500; }
.cr-slide-head span { color: var(--cr-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cr-pop.slider input[type=range] { width: 100%; margin: 14px 0 10px; accent-color: var(--sorrel); }
.cr-slide-ends { display: flex; justify-content: space-between; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--cr-muted); }
.cr-slide-cost { margin: 10px 0 0; font-size: 12px; color: var(--cr-muted); }

/* ---------- model picker ---------- */
.cr-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 32px 24px; background: rgba(0, 0, 0, .6); }
.cr-picker { width: min(900px, 100%); max-height: min(760px, calc(100dvh - 64px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; border: 1px solid rgba(236, 232, 225, .06); background: var(--cr-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: cr-zoom .18s ease-out; }
@keyframes cr-zoom { from { opacity: 0; transform: scale(.97); } }
.cr-picker-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--cr-hair); }
.cr-picker-head h2 { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; }
.cr-picker-head .cr-search { margin-left: auto; width: 100%; max-width: 288px; }
.cr-sqbtn { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--cr-line); background: none; color: var(--bone); cursor: pointer; }
.cr-sqbtn:hover { background: rgba(236, 232, 225, .05); }
.cr-picker-body { flex: 1; overflow-y: auto; padding: 16px; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
.cr-pk-group { margin-bottom: 20px; }
.cr-pk-group h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--cr-muted); }
.cr-pk-feat { margin-bottom: 24px; }
.cr-pk-feat h3 { margin-bottom: 12px; }
.cr-pk-feat h3 svg { color: var(--sorrel); }
.cr-pk-feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cr-fcard { position: relative; height: 144px; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; overflow: hidden; border: 0; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(236, 232, 225, .1); background: var(--cr-surface); color: var(--bone); text-align: left; cursor: pointer; }
.cr-fcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cr-fcard:hover img { transform: scale(1.05); }
.cr-fcard::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(0, 0, 0, .85), transparent); }
.cr-fcard::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(236, 232, 225, .1); transition: box-shadow .2s; pointer-events: none; }
.cr-fcard:hover::after { box-shadow: inset 0 0 0 1px rgba(224, 120, 74, .5); }
.cr-fcard.on::after { box-shadow: inset 0 0 0 2px var(--sorrel); }
.cr-fcard > span { position: relative; z-index: 2; }
.cr-fcard-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.cr-fcard-sub { margin-top: 4px; font-size: 12px; color: rgba(236, 232, 225, .7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-pk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cr-mrow { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border: 0; border-radius: 12px; background: none; color: var(--bone); text-align: left; cursor: pointer; transition: background .2s var(--cr-ease); }
.cr-mrow:hover, .cr-mrow[aria-pressed="true"] { background: rgba(236, 232, 225, .05); }
.cr-mrow-ic { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--cr-hover); color: var(--bone); }
.cr-mrow-ic img { width: 100%; height: 100%; object-fit: cover; }
.cr-mrow-copy { flex: 1; min-width: 0; }
.cr-mrow-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.cr-mrow-copy small { display: block; font-size: 12px; color: var(--cr-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-mrow-end { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cr-mrow-end .num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--cr-muted); }
.cr-mrow-end svg { color: var(--sorrel); }
.cr-specs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cr-specs i { font-style: normal; font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--cr-hover); color: rgba(236, 232, 225, .75); }
.cr-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; line-height: 16px; font-weight: 800; font-style: italic; letter-spacing: .02em; text-transform: uppercase; }
.cr-badge.top { background: var(--bone); color: #000; }
.cr-badge.new { background: rgba(236, 232, 225, .12); color: var(--bone); }

/* ---------- lightbox ---------- */
.cr-lightbox { position: fixed; inset: 0; z-index: 60; background: #0a0a0a; overflow: hidden; }
.cr-lb-back { position: absolute; inset: -10%; background: center / cover no-repeat; filter: blur(64px); opacity: .5; }
.cr-lb { position: relative; height: 100%; display: flex; }
.cr-lb-scrim { position: absolute; inset: 0; border: 0; background: none; cursor: default; }
.cr-lb-stage { position: relative; flex: 1; min-width: 0; display: grid; place-items: center; padding: 24px; pointer-events: none; }
.cr-lb-stage > * { pointer-events: auto; max-width: 100%; max-height: calc(100dvh - 48px); object-fit: contain; border-radius: 12px; }
.cr-lb-nav { position: absolute; top: 50%; z-index: 2; width: 40px; height: 40px; margin-top: -20px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .5); color: var(--bone); cursor: pointer; }
.cr-lb-nav:hover { background: rgba(0, 0, 0, .75); }
.cr-lb-nav.prev { left: 16px; }
.cr-lb-nav.next { right: 384px; }
.cr-lb-side { position: relative; width: 368px; flex-shrink: 0; padding: 8px; }
.cr-lb-card { height: 100%; display: flex; flex-direction: column; border-radius: 24px; background: rgba(24, 24, 24, .75); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(236, 232, 225, .05); overflow: hidden; }
.cr-lb-head { display: flex; align-items: center; gap: 10px; padding: 16px; }
.cr-lb-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--cr-hover); color: var(--bone); flex-shrink: 0; }
.cr-lb-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cr-lb-who b { font-size: 16px; font-weight: 500; }
.cr-lb-who small { font-size: 12px; color: var(--cr-muted); }
.cr-roundbtn { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(236, 232, 225, .05); color: var(--bone); cursor: pointer; }
.cr-roundbtn:hover { background: rgba(236, 232, 225, .1); }
.cr-lb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 16px; }
.cr-eyebrow { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 8px; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--cr-muted); }
.cr-eyebrow button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--cr-muted); font-size: 12px; text-transform: none; letter-spacing: 0; cursor: pointer; }
.cr-eyebrow button:hover { color: var(--bone); }
.cr-lb-prompt { margin: 0; font-size: 14px; line-height: 20px; color: var(--bone); white-space: pre-wrap; overflow-wrap: anywhere; }
.cr-lb-prompt.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.cr-seeall { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--cr-muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cr-lb-details { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 14px; }
.cr-lb-details dt { color: var(--cr-muted); }
.cr-lb-details dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.cr-lb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; border-top: 1px solid var(--cr-hair); }
.cr-lb-actions > * { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(236, 232, 225, .05); color: var(--bone); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.cr-lb-actions > *:hover { background: rgba(236, 232, 225, .1); }
.cr-lb-actions .primary { background-color: var(--sorrel); background-image: none; color: var(--sorrel-ink); font-weight: 600; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .43); }
.cr-lb-actions .primary:hover { background-color: color-mix(in oklab, var(--sorrel) 85%, white); }
.cr-lb-actions .danger:hover { color: var(--error); }

/* confirm */
.cr-dialog { width: min(400px, 100%); padding: 20px; border-radius: 20px; background: #111; border: 1px solid var(--cr-line); }
.cr-dialog h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.cr-dialog p { margin: 0; font-size: 14px; color: var(--cr-muted); }
.cr-dialog-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cr-dialog-row .cr-ghostbtn { margin: 0; background: none; }
.cr-dangerbtn { height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: #3a1712; color: var(--error); font-weight: 600; cursor: pointer; }
.cr-dangerbtn:hover { background: #4a1d16; }

.cr-mobile-go { display: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .cr-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .cr-how { padding: 32px; }
  .cr-how-head h1 { font-size: 40px; }
  .cr-private span { display: none; }
}
@media (max-width: 767px) {
  .cr-body { height: auto; min-height: 100dvh; overflow: visible; }
  .cr { flex-direction: column; padding: 8px; }
  [data-surface="video"] .cr { padding-bottom: 0; }
  .cr-panel { width: 100%; overflow: visible; }
  .cr-panel-scroll { overflow: visible; }
  .cr-panel-go { display: none; }
  .cr-mcard { height: 172px; }
  .cr-mcard-title { font-size: 26px; }
  .cr-canvas { min-height: 60vh; overflow: visible; }
  [data-surface="image"] .cr-canvas { min-height: calc(100dvh - var(--sh-h) - 16px); }
  .cr-canvas-body { overflow: visible; }
  .cr-toolbar { height: auto; flex-wrap: wrap; padding: 8px; gap: 8px; }
  .cr-toolbar-end { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .cr-private { margin-left: auto; }
  .cr-how { padding: 24px 16px 32px; gap: 28px; justify-content: flex-start; }
  .cr-how-head h1 { font-size: 36px; }
  .cr-steps { grid-template-columns: 1fr; }
  .cr-mobile-go { display: block; position: sticky; bottom: 0; z-index: 20; margin: 0 -8px; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--cr-hair); background: rgba(0, 0, 0, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .cr-mobile-go .cr-go { height: 56px; }
  .cr-dock { position: sticky; inset: auto; bottom: 0; padding: 0 8px max(8px, env(safe-area-inset-bottom)); margin-top: auto; }
  [data-surface="image"] .cr-canvas-body { padding-bottom: 0; }
  .cr-dock-box { flex-direction: column; gap: 12px; padding: 14px; }
  .cr-dock-go { width: 100%; height: 56px; flex-direction: column; gap: 2px; }
  .cr-dock-input textarea { min-height: 44px; }
  .cr-presets .cr-search { width: 140px; }
  .cr-pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-feed { columns: var(--cols-m, 2) 120px; }
  .cr-modal { padding: 0; align-items: end; }
  .cr-picker { width: 100%; max-height: 88dvh; border-radius: 24px 24px 0 0; animation: cr-up .2s ease-out; }
  @keyframes cr-up { from { transform: translateY(32px); opacity: 0; } }
  .cr-picker-head { flex-wrap: wrap; }
  .cr-picker-head .cr-search { order: 3; max-width: none; flex-basis: 100%; margin-left: 0; }
  .cr-pk-feat-grid { grid-template-columns: 1fr; }
  .cr-fcard { height: 112px; }
  .cr-pk-grid { grid-template-columns: 1fr; }
  .cr-lb { flex-direction: column; overflow-y: auto; }
  .cr-lb-stage { flex: none; min-height: 55dvh; padding: 56px 12px 12px; }
  .cr-lb-stage > * { max-height: 60dvh; }
  .cr-lb-side { width: 100%; }
  .cr-lb-card { height: auto; }
  .cr-lb-nav { top: 30dvh; }
  .cr-lb-nav.next { right: 16px; }
  .cr-lb-head .cr-roundbtn { position: fixed; top: 12px; right: 12px; z-index: 3; background: rgba(0, 0, 0, .6); }
}
@media (prefers-reduced-motion: reduce) {
  .gen-wait::before, .gen-spin { animation: none; }
  .cr-picker { animation: none; }
}
