/* The hero's project canvas (js/canvas.js): the dr4ft app in its own neutral dark grey, not the page's navy, at a fixed
   internal size scaled to fit. Colours are the app's dark theme as it renders (cloudflare/web/src/vendor/canvas). */

.pc.cx { position: relative; width: 100%; }
.cx-win {
  --bg: #181818; --surface: #202020; --raised: #262626; --deep: #121212; --border: #2e2e2e; --border-s: #262626;
  --fg: #e4e4e4; --contrast: #fafafa; --muted: #9b9b9b; --dim: #6c6c6c; --ok: #22c55e; --warn: #f59e0b; --err: #ef4444;
  position: absolute; top: 0; left: 0; transform-origin: 0 0; display: flex; overflow: hidden;
  background: var(--bg); color: var(--fg); border: 1px solid #333; border-radius: 12px;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.85), 0 18px 40px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.5);
  font: 13px/1.45 var(--font-sans); letter-spacing: 0; text-align: left; -webkit-font-smoothing: antialiased;
  transition: opacity 0.4s ease;
}
.cx-win.cx-fade { opacity: 0; }
.cx-win [hidden] { display: none !important; }
.cx-win * { box-sizing: border-box; }
:where(.cx-win) :is(p, h4, h5, ul) { margin: 0; }
:where(.cx-win) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
:where(.cx-win) button:disabled { cursor: default; }
.cx-win button:focus-visible { outline: 2px solid #8ab4ff; outline-offset: 1px; border-radius: 6px; }
.cx-win:not(.cx-going) * { animation-play-state: paused !important; }
.cx-instant, .cx-instant * { transition: none !important; }
.cx-px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; width: 100%; height: 100%; object-fit: cover; }

.cx-i { display: inline-flex; width: 15px; height: 15px; flex: none; }
.cx-i svg { width: 100%; height: 100%; }
.cx-mk { display: inline-flex; width: 12px; height: 12px; flex: none; color: var(--muted); }
.cx-mk svg { width: 100%; height: 100%; }
.cx-dim-i { color: var(--dim); display: inline-flex; }
.cx-mute { color: var(--muted); }
.cx-ok-t { color: var(--ok); }
.cx-warn-t { color: var(--warn); }
.cx-mono { font-family: var(--font-mono); font-size: 12px; }
.cx-icb { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; color: var(--muted); }
.cx-icb:hover { background: var(--raised); color: var(--contrast); }
.cx-phone-only { display: none !important; }
.cx-phone .cx-phone-only { display: inline-flex !important; }
.cx-phone .cx-desk-only { display: none !important; }

@keyframes cx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cx-fadein { from { opacity: 0; } to { opacity: 1; } }
.cx-in { animation: cx-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
canvas.cx-in { animation-name: cx-fadein; animation-duration: 0.7s; }

/* ---- Sidebar ---- */
.cx-side { width: 224px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--border-s); background: var(--bg); z-index: 3; }
.cx-side-top { height: 40px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border-s); }
.cx-wm { display: inline-flex; color: var(--contrast); }
.cx-wm svg { width: 48px; height: 10.4px; }
.cx-side-body { flex: 1; min-height: 0; padding: 10px 8px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.cx-sec { display: flex; flex-direction: column; gap: 1px; }
.cx-sec-h { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 5px; font-size: 12px; color: var(--muted); }
.cx-sec-plus { width: 13px; height: 13px; color: var(--dim); }
.cx-rows { display: flex; flex-direction: column; gap: 1px; }
.cx-row { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: 6px; width: 100%; color: var(--fg); font-size: 13px; white-space: nowrap; }
.cx-win button.cx-row:hover { background: #222; }
.cx-row.cx-on { background: #2a2a2a; color: var(--contrast); }
.cx-row-x { color: var(--fg); cursor: default; }
.cx-row-x .cx-i { color: var(--muted); }
.cx-row-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cx-row-s { font-size: 12px; color: var(--muted); }
.cx-pico { display: inline-flex; color: #a78bfa; }
.cx-dots { display: inline-flex; gap: 5px; padding-right: 2px; }
.cx-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px color-mix(in srgb, var(--c) 60%, transparent); }
.cx-agents .cx-row { padding-left: 20px; height: 28px; }
.cx-agents { margin: 1px 0 2px; }
.cx-aorb { width: 7px; height: 7px; border-radius: 50%; background: #555; flex: none; margin: 0 3px 0 1px; }
.cx-aorb.cx-lit { background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent), 0 0 8px var(--c); animation: cx-breathe 2.4s ease-in-out infinite; }
@keyframes cx-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.cx-need .cx-i { width: 14px; height: 14px; }
.cx-cover { width: 16px; height: 16px; border-radius: 4px; overflow: hidden; flex: none; background: #333; }
.cx-cover-b { background: linear-gradient(135deg, #d9c7a8, #8d7a63); }
.cx-me { height: 48px; flex: none; display: flex; align-items: center; gap: 9px; padding: 0 14px; border-top: 1px solid var(--border-s); font-size: 13px; }
.cx-avatar { width: 22px; height: 22px; border-radius: 50%; flex: none; background: conic-gradient(from 40deg, #ff5a3c, #ffb547, #ff7ab0, #ff5a3c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25); }

/* ---- Main ---- */
.cx-main { flex: 1; min-width: 0; position: relative; display: flex; }
.cx-project, .cx-spacepg { position: absolute; inset: 0; display: flex; }
.cx-win[data-view="space"] .cx-project, .cx-win[data-view="project"] .cx-spacepg { visibility: hidden; }
.cx-spacepg { flex-direction: column; }
.cx-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cx-head { height: 40px; flex: none; display: flex; align-items: center; gap: 0; padding: 0 10px 0 14px; border-bottom: 1px solid var(--border-s); white-space: nowrap; font-size: 13px; }
.cx-head-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 10px; flex: none; }
.cx-head-t { color: var(--contrast); }
.cx-head-m { color: var(--muted); }
.cx-head-r { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.cx-ring-s { display: inline-flex; }
.cx-ring-s svg { width: 16px; height: 16px; }
.cx-head-pct { color: var(--warn); font-size: 11.5px; margin-left: -6px; }
.cx-exec { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; }
.cx-exec i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.cx-chat-b { flex: 1; min-height: 0; display: flex; position: relative; }
.cx-rail { width: 62px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 12px; }
.cx-pill { width: 44px; border-radius: 22px; border: 1px solid var(--border); background: rgba(33, 33, 33, 0.85); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 7px; }
.cx-pill-t { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* The status pill: a ring per harness in use, as the app's UsageRing (project-status-pill.tsx). */
.cx-usage { gap: 10px; padding: 6px 0 8px; }
.cx-ur { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cx-ur-c { position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.cx-ur-r { position: absolute; inset: 0; transform: rotate(-90deg); }
.cx-ur-r svg { width: 32px; height: 32px; display: block; }
.cx-ur-m { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--raised); color: var(--contrast); }
.cx-ur-m svg { width: 14px; height: 14px; fill: currentColor; }
.cx-ur-d { font-size: 9.5px; line-height: 1; color: var(--muted); }
.cx-trace { padding-top: 11px; gap: 7px; }
.cx-leds { display: grid; grid-template-columns: repeat(2, 8px); gap: 4px; }
.cx-leds i { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--c) 28%, #2a2a2a); transition: background 0.3s, box-shadow 0.3s; }
.cx-leds i.cx-led-on { background: var(--c); box-shadow: 0 0 3px color-mix(in srgb, var(--c) 75%, transparent), 0 0 8px color-mix(in srgb, var(--c) 35%, transparent); animation: cx-breathe 2.4s ease-in-out var(--ph) infinite; }

.cx-col { flex: 1; min-width: 0; max-width: 640px; margin: 0 auto; padding: 0 24px 14px 6px; display: flex; flex-direction: column; }
.cx-mstatus { display: flex; align-items: center; gap: 8px; height: 34px; flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.cx-mstatus .cx-i { width: 13px; height: 13px; }
.cx-mstatus-t { overflow: hidden; text-overflow: ellipsis; }
/* As the app's thread: messages from the top while they fit; once they don't, the newest at the bottom (the auto
   margin takes the free space only while there is some) and the oldest fading out under the top edge. */
.cx-msgs { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.cx-msgs.cx-over { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 44px); mask-image: linear-gradient(to bottom, transparent 0, #000 44px); }
.cx-thread { justify-content: flex-start; -webkit-mask-image: none; mask-image: none; padding-top: 16px; }
.cx-msgs-in { display: flex; flex-direction: column; gap: 0; padding: 4px 0 6px; margin-bottom: auto; }
.cx-m { margin-top: 12px; }
.cx-m:has(.cx-foot) { margin-top: 7px; }
.cx-bubble { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 12px; font-size: 14px; line-height: 21px; color: var(--fg); }
.cx-text p, .cx-ttext { font-size: 14px; line-height: 22px; color: var(--fg); }
.cx-ttext { margin-top: 12px; }
.cx-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.cx-flag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--dim); }
.cx-flag .cx-i { width: 11px; height: 11px; }
.cx-busy-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.cx-busy { display: inline-grid; grid-template-columns: 3px 3px; gap: 2px; }
.cx-busy i { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); animation: cx-blink 1.2s ease-in-out infinite; }
.cx-busy i:nth-child(2) { animation-delay: 0.3s; }
.cx-busy i:nth-child(4) { animation-delay: 0.6s; }
.cx-busy i:nth-child(3) { animation-delay: 0.9s; }
@keyframes cx-blink { 0%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Cards: hand-offs, reports, the ask, a manager's message */
.cx-card { border: 1px solid var(--border-s); background: var(--surface); border-radius: 8px; }
.cx-card-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border-s); font-size: 12.5px; }
.cx-card-h b { font-weight: 600; color: var(--contrast); }
.cx-card-h .cx-i { width: 14px; height: 14px; }
.cx-card-b { padding: 10px 12px 11px; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; line-height: 20px; }
.cx-tag-ok { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.cx-tag-ok .cx-i { width: 12px; height: 12px; color: var(--ok); }
.cx-hc { padding: 9px 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.cx-hc-h { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cx-hc-h b { font-weight: 600; color: var(--contrast); }
.cx-hc-h .cx-i { width: 14px; height: 14px; }
.cx-hc-h .cx-mute { font-size: 12px; }
.cx-hc-r { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.cx-hc-task { font-size: 13px; line-height: 19px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cx-hc-d { font-size: 12px; color: var(--muted); }
.cx-hc-s { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cx-hc-s .cx-i { width: 12px; height: 12px; color: var(--c); }
.cx-hc-s.cx-old { opacity: 0.6; }
.cx-hc-s.cx-old .cx-i { color: var(--muted); }
.cx-proof { display: flex; gap: 6px; }
.cx-thumb { width: 92px; height: 58px; border-radius: 5px; overflow: hidden; border: 1px solid var(--border); }
.cx-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.cx-check .cx-i { width: 14px; height: 14px; }
.cx-arow { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--deep); font-size: 13px; }
.cx-arow b { font-weight: 600; color: var(--contrast); }
.cx-arow-r { margin-left: auto; display: flex; gap: 6px; }
.cx-chip-d { font: 500 11px/1 var(--font-mono); padding: 3px 6px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }
.cx-chip-d.cx-chip-live { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.cx-mini-b { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--raised); font-size: 12px; color: var(--contrast); }
.cx-win button.cx-mini-b:hover:not(:disabled) { background: #303030; }
.cx-win button.cx-mini-b:disabled { opacity: 0.45; }
.cx-mini-p { background: var(--contrast); color: #111; border-color: transparent; }
.cx-win button.cx-mini-p:hover:not(:disabled) { background: #fff; }
.cx-mini-x { color: var(--muted); background: none; border-color: transparent; }
.cx-ask .cx-card-h b { font-weight: 500; }
.cx-opts { display: flex; flex-direction: column; gap: 2px; }
.cx-opt { display: flex; align-items: flex-start; gap: 9px; padding: 3px 4px; border-radius: 6px; width: 100%; }
.cx-win .cx-opt:hover { background: var(--raised); }
.cx-radio { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--muted); margin-top: 3px; flex: none; }
.cx-opt[aria-checked="true"] .cx-radio { border-color: var(--contrast); box-shadow: inset 0 0 0 2.5px var(--surface); background: var(--contrast); }
.cx-opt-t { display: flex; flex-direction: column; font-size: 13px; line-height: 18px; color: var(--contrast); }
.cx-opt-t .cx-mute { font-size: 12px; }
.cx-ta { margin-top: 7px; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: 12.5px; color: var(--dim); background: var(--deep); }
.cx-ask-a { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.cx-ask-s { font-size: 12.5px; color: var(--contrast); }
.cx-tmsg { margin-top: 4px; }
.cx-act { margin-top: 16px; font-size: 13px; color: var(--muted); }
.cx-tline { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.cx-tline .cx-i { width: 12px; height: 12px; }

/* The board card (the deliverables bar), pinned at the top of the manager's chat */
.cx-bc { flex: none; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); margin-bottom: 4px; }
.cx-bc-h { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 12px; font-size: 13px; border-bottom: 1px solid var(--border-s); }
.cx-bc-h b { font-weight: 600; color: var(--contrast); font-variant-numeric: tabular-nums; }
.cx-bc-r { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cx-bc-r .cx-i { width: 13px; height: 13px; }
.cx-bar { display: flex; gap: 2px; width: 150px; height: 5px; border-radius: 3px; overflow: hidden; }
.cx-bar i { flex: 1; background: #3d3d3d; transition: background 0.5s; }
.cx-bar i.cx-seg-done { background: var(--ok); }
.cx-bar i.cx-seg-move { background: #9a9a9a; }
.cx-bc-rows { padding: 4px 0 2px; }
.cx-br { display: flex; align-items: flex-start; gap: 10px; padding: 6px 12px; }
.cx-br-i { display: inline-flex; margin-top: 2px; color: var(--fg); }
.cx-br-i .cx-i { width: 15px; height: 15px; }
.cx-br-c { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cx-br-t { font-size: 13.5px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-br-m { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 0; white-space: pre; }
.cx-adot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin: 0 5px 0 1px; display: inline-block; }
.cx-br-bar { width: 64px; height: 4px; border-radius: 2px; background: #333; margin-top: 8px; flex: none; overflow: hidden; }
.cx-br-bar i { display: block; height: 100%; background: #a3a3a3; transform-origin: 0 50%; transform: scaleX(0); }
.cx-br-done .cx-br-bar i { background: var(--ok); }
.cx-br-done .cx-br-t { color: var(--muted); }
.cx-bc-done { display: flex; align-items: center; gap: 6px; padding: 4px 12px 8px; color: var(--muted); font-size: 12.5px; }
.cx-bc-done .cx-i { width: 12px; height: 12px; }

/* The composer */
.cx-comp { flex: none; display: flex; align-items: center; gap: 10px; min-height: 40px; margin-top: 10px; padding: 4px 5px 4px 16px; border-radius: 18px; background: var(--surface); }
.cx-comp-in { flex: 1; min-width: 0; font-size: 14px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.cx-comp-ph { color: var(--muted); }
.cx-comp-text { color: var(--contrast); overflow: hidden; text-overflow: clip; direction: rtl; text-align: left; unicode-bidi: plaintext; }
.cx-caret { display: none; width: 1.5px; height: 17px; background: var(--contrast); margin-left: 1px; animation: cx-blink 1s steps(1) infinite; }
.cx-typing .cx-caret { display: inline-block; }
.cx-send { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #555; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: background 0.2s, color 0.2s; }
.cx-send .cx-i { width: 14px; height: 14px; }
.cx-typing .cx-send { background: var(--contrast); color: #111; border-color: transparent; }

/* ---- The right panel ---- */
.cx-panel { width: clamp(400px, 43%, 540px); flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--border-s); background: var(--bg); }
.cx-nopanel .cx-panel { display: none; }
.cx-tabs { height: 40px; flex: none; display: flex; align-items: stretch; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--border-s); }
.cx-tab { display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--muted); font-size: 13px; position: relative; white-space: nowrap; }
.cx-win button.cx-tab:hover { color: var(--contrast); }
.cx-tab-l { display: none; }
.cx-tab.cx-on { color: var(--contrast); }
.cx-tab.cx-on .cx-tab-l { display: inline; }
.cx-tab.cx-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--contrast); }
.cx-tab[data-tab="project"] .cx-i { color: #a78bfa; }
.cx-tab-x { color: #5c5c5c; cursor: default; }
.cx-tab-play .cx-i { width: 11px; height: 11px; }
.cx-tab-play { animation: cx-in 0.4s ease both; }
.cx-tabs-x { margin: auto 0 auto auto; }
.cx-panel-b { flex: 1; min-height: 0; position: relative; }
.cx-tb { position: absolute; inset: 0; overflow: hidden; padding: 16px 18px; display: flex; flex-direction: column; }

.cx-pt-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--contrast); margin-bottom: 16px; }
.cx-pico-l .cx-i { width: 20px; height: 20px; }
.cx-pt-board { border-bottom: 1px solid var(--border-s); padding-bottom: 12px; margin-bottom: 14px; }
.cx-pt-bh { display: flex; align-items: center; gap: 9px; font-size: 13px; margin-bottom: 6px; }
.cx-pt-bh b { color: var(--contrast); }
.cx-pt-bh .cx-bar { margin-left: auto; width: 120px; }
.cx-clerk { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.cx-br-p { padding: 6px 0; }
.cx-notes { color: var(--fg); font-size: 13px; line-height: 20px; display: flex; flex-direction: column; gap: 6px; }
.cx-notes-f { font: 11px var(--font-mono); color: var(--dim); }
.cx-notes h4 { font-size: 16px; color: var(--contrast); font-weight: 600; }
.cx-notes h5 { font-size: 13px; color: var(--contrast); font-weight: 600; margin-top: 6px; }
.cx-notes ul { padding-left: 18px; color: var(--fg); }

.cx-files-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 13px; color: var(--contrast); }
.cx-files-h .cx-mute { font: 11px var(--font-mono); }
.cx-files { display: flex; flex-direction: column; margin: 0 -18px; }
.cx-file { display: flex; align-items: center; gap: 8px; height: 26px; font-size: 13px; color: var(--fg); }
.cx-file .cx-i { width: 14px; height: 14px; color: var(--muted); }
.cx-file-m { margin-left: auto; margin-right: 18px; font: 600 11px var(--font-mono); }

.cx-art-h { display: flex; align-items: baseline; gap: 8px; font-size: 16px; }
.cx-art-h b { color: var(--contrast); font-weight: 600; }
.cx-art-h .cx-mute { font-size: 12.5px; }
.cx-art-by { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.cx-art-by .cx-i { width: 12px; height: 12px; }
.cx-chips { display: flex; gap: 4px; margin: 12px 0 14px; font-size: 12.5px; }
.cx-chip-f { padding: 3px 9px; border-radius: 6px; color: var(--muted); }
.cx-chip-f.cx-on { background: var(--raised); color: var(--contrast); }
.cx-agrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; align-content: start; }
.cx-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; border-radius: 8px; }
.cx-poster { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); background: #111; margin-bottom: 5px; }
.cx-fresh .cx-poster { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.cx-tile-k { position: absolute; top: 7px; left: 7px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; background: rgba(10, 10, 10, 0.82); font-size: 11px; color: var(--contrast); }
.cx-tile-k .cx-i { width: 11px; height: 11px; }
.cx-tile-st { position: absolute; top: 7px; right: 7px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 6px; border-radius: 5px; background: rgba(10, 10, 10, 0.82); font: 500 11px/1.3 var(--font-mono); color: var(--muted); }
.cx-tile-st.cx-tile-live { color: var(--contrast); }
.cx-tile-pt { position: absolute; left: 10px; bottom: 8px; font-size: 14px; font-weight: 650; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.cx-tile-n { display: flex; gap: 7px; font-size: 12.5px; color: var(--fg); white-space: nowrap; overflow: hidden; }
.cx-tile-m { font-size: 11.5px; color: var(--muted); }
.cx-win button.cx-tile-app:hover .cx-poster { border-color: #555; }

.cx-sp-row { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 8px; width: 100%; }
.cx-win button.cx-sp-row:hover { background: var(--surface); }
.cx-sp-cover { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #111; }
.cx-sp-t { display: flex; flex-direction: column; font-size: 13.5px; color: var(--contrast); }
.cx-sp-t .cx-mute { font: 11.5px var(--font-mono); }

/* Play */
.cx-tb-play { padding: 0; }
.cx-play-bar { height: 44px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--border-s); white-space: nowrap; }
.cx-play-n { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--contrast); }
.cx-play-n .cx-i { width: 14px; height: 14px; color: var(--muted); }
.cx-play-n b { font-weight: 600; }
.cx-host { display: inline-flex; align-items: center; gap: 4px; font: 11px var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.cx-host .cx-i { width: 11px; height: 11px; flex: none; }
.cx-host-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-seg { display: inline-flex; padding: 2px; border-radius: 6px; background: var(--raised); font-size: 12px; flex: none; }
.cx-seg-b { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 4px; color: var(--muted); }
.cx-seg-b.cx-on { background: #3a3a3a; color: var(--contrast); }
.cx-seg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); display: inline-block; }
.cx-primary { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 6px; background: var(--contrast); color: #111; font-size: 12.5px; font-weight: 600; flex: none; }
.cx-primary .cx-i { width: 13px; height: 13px; }
.cx-win button.cx-primary:disabled { opacity: 0.4; }
.cx-play-bar > .cx-dim-i .cx-i { width: 14px; height: 14px; }
.cx-play-s { height: 26px; flex: none; display: flex; align-items: center; padding: 0 14px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--border-s); }
.cx-play-b { flex: 1; min-height: 0; display: flex; }
.cx-play-rail { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; border-right: 1px solid var(--border-s); color: var(--dim); }
.cx-play-rail > span { display: inline-flex; padding: 6px; border-radius: 6px; }
.cx-play-rail .cx-on { color: var(--contrast); background: var(--raised); }
.cx-play-v { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; background: #05070c; padding: 18px; }
.cx-app { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 10px; }
.cx-app-h, .cx-app-f { display: flex; justify-content: space-between; align-items: baseline; font: 11px var(--font-mono); color: #8a90b8; }
.cx-app-t { font: 700 15px var(--font-mono); letter-spacing: 0.3em; color: #f4f1ea; }
.cx-app-fuel { color: #ffb547; }
.cx-game { width: 100%; height: auto; aspect-ratio: 128 / 84; image-rendering: pixelated; image-rendering: crisp-edges; border-radius: 4px; }

/* ---- The space page ---- */
.cx-space-head { gap: 6px; }
.cx-space-head .cx-head-t { font-weight: 600; }
.cx-space-head .cx-head-m { margin-left: 6px; font-size: 12px; }
.cx-seg3 { display: inline-flex; padding: 2px; gap: 1px; border: 1px solid var(--border); border-radius: 7px; }
.cx-seg3 > span { display: inline-flex; padding: 3px 6px; border-radius: 5px; color: var(--muted); }
.cx-seg3 .cx-on { background: var(--raised); color: var(--contrast); }
.cx-seg3 .cx-i { width: 14px; height: 14px; }
.cx-search { display: inline-flex; align-items: center; gap: 7px; width: 210px; height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--deep); font-size: 12.5px; color: var(--dim); }
.cx-search .cx-i { width: 13px; height: 13px; }
.cx-add { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 6px; background: var(--contrast); color: #111; font-size: 12.5px; font-weight: 600; }
.cx-add .cx-i { width: 13px; height: 13px; }
.cx-canvas { flex: 1; min-height: 0; position: relative; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(circle at 1px 1px, #2f2f2f 1px, transparent 1.4px); background-size: 20px 20px; }
.cx-tools { position: absolute; top: 9px; left: 10px; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: rgba(24, 24, 24, 0.92); }
.cx-tool { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; color: var(--muted); }
.cx-tool .cx-i { width: 14px; height: 14px; }
.cx-accept { color: var(--contrast); animation: cx-in 0.35s ease both; }
.cx-win button.cx-accept:hover { background: var(--raised); }
.cx-items { position: absolute; left: 0; top: 0; width: 1100px; height: 530px; transform-origin: 0 0; }
.cx-it { position: absolute; transition: left 0.75s cubic-bezier(0.3, 0.7, 0.2, 1), top 0.75s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.75s, height 0.75s; }
.cx-img canvas { border-radius: 6px; }
.cx-it-t { position: absolute; left: 0; top: calc(100% + 5px); font-size: 11px; color: var(--muted); white-space: nowrap; }
.cx-note { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.cx-note-i .cx-i { width: 13px; height: 13px; color: var(--dim); }
.cx-note b { font-size: 12.5px; color: var(--contrast); }
.cx-note p { font-size: 12px; line-height: 17px; color: var(--fg); }
.cx-sound { display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.cx-sound-p { width: 28px; height: 28px; border-radius: 50%; background: #f2f2f2; color: #111; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cx-sound-p .cx-i { width: 12px; height: 12px; margin-left: 2px; }
.cx-sound-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cx-sound-b b { font-size: 11.5px; font-weight: 500; color: var(--contrast); }
.cx-wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.cx-wave i { width: 2px; background: #777; border-radius: 1px; }
.cx-sound-d { font-size: 10px; color: var(--muted); align-self: flex-end; margin-bottom: 8px; }
.cx-shelf-l { position: absolute; font-size: 10.5px; color: var(--dim); transform: translateY(-100%); }
.cx-arr .cx-face { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; }
.cx-arr .cx-face canvas { border-radius: 6px; }
.cx-arr-in .cx-face { outline: 1.5px dashed rgba(255, 255, 255, 0.85); outline-offset: 3px; overflow: visible; }
.cx-arr-in .cx-face > * { border-radius: 6px; overflow: hidden; }
.cx-atag { position: absolute; left: 0; bottom: calc(100% + 7px); display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 10px; border: 1px solid #555; background: rgba(36, 36, 36, 0.95); font-size: 11.5px; color: var(--contrast); white-space: nowrap; transition: opacity 0.3s; }
.cx-atag .cx-i { width: 12px; height: 12px; }
.cx-arr:not(.cx-arr-in) .cx-atag { opacity: 0; pointer-events: none; }
.cx-sprite .cx-face canvas { object-fit: contain; background: #0d1020; }
.cx-spark { position: absolute; right: 5px; bottom: 5px; display: inline-flex; padding: 2px; border-radius: 4px; background: rgba(0, 0, 0, 0.55); color: #fff; }
.cx-spark .cx-i { width: 10px; height: 10px; }
.cx-run { position: absolute; inset: 0; background: var(--raised); border: 1px solid var(--border); border-radius: 6px; padding: 8px 9px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; overflow: hidden; }
.cx-shine { position: absolute; inset: 0; background-image: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%); background-size: 200% 100%; animation: cx-shine 1.6s linear infinite; }
@keyframes cx-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.cx-run p { position: relative; font-size: 10.5px; line-height: 14px; color: var(--fg); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cx-run-l { position: relative; display: flex; align-items: center; gap: 4px; font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-run-l u { margin-left: auto; text-underline-offset: 2px; }
.cx-orb { width: 8px; height: 8px; border-radius: 50%; background: conic-gradient(#b892ff, #6cb6ff, #ff7ab0, #b892ff); animation: cx-spin 1.4s linear infinite; flex: none; }
@keyframes cx-spin { to { transform: rotate(360deg); } }
.cx-mini { position: absolute; right: 12px; bottom: 12px; width: 170px; height: 104px; border: 1px solid var(--border); border-radius: 9px; background: rgba(28, 28, 28, 0.92); padding: 10px; }
.cx-mini-in { position: absolute; inset: 12px; }
.cx-mini-in i { position: absolute; background: #4a4a4a; border-radius: 1px; transition: left 0.75s, top 0.75s; }
.cx-mini-v { position: absolute; top: 6px; bottom: 6px; border: 1.5px solid #d8d8d8; border-radius: 4px; }
.cx-zoom { position: absolute; left: 10px; bottom: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font-size: 11px; color: var(--muted); }

/* ---- Toast and the pointer ---- */
.cx-toast { position: absolute; left: 50%; bottom: 22px; z-index: 8; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 9px; border: 1px solid #3a3a3a; background: #262626; color: var(--contrast); font-size: 13px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); transform: translate(-50%, 12px); opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; white-space: nowrap; }
.cx-toast .cx-i { color: var(--ok); }
.cx-toast.cx-show { opacity: 1; transform: translate(-50%, 0); }
.cx-ptr { position: absolute; left: 0; top: 0; z-index: 9; width: 18px; height: 22px; pointer-events: none; opacity: 0; transition: opacity 0.3s; will-change: transform; }
.cx-ptr.cx-show { opacity: 1; }
.cx-ptr svg { width: 18px; height: 22px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.cx-ptr-l { position: absolute; left: 15px; top: 18px; padding: 1px 7px 2px; border-radius: 4px; background: #ff5a3c; color: #fff; font: 600 11px/1.4 var(--font-sans); transition: opacity 0.3s; }
.cx-ptr.cx-rest .cx-ptr-l { opacity: 0; }
.cx-ptr-ring { position: absolute; left: -9px; top: -9px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #ff5a3c; opacity: 0; transform: scale(0.4); }
.cx-ptr.cx-down .cx-ptr-ring { animation: cx-ring 0.35s ease-out both; }
@keyframes cx-ring { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(1.5); } }
.cx-scrim { position: absolute; inset: 0; z-index: 4; background: rgba(0, 0, 0, 0.5); }

/* ---- The phone layout: one pane at a time, the sidebar a drawer ---- */
.cx-phone { font-size: 14px; }
.cx-phone .cx-side { position: absolute; top: 0; bottom: 0; left: 0; width: 290px; z-index: 5; transform: translateX(-102%); transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.2, 1); box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5); }
.cx-phone.cx-drawer .cx-side { transform: none; }
.cx-phone .cx-row { height: 34px; font-size: 14px; }
.cx-phone .cx-agents .cx-row { height: 32px; }
.cx-phone .cx-head { height: 44px; padding: 0 8px; gap: 2px; }
.cx-phone .cx-head-dot { margin: 0 8px 0 6px; }
.cx-phone .cx-head-m { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cx-phone .cx-rail { display: none; }
.cx-phone .cx-col { padding: 0 12px 12px; max-width: none; }
.cx-phone .cx-panel { position: absolute; inset: 0; width: auto; border-left: 0; }
.cx-phone[data-focus="chat"] .cx-panel, .cx-phone[data-focus="panel"] .cx-chat { visibility: hidden; }
.cx-phone.cx-nopanel .cx-panel { display: flex; }
.cx-phone .cx-tabs { height: 44px; padding: 0 4px; gap: 0; }
.cx-phone .cx-tab { padding: 0 9px; }
.cx-phone .cx-bar { width: 96px; }
.cx-phone .cx-br-bar { width: 44px; }
.cx-phone .cx-bc-r { display: none; }
.cx-phone .cx-search { width: 34px; padding: 0 9px; }
.cx-phone .cx-add { width: 30px; padding: 0; justify-content: center; }
.cx-phone .cx-space-head .cx-head-t { margin-left: 6px; }
.cx-phone .cx-atag { font-size: 15px; height: 26px; border-radius: 13px; padding: 0 10px; bottom: calc(100% + 9px); }
.cx-phone .cx-atag .cx-i { width: 15px; height: 15px; }
.cx-phone .cx-run p { font-size: 14px; line-height: 18px; }
.cx-phone .cx-run-l { font-size: 13px; }
.cx-phone .cx-it-t { font-size: 14px; }
.cx-phone .cx-shelf-l { font-size: 14px; }
.cx-phone .cx-mini { width: 120px; height: 76px; }
.cx-phone .cx-agrid { gap: 14px 12px; }
.cx-phone .cx-play-bar { gap: 6px; padding: 0 10px; }
.cx-phone .cx-host { display: none; }
.cx-phone .cx-play-rail { display: none; }
.cx-phone .cx-play-v { padding: 12px; }
.cx-phone .cx-toast { font-size: 12.5px; bottom: 16px; }
.cx-phone .cx-text p { font-size: 14.5px; line-height: 22px; }
.cx-phone .cx-hc-task { -webkit-line-clamp: 2; }

/* ---- The step strip under the window, and the play/pause control ---- */
.cx-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
.cx-wrap > .pc { grid-column: 1 / -1; }
.cx-pp {
  align-self: start; margin-top: 30px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--night-2);
  color: var(--paper); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: border-color 0.15s, background 0.15s;
}
.cx-pp:hover { border-color: var(--muted); background: var(--night-3); }
.cx-pp .cx-i { width: 13px; height: 13px; }
.cx-pp .cx-pp-play, .cx-pp.cx-paused .cx-pp-pause { display: none; }
.cx-pp.cx-paused .cx-pp-play { display: inline-flex; }
.pc-steps.cx-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; grid-column: 2; }
.cx-wrap:not(:has(.cx-pp)) .pc-steps.cx-steps { grid-column: 1 / -1; }
.cx-steps li { min-width: 0; }
.cx-step {
  width: 100%; height: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 2px 0; border: 0; background: none; cursor: pointer;
  color: var(--dim); font: inherit; position: relative; transition: color 0.3s;
}
.cx-step b { font-size: 14px; font-weight: 650; color: var(--muted); transition: color 0.3s; }
.cx-step span:not(.cx-step-bar) { font-size: 13px; line-height: 1.45; color: var(--dim); transition: color 0.3s; }
.cx-step-bar { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--line-2); overflow: hidden; }
.cx-step-bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.cx-past .cx-step-bar i { background: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.cx-cur .cx-step b { color: var(--paper); }
.cx-cur .cx-step span:not(.cx-step-bar) { color: var(--muted); }
.cx-step:hover b { color: var(--paper); }
.cx-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
@media (max-width: 860px) {
  .pc-steps.cx-steps { gap: 8px; margin-top: 18px; }
  .cx-step span:not(.cx-step-bar) { display: none; }
  .cx-step b { font-size: 12.5px; line-height: 1.3; }
  .cx-pp { margin-top: 18px; width: 30px; height: 30px; }
}
@media (max-width: 520px) {
  .pc-steps.cx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-win *, .cx-win { animation: none !important; transition: none !important; }
}
