/* The canvas page (play/canvas/index.html, play/js/canvas/main.js): a gallery-dark room with the painting lit in the
   middle, the painters and a caption under it, and the brushes when you can draw. */
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('/play/fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url('/play/fonts/fredoka-latin-700-normal.woff2') format('woff2'); }
/* The text faces a painting may use (wire.js FONTS): subsets of OFL and Apache fonts (Latin, Greek, Cyrillic, symbols),
   licences beside them. The same files draw the agent's picture (worker/canvas/render.js), so both agree. */
@font-face { font-family: 'Fredoka'; font-weight: 300; font-display: swap; src: url('/play/fonts/canvas/Fredoka-300.ttf') format('truetype'); }
@font-face { font-family: 'Fredoka'; font-weight: 400; font-display: swap; src: url('/play/fonts/canvas/Fredoka-400.ttf') format('truetype'); }
@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url('/play/fonts/canvas/Fredoka-500.ttf') format('truetype'); }
@font-face { font-family: 'Noto Sans'; font-weight: 400; font-display: swap; src: url('/play/fonts/canvas/NotoSans-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Noto Sans'; font-weight: 700; font-display: swap; src: url('/play/fonts/canvas/NotoSans-Bold.ttf') format('truetype'); }
/* Backups for what the faces lack (wire.js textRuns): arrows and maths, symbols, Chinese and Japanese. Each loads only
   when a painting has a character in its range. Emoji are left to the viewer's own colour emoji. */
@font-face { font-family: 'Noto Sans Math'; font-display: swap; src: url('/play/fonts/canvas/NotoSansMath-Regular.ttf') format('truetype'); unicode-range: U+2190-22FF, U+27F0-27FF, U+2900-297F, U+2B00-2B2F; }
@font-face { font-family: 'Noto Sans Symbols 2'; font-display: swap; src: url('/play/fonts/canvas/NotoSansSymbols2-Regular.ttf') format('truetype'); unicode-range: U+2190-2BFF; }
@font-face { font-family: 'Noto Sans SC'; font-display: swap; src: url('/play/fonts/canvas/NotoSansSC-Regular.ttf') format('truetype'); unicode-range: U+3000-30FF, U+31F0-31FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF; }
@font-face { font-family: 'PT Serif'; font-weight: 400; font-display: swap; src: url('/play/fonts/canvas/PTSerif-Regular.ttf') format('truetype'); }
@font-face { font-family: 'PT Serif'; font-weight: 700; font-display: swap; src: url('/play/fonts/canvas/PTSerif-Bold.ttf') format('truetype'); }
@font-face { font-family: 'PT Serif'; font-weight: 400; font-style: italic; font-display: swap; src: url('/play/fonts/canvas/PTSerif-Italic.ttf') format('truetype'); }
@font-face { font-family: 'Space Mono'; font-weight: 400; font-display: swap; src: url('/play/fonts/canvas/SpaceMono-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Space Mono'; font-weight: 700; font-display: swap; src: url('/play/fonts/canvas/SpaceMono-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Gochi Hand'; font-display: swap; src: url('/play/fonts/canvas/GochiHand-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Permanent Marker'; font-display: swap; src: url('/play/fonts/canvas/PermanentMarker-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Abril Fatface'; font-display: swap; src: url('/play/fonts/canvas/AbrilFatface-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Bebas Neue'; font-display: swap; src: url('/play/fonts/canvas/BebasNeue-Regular.ttf') format('truetype'); }
:root { --bg: #15161d; --bg2: #1e2029; --ink: #f4efe4; --mute: #a5a3ad; --line: #34363f; --accent: #ffd166; --font: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: radial-gradient(ellipse at 50% 40%, #23252f 0%, var(--bg) 70%); color: var(--ink); font: 600 15px/1.35 var(--font); display: flex; flex-direction: column; overflow: hidden; }
button, a.cv-btn { font: inherit; }

.cv-top { display: flex; align-items: center; gap: 14px; padding: max(10px, env(safe-area-inset-top)) 16px 8px; }
.cv-home { color: var(--accent); font-weight: 700; text-decoration: none; letter-spacing: .2px; }
.cv-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.cv-title h1 { margin: 0; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-title span { color: var(--mute); font-size: 13px; white-space: nowrap; }
.cv-live { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--mute); background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.cv-live i { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); animation: cvlive 1.8s ease-out infinite; }
@keyframes cvlive { to { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); } }

.cv-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 4px 16px; }
.cv-frame { position: relative; width: min(100%, calc((100vh - 230px) * var(--ar, 1.6))); aspect-ratio: 16 / 10; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06); overflow: hidden; background: #fbf7ee; touch-action: none; }
.cv-frame svg { display: block; width: 100%; height: 100%; isolation: isolate; }
.cv-frame.drawable { cursor: crosshair; }

/* Drawing in: dashes for lines, a fade for fills, a mask for strokes (main.js sets --d). */
.cv-dr { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: cvdraw var(--d, 400ms) linear forwards; }
@keyframes cvdraw { to { stroke-dashoffset: 0; } }
.cv-fade { opacity: 0; animation: cvfade var(--d, 400ms) ease-out forwards; }
@keyframes cvfade { to { opacity: 1; } }
.cv-pop { opacity: 0; animation: cvfade 240ms ease-out forwards; }

.cv-cursor { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; transition: transform 220ms ease-out; }
.cv-cursor.follow { transition: none; }
.cv-cursor i { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--pc, #7c3aed); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.cv-cursor span { position: absolute; left: 12px; top: 6px; white-space: nowrap; font-size: 12px; color: #fff; background: var(--pc, #7c3aed); padding: 2px 8px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }

/* Shown while the painting loads (a canvas nobody has opened lately takes a moment to wake); fades in only if slow. */
.cv-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #78716c; font-size: 18px; pointer-events: none; opacity: 0; animation: cv-load-in .3s .5s forwards; }
.cv-loading[hidden] { display: none; }
@keyframes cv-load-in { to { opacity: 1; } }
.cv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #57534e; padding: 24px; pointer-events: none; }
.cv-empty b { font-size: 22px; }
.cv-empty p { max-width: 420px; color: #78716c; }
.cv-empty[hidden], .cv-cursor[hidden] { display: none; }

.cv-caption { margin: 0; min-height: 26px; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); max-width: min(100%, 900px); text-align: center; }
.cv-caption i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc, #7c3aed); flex: none; }
.cv-caption b { color: var(--pc, #c4b5fd); }
.cv-caption span { color: var(--ink); opacity: .9; }
.cv-caption[hidden] { visibility: hidden; display: flex; }

.cv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(21, 22, 29, .85); }
.cv-painters { display: flex; gap: 6px; flex-wrap: wrap; }
.cv-painter { display: flex; align-items: center; gap: 6px; font-size: 13px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 6px; }
.cv-painter i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); }
.cv-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cv-tools[hidden] { display: none; }
.cv-brushes, .cv-colors { display: flex; gap: 4px; flex-wrap: wrap; }
.cv-brushes button { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 13px; cursor: pointer; }
.cv-brushes button[aria-checked=true] { background: var(--accent); color: #1c1917; border-color: var(--accent); }
.cv-colors button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: var(--c); cursor: pointer; padding: 0; }
.cv-colors button[aria-checked=true] { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.cv-size { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); }
.cv-size input { width: 90px; accent-color: var(--accent); }
.cv-note { margin: 0; flex: 1; min-width: 160px; font-size: 13px; color: var(--mute); }
.cv-note a { color: var(--accent); }
.cv-actions { display: flex; gap: 6px; margin-left: auto; }
.cv-btn { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; cursor: pointer; text-decoration: none; font-size: 14px; white-space: nowrap; }
.cv-btn:hover { border-color: var(--mute); }
.cv-btn:disabled { opacity: .5; cursor: default; }
.cv-share { background: var(--accent); color: #1c1917; border-color: var(--accent); }
.cv-toast { position: fixed; left: 50%; bottom: 90px; translate: -50% 0; background: #fff; color: #1c1917; padding: 8px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); z-index: 5; }
.cv-toast[hidden] { display: none; }

/* Phones in portrait: the painting full width, tools in a scrolling row. */
@media (max-width: 640px) {
  .cv-top { padding-left: 12px; padding-right: 12px; }
  .cv-title { flex-direction: column; gap: 0; }
  .cv-title h1 { font-size: 17px; }
  .cv-stage { padding: 4px 8px; }
  .cv-frame { width: 100%; }
  .cv-bar { padding-left: 10px; padding-right: 10px; }
  .cv-tools { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .cv-brushes, .cv-colors { flex-wrap: nowrap; }
  .cv-actions { width: 100%; justify-content: stretch; }
  .cv-actions .cv-btn { flex: 1; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .cv-live i { animation: none; } }

/* The landing page (no canvas in the link): the sample painting replays beside a panel to start one. */
body.landing { overflow: auto; }
.cv-wrap { display: flex; flex: 1; min-height: 0; }
.cv-wrap .cv-stage { flex: 1; min-width: 0; }
.cv-land { width: 380px; flex: none; padding: 8px 20px 20px 4px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.cv-land[hidden] { display: none; }
.cv-eyebrow { margin: 0; color: var(--accent); font-size: 13px; letter-spacing: .4px; text-transform: uppercase; }
.cv-land h2 { margin: 0; font-size: 34px; line-height: 1.05; }
.cv-lede { margin: 0; color: var(--mute); }
.cv-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cv-card h3 { margin: 0; font-size: 17px; }
.cv-card form { display: flex; flex-direction: column; gap: 10px; }
.cv-card form[hidden], .cv-card p[hidden], .cv-card[hidden] { display: none; }
.cv-card input[type=text], .cv-card input:not([type]) { font: inherit; color: var(--ink); background: #0f1016; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cv-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--mute); }
.cv-check input { accent-color: var(--accent); width: 18px; height: 18px; }
.cv-go { background: var(--accent); color: #1c1917; border-color: var(--accent); text-align: center; font-weight: 700; padding: 10px 14px; }
.cv-card p { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cv-card small { color: var(--mute); }
.cv-steps { margin: 0; padding-left: 20px; color: var(--mute); }
.cv-steps a { color: var(--accent); }
.cv-prompt { display: flex; gap: 8px; align-items: flex-start; background: #0f1016; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; font-size: 14px; }
.cv-prompt span { flex: 1; }
/* Your canvases: a grid of small pictures with their titles. */
.cv-mine { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cv-mine a { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; padding: 6px; border-radius: 10px; min-width: 0; }
.cv-mine a:hover, .cv-mine a:focus-visible { background: #2a2c37; }
.cv-mine img, .cv-thumb-empty { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #0f1016; border-radius: 6px; }
.cv-mine span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-mine small { color: var(--mute); white-space: nowrap; font-size: 12px; }
#mineMore[hidden] { display: none; }
.cv-mine li { position: relative; }
.cv-del { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #15161dcc; color: var(--ink); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.cv-mine li:hover .cv-del, .cv-del:focus-visible { opacity: 1; }
@media (hover: none) { .cv-del { opacity: .85; } }
.cv-del:hover { background: #b91c1c; border-color: #b91c1c; }
#mineT small { color: var(--mute); font-size: 13px; font-weight: 600; margin-left: 6px; }
/* The start form's shape picker: a little outline of each canvas shape. */
.cv-shapes { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cv-shapes legend { padding: 0; margin-bottom: 6px; }
.cv-shapes label { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--mute); padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-width: 58px; }
.cv-shapes input { position: absolute; opacity: 0; pointer-events: none; }
.cv-shapes label:has(input:checked) { border-color: var(--accent); color: var(--ink); background: #2a2c37; }
.cv-shapes label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cv-shape { display: block; width: calc(var(--w) * 1.6px); height: calc(var(--h) * 1.6px); border: 2px solid currentColor; border-radius: 3px; }
/* New canvas and your canvases, from any canvas. */
.cv-nav { display: flex; gap: 8px; flex: none; }
.cv-nav .cv-btn { padding: 6px 11px; font-size: 13px; }
body.landing #navNew { display: none; }
@media (max-width: 640px) { .cv-nav #navMine { display: none; } }
body.landing .cv-tools, body.landing .cv-painters, body.landing #svg, body.landing #share { display: none; }
@media (max-width: 900px) {
  body.landing .cv-wrap { flex-direction: column; flex: none; }
  body.landing .cv-stage { flex: none; padding-top: 4px; }
  .cv-land { width: auto; padding: 4px 16px 16px; overflow: visible; }
  .cv-land h2 { font-size: 28px; }
}
.cv-live[hidden] { display: none; }
.cv-out { animation: cvout var(--d, 600ms) ease-in forwards; pointer-events: none; }
@keyframes cvout { to { opacity: 0; } }

/* The owner's "now ask your AI" card over their own empty canvas, and the start form's brief. */
.cv-ask { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px)); box-sizing: border-box; background: #1c1d26; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 40px #0008; z-index: 3; }
.cv-ask[hidden] { display: none; }
.cv-ask b { font-size: 19px; padding-right: 28px; }
.cv-ask small { color: var(--mute); }
.cv-ask .cv-prompt { font-size: 15px; overflow-wrap: anywhere; }
.cv-x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--mute); font-size: 22px; cursor: pointer; line-height: 1; padding: 4px; }
.cv-conn { margin: 0; font-size: 14px; color: var(--mute); }
.cv-conn a { color: var(--accent); }
.cv-conn.ok { color: #86efac; }
.cv-label { font-size: 14px; color: var(--mute); }
.cv-card textarea { font: inherit; color: var(--ink); background: #0f1016; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; min-height: 64px; }
.cv-steps li.ok { color: #86efac; }
@media (max-width: 600px) { .cv-ask { position: relative; left: auto; top: auto; transform: none; width: 100%; padding: 14px; gap: 10px; box-shadow: none; } .cv-ask b { font-size: 17px; } .cv-ask .cv-prompt { font-size: 14px; } }

/* Feedback (play/js/canvas/feedback.js): numbered pins and areas on the painting, a popover to write or read a thread,
   and a side panel (a bottom sheet on phones) listing them. Orange so pins never blend into a painting. */
.cv-pins { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.cv-pin { --pin: #f97316; position: absolute; translate: -50% -100%; pointer-events: auto; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 14px; border: 2px solid #fff; background: var(--pin); color: #fff; font: 700 13px/24px var(--font); cursor: pointer; box-shadow: 0 3px 10px rgba(0, 0, 0, .45); transform: translateY(-6px); transform-origin: 50% 100%; transition: transform 140ms ease-out; }
.cv-pin::after { content: ""; position: absolute; left: 50%; bottom: -9px; translate: -50% 0; border: 5px solid transparent; border-top: 6px solid #fff; }
.cv-pin:hover, .cv-pin.on { transform: translateY(-6px) scale(1.15); z-index: 1; }
.cv-pin.on { outline: 3px solid rgba(249, 115, 22, .45); outline-offset: 2px; }
.cv-pin.answered { --pin: #7c3aed; }
.cv-pin.done { --pin: #16a34a; opacity: .85; }
.cv-pin.ping { animation: cvping 900ms ease-out 2; }
@keyframes cvping { 0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .8); } 100% { box-shadow: 0 0 0 16px rgba(124, 58, 237, 0); } }
.cv-area { position: absolute; border: 2px dashed #f97316; background: rgba(249, 115, 22, .08); border-radius: 4px; box-sizing: border-box; pointer-events: none; }
.cv-area.on, .cv-area.drawing { border-style: solid; background: rgba(249, 115, 22, .14); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .18); }
.cv-area.done { border-color: #16a34a; background: none; }
.cv-area[hidden] { display: none; }
.cv-frame.pinning { cursor: crosshair; outline: 3px solid #f97316; outline-offset: -3px; }
.cv-cmode { position: absolute; left: 50%; top: 10px; translate: -50% 0; z-index: 3; display: flex; align-items: center; gap: 10px; background: rgba(28, 29, 38, .94); color: var(--ink); border: 1px solid #f97316; border-radius: 999px; padding: 5px 6px 5px 14px; font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); width: max-content; max-width: calc(100% - 20px); box-sizing: border-box; }
.cv-cmode .cv-btn { padding: 4px 12px; border-radius: 999px; }
.cv-cmode[hidden] { display: none; }
.cv-before { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.cv-before[hidden] { display: none; }
.cv-frame.before::after { content: "Before"; position: absolute; left: 10px; bottom: 10px; z-index: 3; background: rgba(0, 0, 0, .7); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12px; }

.cv-pop { position: absolute; z-index: 4; width: min(340px, calc(100% - 16px)); box-sizing: border-box; background: #1c1d26; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 16px 48px rgba(0, 0, 0, .55); display: flex; flex-direction: column; gap: 10px; max-height: min(70vh, 520px); overflow-y: auto; }
.cv-pop[hidden] { display: none; }
.cv-pop.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; border-radius: 16px 16px 0 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); max-height: 65vh; }
.cv-pop-h { font-size: 15px; }
.cv-pop-form { display: flex; flex-direction: column; gap: 8px; }
.cv-pop textarea { font: 500 14px/1.4 var(--font); color: var(--ink); background: #0f1016; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; resize: vertical; min-height: 44px; }
.cv-pop textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.cv-pop-row { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cv-pop-row .cv-go { padding: 7px 14px; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cv-chips button { font: 600 12px/1 var(--font); color: var(--ink); background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.cv-chips button:hover { border-color: #f97316; color: #fff; }
.cv-pop-head { position: relative; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); padding-right: 28px; }
.cv-pop-head b { color: var(--ink); }
.cv-pop-head .cv-x { top: -4px; right: -4px; }
.cv-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cv-thread li { background: #15161d; border-radius: 10px; padding: 8px 10px; }
.cv-thread li:first-child { background: none; padding: 0 2px; }
.cv-thread li:first-child p { font-size: 15px; font-weight: 600; }
.cv-thread li.ai { border-left: 3px solid #7c3aed; }
.cv-thread b { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cv-thread b i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }
.cv-thread b small { font-size: 10px; letter-spacing: .5px; background: #7c3aed; color: #fff; border-radius: 4px; padding: 1px 5px; }
.cv-thread p { margin: 3px 0 0; font-weight: 500; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cv-thread .when { color: var(--mute); font-size: 11px; }
.cv-before-btn { user-select: none; -webkit-user-select: none; touch-action: none; }
.cv-before-btn.on { border-color: #f97316; color: #fff; }
.cv-del-btn { margin-right: auto; color: #fca5a5; }
.cv-fb-n { display: inline-grid; place-items: center; flex: none; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 11px; background: #f97316; color: #fff; font: 700 12px/1 var(--font); font-style: normal; }
.cv-fb-n.done, li.done .cv-fb-n { background: #16a34a; }

.cv-fb { width: 340px; flex: none; box-sizing: border-box; padding: 6px 16px 16px 4px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.cv-fb[hidden] { display: none; }
.cv-fb-head { position: relative; display: flex; align-items: center; }
.cv-fb-head h2 { margin: 0; font-size: 20px; }
.cv-fb-head small { color: var(--mute); font-size: 13px; font-weight: 600; margin-left: 6px; }
.cv-fb-head .cv-x { top: -2px; right: 0; }
.cv-fb-tip { margin: 0; color: var(--mute); font-size: 13px; font-weight: 500; }
.cv-fb-tip[hidden], .cv-fb-ask[hidden], .cv-fb-empty[hidden], .cv-fb-done[hidden], #fbAdd[hidden] { display: none; }
.cv-fb-ask { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.cv-fb-ask .cv-prompt { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.cv-fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cv-fb-item { width: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 3px 9px; background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; cursor: pointer; }
.cv-fb-item:hover, li.on .cv-fb-item { border-color: #f97316; }
.cv-fb-item small, .cv-fb-last { grid-column: 2; }
.cv-fb-text { font-size: 14px; overflow-wrap: anywhere; }
.cv-fb-item small { color: var(--mute); font-size: 12px; font-weight: 500; }
.cv-fb-last { font-size: 13px; font-weight: 500; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cv-fb-last.ai { color: #c4b5fd; }
.cv-fb-last b { font-weight: 700; }
li.done .cv-fb-item { opacity: .7; }
.cv-fb-empty { margin: 4px 0; color: var(--mute); font-size: 14px; font-weight: 500; }
.cv-fbbtn[aria-expanded="true"] { border-color: #f97316; }
.cv-fbbtn b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: #f97316; color: #fff; font-size: 11px; }
.cv-fbbtn b[hidden], .cv-fbbtn[hidden] { display: none; }
body.landing .cv-fb, body.landing .cv-fbbtn, body.landing .cv-pins { display: none; }
@media (max-width: 900px) {
  .cv-fb { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 62vh; z-index: 4; background: #1c1d26; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 14px 16px max(16px, env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0, 0, 0, .5); }
}
@media (hover: none) { .cv-pin { min-width: 32px; height: 32px; line-height: 28px; border-radius: 16px; } }
@media (prefers-reduced-motion: reduce) { .cv-pin.ping { animation: none; } .cv-pin { transition: none; } }
.cv-pin.ghost { --pin: #f97316; pointer-events: none; animation: cvping 900ms ease-out infinite; }

/* Following your AI (main.js startFollow): the switch in the top bar, and the note when your AI moves to another canvas,
   with a bar running down the moment before the page goes there ("Stay here" stops it). */
.cv-followtog { font-size: 13px; white-space: nowrap; cursor: pointer; }
.cv-followtog input { width: 16px; height: 16px; }
.cv-followtog[hidden] { display: none; }
.cv-followed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 32px); overflow: hidden; padding-bottom: 10px; }
.cv-followed[hidden] { display: none; }
.cv-followbtns { display: flex; gap: 6px; }
.cv-followed .cv-btn { padding: 4px 10px; font-size: 13px; background: #f4f1ea; color: #1c1917; border-color: #d6d3d1; }
.cv-followed .cv-go { background: var(--accent); border-color: var(--accent); }
.cv-followbar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #7c3aed; transform-origin: left; transform: scaleX(0); }
.cv-followed.counting .cv-followbar { animation: cvfollow 2600ms linear forwards; }
@keyframes cvfollow { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .cv-followed.counting .cv-followbar { animation: none; transform: scaleX(1); } }
@media (max-width: 640px) { .cv-followtog { font-size: 12px; } }

/* Your canvases: how many of how many the plan keeps, and Download all (greyed, with the plans that have it, when off). */
.cv-mine-plan, .cv-mine-none { margin: 0; font-size: 13px; color: var(--mute); }
.cv-mine-plan a, .cv-zip a { color: var(--accent); }
.cv-mine-plan[hidden], .cv-mine-none[hidden] { display: none; }
.cv-zip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cv-zip small { color: var(--mute); font-size: 12px; flex: 1; min-width: 140px; }
.cv-toast.cv-followed { bottom: 140px; }

/* Download (play/js/canvas/export.js): a picture, a time-lapse, or the SVG. */
.cv-export { background: #1c1d26; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; width: min(440px, calc(100% - 32px)); box-sizing: border-box; font-family: var(--font); box-shadow: 0 12px 40px #0008; }
.cv-export::backdrop { background: #0009; }
.cv-export > b { font-size: 19px; display: block; margin-bottom: 6px; }
.cv-export section { padding: 10px 0; border-top: 1px solid var(--line); }
.cv-export h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.cv-export h3 small { color: var(--mute); font-weight: 400; margin-left: 4px; }
.cv-export .cv-dl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-export .cv-hint { color: var(--mute); font-size: 13px; margin: 6px 0 0; }
.cv-export .cv-x-form { margin: 0; }
.cv-progress { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.cv-progress[hidden] { display: none; }
.cv-progress progress { flex: 1; accent-color: var(--accent); }
.cv-export .cv-dl-chips .cv-btn { font: 500 14px var(--font); min-width: 56px; }
.cv-export .cv-dl-plan { margin: 0 0 10px; }
.cv-export .cv-dl-plan a { color: var(--accent); }

.cv-studio { max-width: min(100%, 31rem); overflow: auto; }
.cv-studio form, .cv-layer-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.cv-studio input:not([type=range]), .cv-studio select, .cv-tools select { background: #20222e; color: #fff; border: 1px solid #747689; padding: .25rem; border-radius: .3rem; }
#studio-layers, #studio-checkpoints, #studio-invites { list-style: none; padding: 0; }
#studio-layers li { display: grid; gap: .3rem; padding: .5rem; margin-block: .35rem; border: 1px solid #515467; border-radius: .45rem; }
#studio-layers li[aria-current=true] { border-color: #c6abff; }
.cv-layer-thumb { width: 48px; height: 32px; object-fit: contain; background: #777; vertical-align: middle; margin-right: .4rem; }
.cv-studio button[aria-pressed=true], #pen-eraser[aria-pressed=true] { outline: 2px solid #c6abff; }
.cv-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.cv-compare figure { margin: 0; } .cv-compare img { width: 100%; }
#studio-status { min-height: 1.5em; } .cv-stage { overflow: clip; }

@media (max-width: 680px) {
  .cv-studio { position: fixed; z-index: 12; right: .35rem; bottom: 4.5rem; width: min(92vw, 31rem); max-height: 70vh;
    padding: .75rem; background: var(--bg2); border: 1px solid var(--line); border-radius: .6rem; }
}
