/* Component styles, v2. One class prefix per component (cm-<component>).
   Only tokens from tokens.css are used. Screens add no CSS.
   Principles (contract/DESIGN-PRINCIPLES.md): one primary action per screen,
   scoped navigation, fewer boxes, calm density (44px rows, 4px grid),
   context in a side panel, speed (palette, keys, undo), designed states,
   one icon set and color only for meaning. */

html, body { height: 100%; }
body { margin: 0; font-family: var(--cm-font-ui); font-size: var(--cm-text-md); line-height: var(--cm-leading); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--cm-surface); }
* { box-sizing: border-box; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cm-accent); outline-offset: 2px; border-radius: 4px; }
a { color: var(--cm-accent); text-underline-offset: 2px; }
.cm-num { font-variant-numeric: tabular-nums; }
.cm-muted { color: var(--cm-ink-2); }
.cm-faint { color: var(--cm-ink-3); font-size: var(--cm-text-sm); }
.cm-icon { width: 16px; height: 16px; flex: none; stroke-width: 1.75; }

/* ---- AppShell ---- */
.cm-shell { display: grid; grid-template-columns: var(--cm-rail-width) minmax(0, 1fr); min-height: 100%; }
.cm-rail { background: var(--cm-surface); border-right: 1px solid var(--cm-line); padding-block: var(--cm-s3);
  padding-left: max(var(--cm-s3), env(safe-area-inset-left, 0px)); padding-right: var(--cm-s3);
  display: flex; flex-direction: column; gap: var(--cm-s4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.cm-nav { display: flex; flex-direction: column; gap: var(--cm-s4); flex: 1; }
.cm-nav-group { display: flex; flex-direction: column; gap: 1px; }
.cm-nav-label { font-size: var(--cm-text-xs); color: var(--cm-ink-3); padding: 0 var(--cm-s2) var(--cm-s1); }
.cm-nav-item { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cm-ink-2);
  height: 32px; padding: 0 var(--cm-s2); border-radius: var(--cm-radius-sm); font-size: var(--cm-text-md); white-space: nowrap; }
.cm-nav-item > span:first-of-type { flex: 1; }
.cm-nav-item:hover { background: var(--cm-surface-2); color: var(--cm-ink); }
.cm-nav-item[aria-current="page"] { background: var(--cm-surface-2); color: var(--cm-ink); font-weight: 600; }
.cm-nav-item[aria-current="page"] .cm-icon { color: var(--cm-accent); }
.cm-nav-count { font-size: var(--cm-text-xs); color: var(--cm-ink-3); font-variant-numeric: tabular-nums; }
.cm-rail-foot { border-top: 1px solid var(--cm-line); padding-top: var(--cm-s3); display: flex; flex-direction: column; gap: 1px; }
.cm-main { min-width: 0; display: flex; flex-direction: column; }
.cm-content { padding-block: var(--cm-s5) var(--cm-s7); padding-left: max(var(--cm-s6), env(safe-area-inset-left, 0px));
  padding-right: max(var(--cm-s6), env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: var(--cm-s6); max-width: 1200px; width: 100%; }

/* ---- WorkspaceSwitcher ---- */
.cm-ws { position: relative; }
.cm-ws-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px var(--cm-s2); border: 1px solid transparent; border-radius: var(--cm-radius-sm);
  background: transparent; cursor: pointer; text-align: left; }
.cm-ws-button:hover, .cm-ws-button[aria-expanded="true"] { background: var(--cm-surface-2); }
.cm-ws-mark { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: var(--cm-text-xs); font-weight: 700;
  background: var(--cm-accent); color: var(--cm-on-accent); flex: none; }
.cm-ws-mark.is-level { background: var(--cm-ink); }
.cm-ws-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.cm-ws-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-ws-level { font-size: var(--cm-text-xs); color: var(--cm-ink-3); }
.cm-ws-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: var(--cm-surface); border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius-md); box-shadow: 0 12px 32px rgba(23, 32, 28, 0.14); padding: 4px; display: flex; flex-direction: column; gap: 1px; }
.cm-ws-menu-label { font-size: var(--cm-text-xs); color: var(--cm-ink-3); padding: 6px var(--cm-s2) 2px; }
.cm-ws-option { display: flex; align-items: center; gap: 10px; padding: 6px var(--cm-s2); border: 0; background: transparent; border-radius: var(--cm-radius-sm); cursor: pointer; text-align: left; font-size: var(--cm-text-sm); }
.cm-ws-option:hover { background: var(--cm-surface-2); }
.cm-ws-option .cm-ws-mark { width: 22px; height: 22px; border-radius: 5px; font-size: 10px; }
.cm-ws-option[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--cm-accent); }

/* ---- TopBar ---- */
.cm-topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--cm-s3); flex-wrap: wrap; min-height: 52px;
  padding-block: var(--cm-s2); padding-left: max(var(--cm-s6), env(safe-area-inset-left, 0px)); padding-right: max(var(--cm-s6), env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--cm-line); background: color-mix(in srgb, var(--cm-surface) 92%, transparent); backdrop-filter: blur(8px);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.cm-topbar-right { display: flex; align-items: center; gap: var(--cm-s3); flex-wrap: wrap; }
.cm-crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--cm-text-sm); color: var(--cm-ink-3); min-width: 0; }
.cm-crumbs strong { color: var(--cm-ink); font-weight: 600; }
.cm-search { display: flex; align-items: center; gap: var(--cm-s2); min-width: 240px; height: 32px; padding: 0 6px 0 10px; border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius-sm); background: var(--cm-paper); color: var(--cm-ink-3); font-size: var(--cm-text-sm); cursor: pointer; }
.cm-search:hover { border-color: var(--cm-line-strong); color: var(--cm-ink-2); }
.cm-search > span { flex: 1; text-align: left; }
.cm-select { appearance: none; border: 1px solid var(--cm-line); background: var(--cm-surface); border-radius: var(--cm-radius-sm); height: 32px;
  padding: 0 28px 0 10px; font-size: var(--cm-text-sm);
  background-image: linear-gradient(45deg, transparent 50%, var(--cm-ink-3) 50%), linear-gradient(135deg, var(--cm-ink-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.cm-role { display: flex; align-items: center; gap: var(--cm-s2); font-size: var(--cm-text-sm); color: var(--cm-ink-3); }
.cm-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--cm-surface-2); color: var(--cm-ink-2); flex: none; box-shadow: inset 0 0 0 1px var(--cm-line); }
.cm-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 4px; font-size: 11px;
  font-family: var(--cm-font-ui); color: var(--cm-ink-2); background: var(--cm-surface); box-shadow: inset 0 0 0 1px var(--cm-line), 0 1px 0 var(--cm-line); }

/* ---- FocusBanner ---- */
.cm-focus { display: flex; gap: var(--cm-s4); align-items: center; justify-content: space-between; flex-wrap: wrap;
  border: 1px solid var(--cm-line); background: var(--cm-surface); border-radius: var(--cm-radius-md); padding: var(--cm-s3) var(--cm-s4); }
.cm-focus-main { display: flex; gap: var(--cm-s3); align-items: baseline; min-width: 0; flex: 1 1 420px; }
.cm-focus-label { font-size: var(--cm-text-xs); color: var(--cm-accent); font-weight: 600; white-space: nowrap; }
.cm-focus-text { color: var(--cm-ink); max-width: 80ch; }
.cm-focus-meta { display: flex; gap: var(--cm-s2); align-items: center; flex-wrap: wrap; }

/* ---- PageHeader ---- */
.cm-page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--cm-s4); flex-wrap: wrap; }
.cm-page-title { font-family: var(--cm-font-display); font-size: var(--cm-text-2xl); font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; }
.cm-page-sub { color: var(--cm-ink-2); max-width: 68ch; margin-top: 6px; }
.cm-actions { display: flex; gap: var(--cm-s2); flex-wrap: wrap; align-items: center; }

/* ---- Section (plain) and Panel (bordered object) ---- */
.cm-section { display: flex; flex-direction: column; gap: var(--cm-s3); min-width: 0; }
.cm-section-head { display: flex; justify-content: space-between; align-items: center; gap: var(--cm-s3); flex-wrap: wrap; min-height: 32px; }
.cm-section-title { font-size: var(--cm-text-lg); font-weight: 600; }
.cm-panel { background: var(--cm-surface); border: 1px solid var(--cm-line); border-radius: var(--cm-radius-md); min-width: 0; overflow: hidden; }
.cm-panel-body { padding: var(--cm-s4); display: flex; flex-direction: column; gap: var(--cm-s3); min-width: 0; }
.cm-panel-body.flush { padding: 0; gap: 0; }
.cm-grid { display: grid; gap: var(--cm-s6); }
.cm-grid-tight { gap: var(--cm-s4); }
.cm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cm-grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cm-stack { display: flex; flex-direction: column; gap: var(--cm-s3); min-width: 0; }
.cm-row { display: flex; gap: var(--cm-s2); align-items: center; flex-wrap: wrap; }
.cm-between { display: flex; justify-content: space-between; gap: var(--cm-s3); align-items: center; flex-wrap: wrap; }

/* ---- Button ---- */
.cm-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; border: 1px solid var(--cm-line-strong); background: var(--cm-surface); color: var(--cm-ink);
  border-radius: var(--cm-radius-sm); padding: 0 12px; font-size: var(--cm-text-sm); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s; }
.cm-btn:hover { background: var(--cm-surface-2); }
.cm-btn-primary { background: var(--cm-accent); border-color: var(--cm-accent); color: var(--cm-on-accent); }
.cm-btn-primary:hover { background: var(--cm-accent-hover); }
.cm-btn-quiet { border-color: transparent; background: transparent; color: var(--cm-ink-2); }
.cm-btn-quiet:hover { background: var(--cm-surface-2); color: var(--cm-ink); }
.cm-btn-danger { color: var(--cm-blocked); }
.cm-btn-sm { height: 26px; padding: 0 8px; font-size: var(--cm-text-xs); }
.cm-btn[disabled] { opacity: 0.45; cursor: default; }

/* ---- Segmented ---- */
.cm-seg { display: inline-flex; background: var(--cm-surface-2); border-radius: var(--cm-radius-sm); padding: 2px; gap: 2px; flex-wrap: wrap; }
.cm-seg button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 5px; font-size: var(--cm-text-sm); color: var(--cm-ink-2); cursor: pointer; }
.cm-seg button:hover { color: var(--cm-ink); }
.cm-seg button[aria-pressed="true"] { background: var(--cm-surface); color: var(--cm-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 32, 28, 0.08), 0 0 0 1px var(--cm-line); }

/* ---- Pills, chips, tags ---- */
.cm-pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--cm-text-xs); font-weight: 500; padding: 1px 8px; height: 22px; border-radius: 999px; white-space: nowrap; }
.cm-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cm-pill-ready { background: var(--cm-ready-soft); color: var(--cm-ready); }
.cm-pill-progress { background: var(--cm-progress-soft); color: var(--cm-progress); }
.cm-pill-blocked { background: var(--cm-blocked-soft); color: var(--cm-blocked); }
.cm-pill-posted { background: var(--cm-posted-soft); color: var(--cm-posted); }
.cm-pill-planned { background: transparent; color: var(--cm-ink-3); box-shadow: inset 0 0 0 1px var(--cm-line-strong); }
.cm-job { display: inline-flex; align-items: center; height: 20px; font-size: var(--cm-text-xs); font-weight: 600; padding: 0 7px; border-radius: 5px; white-space: nowrap; }
.cm-job-grow { background: var(--cm-grow-soft); color: var(--cm-grow); }
.cm-job-nurture { background: var(--cm-nurture-soft); color: var(--cm-nurture); }
.cm-job-convert { background: var(--cm-convert-soft); color: var(--cm-convert); }
.cm-tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; font-size: var(--cm-text-xs); color: var(--cm-ink-2); background: var(--cm-surface-2); border-radius: 5px; padding: 0 7px; white-space: nowrap; }
.cm-tag .cm-icon { width: 12px; height: 12px; }

/* ---- StatStrip ---- */
.cm-statstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--cm-line); border-radius: var(--cm-radius-md); background: var(--cm-surface); overflow: hidden; }
.cm-statstrip-item { padding: var(--cm-s3) var(--cm-s4); border-left: 1px solid var(--cm-line); display: flex; flex-direction: column; gap: 2px; }
.cm-statstrip-item:first-child { border-left: 0; }
.cm-stat-label { font-size: var(--cm-text-xs); color: var(--cm-ink-3); }
.cm-stat-value { font-family: var(--cm-font-display); font-size: var(--cm-text-xl); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.cm-stat-note { font-size: var(--cm-text-xs); color: var(--cm-ink-2); }
.cm-stat-note.is-bad { color: var(--cm-blocked); }

/* ---- MixBar ---- */
.cm-mix { display: flex; flex-direction: column; gap: 6px; }
.cm-mix-head { display: flex; justify-content: space-between; gap: var(--cm-s2); font-size: var(--cm-text-sm); flex-wrap: wrap; }
.cm-mix-track { position: relative; display: flex; height: 10px; border-radius: 3px; background: var(--cm-surface-2); }
.cm-mix-seg { height: 100%; }
.cm-mix-seg:first-child { border-radius: 3px 0 0 3px; }
.cm-mix-seg:last-child { border-radius: 0 3px 3px 0; }
.cm-mix-seg + .cm-mix-seg { box-shadow: -1px 0 0 var(--cm-surface); }
.cm-mix-grow { background: var(--cm-grow); } .cm-mix-nurture { background: var(--cm-nurture); } .cm-mix-convert { background: var(--cm-convert); }
.cm-mix-floor { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--cm-ink); border-radius: 1px; }
.cm-mix-legend { display: flex; gap: var(--cm-s3); flex-wrap: wrap; font-size: var(--cm-text-xs); color: var(--cm-ink-3); }
.cm-mix-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* ---- BrickCard ---- */
.cm-bricks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--cm-line); border: 1px solid var(--cm-line); border-radius: var(--cm-radius-md); overflow: hidden; }
.cm-brick { padding: var(--cm-s3); background: var(--cm-surface); min-width: 0; display: flex; flex-direction: column; gap: 4px; position: relative; }
.cm-brick-idea { background: color-mix(in srgb, var(--cm-accent-soft) 55%, var(--cm-surface)); }
.cm-brick-name { font-size: var(--cm-text-xs); color: var(--cm-ink-3); display: flex; justify-content: space-between; gap: var(--cm-s1); align-items: center; min-height: 20px; }
.cm-brick-value { font-size: var(--cm-text-sm); overflow-wrap: anywhere; }
.cm-brick-flag { color: var(--cm-blocked); font-weight: 600; font-size: var(--cm-text-xs); }
.cm-brick.is-flagged { box-shadow: inset 0 0 0 2px var(--cm-blocked); }
.cm-bricks-caption { display: flex; justify-content: space-between; gap: var(--cm-s3); flex-wrap: wrap; font-size: var(--cm-text-xs); color: var(--cm-ink-3); margin-top: var(--cm-s2); }
@media (hover: hover) { .cm-brick .cm-reveal { opacity: 0; transition: opacity .12s; } .cm-brick:hover .cm-reveal, .cm-brick:focus-within .cm-reveal { opacity: 1; } }

/* ---- PipelineSteps ---- */
.cm-steps { display: flex; gap: 0; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; row-gap: 6px; }
.cm-step { display: flex; align-items: center; gap: 6px; font-size: var(--cm-text-xs); color: var(--cm-ink-3); padding-right: 10px; }
.cm-step + .cm-step::before { content: ""; width: 14px; height: 1px; background: var(--cm-line-strong); margin-right: 4px; }
.cm-step-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--cm-line-strong); flex: none; }
.cm-step-gate .cm-step-dot { border-radius: 2px; transform: rotate(45deg); }
.cm-step-done { color: var(--cm-ink-2); } .cm-step-done .cm-step-dot { background: var(--cm-ready); box-shadow: none; }
.cm-step-current { color: var(--cm-ink); font-weight: 600; } .cm-step-current .cm-step-dot { background: var(--cm-accent); box-shadow: 0 0 0 3px var(--cm-accent-soft); }
.cm-step-blocked { color: var(--cm-blocked); font-weight: 600; } .cm-step-blocked .cm-step-dot { background: var(--cm-blocked); box-shadow: 0 0 0 3px var(--cm-blocked-soft); }

/* ---- Table ---- */
.cm-table-wrap { overflow-x: auto; }
.cm-table { width: 100%; border-collapse: collapse; font-size: var(--cm-text-sm); }
.cm-table th { text-align: left; font-weight: 500; color: var(--cm-ink-3); font-size: var(--cm-text-xs); height: 36px; padding: 0 var(--cm-s4); border-bottom: 1px solid var(--cm-line); white-space: nowrap; }
.cm-table td { height: 44px; padding: 6px var(--cm-s4); border-bottom: 1px solid var(--cm-line); vertical-align: middle; }
.cm-table tr:last-child td { border-bottom: 0; }
.cm-table tr.cm-clickable { cursor: pointer; }
.cm-table tr.cm-clickable:hover td { background: var(--cm-paper); }
.cm-table tr.is-selected td { background: var(--cm-accent-soft); }
.cm-table .cm-num, .cm-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cm-cell-title { font-weight: 500; color: var(--cm-ink); }
.cm-cell-sub { font-size: var(--cm-text-xs); color: var(--cm-ink-3); }
@media (hover: hover) { .cm-table .cm-reveal { opacity: 0; transition: opacity .12s; } .cm-table tr:hover .cm-reveal, .cm-table tr:focus-within .cm-reveal { opacity: 1; } }

/* ---- List rows ---- */
.cm-list { display: flex; flex-direction: column; }
.cm-list-row { display: flex; gap: var(--cm-s3); align-items: center; justify-content: space-between; min-height: 44px; padding: 10px var(--cm-s4);
  border-bottom: 1px solid var(--cm-line); transition: background .12s, opacity .3s, transform .3s; }
.cm-list-row:last-child { border-bottom: 0; }
.cm-list-row.cm-clickable { cursor: pointer; }
.cm-list-row.cm-clickable:hover, .cm-list-row.is-selected { background: var(--cm-paper); }
.cm-list-row.is-selected { box-shadow: inset 2px 0 0 var(--cm-accent); }
.cm-list-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.cm-list-lead { display: flex; gap: var(--cm-s3); align-items: flex-start; min-width: 0; flex: 1; }
.cm-list-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--cm-surface-2); color: var(--cm-ink-2); flex: none; }
.cm-list-side { display: flex; gap: var(--cm-s2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cm-list-row.is-done { opacity: 0.55; }
.cm-list-row.is-done .cm-cell-title { text-decoration: line-through; color: var(--cm-ink-3); }
.cm-list-row.is-leaving { opacity: 0; transform: translateX(8px); }
@media (hover: hover) { .cm-list-row .cm-reveal { opacity: 0; transition: opacity .12s; } .cm-list-row:hover .cm-reveal, .cm-list-row:focus-within .cm-reveal, .cm-list-row.is-selected .cm-reveal { opacity: 1; } }
.cm-due-late { color: var(--cm-blocked); font-weight: 500; }

/* ---- KeyValue, fields, toggle ---- */
.cm-kv { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); gap: 10px var(--cm-s4); font-size: var(--cm-text-sm); margin: 0; }
.cm-kv dt { color: var(--cm-ink-3); } .cm-kv dd { margin: 0; }
.cm-field { display: flex; flex-direction: column; gap: 6px; font-size: var(--cm-text-sm); color: var(--cm-ink-2); }
.cm-input { height: 34px; border: 1px solid var(--cm-line-strong); border-radius: var(--cm-radius-sm); padding: 0 10px; background: var(--cm-surface); width: 100%; color: var(--cm-ink); }
.cm-toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--cm-s3); min-height: 44px; padding: 0 var(--cm-s4); border-bottom: 1px solid var(--cm-line); font-size: var(--cm-text-sm); }
.cm-toggle:last-child { border-bottom: 0; }
.cm-switch { width: 32px; height: 18px; border-radius: 999px; border: 0; background: var(--cm-line-strong); position: relative; cursor: pointer; flex: none; }
.cm-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--cm-surface); transition: transform .15s; box-shadow: 0 1px 2px rgba(23,32,28,.2); }
.cm-switch[aria-checked="true"] { background: var(--cm-accent); }
.cm-switch[aria-checked="true"]::after { transform: translateX(14px); }

/* ---- Meter ---- */
.cm-meter { height: 6px; background: var(--cm-surface-2); border-radius: 3px; overflow: hidden; min-width: 60px; }
.cm-meter > span { display: block; height: 100%; background: var(--cm-accent); border-radius: 3px; }
.cm-meter.is-high > span { background: var(--cm-blocked); }

/* ---- Notice, EmptyState, Skeleton ---- */
.cm-notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px var(--cm-s4); border-radius: var(--cm-radius-md); font-size: var(--cm-text-sm); }
.cm-notice .cm-icon { margin-top: 2px; }
.cm-notice-warn { background: var(--cm-blocked-soft); color: var(--cm-ink); } .cm-notice-warn .cm-icon { color: var(--cm-blocked); }
.cm-notice-info { background: var(--cm-surface-2); color: var(--cm-ink-2); }
.cm-empty { padding: var(--cm-s6) var(--cm-s4); display: flex; flex-direction: column; align-items: center; gap: var(--cm-s2); text-align: center; color: var(--cm-ink-2); font-size: var(--cm-text-sm); }
.cm-empty-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--cm-surface-2); color: var(--cm-ink-3); }
.cm-empty-title { color: var(--cm-ink); font-weight: 600; font-size: var(--cm-text-md); }
.cm-skel { display: block; border-radius: 4px; background: linear-gradient(90deg, var(--cm-surface-2), var(--cm-paper), var(--cm-surface-2)); background-size: 200% 100%; animation: cm-shimmer 1.4s linear infinite; }
@keyframes cm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- Toast ---- */
.cm-toast { position: fixed; bottom: calc(var(--cm-s5) + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: var(--cm-s3);
  background: var(--cm-ink); color: var(--cm-surface); padding: 8px 8px 8px 14px; border-radius: var(--cm-radius-md); font-size: var(--cm-text-sm); z-index: 60;
  box-shadow: 0 10px 30px rgba(23,32,28,.24); animation: cm-rise .18s ease-out; max-width: calc(100vw - 32px); }
.cm-toast .cm-icon { color: var(--cm-accent-soft); }
.cm-toast button { border: 0; background: rgba(255,255,255,.12); color: var(--cm-surface); height: 26px; padding: 0 10px; border-radius: 5px; cursor: pointer; font-size: var(--cm-text-xs); font-weight: 600; }
@keyframes cm-rise { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---- FeedbackSheet ---- */
.cm-sheet { border-top: 1px solid var(--cm-line); background: var(--cm-paper); padding: var(--cm-s3) var(--cm-s4) var(--cm-s4); display: flex; flex-direction: column; gap: var(--cm-s3); }

/* ---- LayerStack ---- */
.cm-layers { display: flex; flex-direction: column; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-md); overflow: hidden; background: var(--cm-surface); }
.cm-layer { display: grid; grid-template-columns: 24px 170px minmax(0, 1fr) auto; gap: var(--cm-s3); align-items: center; min-height: 52px; padding: 8px var(--cm-s4); border-bottom: 1px solid var(--cm-line); font-size: var(--cm-text-sm); }
.cm-layer:last-child { border-bottom: 0; }
.cm-editor-side .cm-layer { grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; }
.cm-editor-side .cm-layer > .cm-muted { grid-column: 2 / 4; grid-row: 2; }
.cm-editor-side .cm-layer > .cm-faint { grid-column: 3; grid-row: 1; }
.cm-layer-index { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: var(--cm-ink-3); box-shadow: inset 0 0 0 1px var(--cm-line-strong); }
.cm-layer-brand { background: color-mix(in srgb, var(--cm-accent-soft) 55%, var(--cm-surface)); }
.cm-layer-brand .cm-layer-index { background: var(--cm-accent); color: var(--cm-on-accent); box-shadow: none; }
.cm-layer-name { color: var(--cm-ink-3); font-size: var(--cm-text-xs); display: block; }

/* ---- MonthCalendar ---- */
.cm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cm-cal-dow { font-size: var(--cm-text-xs); color: var(--cm-ink-3); padding: 8px var(--cm-s3); border-bottom: 1px solid var(--cm-line); }
.cm-cal-week { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--cm-s3); flex-wrap: wrap; align-items: center;
  padding: 8px var(--cm-s3); border-bottom: 1px solid var(--cm-line); background: var(--cm-paper); cursor: pointer; font-size: var(--cm-text-sm); }
.cm-cal-week:hover { background: var(--cm-surface-2); }
.cm-cal-week.is-current { background: var(--cm-accent-soft); }
.cm-cal-day { min-height: 84px; padding: 6px var(--cm-s2); border-bottom: 1px solid var(--cm-line); border-left: 1px solid var(--cm-line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cm-cal-day:nth-child(7n+1) { border-left: 0; }
.cm-cal-date { font-size: var(--cm-text-xs); color: var(--cm-ink-3); font-variant-numeric: tabular-nums; }
.cm-cal-day.is-out .cm-cal-date { opacity: 0.4; }
.cm-cal-chip { font-size: 11px; line-height: 1.35; border-radius: 4px; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-cal-event { font-size: 11px; font-weight: 600; color: var(--cm-accent); }
.cm-cal-count { font-size: 11px; color: var(--cm-ink-3); }

/* ---- SidePanel ---- */
.cm-scrim { position: fixed; inset: 0; background: rgba(23, 32, 28, 0.18); z-index: 40; animation: cm-fade .15s ease-out; }
.cm-side { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--cm-surface); border-left: 1px solid var(--cm-line);
  box-shadow: -16px 0 40px rgba(23, 32, 28, 0.12); z-index: 41; display: flex; flex-direction: column; animation: cm-slide .2s ease-out;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px); }
.cm-side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--cm-s2); padding: 10px var(--cm-s4); border-bottom: 1px solid var(--cm-line); }
.cm-side-body { padding: var(--cm-s5) var(--cm-s5) var(--cm-s6); overflow-y: auto; display: flex; flex-direction: column; gap: var(--cm-s5); }
.cm-side-foot { margin-top: auto; padding: var(--cm-s3) var(--cm-s4); border-top: 1px solid var(--cm-line); display: flex; gap: var(--cm-s2); justify-content: flex-end; flex-wrap: wrap; }
.cm-side .cm-bricks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@keyframes cm-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cm-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- CommandPalette ---- */
.cm-palette-wrap { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(23, 32, 28, 0.24); animation: cm-fade .12s ease-out; }
.cm-palette { width: min(600px, 100%); background: var(--cm-surface); border-radius: 12px; box-shadow: 0 24px 60px rgba(23, 32, 28, 0.28), 0 0 0 1px var(--cm-line); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.cm-palette-input { display: flex; align-items: center; gap: 10px; padding: 0 var(--cm-s4); border-bottom: 1px solid var(--cm-line); color: var(--cm-ink-3); }
.cm-palette-input input { flex: 1; height: 52px; border: 0; outline: 0; font-size: var(--cm-text-lg); background: transparent; color: var(--cm-ink); }
.cm-palette-list { overflow-y: auto; padding: 6px; }
.cm-palette-group { font-size: var(--cm-text-xs); color: var(--cm-ink-3); padding: 8px 10px 4px; }
.cm-palette-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: var(--cm-radius-sm); background: transparent; cursor: pointer; text-align: left; font-size: var(--cm-text-sm); color: var(--cm-ink); }
.cm-palette-item .cm-icon { color: var(--cm-ink-3); }
.cm-palette-item > span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-palette-item[aria-selected="true"] { background: var(--cm-surface-2); }
.cm-palette-foot { display: flex; gap: var(--cm-s4); padding: 8px var(--cm-s4); border-top: 1px solid var(--cm-line); font-size: var(--cm-text-xs); color: var(--cm-ink-3); flex-wrap: wrap; }
.cm-palette-foot span { display: inline-flex; gap: 4px; align-items: center; }
.cm-hints { display: flex; gap: var(--cm-s4); flex-wrap: wrap; font-size: var(--cm-text-xs); color: var(--cm-ink-3); }
.cm-hints span { display: inline-flex; gap: 4px; align-items: center; }


/* ---- Editor components ---- */
.cm-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--cm-s6); align-items: start; }
.cm-editor.is-side-first { grid-template-columns: 220px minmax(0, 1fr); }
.cm-editor.is-side-first .cm-editor-side { order: -1; }
.cm-editor-main { min-width: 0; display: flex; flex-direction: column; gap: var(--cm-s5); }
.cm-editor-side { position: sticky; top: calc(68px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: var(--cm-s5); min-width: 0; }
.cm-subnav { display: flex; flex-direction: column; gap: 1px; }
.cm-subnav-item { display: flex; align-items: center; justify-content: space-between; gap: var(--cm-s2); height: 34px; padding: 0 10px; border: 0; background: transparent;
  border-radius: var(--cm-radius-sm); cursor: pointer; text-align: left; font-size: var(--cm-text-md); color: var(--cm-ink-2); }
.cm-subnav-item:hover { background: var(--cm-surface-2); color: var(--cm-ink); }
.cm-subnav-item[aria-current="true"] { background: var(--cm-surface); color: var(--cm-ink); font-weight: 600; box-shadow: 0 0 0 1px var(--cm-line); }
.cm-subnav-warn { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--cm-blocked-soft); color: var(--cm-blocked); }
.cm-field-label { color: var(--cm-ink); font-weight: 500; }
.cm-textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: var(--cm-leading); }
.cm-input.is-empty { border-color: var(--cm-blocked); background: color-mix(in srgb, var(--cm-blocked-soft) 40%, var(--cm-surface)); }
.cm-input[readonly] { background: var(--cm-paper); color: var(--cm-ink-2); }
.cm-field .cm-select { width: 100%; height: 34px; border-color: var(--cm-line-strong); color: var(--cm-ink); }
.cm-select.is-empty { border-color: var(--cm-blocked); }
.cm-field-error { color: var(--cm-blocked); font-size: var(--cm-text-xs); }
.cm-check { display: inline-flex; align-items: center; gap: var(--cm-s2); cursor: pointer; font-size: var(--cm-text-sm); }
.cm-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cm-check-box { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--cm-line-strong); background: var(--cm-surface); color: transparent; flex: none; }
.cm-check input:checked + .cm-check-box { background: var(--cm-accent); box-shadow: none; color: var(--cm-on-accent); }
.cm-check input:focus-visible + .cm-check-box { outline: 2px solid var(--cm-accent); outline-offset: 2px; }
.cm-check-box .cm-icon { width: 12px; height: 12px; stroke-width: 3; }
.cm-qa { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: var(--cm-text-sm); }
.cm-qa li { display: flex; gap: 10px; align-items: flex-start; }
.cm-qa li > div { display: flex; flex-direction: column; gap: 2px; }
.cm-qa .is-ok .cm-icon { color: var(--cm-ready); margin-top: 2px; }
.cm-qa .is-fail .cm-icon { color: var(--cm-blocked); margin-top: 2px; }
.cm-qa .is-fail > div > span:first-child { font-weight: 600; }

/* VideoFrame: a schematic still of the edit (host, panel, caption). */
.cm-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: var(--cm-radius-md); overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cm-ink) 88%, var(--cm-accent)), var(--cm-ink)); }
.cm-frame.is-vertical { aspect-ratio: 9 / 16; width: 100%; max-width: 280px; margin-inline: auto; }
.cm-frame.is-vertical .cm-frame-sub { font-size: 15px; bottom: 12%; }
.cm-frame-host { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; transition: all .3s ease-out; }
.cm-frame-host.is-glide { inset: 18% 8% 10% 56%; border-radius: 12px; background: color-mix(in srgb, var(--cm-ink) 70%, var(--cm-accent)); box-shadow: 0 8px 24px rgba(0,0,0,.35); overflow: hidden; }
.cm-frame-host.is-glide.is-left { inset: 18% 56% 10% 8%; }
.cm-frame-head { width: 15%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--cm-surface) 30%, transparent); margin-bottom: 2%; }
.cm-frame-host.is-glide .cm-frame-head { width: 32%; }
.cm-frame-body { width: 34%; height: 34%; border-radius: 40% 40% 0 0; background: color-mix(in srgb, var(--cm-surface) 22%, transparent); }
.cm-frame-host.is-glide .cm-frame-body { width: 70%; }
.cm-frame-panel { position: absolute; inset: 18% 48% 10% 6%; display: flex; flex-direction: column; justify-content: center; gap: 8px; color: var(--cm-surface); }
.cm-frame-panel.is-left { inset: 18% 6% 10% 48%; }
.cm-frame-device { font-size: var(--cm-text-xs); color: color-mix(in srgb, var(--cm-surface) 60%, transparent); }
.cm-frame-caption { font-family: var(--cm-font-display); font-size: clamp(14px, 2.2vw, 24px); font-weight: 600; line-height: 1.2; text-wrap: balance; }
.cm-frame-caption mark { background: transparent; color: var(--cm-accent-soft); text-shadow: 0 0 18px color-mix(in srgb, var(--cm-accent-soft) 70%, transparent); }
.cm-frame-sub { position: absolute; left: 10%; right: 10%; bottom: 8%; text-align: center; color: var(--cm-surface); font-weight: 600; font-size: clamp(12px, 1.6vw, 18px); text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.cm-frame-time { position: absolute; top: 10px; left: 12px; font-size: 11px; color: color-mix(in srgb, var(--cm-surface) 70%, transparent); font-variant-numeric: tabular-nums; }

/* Timeline */
.cm-timeline { display: flex; flex-direction: column; gap: 6px; }
.cm-timeline-track { position: relative; height: 36px; border-radius: var(--cm-radius-sm); background: repeating-linear-gradient(90deg, var(--cm-surface-2) 0 3px, var(--cm-paper) 3px 6px); box-shadow: inset 0 0 0 1px var(--cm-line); }
.cm-timeline-seg { position: absolute; top: 4px; bottom: 4px; border: 0; border-radius: 4px; background: var(--cm-line-strong); cursor: pointer; padding: 0; }
.cm-timeline-seg.is-on { background: var(--cm-accent); }
.cm-timeline-seg:hover { filter: brightness(0.92); }
.cm-timeline-ticks { position: relative; height: 16px; font-size: 11px; color: var(--cm-ink-3); font-variant-numeric: tabular-nums; }
.cm-timeline-ticks span { position: absolute; transform: translateX(-50%); }
.cm-timeline-ticks span:first-child { transform: none; }
.cm-timeline-ticks span:last-child { transform: translateX(-100%); }

/* SlideStrip */
.cm-slides { display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: var(--cm-s3); overflow-x: auto; padding: 2px 2px var(--cm-s2); }
.cm-slide { position: relative; aspect-ratio: 4 / 5; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-sm); background: var(--cm-surface);
  padding: 22px 12px 26px; display: flex; align-items: center; text-align: left; cursor: pointer; font-family: var(--cm-font-display); font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--cm-ink); }
.cm-slide:first-child { background: var(--cm-accent); color: var(--cm-on-accent); border-color: var(--cm-accent); font-size: 15px; }
.cm-slide[aria-selected="true"] { box-shadow: 0 0 0 2px var(--cm-surface), 0 0 0 4px var(--cm-accent); }
.cm-slide-n { position: absolute; top: 8px; left: 10px; font-family: var(--cm-font-ui); font-size: 11px; font-weight: 500; opacity: .6; }
.cm-slide-role { position: absolute; bottom: 8px; left: 10px; right: 10px; font-family: var(--cm-font-ui); font-size: 10px; font-weight: 500; opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-slide-text { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Brand kit page ---- */
/* Playbooks */
.cm-structure { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--cm-s2); counter-reset: none; }
.cm-structure-step { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-md); background: var(--cm-surface); font-size: var(--cm-text-sm); min-width: 0; }
.cm-structure-step.is-optional { border-style: dashed; background: transparent; }
.cm-structure-step strong { font-weight: 600; }
.cm-structure-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: var(--cm-ink-3); box-shadow: inset 0 0 0 1px var(--cm-line-strong); }
.cm-structure-step:first-child .cm-structure-n { background: var(--cm-accent); color: var(--cm-on-accent); box-shadow: none; }
.cm-structure-beats { margin-top: auto; padding-top: 4px; font-size: var(--cm-text-xs); color: var(--cm-ink-3); font-variant-numeric: tabular-nums; }
.cm-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-md); background: var(--cm-surface); overflow: hidden; }
.cm-rule { display: flex; justify-content: space-between; gap: var(--cm-s4); padding: 10px var(--cm-s4); border-bottom: 1px solid var(--cm-line); font-size: var(--cm-text-sm); line-height: 1.45; }
.cm-rule:last-child { border-bottom: 0; }
.cm-rule.is-brand { background: color-mix(in srgb, var(--cm-accent-soft) 45%, var(--cm-surface)); }
.cm-rule-from { flex: none; font-size: var(--cm-text-xs); color: var(--cm-ink-3); padding-top: 2px; }

/* Brand Brain */
.cm-part-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--cm-radius-sm); background: var(--cm-paper); color: var(--cm-ink-2); }
.cm-offer-form > .cm-field:has(textarea) { grid-column: 1 / -1; }
.cm-editor-side .cm-section a, .cm-editor-main .cm-section > a { font-size: var(--cm-text-sm); }

/* Offer ladder */
.cm-ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--cm-s3); }
.cm-ladder-rung { display: flex; flex-direction: column; gap: var(--cm-s2); min-width: 0; }
.cm-ladder-head { display: flex; align-items: center; justify-content: space-between; font-size: var(--cm-text-xs); color: var(--cm-ink-3); padding: 0 2px 4px; border-bottom: 1px solid var(--cm-line); }
.cm-ladder-card { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-md);
  background: var(--cm-surface); font: inherit; color: var(--cm-ink); cursor: pointer; transition: border-color .12s; }
.cm-ladder-card:hover { border-color: var(--cm-line-strong); }
.cm-ladder-card:focus-visible { outline: 2px solid var(--cm-accent); outline-offset: 2px; }
.cm-ladder-card.is-core { box-shadow: inset 3px 0 0 var(--cm-accent); }
.cm-ladder-card strong { font-weight: 600; font-size: var(--cm-text-sm); line-height: 1.3; }
.cm-ladder-type { font-size: var(--cm-text-xs); color: var(--cm-ink-3); display: flex; align-items: center; gap: 6px; }
.cm-ladder-price { font-size: var(--cm-text-sm); font-variant-numeric: tabular-nums; }
.cm-ladder-card .cm-faint { font-size: var(--cm-text-xs); }
.cm-ladder-empty { font-size: var(--cm-text-xs); padding: 10px 2px; }
.cm-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--cm-s3); }
.cm-swatch { border: 1px solid var(--cm-line); border-radius: var(--cm-radius-sm); overflow: hidden; font-size: var(--cm-text-xs); background: var(--cm-surface); }
.cm-swatch-color { height: 44px; }
.cm-swatch-meta { padding: 6px 8px; display: flex; flex-direction: column; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .cm-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-editor, .cm-editor.is-side-first { grid-template-columns: minmax(0, 1fr); }
  .cm-editor-side { position: static; }
  .cm-editor.is-side-first .cm-subnav { flex-direction: row; overflow-x: auto; }
  .cm-editor.is-side-first .cm-subnav-item { flex: none; }
  .cm-shell { grid-template-columns: minmax(0, 1fr); }
  .cm-rail { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--cm-line); gap: var(--cm-s2);
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .cm-nav { flex-direction: row; overflow-x: auto; gap: 2px; padding-bottom: 2px; }
  .cm-nav-group { flex-direction: row; flex: none; }
  .cm-nav-label, .cm-rail-foot, .cm-nav-count { display: none; }
  .cm-grid-2, .cm-grid-3, .cm-grid-main { grid-template-columns: minmax(0, 1fr); }
  .cm-content, .cm-topbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .cm-search { min-width: 0; }
  .cm-search > span, .cm-search .cm-kbd, .cm-role > span { display: none; }
}
@media (max-width: 640px) {
  .cm-rule { flex-direction: column; gap: 2px; }
  .cm-ladder { grid-template-columns: minmax(0, 1fr); }
  .cm-bricks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-cal-day { min-height: 52px; padding: 4px; }
  .cm-cal-chip { display: none; }
  .cm-layer { grid-template-columns: 24px minmax(0, 1fr); }
  .cm-layer > :nth-child(n+3) { grid-column: 2; }
  .cm-kv { grid-template-columns: minmax(0, 1fr); gap: 2px var(--cm-s4); }
  .cm-kv dd { margin-bottom: var(--cm-s2); }
  .cm-table { min-width: 560px; }
  .cm-editor .cm-table { min-width: 720px; }
  .cm-statstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-statstrip-item { border-left: 0; border-top: 1px solid var(--cm-line); }
  .cm-statstrip-item:nth-child(-n+2) { border-top: 0; }
  .cm-statstrip-item:nth-child(even) { border-left: 1px solid var(--cm-line); }
  .cm-list-row { flex-wrap: wrap; }
  .cm-list-side { width: 100%; justify-content: flex-start; padding-left: 40px; }
  .cm-focus-main { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* SlidePreview: rendered carousel slides */
.cm-slide-preview { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 180px); gap: var(--cm-s3); overflow-x: auto; padding: 2px 2px var(--cm-s2); }
.cm-slide-shot { margin: 0; position: relative; }
.cm-slide-shot img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: var(--cm-radius-sm); box-shadow: 0 0 0 1px var(--cm-line); }
.cm-slide-shot figcaption { margin-top: 6px; text-align: center; font-size: var(--cm-text-xs); font-variant-numeric: tabular-nums; color: var(--cm-ink-3); }
.cm-palette-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: var(--cm-s3); align-items: start; padding: var(--cm-s3) var(--cm-s4); border-top: 1px solid var(--cm-line); }
.cm-palette-row:first-child { border-top: 0; }
@media (max-width: 640px) { .cm-palette-row { grid-template-columns: 1fr; } }
