/* Content production (复刻任务 / 对标学习 / 素材生成 / 剪辑成片 / 视频产出). Light studio: Matrix's own
   colours, a dark well only where video plays, violet for what AI generated. Everything is scoped under .cp. */

/* With the engine on, its views replace the older content production markup in the same sections. */
body.remake-on #view-dashboard > :not(.remake-mount),
body.remake-on #view-learn > :not(.remake-mount),
body.remake-on #view-flow > :not(.remake-mount),
body.remake-on #view-edit > :not(.remake-mount) {
  display: none;
}

body:not(.remake-on) .remake-mount {
  display: none;
}

.cp {
  --cp-faint: var(--muted-2);
  --cp-line-soft: var(--line-soft);
  --cp-primary-ink: var(--primary-strong);
  --cp-media: var(--media);
  --cp-media-2: var(--media-2);
  --cp-shadow-lift: var(--shadow);
  --cp-radius: var(--radius-lg);
  --cp-board-cols: 3; /* 素材生成's columns (set on the board from the number of states shown) */
  --cp-clamp: 4; /* lines an insight card shows */
  color: var(--ink);
}

.cp h2, .cp h3, .cp h4, .cp p { margin: 0; }
.cp img { display: block; max-width: 100%; }
.cp a { color: inherit; }
.cp .num { font-variant-numeric: tabular-nums; }
.cp .cp-muted { color: var(--muted); }
.cp .cp-small { font-size: 12px; }
.cp .cp-broken { visibility: hidden; }
.cp .cp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp .cp-col { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.cp .cp-section { margin-top: 16px; }
.cp .cp-label { margin: 10px 2px 2px; color: var(--cp-faint); font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: .06em; }
.cp :focus-visible { outline: 3px solid var(--primary-line); outline-offset: 2px; }

/* buttons: Matrix .btn plus a few sizes and tones */
.cp .btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.cp .btn.primary { box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 22%, transparent); }
.cp .btn.primary:hover:not(:disabled) { background: var(--primary-gradient-hover); }
.cp .btn.danger { color: var(--rose); border-color: var(--rose-line); background: var(--rose-soft); }
.cp .btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.cp .btn:disabled { cursor: not-allowed; opacity: 0.5; box-shadow: none; }
.cp .btn .price { padding: 1px 7px; border-radius: var(--radius-xs); background: color-mix(in srgb, var(--surface) 18%, transparent); font-size: 12px; }
.cp a.btn { text-decoration: none; }

/* chips, tags, status colours */
.cp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--fill); color: var(--ink-2);
  font-size: 12px; font-weight: var(--fw-semibold); white-space: nowrap; text-decoration: none; }
.cp-chip svg { width: 13px; height: 13px; }
.cp-chip.st-awaiting { background: var(--amber-soft); color: var(--amber); }
.cp-chip.st-generating { background: var(--primary-soft); color: var(--cp-primary-ink, var(--primary-strong)); }
.cp-chip.st-review { background: var(--violet-soft); color: var(--violet); }
.cp-chip.st-approved { background: var(--teal-soft); color: var(--teal); }
.cp-chip.st-failed { background: var(--rose-soft); color: var(--rose); }
.cp-chip.st-cancelled { background: var(--fill); color: var(--muted); }
.cp-chip.dark { background: rgba(0, 0, 0, 0.55); color: var(--on-accent); }
.cp-chip.ai { background: var(--primary-gradient); color: var(--on-accent); }
.cp .corner .cp-chip:not(.dark):not(.ai) { background: color-mix(in srgb, var(--surface-elevated) 94%, transparent); box-shadow: var(--shadow-sm); }
.cp-chip .cp-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: cp-pulse 1.2s ease-in-out infinite; }
.cp-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-xs); background: var(--fill); color: var(--muted); font-size: 12px; font-weight: var(--fw-bold); }
.cp-tag svg { width: 13px; height: 13px; }
.cp-tag.ai { background: var(--violet-soft); color: var(--violet); }

/* surfaces */
.cp-card { background: var(--surface); border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--cp-radius, 12px); box-shadow: var(--shadow); }
.cp-pad { padding: 18px 20px; }
.cp-pad-top { padding-bottom: 0; }
.cp-sh { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cp-sh h3 { font-size: 17px; }
.cp-sh p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.cp-alert { display: flex; gap: 12px; margin-top: 14px; padding: 12px 16px; border: 1px solid var(--rose-line); border-radius: var(--radius-lg); background: var(--rose-soft); color: var(--rose-strong); }
.cp-alert svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; }
.cp-alert p { margin-top: 2px; word-break: break-word; }
.cp-alert small { color: var(--muted); }
.cp-alert.info { border-color: var(--primary-line); background: var(--primary-soft); color: var(--ink); }
.cp-alert.info svg { color: var(--primary); }

/* media well */
.cp-media { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--cp-media, var(--media)); }
.cp-media img, .cp-media video { width: 100%; height: 100%; object-fit: cover; }
.cp-media video { object-fit: contain; background: var(--media); }
.cp-media .shade { position: absolute; inset: auto 0 0 0; height: 42%; background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent); pointer-events: none; }
.cp-media .play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; display: grid; place-items: center;
  border-radius: 50%; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--cp-media, var(--ink)); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); pointer-events: none; }
.cp-media .play svg { width: 22px; height: 22px; margin-left: 3px; }
.cp-media .corner { position: absolute; left: 10px; top: 10px; }
.cp-media .stamp { position: absolute; right: 10px; bottom: 9px; color: var(--on-accent); font-size: 12px; font-weight: var(--fw-semibold); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.cp-media .label { position: absolute; left: 10px; bottom: 9px; color: var(--on-accent); font-size: 12px; font-weight: var(--fw-semibold); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.cp .ratio-16 { aspect-ratio: 16 / 9; }
.cp .ratio-9 { aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; }

/* progress and cost */
.cp-bar { display: block; height: 6px; border-radius: var(--radius-pill); background: var(--line-soft); overflow: hidden; }
.cp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width 0.25s; }
.cp-progress-text { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: var(--fw-bold); }
.cp-cost { display: grid; gap: 6px; min-width: 260px; }
.cp-cost-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: var(--fw-bold); }
.cp-cost-row b { color: var(--ink); font-size: 15px; }
.cp-cost-track { position: relative; height: 8px; border-radius: var(--radius-pill); background: var(--line-soft); }
.cp-cost-track .spent { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--teal); }
.cp-cost-track .est { position: absolute; top: -3px; width: 2px; height: 14px; margin-left: -1px; background: var(--ink); }
.cp-cost.over .spent { background: var(--amber); }
.cp .shimmer { background: linear-gradient(100deg, var(--media-2) 20%, var(--media-2) 40%, var(--media-2) 60%); background-size: 220% 100%; animation: cp-flow 1.8s linear infinite; }
@keyframes cp-flow { to { background-position: -200% 0; } }
@keyframes cp-pulse { 50% { opacity: 0.35; } }

/* P1 task wall */
.cp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.cp-kpi { padding: 16px 18px; }
.cp-kpi small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: var(--fw-semibold); }
.cp-kpi small svg { width: 15px; height: 15px; }
.cp-kpi strong { display: block; margin-top: 6px; font-size: 28px; letter-spacing: -0.02em; }
.cp-kpi em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: var(--fw-bold); }
.cp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cp-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--radius-md); background: var(--fill); flex-wrap: wrap; }
.cp-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--ink-2); font: inherit; font-weight: var(--fw-semibold); cursor: pointer; }
.cp-seg button svg { width: 15px; height: 15px; }
.cp-seg button.on { background: var(--surface); color: var(--cp-primary-ink, var(--primary-strong)); box-shadow: var(--shadow-sm); }
.cp-seg .n { color: var(--cp-faint, var(--muted-2)); }
.cp-search { display: flex; align-items: center; gap: 8px; min-width: 260px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--cp-faint, var(--muted-2)); }
.cp-search input { flex: 1; min-height: 38px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.cp-search svg { width: 16px; height: 16px; }
.cp-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.cp-task { overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.cp-task:hover { transform: translateY(-2px); box-shadow: var(--cp-shadow-lift); }
.cp-task .cp-media { border-radius: 0; }
.cp-task-body { padding: 14px 16px 16px; }
.cp-task-body h3 { font-size: 16px; line-height: 1.35; }
.cp-task-body h3 a { text-decoration: none; }
.cp-task-meta { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 650; }
.cp-versions { display: grid; gap: 6px; margin-top: 12px; }
.cp-versions > .cp-muted { font-size: 12px; }
.cp-ver { display: grid; grid-template-columns: minmax(54px, auto) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); text-decoration: none; }
.cp-ver:hover { background: var(--primary-soft); }
.cp-ver b { font-size: 13px; white-space: nowrap; }
.cp-ver-state { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: var(--fw-semibold); }
.cp-ver-state > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-task-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--cp-line-soft, var(--line-soft));
  color: var(--muted); font-size: 12px; font-weight: var(--fw-bold); }
.cp-task-foot b { color: var(--ink); }
.cp-new-card { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 330px; border: 1.5px dashed var(--line-strong); border-radius: var(--cp-radius, 12px);
  background: color-mix(in srgb, var(--surface) 50%, transparent); color: var(--muted); font: inherit; font-weight: var(--fw-semibold); cursor: pointer; }
.cp-new-card:hover { border-color: var(--primary); color: var(--primary); }
.cp-new-card > span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.cp-new-card svg { width: 24px; height: 24px; }
.cp-new-card small { font-weight: 650; }

/* P2 drawer (rendered in #cp-overlay, outside the view) */
.cp-scrim { position: fixed; inset: 0; z-index: 900; background: color-mix(in srgb, var(--media) 38%, transparent); }
.cp-drawer { position: fixed; z-index: 901; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); display: grid; grid-template-rows: auto auto 1fr auto;
  background: var(--surface); box-shadow: -20px 0 60px color-mix(in srgb, var(--media) 20%, transparent); outline: none; }
.cp-drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--cp-line-soft, var(--line-soft)); }
.cp-drawer-head h2 { font-size: 19px; }
.cp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 24px; border-bottom: 1px solid var(--cp-line-soft, var(--line-soft)); background: var(--surface-2); }
.cp-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: var(--fw-semibold); }
.cp-step i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--fill); font-style: normal; font-size: 12px; }
.cp-step.done i { background: var(--teal); color: var(--on-accent); }
.cp-step.on { color: var(--cp-primary-ink, var(--primary-strong)); }
.cp-step.on i { background: var(--primary); color: var(--on-accent); }
.cp-drawer-body { overflow: auto; padding: 18px 24px 24px; display: grid; gap: 16px; align-content: start; }
.cp-drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--cp-line-soft, var(--line-soft)); background: var(--surface-2); }
.cp-upload-state { margin-top: 4px; color: var(--primary); font-size: 12px; font-weight: var(--fw-semibold); }
.cp-drawer-foot > .cp-row { flex: 0 0 auto; flex-wrap: nowrap; }
.cp-field { display: grid; gap: 6px; }
.cp-field > span { color: var(--ink-2); font-size: 12px; font-weight: var(--fw-semibold); }
.cp-field small { color: var(--muted); font-size: 12px; font-weight: 600; }
.cp-field[hidden], .cp-row2[hidden] { display: none; }
.cp-input { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; }
textarea.cp-input { min-height: 72px; resize: vertical; line-height: 1.5; }
.cp-input::placeholder { color: var(--muted-2); }
.cp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cp-hint { margin: -4px 0 0; font-size: 12px; line-height: 1.5; }
.cp-drop { display: grid; place-items: center; gap: 6px; min-height: 120px; padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--muted); text-align: center; font-weight: var(--fw-bold); cursor: pointer; }
.cp-drop:hover { border-color: var(--primary); }
.cp-drop svg { width: 24px; height: 24px; color: var(--primary); }
.cp-picked { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--radius-md); }
.cp-picked > div:last-child { display: grid; gap: 4px; min-width: 0; }
.cp-picked strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-thumbs .t { position: relative; width: 74px; height: 98px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--cp-line-soft, var(--line-soft)); background: var(--surface-2); }
.cp-thumbs .t img { width: 100%; height: 100%; object-fit: contain; }
.cp-thumbs .t button { position: absolute; right: 3px; top: 3px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--media) 70%, transparent); color: var(--on-accent); cursor: pointer; }
.cp-thumbs .t button svg { width: 13px; height: 13px; }
.cp-thumbs .add { display: grid; place-items: center; color: var(--primary); border-style: dashed; cursor: pointer; }
.cp-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-weight: var(--fw-semibold); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.cp-check:hover { border-color: var(--primary-line); }
.cp-check:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.cp-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.cp-check small { display: block; color: var(--muted); font-weight: 600; }
/* on/off options as switches: label on the left, the control on the right */
.cp-switches { display: grid; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.cp-switch { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.cp-switch + .cp-switch { border-top: 1px solid var(--cp-line-soft, var(--line-soft)); }
.cp-switch > span { display: grid; gap: 2px; }
.cp-switch b { font-size: 13px; font-weight: var(--fw-semibold); }
.cp-switch small { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; }
.cp-switch input { position: relative; box-sizing: border-box; width: 42px; height: 24px; min-height: 0; max-height: 24px; margin: 0; padding: 0; border: 0; border-radius: var(--radius-pill); background: var(--line-strong); appearance: none; cursor: pointer; transition: background 0.2s; }
.cp-switch input::before { content: none; }
.cp-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 0.2s; }
.cp-switch input:checked { background: var(--primary); }
.cp-switch input:checked::after { transform: translateX(18px); }

/* workspace header, version tabs, stepper */
.cp-crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.cp-crumbs a { color: var(--muted); text-decoration: none; }
.cp-crumbs a:hover { color: var(--primary); }
.cp-crumbs svg { width: 14px; height: 14px; }
.cp-crumbs-facts { margin-left: auto; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cp-ws-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 20px; }
.cp-ws-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.cp-ws-title h2 { font-size: 19px; }
.cp-vtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-vtab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--ink); font: inherit; font-weight: var(--fw-semibold); cursor: pointer; text-decoration: none; }
.cp-vtab .cp-chip { padding: 1px 7px; font-size: 11px; }
.cp-vtab.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; color: var(--cp-primary-ink, var(--primary-strong)); }
.cp-vtab.add { border-style: dashed; color: var(--muted); }
.cp-vtab svg { width: 14px; height: 14px; }
.cp-ws-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cp-ws-actions .cp-cost { min-width: 220px; }
.cp-stepper { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--cp-line-soft, var(--line-soft)); }
.cp-stage { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: var(--cp-faint, var(--muted-2)); font-weight: var(--fw-semibold); text-decoration: none; }
.cp-stage + .cp-stage::before { content: ""; position: absolute; left: -14px; top: 50%; width: 28px; height: 2px; background: var(--line); }
.cp-stage i { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-style: normal; }
.cp-stage i svg { width: 14px; height: 14px; }
.cp-stage span { white-space: nowrap; }
.cp-stage small { display: block; color: var(--cp-faint, var(--muted-2)); font-size: 11px; font-weight: var(--fw-bold); }
.cp-stage.done { color: var(--ink); }
.cp-stage.done i { border-color: var(--teal); background: var(--teal); color: var(--on-accent); }
.cp-stage.done + .cp-stage::before, .cp-stage.now::before { background: var(--teal); }
.cp-stage.now { color: var(--cp-primary-ink, var(--primary-strong)); }
.cp-stage.now i { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.cp-stage.bad { color: var(--rose); }
.cp-stage.bad i { border-color: var(--rose); color: var(--rose); }
.cp-stage.in-view { background: linear-gradient(to top, var(--primary) 0 3px, transparent 3px); }
.cp-stage:hover { background-color: var(--surface-3); }

/* storyboard strip: tile widths follow shot length */
.cp-strip { display: flex; gap: 4px; padding: 10px; border-radius: var(--radius-md); background: var(--cp-media, var(--media)); overflow-x: auto; }
.cp-shot { position: relative; min-width: 76px; display: grid; gap: 4px; padding: 4px; border-radius: var(--radius-xs); border: 2px solid transparent; background: var(--cp-media-2, var(--media-2));
  color: var(--on-accent); font: inherit; text-align: left; cursor: pointer; }
.cp-shot:hover { border-color: var(--media-2); }
.cp-shot.sel { border-color: var(--highlight); box-shadow: 0 0 0 2px color-mix(in srgb, var(--highlight) 25%, transparent); }
.cp-shot.cur { border-color: var(--primary-line); }
.cp-shot.sel.cur { border-color: var(--highlight); outline: 2px solid var(--primary-line); outline-offset: 1px; }
.cp-shot .pic { position: relative; display: block; height: 54px; overflow: hidden; border-radius: 4px; background: var(--media-2); }
.cp-shot .pic img { width: 100%; height: 100%; object-fit: cover; }
.cp-shot .pic.tall { height: 70px; }
.cp-shot .pic .tiny { position: absolute; left: 4px; top: 3px; padding: 0 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); color: var(--on-accent); font-size: 9px; font-weight: var(--fw-semibold); }
.cp-shot .cap { display: flex; justify-content: space-between; gap: 4px; font-size: 10px; font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; }
.cp-shot .cap span:first-child { overflow: hidden; text-overflow: ellipsis; }
.cp-shot .flag { position: absolute; z-index: 1; right: 6px; top: 6px; padding: 1px 6px; border-radius: 4px; background: var(--highlight); color: var(--on-highlight); font-size: 10px; font-weight: var(--fw-bold); }
.cp-shot .state { display: grid; place-items: center; height: 100%; color: var(--muted-2); font-size: 10px; font-weight: var(--fw-semibold); }
.cp-shot .state.run { color: var(--primary-line); }
.cp-shot .state.ok { color: var(--teal-2); }
.cp-legend { display: flex; gap: 14px; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: var(--fw-bold); flex-wrap: wrap; }
.cp-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.cp-legend i.ok { background: var(--teal); }
.cp-legend i.run { background: var(--primary); }

/* P3 plan */
.cp-plan-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 16px; }
.cp-confirm { display: grid; gap: 14px; align-content: start; }
.cp-confirm h3 { font-size: 17px; }
.cp-breakdown { display: grid; gap: 8px; }
.cp-breakdown div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-weight: var(--fw-bold); }
.cp-breakdown div b { color: var(--ink); }
.cp-breakdown .total { padding-top: 8px; border-top: 1px solid var(--cp-line-soft, var(--line-soft)); color: var(--ink); font-size: 16px; }
.cp-insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cp-insights.one { grid-template-columns: 1fr; }
.cp-insight { padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--cp-line-soft, var(--line-soft)); }
.cp-insight span { color: var(--cp-primary-ink, var(--primary-strong)); font-size: 12px; font-weight: var(--fw-bold); }
.cp-insight p { margin-top: 5px; font-size: 13px; line-height: 1.6; }
.cp-shotlist { display: grid; gap: 8px; }
.cp-shotrow { display: grid; grid-template-columns: 96px 150px minmax(0, 1fr) 220px; gap: 14px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--radius-md); background: var(--surface); transition: box-shadow 0.25s; }
.cp-shotrow.flash { box-shadow: 0 0 0 3px var(--primary-line); }
.cp-shotrow .time { font-size: 13px; font-weight: var(--fw-semibold); }
.cp-shotrow .time small { display: block; color: var(--muted); font-weight: var(--fw-bold); }
.cp-shotrow .cp-media { height: 84px; }
.cp-prompt { display: -webkit-box; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 12px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cp-line { font-size: 13px; line-height: 1.6; }
.cp-line b { margin-right: 6px; color: var(--violet); }
.cp-refs { display: flex; flex-wrap: wrap; gap: 4px; }
.cp-markdown h4 { margin: 14px 0 6px; font-size: 15px; }
.cp-markdown p, .cp-markdown li { line-height: 1.7; }
.cp-markdown ul { margin: 6px 0; padding-left: 20px; }
details.cp-markdown > summary, details.cp-agent > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
details.cp-markdown > summary::-webkit-details-marker, details.cp-agent > summary::-webkit-details-marker { display: none; }
details.cp-markdown > summary::before, details.cp-agent > summary::before { content: "▸"; color: var(--muted); transition: transform 0.15s; }
details[open].cp-markdown > summary::before, details[open].cp-agent > summary::before { transform: rotate(90deg); }
.cp-table { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 13px; }
.cp-table th, .cp-table td { padding: 6px 8px; border-bottom: 1px solid var(--cp-line-soft, var(--line-soft)); text-align: left; vertical-align: top; }

/* AI thinking panel */
.cp-agent { margin-top: 16px; padding: 14px 20px; }
.cp-agent > summary { padding: 2px 0; }
.cp-agent-title { font-size: 16px; font-weight: var(--fw-semibold); }
.cp-agent-title::before { content: "✦ "; color: var(--violet); }
.cp-agent > summary .cp-muted { font-size: 13px; }
.cp-agent-live { margin-left: auto; }
.cp-agent-body { display: grid; gap: 8px; max-height: 460px; margin-top: 12px; padding: 12px; overflow: auto; border-radius: var(--radius-md); background: var(--surface-2);
  border: 1px solid var(--cp-line-soft, var(--line-soft)); font-size: 13px; line-height: 1.65; }
.cp-phase { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--violet); border-bottom: 1px dashed var(--violet); }
.cp-phase time { color: var(--cp-faint, var(--muted-2)); font-size: 12px; }
.cp-think { padding: 6px 10px; border-left: 3px solid var(--violet); color: var(--muted); font-style: italic; white-space: pre-wrap; word-break: break-word; }
.cp-think::before { content: "思考 · "; color: var(--violet); font-style: normal; font-weight: var(--fw-semibold); }
.cp-say { white-space: pre-wrap; word-break: break-word; }
.cp-tool { display: flex; gap: 8px; align-items: baseline; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--cp-line-soft, var(--line-soft)); font-size: 12px; }
.cp-tool::before { content: "⚙"; color: var(--primary); }
.cp-tool b { white-space: nowrap; }
.cp-tool span { color: var(--muted); word-break: break-word; }
.cp-tool.bad { border-color: var(--rose-line); background: var(--rose-soft); }
.cp-tool.bad::before { content: "!"; color: var(--rose); font-weight: var(--fw-bold); }
.cp-phase-end { color: var(--teal); font-size: 12px; font-weight: var(--fw-semibold); }
.cp-phase-end.bad { color: var(--rose); }
.cp-typing { color: var(--violet); font-weight: var(--fw-semibold); }
.cp-typing span { display: inline-block; width: 5px; height: 5px; margin-left: 3px; border-radius: 50%; background: currentColor; animation: cp-pulse 1s ease-in-out infinite; }
.cp-typing span:nth-child(2) { animation-delay: 0.2s; }
.cp-typing span:nth-child(3) { animation-delay: 0.4s; }

/* P4 assets */
.cp-gen-head { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: center; }
.cp-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-items: start; }
.cp-asset-grid.clips { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cp-asset { display: grid; gap: 6px; margin: 0; }
.cp-asset .pic { display: block; overflow: hidden; border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--radius-sm); background: var(--surface-2); }
.cp-asset .pic img { width: 100%; height: 210px; object-fit: contain; }
.cp-asset.wide .pic img { height: 120px; object-fit: cover; }
.cp-asset video { width: 100%; max-height: 260px; border-radius: var(--radius-sm); background: var(--media); object-fit: contain; }
.cp-asset.clip video { aspect-ratio: 9 / 16; max-height: 360px; }
.cp-asset figcaption { display: grid; gap: 2px; }
.cp-asset strong { font-size: 13px; }
.cp-asset small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.cp-voice { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--radius-md); }
.cp-voice + .cp-voice { margin-top: 8px; }
.cp-voice audio { width: 100%; height: 34px; }
.cp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* P5 / P8 review */
.cp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; border-radius: var(--cp-radius, 12px); background: var(--cp-media, var(--media)); }
.cp-compare .cp-media { aspect-ratio: 16 / 9; }
.cp-compare.portrait .cp-media { aspect-ratio: 9 / 16; max-height: 64vh; width: auto; justify-self: center; }
.cp-compare .side-label { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; pointer-events: none; }
.cp-transport { grid-column: 1 / -1; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 4px 6px 2px; color: var(--on-accent); }
.cp-transport > button[data-cp-play] { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface); color: var(--cp-media, var(--ink)); cursor: pointer; }
.cp-transport svg { width: 17px; height: 17px; }
.cp-audio { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--media-2); border-radius: var(--radius-sm); background: transparent; color: var(--on-accent);
  font: inherit; font-size: 12px; font-weight: var(--fw-semibold); cursor: pointer; }
.cp-scrub { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.cp-scrub .track { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--media-2); }
.cp-scrub .fill { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--primary-line); }
.cp-scrub .knob { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); }
.cp-scrub .tick { position: absolute; top: 6px; width: 2px; height: 10px; background: var(--media-2); }
.cp-scrub .tick.bad { top: 4px; height: 14px; background: var(--highlight); }
.cp-review-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.cp-shot-detail { display: grid; gap: 14px; align-content: start; }
.cp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cp-pair .cp-media { aspect-ratio: 16 / 9; }
.cp-redo-box { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.cp-redo-box.on { border-color: var(--rose-line); background: var(--rose-soft); }
.cp-redo-box label { display: flex; align-items: center; gap: 8px; color: var(--rose); font-weight: var(--fw-semibold); cursor: pointer; }
.cp-redo-box input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--rose); }
.cp-redo-list { display: grid; gap: 8px; }
.cp-redo-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 8px; border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cp-redo-item .cp-media { height: 40px; }
.cp-redo-item b { display: block; font-size: 13px; }
.cp-redo-item span > span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cp-redo-item .warn { color: var(--amber) !important; }
.cp-history { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--cp-line-soft, var(--line-soft)); font-size: 13px; }
.cp-history .cp-tag { margin-right: 6px; }
.cp-ok { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--teal-line); border-radius: var(--radius-md); background: var(--teal-soft); color: var(--teal); font-weight: var(--fw-semibold); }
.cp-ok svg { width: 20px; height: 20px; }
.cp-ok small { display: block; color: var(--muted); font-weight: 650; }
.cp-actionbar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px); flex-wrap: wrap; }
.cp-actionbar .msg { display: flex; align-items: center; gap: 8px; font-weight: var(--fw-semibold); flex-wrap: wrap; }
.cp-actionbar .msg svg { width: 18px; height: 18px; color: var(--rose); }
.cp-actionbar .warn { color: var(--amber); }

/* P6 learning library */
.cp-ref-list { display: grid; gap: 14px; }
.cp-ref-card { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; padding: 16px; }
.cp-ref-card.on { border-color: var(--primary-line); box-shadow: 0 0 0 1px var(--primary-line) inset, var(--shadow); }
.cp-ref-card h3 { font-size: 18px; }
.cp-ref-card > div:last-child > p { margin-top: 4px; }
.cp-quote { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; background: var(--primary-soft); font-size: 14px; line-height: 1.6; }
.cp-used { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cp-timeline { display: flex; gap: 3px; height: 92px; }
.cp-timeline .seg { position: relative; min-width: 24px; overflow: hidden; border-radius: var(--radius-xs); background: var(--cp-media, var(--media)); }
.cp-timeline .seg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.cp-timeline .seg span { position: absolute; left: 6px; bottom: 5px; color: var(--on-accent); font-size: 11px; font-weight: var(--fw-semibold); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
.cp-timeline .seg em { position: absolute; left: 6px; top: 5px; padding: 0 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); color: var(--on-accent); font-size: 10px; font-style: normal; font-weight: var(--fw-semibold); }
.cp-said { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--cp-line-soft, var(--line-soft)); font-size: 13px; line-height: 1.6; }
.cp-said > span { color: var(--muted); font-weight: var(--fw-semibold); }

/* P7 queue */
.cp-qrow { display: grid; grid-template-columns: 150px minmax(0, 1fr) 260px auto; gap: 18px; align-items: center; padding: 14px 16px; }
.cp-qrow + .cp-qrow { border-top: 1px solid var(--cp-line-soft, var(--line-soft)); }
.cp-qrow .cp-media { height: 84px; }
.cp-qrow h4 { font-size: 15px; }
.cp-qrow h4 a { text-decoration: none; }
.cp-qrow p { margin: 2px 0 6px; font-size: 13px; word-break: break-word; }
.cp-counts { display: flex; gap: 14px; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: var(--fw-semibold); }
.cp-counts b { color: var(--ink); }

/* P8 review desk */
.cp-rq { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.cp-rq-list { position: sticky; top: 12px; display: grid; gap: 8px; align-content: start; }
.cp-rq-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 9px; border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--radius-md);
  background: var(--surface); text-decoration: none; }
.cp-rq-item.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.cp-rq-item .cp-media { height: 52px; }
.cp-rq-item > span:last-child { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.cp-rq-item b { font-size: 13px; line-height: 1.35; }
.cp-rq-item small { color: var(--muted); font-size: 12px; font-weight: var(--fw-semibold); }
.cp-rq > div:last-child > .cp-sh h3 a { text-decoration: none; }
/* the review desk's right column is narrow: shot detail and the review panel stack */
.cp-rq .cp-review-grid { grid-template-columns: 1fr; }

/* P9 output */
.cp-production { margin-bottom: 0; }
.cp-films { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cp-film { overflow: hidden; }
.cp-film .cp-media { border-radius: 0; }
.cp-film-body { display: grid; gap: 8px; padding: 12px 14px 14px; }
.cp-film-body h4 { font-size: 15px; }
.cp-legacy { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 12px; font-weight: var(--fw-bold); }
.cp-legacy svg { width: 15px; height: 15px; }

@media (prefers-reduced-motion: reduce) {
  .cp .shimmer, .cp-typing span, .cp .corner .cp-chip:not(.dark):not(.ai) { background: color-mix(in srgb, var(--surface-elevated) 94%, transparent); box-shadow: var(--shadow-sm); }
.cp-chip .cp-dot { animation: none; }
  .cp-task, .cp-bar i { transition: none; }
}

/* narrow screens */
@media (max-width: 1200px) {
  .cp-plan-grid, .cp-review-grid, .cp-two, .cp-rq, .cp-ref-card, .cp-gen-head { grid-template-columns: 1fr; }
  .cp-rq-list { position: static; }
  .cp-shotrow { grid-template-columns: 80px 120px minmax(0, 1fr); }
  .cp-shotrow .cp-refs { grid-column: 2 / -1; }
  .cp-qrow { grid-template-columns: 120px minmax(0, 1fr); }
  .cp-qrow > .cp-cost, .cp-qrow > .cp-col { grid-column: 2 / -1; }
  .cp-ws-head { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .cp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-wall { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .cp-stepper { grid-template-columns: repeat(6, minmax(110px, 1fr)); overflow-x: auto; }
  .cp-compare { grid-template-columns: 1fr; }
  .cp-transport { grid-template-columns: auto auto minmax(0, 1fr); }
  .cp-transport .cp-audio { grid-column: 1 / -1; justify-self: start; }
  .cp-search { min-width: 0; flex: 1; }
  .cp-cost { min-width: 0; }
  .cp-picked { grid-template-columns: 1fr; }
}

/* 和 AI 对话 (chat with the concierge): a side panel; proposals are cards the person confirms or dismisses */
.cp-chat-panel { position: fixed; z-index: 900; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface-elevated); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.cp-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.cp-chat-head h3 { font-size: 16px; }
.cp-chat-head h3::before { content: "✦ "; color: var(--violet); }
.cp-chat-log { overflow: auto; padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.cp-msg { max-width: 92%; padding: 9px 12px; border-radius: var(--radius-lg); font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.cp-msg.user { justify-self: end; background: var(--accent-fill); color: var(--on-accent-fill); border-bottom-right-radius: 4px; }
.cp-msg.assistant { justify-self: start; background: var(--surface-2); border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; }
.cp-msg.assistant p { margin: 0 0 6px; }
.cp-msg.assistant p:last-of-type { margin-bottom: 0; }
.cp-msg.note { justify-self: center; max-width: 100%; padding: 2px 8px; color: var(--muted-2); font-size: 12px; background: none; }
.cp-msg time { display: block; margin-top: 4px; font-size: 11px; opacity: .7; }
.cp-action { display: grid; gap: 8px; max-width: 92%; padding: 10px 12px; border: 1px solid var(--primary-line); border-radius: var(--radius-md); background: var(--primary-soft); font-size: 13px; }
.cp-action.done { border-color: var(--line-soft); background: var(--surface-3); opacity: .8; }
.cp-action-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cp-action-head b { display: inline-flex; align-items: center; gap: 6px; }
.cp-action-head b svg { width: 15px; height: 15px; }
.cp-action ul { margin: 0; padding-left: 16px; display: grid; gap: 3px; }
.cp-action p { margin: 0; color: var(--ink-2); }
.cp-action-state { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.cp-action-state svg { width: 13px; height: 13px; }
.cp-chat-live { max-width: 92%; max-height: 180px; overflow: auto; padding: 8px 10px; border-left: 3px solid var(--violet); color: var(--muted); font-size: 12px; font-style: italic; white-space: pre-wrap; word-break: break-word; }
.cp-chat-error { color: var(--rose); font-size: 12px; }
.cp-chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 12px 16px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.cp-chat-form textarea { resize: none; min-height: 44px; }
@media (max-width: 900px) { .cp-chat-panel { width: 100vw; } }

/* 素材过目 (asset review before the clips): a grid of picture-first cards; the card whose form is open spreads over its row,
   the versions sit under the picture as a strip, and the one decision — start the clips — stays in a bar at the bottom */
.cp svg.lucide-loader, .cp svg.lucide-loader-circle { animation: cp-spin 1.2s linear infinite; }
@keyframes cp-spin { to { transform: rotate(360deg); } }
.cp-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 8px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--fill); color: var(--muted); font-size: 12px; font-weight: var(--fw-bold); vertical-align: 2px; }
.cp-price-legend { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 2px; }
.cp-price-legend span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: var(--fw-semibold); }
.cp-price-legend b { color: var(--ink); }
.cp-price-legend b.free { color: var(--teal); }
.cp-asset-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.cp-asset-cards.voices { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.cp-asset-card { position: relative; display: grid; align-content: start; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); transition: box-shadow 0.2s, border-color 0.2s; }
.cp-asset-card:hover { border-color: var(--line-strong); box-shadow: var(--cp-shadow-lift, var(--shadow)); }
.cp-asset-card.busy { border-color: var(--primary-line); box-shadow: 0 0 0 3px var(--primary-soft); }
.cp-asset-card.open { grid-column: 1 / -1; grid-template-columns: 236px minmax(0, 1fr); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cp-asset-card.open .cp-asset-pic { grid-row: 1 / span 2; }
.cp-asset-card.open .cp-asset-body, .cp-asset-card.open .cp-asset-forms { grid-column: 2; }
.cp-asset-card.open .cp-asset-acts { max-width: 420px; }
.cp-asset-pic { position: relative; aspect-ratio: 3 / 4; background: var(--cp-media, var(--media)); }
.cp-asset-card.open .cp-asset-pic { aspect-ratio: 9 / 16; }
.cp-asset-pic .pic { position: relative; display: block; height: 100%; overflow: hidden; }
.cp-asset-pic img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.cp-asset-pic img.blur { position: absolute; inset: 0; object-fit: cover; filter: blur(24px) saturate(1.2); opacity: 0.55; transform: scale(1.15); }
.cp-asset-pic .corner-l { position: absolute; left: 8px; top: 8px; }
.cp-asset-pic .corner-r { position: absolute; right: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; }
.cp-asset-pic .corner-r b { padding: 1px 6px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--media) 70%, transparent); color: var(--on-accent); font-size: 11px; }
.cp-asset-pic .cp-tag, .cp-lib-pic .cp-tag { background: color-mix(in srgb, var(--surface-elevated) 92%, transparent); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.cp-asset-busy { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--media) 45%, transparent); backdrop-filter: blur(2px); }
.cp-asset-busy::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 22%, transparent) 50%, transparent 70%); background-size: 220% 100%; animation: cp-flow 1.6s linear infinite; }
.cp-asset-busy .cp-chip { position: relative; box-shadow: var(--shadow); }
.cp-asset-body { display: grid; gap: 8px; padding: 12px; }
.cp-asset-head { display: grid; gap: 2px; min-width: 0; }
.cp-asset-head strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.cp-asset-head small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.cp-asset-body .cp-prompt { margin: 0; cursor: pointer; }
.cp-asset-body .cp-prompt.full { display: block; }
.cp-asset-error { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--rose-line); border-radius: var(--radius-sm); background: var(--rose-soft); color: var(--rose); font-size: 12px; }
.cp-asset-error svg { flex: 0 0 auto; width: 15px; height: 15px; }
.cp-revs { display: flex; gap: 6px; padding: 2px; overflow-x: auto; scrollbar-width: thin; }
.cp-rev { position: relative; display: grid; flex: 0 0 auto; width: 46px; padding: 0; overflow: hidden; border: 2px solid var(--line); border-radius: var(--radius-xs); background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; }
.cp-rev img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: var(--cp-media, var(--media)); }
.cp-rev i { display: block; padding: 1px 0; color: var(--muted); font-size: 10px; font-style: normal; font-weight: var(--fw-bold); text-align: center; }
.cp-rev:not(.cur):not(:disabled):hover { border-color: var(--primary-line); }
.cp-rev.cur { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); cursor: default; }
.cp-rev.cur i { background: var(--primary); color: var(--on-accent); }
.cp-rev:disabled:not(.cur) { opacity: 0.55; cursor: not-allowed; }
.cp-revs.rows { display: grid; gap: 4px; overflow: visible; }
.cp-revs.rows .cp-rev { display: flex; align-items: center; gap: 8px; width: auto; padding: 6px 8px; border-width: 1px; border-radius: var(--radius-sm); text-align: left; }
.cp-revs.rows .cp-rev.cur { box-shadow: 0 0 0 1px var(--primary) inset; }
.cp-revs.rows .cp-rev b { min-width: 22px; font-size: 12px; }
.cp-revs.rows .cp-rev small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cp-asset-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cp-act { display: grid; gap: 2px; justify-items: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; font-weight: var(--fw-semibold); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.cp-act svg { width: 16px; height: 16px; color: var(--primary); }
.cp-act em { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 600; }
.cp-act:hover:not(:disabled):not(.off) { border-color: var(--primary-line); background: var(--primary-soft); }
.cp-act.on { border-color: var(--primary); background: var(--primary-soft); color: var(--cp-primary-ink, var(--primary-strong)); }
.cp-act:disabled, .cp-act.off { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.cp-asset-forms { padding: 0 12px 12px; }
.cp-asset-card:not(.open) .cp-asset-forms { display: none; }
.cp-asset-form { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--primary-line); border-radius: var(--radius-md); background: var(--primary-soft); }
.cp-asset-form[hidden] { display: none; }
.cp-asset-form .cp-check { padding: 8px 10px; }
.cp-asset-card.voice { gap: 10px; padding: 12px; }
.cp-asset-card.voice.open { grid-template-columns: 1fr; }
.cp-asset-card.voice.open .cp-asset-body, .cp-asset-card.voice.open .cp-asset-forms { grid-column: 1; }
.cp-asset-card.voice .cp-asset-body, .cp-asset-card.voice .cp-asset-forms { padding: 0; }
.cp-voice-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.cp-avatar { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: var(--fill); color: var(--primary); }
.cp-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cp-avatar svg { width: 20px; height: 20px; }
.cp-asset-card.voice audio { width: 100%; height: 36px; }
.cp-ranges { display: grid; gap: 6px; margin-bottom: 8px; }
.cp-range { display: grid; gap: 2px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cp-range:hover { border-color: var(--primary-line); }
.cp-range small { color: var(--muted); font-size: 12px; }
.cp-range-player { width: 100%; max-height: 240px; border-radius: var(--radius-sm); background: var(--cp-media, var(--media)); }
.cp-asset-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border: 1px solid var(--primary-line); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface-elevated) 94%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(8px); }
.cp-asset-bar-text { display: grid; gap: 2px; min-width: 0; }
.cp-asset-bar-text b { font-size: 14px; }
.cp-asset-bar-text small { color: var(--muted); font-size: 12px; }
.cp-asset-bar .btn.primary { flex: 0 0 auto; }
@media (max-width: 900px) {
  .cp-asset-card.open { grid-template-columns: 1fr; }
  .cp-asset-card.open .cp-asset-pic { grid-row: auto; aspect-ratio: auto; max-height: 300px; }
  .cp-asset-card.open .cp-asset-body, .cp-asset-card.open .cp-asset-forms { grid-column: 1; }
  .cp-asset-bar { flex-direction: column; align-items: stretch; }
}

/* 素材资产库 (asset library): picture tiles with the facts as overlays, a sheet beside the grid for the selected one,
   and the same tiles inside the @ picker of the create drawer */
.cp-lib-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.cp-lib-split.with-sheet { grid-template-columns: minmax(0, 1fr) 360px; }
.cp-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cp-lib-grid.dense { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.cp-lib-tile { position: relative; display: grid; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; text-align: left; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, border-color 0.15s; }
.cp-lib-tile:hover { transform: translateY(-2px); box-shadow: var(--cp-shadow-lift, var(--shadow)); }
.cp-lib-tile.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cp-lib-tile.picked { border-color: var(--teal); }
.cp-lib-pic { position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; background: var(--cp-media, var(--media)); }
.cp-lib-pic img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.cp-lib-tile:hover .cp-lib-pic img { transform: scale(1.04); }
.cp-lib-pic .play { position: absolute; inset: 0; display: grid; place-items: center; color: var(--on-accent); pointer-events: none; }
.cp-lib-pic .play svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); }
.cp-lib-pic .stamp { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: var(--radius-xs); background: color-mix(in srgb, var(--media) 70%, transparent); color: var(--on-accent); font-size: 11px; font-weight: var(--fw-semibold); }
.cp-lib-pic.voice { background: var(--primary-soft); }
.cp-lib-pic.voice img { opacity: 0.85; }
.cp-lib-busy { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--media) 45%, transparent); color: var(--on-accent); }
.cp-lib-busy svg { width: 26px; height: 26px; }
.cp-lib-pic .corner-l { position: absolute; left: 6px; top: 6px; }
.cp-lib-pic .corner-r { position: absolute; right: 6px; top: 6px; }
.cp-lib-picked { position: absolute; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px; background: var(--teal); color: var(--on-accent); font-size: 11px; font-weight: var(--fw-bold); }
.cp-lib-picked svg { width: 12px; height: 12px; }
.cp-lib-meta { display: grid; gap: 1px; min-width: 0; padding: 8px 10px; }
.cp-lib-meta b, .cp-lib-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-lib-meta b { font-size: 13px; }
.cp-lib-meta small { color: var(--muted); font-size: 11px; }
.cp-lib-sheet { position: sticky; top: 16px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 32px); overflow: hidden; }
.cp-lib-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--cp-line-soft, var(--line-soft)); }
.cp-lib-sheet-head h3 { font-size: 16px; }
.cp-lib-sheet-head p { margin-top: 2px; font-size: 12px; }
.cp-lib-sheet-body { display: grid; gap: 12px; align-content: start; padding: 14px 16px; overflow: auto; }
.cp-lib-sheet-body .ratio-9 { max-height: 46vh; }
.cp-lib-sheet-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--cp-line-soft, var(--line-soft)); background: var(--surface-2); }
.cp-lib-revs { display: grid; gap: 6px; }
.cp-lib-revs .cp-label { margin: 0 2px; }
.cp-lib-revs .cp-rev { cursor: pointer; }
.cp-lib-sheet audio { width: 100%; height: 36px; }
.cp-lines { display: grid; gap: 4px; margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.cp-lines b { margin-right: 6px; color: var(--muted); font-weight: var(--fw-semibold); }
.cp-facts { display: grid; gap: 6px; margin: 0; }
.cp-facts div { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.cp-facts dt { color: var(--muted); font-weight: var(--fw-semibold); }
.cp-facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.cp-facts a { color: var(--primary); text-decoration: none; }
.cp-facts a:hover { text-decoration: underline; }
.cp-token { padding: 2px 6px; border-radius: var(--radius-xs); background: var(--fill); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.cp-empty { display: grid; justify-items: center; gap: 8px; padding: 48px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--muted); text-align: center; }
.cp-empty > span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.cp-empty svg { width: 26px; height: 26px; }
.cp-empty b { color: var(--ink); font-size: 16px; }
.cp-empty p { max-width: 420px; font-size: 13px; }
.cp-at-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-at-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-at-chip { gap: 6px; padding-right: 4px; }
.cp-at-chip img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; }
.cp-at-chip small { color: var(--muted); }
.cp-at-chip button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.cp-at-chip button:hover { background: var(--fill); }
.cp-at-chip button svg { width: 12px; height: 12px; }
.cp-at-scrim { position: fixed; inset: 0; z-index: 950; background: var(--overlay); }
.cp-at-panel { position: fixed; z-index: 951; left: 50%; top: 8vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; width: min(820px, 94vw); max-height: 84vh; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-elevated); box-shadow: var(--shadow-lg); transform: translateX(-50%); }
.cp-at-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.cp-at-head h3 { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; white-space: nowrap; }
.cp-at-head h3 svg { width: 16px; height: 16px; color: var(--primary); }
.cp-at-body { overflow: auto; }
.cp-at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.cp-at-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--cp-line-soft, var(--line-soft)); color: var(--muted); font-size: 12px; }
.cp-at-foot b { color: var(--ink); }
.cp-at-foot kbd { padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); font: inherit; font-size: 11px; }
@media (max-width: 1100px) {
  .cp-lib-split.with-sheet { grid-template-columns: 1fr; }
  .cp-lib-sheet { position: fixed; z-index: 900; inset: 0 0 0 auto; width: min(420px, 100vw); max-height: none; border-radius: 0; }
}

/* 一屏 (one screen): every 内容生产 view fills the window under the page title (styles.css .cp-screen) and never scrolls
   as a page. Lists are fitted boxes (pager.js fit): as many cards as the box holds, the rest behind the pager under it.
   Pages with a detail are desks: a list or player on the left, the picked item's sheet on the right. */
.view.cp-screen > .remake-mount { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.cp-screen-root { display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-height: 0; }
.cp-screen-root > * { flex: 0 0 auto; margin-top: 0; margin-bottom: 0; }
.cp-screen-root > .cp-fit, .cp-screen-root > .cp-ws-body, .cp-screen-root > .cp-board, .cp-screen-root > .cp-lib-split,
.cp-screen-root > .cp-learn, .cp-screen-root > .cp-rq, .cp-screen-root > .cp-empty, .cp-screen-root > .cp-desk-fill { flex: 1 1 0; min-height: 0; }
.cp-fit { display: grid; gap: 12px; min-height: 0; overflow: hidden; }
.cp-fit > * { min-width: 0; min-height: 0; }
.cp-fit > .empty, .cp-fit > .cp-empty, .cp-fit > .cp-fit-fill, .cp-fit > .cp-new-card { grid-column: 1 / -1; grid-row: 1 / -1; align-self: center; justify-self: stretch; margin: 0; }
.cp-fit > .cp-new-card { justify-self: center; width: min(420px, 100%); min-height: 260px; }
.cp-fit-pager { flex: 0 0 auto; min-height: 42px; }
.cp-fit-pager:empty { min-height: 0; }
.cp-desk-fill { display: grid; flex: 1 1 0; place-items: center; min-height: 0; margin: 0; text-align: center; }
.cp-pane { display: flex; flex: 1 1 0; flex-direction: column; gap: 10px; min-height: 0; }
.cp-pane > .cp-fit { flex: 1 1 0; }
.cp-pane-scroll { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-width: thin; }
.cp-pane-strip .cp-strip { padding: 8px; }

/* fitted cards: the picture takes what the cell leaves after the text */
.cp-fit > .cp-lib-tile { grid-template-rows: minmax(0, 1fr) auto; }
.cp-fit .cp-lib-pic { height: 100%; min-height: 0; aspect-ratio: auto; }
.cp-fit .cp-lib-pic img { object-position: center 22%; }
/* insight cards: the text clamps to the card (the whole of it is the card's tooltip) */
.cp-fit.cp-insights { gap: 10px; }
.cp-fit > .cp-insight { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cp-fit > .cp-insight p { display: -webkit-box; margin-top: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: var(--cp-clamp); }
.cp-fit > .cp-task, .cp-fit > .cp-film { display: flex; flex-direction: column; }
.cp-fit > .cp-task > .cp-media, .cp-fit > .cp-film > .cp-media { flex: 1 1 0; min-height: 64px; aspect-ratio: auto; }
.cp-fit > .cp-task > .cp-task-body, .cp-fit > .cp-film > .cp-film-body { flex: 0 0 auto; }
.cp-fit.cp-wall, .cp-fit.cp-films { gap: 16px; }
.cp-fit > .cp-task h3, .cp-fit > .cp-film h4 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-film-body p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* storyboard strips always fit their width: tiles narrow with the shot, captions give way first */
.cp-strip { overflow: hidden; }
.cp-shot { min-width: 0; container-type: inline-size; }
@container (max-width: 66px) { .cp-shot .cap .num { display: none; } }
@container (max-width: 40px) { .cp-shot .cap, .cp-shot .pic .tiny, .cp-shot .flag { display: none; } }

/* workspace */
.cp-ws.cp-screen-root { gap: 10px; }
.cp-ws-body { display: flex; flex: 1 1 0; flex-direction: column; gap: 14px; min-height: 0; margin-top: 0; }
.cp-ws-body > * { flex: 0 0 auto; margin-top: 0; }
.cp-ws-body > .cp-desk, .cp-ws-body > .cp-plan-desk, .cp-ws-body > .cp-film-desk, .cp-ws-body > .cp-film-wait { flex: 1 1 0; min-height: 0; }

/* 方案: reference + state | panes */
.cp-plan-desk { display: grid; grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.6fr); gap: 14px; }
.cp-plan-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.cp-ref-pane { display: flex; flex: 1 1 0; flex-direction: column; min-height: 160px; padding: 14px 16px; }
.cp-ref-pane .cp-sh { flex: 0 0 auto; margin-bottom: 10px; }
.cp-ref-player { flex: 1 1 0; min-height: 0; }
.cp-ref-player .cp-media { width: 100%; height: 100%; max-height: none; aspect-ratio: auto !important; }
.cp-plan-side > .cp-confirm { flex: 0 1 auto; min-height: 0; overflow: auto; scrollbar-width: thin; }
.cp-plan-main { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 12px 14px; }
.cp-fit.cp-shotlist { gap: 8px; }
.cp-fit > .cp-shotrow { grid-template-columns: 92px 112px minmax(0, 1fr) 200px; padding: 8px 10px; overflow: hidden; }
.cp-fit > .cp-shotrow .cp-media { height: 72px; }
.cp-shotrow-text { max-height: 100%; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, var(--ink) 72%, transparent); mask-image: linear-gradient(to bottom, var(--ink) 72%, transparent); }
.cp-shotrow-text .cp-prompt { -webkit-line-clamp: 1; }
.cp-fit > .cp-shotrow .cp-refs { max-height: 100%; overflow: hidden; }
.cp-agent-pane { display: flex; flex: 1 1 0; flex-direction: column; gap: 8px; min-height: 0; }
.cp-agent-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.cp-agent-pane .cp-agent-body { flex: 1 1 0; min-height: 0; max-height: none; margin-top: 0; }

/* 素材: tiles | sheet (the workspace's assets, the review before the clips, the library) */
.cp-desk { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.cp-desk-main { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 12px 14px; }
.cp-desk-main > * { flex: 0 0 auto; margin-top: 0; }
.cp-desk-main > .cp-fit, .cp-desk-main > .cp-desk-fill { flex: 1 1 0; min-height: 0; }
.cp-desk-main > .cp-agent { margin-top: 0; padding: 8px 14px; box-shadow: none; }
.cp-desk-main > .cp-asset-bar { position: static; box-shadow: none; backdrop-filter: none; }
.cp-desk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; }
.cp-desk-title { display: grid; gap: 2px; min-width: 0; }
.cp-desk-title h3 { font-size: 16px; }
.cp-desk-title p { font-size: 12px; }
.cp-desk-status { display: inline-flex; align-items: center; gap: 10px; }
.cp-desk-strip .cp-strip { padding: 8px; }
.cp-desk-side, .cp-lib-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cp-desk-side > .cp-lib-sheet, .cp-lib-side > .cp-lib-sheet { flex: 1 1 0; position: static; height: auto; max-height: none; min-height: 0; }
.cp-desk-empty { display: grid; place-items: center; color: var(--muted); text-align: center; }
.cp-desk-empty svg { width: 28px; height: 28px; margin: 0 auto 8px; color: var(--primary); }
.cp-desk-empty p { max-width: 240px; font-size: 13px; }
.cp-lib-split { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 14px; align-items: stretch; }
.cp-lib-split.with-sheet { grid-template-columns: minmax(0, 1fr) 340px; }
.cp-lib-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.cp-lib-main > .cp-fit { flex: 1 1 0; }
/* the sheet: header, a preview that takes what the text leaves, the actions at the foot */
.cp-lib-sheet-body { display: flex; flex-direction: column; gap: 12px; }
.cp-lib-sheet-body > * { flex: 0 0 auto; }
.cp-lib-sheet-body > .cp-media { flex: 1 1 0; width: 100%; min-height: 150px; max-height: none !important; aspect-ratio: auto !important; }
.cp-lib-sheet-body > .cp-media img { object-fit: contain; }
.cp-lib-sheet-body .cp-facts dd { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; cursor: default; }
.cp-review-sheet .cp-lib-sheet-body { padding: 0; }
.cp-review-sheet .cp-asset-card { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.cp-review-sheet .cp-asset-card:hover { box-shadow: none; }
.cp-review-sheet .cp-asset-pic { flex: 1 1 0; min-height: 150px; aspect-ratio: auto; }
.cp-review-sheet .cp-asset-card.open .cp-asset-pic { flex: 0 0 120px; aspect-ratio: auto; }
.cp-review-sheet .cp-asset-body, .cp-review-sheet .cp-asset-forms { flex: 0 0 auto; }
.cp-review-sheet .cp-asset-body > .cp-asset-head strong { display: none; }
.cp-review-sheet .cp-asset-card.voice { padding: 14px 16px; }

/* 成片: players and the shot strip | the picked shot, the review and the decision */
.cp-film-desk { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.cp-film-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.cp-film-main > .cp-compare { flex: 1 1 0; min-height: 180px; grid-template-rows: minmax(0, 1fr) auto; }
.cp-film-main .cp-compare .cp-media, .cp-film-main .cp-compare.portrait .cp-media { width: 100%; height: 100%; max-height: none; min-height: 0; aspect-ratio: auto; justify-self: stretch; }
/* landscape films in a tall well: one above the other (setupCompare sets .stack from the well's shape) */
.cp-compare.stack { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto; }
.cp-film-strip { flex: 0 0 auto; padding: 12px 14px; }
.cp-film-strip .cp-sh { margin-bottom: 8px; }
.cp-film-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.cp-film-side > .cp-alert { flex: 0 0 auto; margin: 12px 12px 0; }
.cp-film-side-body { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-width: thin; }
.cp-film-side .cp-review-grid { display: block; }
.cp-film-side .cp-review-grid > .cp-card { border: 0; border-radius: 0; background: none; box-shadow: none; }
.cp-film-side .cp-review-grid > .cp-card + .cp-card { border-top: 1px solid var(--cp-line-soft, var(--line-soft)); }
.cp-film-side .cp-pair { display: none; }
.cp-film-side .cp-agent { margin: 0 12px 12px; box-shadow: none; }
.cp-film-side .cp-actionbar { position: static; margin: 0; border-width: 1px 0 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }
.cp-film-side .cp-actionbar .cp-row { width: 100%; justify-content: flex-end; }
.cp-film-wait { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.cp-film-wait > section:first-child { flex: 0 1 auto; min-height: 0; overflow: auto; scrollbar-width: thin; }
.cp-agent-card { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; padding-bottom: 14px; }
.cp-agent-card .cp-sh { margin-bottom: 8px; }
.cp-agent-card .cp-agent-pane { padding: 0 20px; }

/* 剪辑成片: versions rail | the film desk */
.cp-rq { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.cp-rq-rail { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 10px; }
.cp-rq-rail > .cp-fit, .cp-rq-rail > .cp-desk-fill { flex: 1 1 0; }
.cp-fit.cp-rq-list { position: static; gap: 8px; align-content: stretch; }
.cp-fit > .cp-rq-item { align-items: center; overflow: hidden; }
.cp-rq-item > span:last-child { justify-items: stretch; }
.cp-rq-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-rq-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.cp-rq-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.cp-rq-head h3 { font-size: 17px; }
.cp-rq-head h3 a { text-decoration: none; }
.cp-rq-head p { font-size: 12px; }
.cp-rq-main > .cp-ws-body { flex: 1 1 0; }

/* 对标学习: references rail | the picked reference */
.cp-learn { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; }
.cp-learn-rail { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 12px; }
.cp-learn-rail-head { display: grid; gap: 8px; }
.cp-learn-rail-head .cp-search { min-width: 0; }
.cp-learn-rail > .cp-fit, .cp-learn-rail > .cp-desk-fill { flex: 1 1 0; }
.cp-fit.cp-ref-list { gap: 8px; }
.cp-ref-item { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; overflow: hidden; border: 1px solid var(--cp-line-soft, var(--line-soft));
  border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cp-ref-item:hover { border-color: var(--primary-line); }
.cp-ref-item.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.cp-ref-item .cp-media { height: 60px; }
.cp-ref-item-text { display: grid; gap: 2px; min-width: 0; }
.cp-ref-item-text b, .cp-ref-item-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-ref-item-text b { font-size: 13px; }
.cp-ref-item-text small { color: var(--muted); font-size: 11px; }
.cp-ref-item-text small.hook { color: var(--ink-2); }
.cp-learn-detail { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; }
.cp-learn-detail > * { flex: 0 0 auto; }
.cp-learn-detail > .cp-learn-panes, .cp-learn-detail > .cp-desk-empty { flex: 1 1 0; min-height: 0; }
.cp-learn-head { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; padding: 14px; }
.cp-learn-head .cp-media { height: 192px; }
.cp-learn-info { display: grid; gap: 8px; align-content: start; min-width: 0; }
.cp-learn-info h3 { font-size: 17px; }
.cp-learn-info .cp-quote { margin-top: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cp-learn-info .cp-used { margin-top: 0; }
.cp-learn-beats { padding: 12px 16px; }
.cp-learn-beats .cp-sh { margin-bottom: 8px; }
.cp-learn-beats .cp-timeline { height: 80px; }
.cp-learn-panes { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.cp-fit.cp-said-list { gap: 0; }
.cp-fit > .cp-said { align-items: center; padding: 0; }
.cp-fit > .cp-said > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 素材生成: a board of columns */
.cp-board-tabs { display: none; }
.cp-board { display: grid; grid-template-columns: repeat(var(--cp-board-cols), minmax(0, 1fr)); gap: 14px; }
.cp-board-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding: 12px; }
.cp-board-col > .cp-fit, .cp-board-col > .cp-desk-fill { flex: 1 1 0; }
.cp-board-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.cp-board-head h3 { font-size: 16px; }
.cp-board-head .cp-count { margin-left: 0; }
.cp-fit.cp-qlist { gap: 10px; }
.cp-qcard { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 10px 12px; overflow: hidden; border: 1px solid var(--cp-line-soft, var(--line-soft)); border-radius: var(--radius-md); background: var(--surface-2); }
.cp-qcard-top { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: center; }
.cp-qcard-top .cp-media { height: 50px; }
.cp-qcard-text { display: grid; gap: 2px; min-width: 0; }
.cp-qcard-text h4 { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.cp-qcard-text h4 a { text-decoration: none; }
.cp-qcard-text p { margin: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cp-qcard .cp-counts { margin-top: 0; gap: 10px; }
.cp-qcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.cp-qcard-cost { color: var(--muted); font-size: 12px; font-weight: var(--fw-semibold); white-space: nowrap; }
.cp-qcard-cost b { color: var(--ink); }

/* 视频产出: the remade films as one screen; the Google Drive statistics below it split into panes */
#view-production.cp-screen > .account-screen { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
#view-production.cp-screen .remake-production { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
#view-production[data-cp-pane] > .account-screen { display: flex; flex-direction: column; }
#view-production[data-cp-pane] .remake-production { order: -1; }
#view-production[data-cp-pane]:not(.cp-screen) .remake-production { margin-bottom: 14px; }
#view-production[data-cp-pane="films"] .account-toolbar, #view-production[data-cp-pane="films"] #production-dashboard { display: none; }
#view-production[data-cp-pane="overview"] .production-filter-panel,
#view-production[data-cp-pane="overview"] .production-insight-grid > :first-child,
#view-production[data-cp-pane="overview"] .production-file-panel,
#view-production[data-cp-pane="people"] .production-overview-card,
#view-production[data-cp-pane="people"] .matrix-status-strip,
#view-production[data-cp-pane="people"] .production-insight-grid > :nth-child(2),
#view-production[data-cp-pane="people"] .production-file-panel,
#view-production[data-cp-pane="files"] .production-overview-card,
#view-production[data-cp-pane="files"] .matrix-status-strip,
#view-production[data-cp-pane="files"] .production-insight-grid { display: none; }
#view-production[data-cp-pane="overview"] .production-insight-grid,
#view-production[data-cp-pane="people"] .production-insight-grid { grid-template-columns: minmax(0, 1fr); }
.cp-production .cp-toolbar { margin-bottom: 0; }

/* short windows: tighter chrome so the lists keep their room */
@media (max-height: 820px) {
  .cp-screen-root { gap: 10px; }
  .cp-screen-root .cp-kpi { padding: 10px 14px; }
  .cp-screen-root .cp-kpi strong { margin-top: 2px; font-size: 22px; }
  .cp-screen-root .cp-kpi em { display: none; }
  .cp-ws-head { padding: 8px 16px; }
  .cp-stage { padding: 6px 14px; }
  .cp-stage small { display: none; }
  .cp-learn-head .cp-media { height: 150px; }
  .cp-learn-beats .cp-timeline { height: 64px; }
  .cp-shot .pic { height: 34px; }
  .cp-shot .pic.tall { height: 46px; }
  .cp-film-strip .cp-sh p, .cp-ref-pane .cp-sh p { display: none; }
  .cp-film-side .cp-review-grid > .cp-pad { padding: 12px 16px; }
  .cp-film-side .cp-redo-box { gap: 8px; padding: 10px; }
  .cp-film-side .cp-redo-box textarea { min-height: 54px; }
}
/* phones: the counts become one compact row, the pager one line */
@media (max-width: 640px) {
  .cp-screen-root .cp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cp-screen-root .cp-kpi { padding: 8px; }
  .cp-screen-root .cp-kpi small { font-size: 11px; }
  .cp-screen-root .cp-kpi small svg { display: none; }
  .cp-screen-root .cp-kpi strong { margin-top: 2px; font-size: 17px; }
  .cp-screen-root .cp-kpi em { display: none; }
  .cp-screen-root .cp-toolbar .cp-search { flex: 1 1 100%; }
}

/* narrower screens: the sheet opens over the tiles; rails get narrower */
@media (max-width: 1280px) {
  .cp-film-desk { grid-template-columns: minmax(0, 1fr) 320px; }
  .cp-learn { grid-template-columns: 270px minmax(0, 1fr); }
  .cp-rq { grid-template-columns: 240px minmax(0, 1fr); }
  .cp-learn-head { grid-template-columns: 260px minmax(0, 1fr); }
  .cp-fit > .cp-shotrow { grid-template-columns: 80px 96px minmax(0, 1fr); }
  .cp-fit > .cp-shotrow .cp-refs { display: none; }
}
@media (max-width: 1100px) {
  .cp-desk, .cp-lib-split.with-sheet { grid-template-columns: minmax(0, 1fr); }
  .cp-desk .cp-lib-sheet, .cp-lib-side .cp-lib-sheet { position: fixed; z-index: 900; inset: 0 0 0 auto; width: min(420px, 100vw); height: auto; max-height: none; border-radius: 0; }
  .cp-desk-side:not(.open), .cp-lib-side:not(.open) { display: none; }
  .cp-plan-desk { grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.5fr); }
  .cp-board-tabs { display: block; }
  .cp-board { grid-template-columns: minmax(0, 1fr); }
  .cp-board-col:not(.on) { display: none; }
}
/* phones and narrow tablets: desks stack and their root scrolls; fitted lists keep a fixed share of the screen */
@media (max-width: 900px) {
  .cp-stack { overflow-y: auto; }
  .cp-stack .cp-ws-body, .cp-stack .cp-plan-desk, .cp-stack .cp-film-desk, .cp-stack .cp-learn, .cp-stack .cp-rq,
  .cp-stack .cp-plan-side, .cp-stack .cp-learn-detail, .cp-stack .cp-rq-main, .cp-stack .cp-film-main { display: flex; flex: none; flex-direction: column; gap: 12px; }
  .cp-stack .cp-ws-body > *, .cp-stack .cp-learn-detail > *, .cp-stack .cp-film-main > *, .cp-stack .cp-plan-desk > * { flex: none; }
  .cp-stack .cp-fit { flex: none; height: 62vh; }
  .cp-stack .cp-rq-rail .cp-fit, .cp-stack .cp-learn-rail .cp-fit { height: 34vh; }
  .cp-stack .cp-ref-player, .cp-stack .cp-film-main > .cp-compare { flex: none; height: 56vh; }
  .cp-stack .cp-plan-main, .cp-stack .cp-learn-panes, .cp-stack .cp-agent-card { flex: none; min-height: 60vh; }
  .cp-stack .cp-film-side-body, .cp-stack .cp-pane-scroll { overflow: visible; }
  .cp-stack .cp-desk { flex: none; }
  .cp-stack .cp-film-main > .cp-compare { grid-template-columns: 1fr 1fr; }
  .cp-stack .cp-desk-main { min-height: 70vh; }
  .cp-learn-head { grid-template-columns: minmax(0, 1fr); }
  .cp-screen-root .cp-kpi em { display: none; }
}

/* AI 工作室 (the studio agent): a side panel built from the agent's events - messages, its steps with the pictures it
   looked at, what it ran and what that cost, the jobs it watches and the buttons that are the person's to press */
.cp-studio { position: fixed; z-index: 900; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface-elevated); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); transition: width 0.2s; }
.cp-studio.wide { width: min(920px, 100vw); }
.cp-studio-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.cp-studio-title h3 { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.cp-studio-title h3 svg { width: 17px; height: 17px; color: var(--violet); }
.cp-studio-title small { display: block; margin-top: 2px; font-size: 12px; }
.cp-st-state.running { color: var(--primary); font-weight: var(--fw-semibold); }
.cp-studio-meter { grid-column: 1 / -1; display: grid; gap: 4px; }
.cp-studio-meter .cp-cost-row { font-size: 12px; }
.cp-studio-meter .cp-cost-track { height: 6px; }
.cp .cp-link { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: 12px; cursor: pointer; }
.cp .cp-link:hover { text-decoration: underline; }
.cp-studio-log { display: grid; grid-auto-rows: max-content; gap: 10px; align-content: start; padding: 14px 16px; overflow: auto; scrollbar-width: thin; }
.cp-st-user { display: grid; justify-items: end; gap: 2px; }
.cp-st-bubble { max-width: 88%; padding: 9px 12px; border-radius: var(--radius-lg); border-bottom-right-radius: 4px; background: var(--accent-fill); color: var(--on-accent-fill);
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.cp-st-user small, .cp-st-user time { color: var(--muted-2); font-size: 11px; }
.cp-st-ai { max-width: 96%; font-size: 13.5px; line-height: 1.65; word-break: break-word; }
.cp-st-ai p { margin: 0 0 8px; }
.cp-st-ai p:last-child { margin-bottom: 0; }
.cp-st-ai ul, .cp-st-ai ol { margin: 4px 0 8px; padding-left: 20px; }
.cp-st-intro { padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); }
.cp-st-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cp-st-examples .cp-chip { border: 1px solid var(--line); cursor: pointer; white-space: normal; text-align: left; }
.cp-st-examples .cp-chip:hover { border-color: var(--primary-line); color: var(--primary); }
.cp-st-steps { border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface-2); font-size: 12px; }
.cp-st-steps summary { display: flex; align-items: center; gap: 6px; padding: 7px 10px; color: var(--muted); cursor: pointer; list-style: none; }
.cp-st-steps summary::-webkit-details-marker { display: none; }
.cp-st-steps summary svg { width: 14px; height: 14px; }
.cp-st-steps summary span { color: var(--ink-2); font-weight: var(--fw-semibold); }
.cp-st-step-list { display: grid; gap: 4px; max-height: 320px; overflow: auto; padding: 0 10px 10px; }
.cp-st-think { padding: 4px 8px; border-left: 2px solid var(--violet); color: var(--muted); font-style: italic; white-space: pre-wrap; word-break: break-word; }
.cp-st-tool { display: grid; grid-template-columns: 16px auto minmax(0, 1fr); gap: 6px; align-items: baseline; color: var(--ink-2); }
.cp-st-tool svg { width: 13px; height: 13px; color: var(--teal); }
.cp-st-tool.bad svg { color: var(--rose); }
.cp-st-tool small { overflow: hidden; color: var(--muted-2); text-overflow: ellipsis; white-space: nowrap; }
.cp-st-tool em { grid-column: 2 / -1; color: var(--rose); font-style: normal; }
.cp-st-spin svg { animation: cp-spin 1.2s linear infinite; color: var(--primary); }
.cp-st-views { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.cp-st-view { display: grid; gap: 2px; flex: 0 0 auto; width: 96px; text-decoration: none; color: var(--muted); font-size: 11px; }
.cp-st-view img { width: 96px; height: 128px; object-fit: cover; border-radius: var(--radius-sm); background: var(--cp-media, var(--media)); border: 1px solid var(--line-soft); }
.cp-st-view small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-st-action, .cp-st-watch { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 9px 12px; border: 1px solid var(--primary-line);
  border-radius: var(--radius-md); background: var(--primary-soft); font-size: 13px; }
.cp-st-action svg, .cp-st-watch svg { width: 16px; height: 16px; margin-top: 2px; color: var(--primary); }
.cp-st-action .cp-row, .cp-st-watch small { font-size: 12px; color: var(--muted); }
.cp-st-action a, .cp-st-watch a, .cp-st-note a { color: var(--primary); text-decoration: none; }
.cp-st-watch { border-color: var(--amber-soft); background: color-mix(in srgb, var(--amber-soft) 60%, transparent); }
.cp-st-watch svg { color: var(--amber); }
.cp-st-watch small { display: block; }
.cp-st-watch.done { opacity: 0.7; }
.cp-st-note { display: flex; align-items: center; gap: 6px; justify-content: center; color: var(--muted); font-size: 12px; }
.cp-st-note svg { width: 14px; height: 14px; color: var(--amber); }
.cp-st-card { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--violet); border-radius: var(--radius-md); background: var(--violet-soft); font-size: 13px; }
.cp-st-card b { display: inline-flex; align-items: center; gap: 6px; }
.cp-st-card b svg { width: 15px; height: 15px; color: var(--violet); }
.cp-st-card p { margin: 0; color: var(--ink-2); }
.cp-st-card.done { border-color: var(--line-soft); background: var(--surface-3); }
.cp-st-problem { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--rose-line); border-radius: var(--radius-sm); background: var(--rose-soft); color: var(--rose); font-size: 12px; }
.cp-st-problem svg { flex: 0 0 auto; width: 15px; height: 15px; }
.cp-st-legacy { border: 1px solid var(--line-soft); border-radius: var(--radius-md); padding: 6px 10px; font-size: 12px; }
.cp-st-legacy summary { color: var(--muted); cursor: pointer; }
.cp-st-legacy .cp-msg { margin-top: 8px; }
.cp-studio-form { display: grid; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.cp-studio-form textarea { resize: none; min-height: 52px; }
.cp-studio-form > .cp-row { justify-content: space-between; }
.cp-studio-form .btn.off { opacity: 0.5; pointer-events: none; }
.cp-st-attachments { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-st-attach { position: relative; width: 52px; height: 52px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.cp-st-attach img { width: 100%; height: 100%; object-fit: cover; }
.cp-st-attach button { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--media) 70%, transparent); color: var(--on-accent); cursor: pointer; }
.cp-st-attach button svg { width: 11px; height: 11px; }
@media (max-width: 900px) { .cp-studio, .cp-studio.wide { width: 100vw; } }
