@layer staging {
  :root { color-scheme: light; }
  body { margin: 0; min-width: 320px; background: var(--cf-color-page); }
  .staging-app { min-height: 100vh; font-size: var(--cf-font-size-400); }
  .staging-topbar { position: sticky; z-index: var(--cf-z-navigation); top: 0; display: flex; min-height: 64px; border-bottom: 1px solid var(--cf-color-line); align-items: center; justify-content: space-between; gap: var(--cf-space-6); background: rgba(248,249,250,.96); padding: var(--cf-space-4) clamp(16px, 2vw, 32px); backdrop-filter: blur(10px); }
  .brand-lockup { display: flex; align-items: center; gap: var(--cf-space-4); color: inherit; text-decoration: none; }
  .brand-lockup img { width: 34px; height: 34px; object-fit: contain; }
  .brand-lockup span { display: grid; line-height: 1.05; }
  .brand-lockup small { color: var(--cf-color-muted); font-size: var(--cf-font-size-100); font-weight: 700; text-transform: uppercase; }
  .brand-lockup strong { color: var(--cf-color-brand-600); font-family: var(--cf-font-title); font-size: var(--cf-font-size-600); }
  .staging-topbar nav { display: flex; align-items: center; gap: var(--cf-space-5); }
  .api-state { display: inline-flex; align-items: center; gap: var(--cf-space-3); color: var(--cf-color-muted); font-size: var(--cf-font-size-300); }
  .api-state > span { width: 8px; height: 8px; border-radius: 50%; background: var(--cf-color-warning); }
  .auth-nav-state { color: var(--cf-color-muted); font-size: var(--cf-font-size-200); font-weight: 600; }
  .auth-nav-state[data-status="authorized"] { color: var(--cf-color-positive); }
  .auth-nav-sign-out { min-height: 32px; padding-inline: var(--cf-space-4); }
  .auth-gate { display: grid; min-height: calc(100vh - 65px); place-items: center; padding: var(--cf-space-7); }
  .auth-gate[hidden], .staging-shell[hidden], .auth-form[hidden], .auth-secondary-actions button[hidden], .auth-nav-sign-out[hidden] { display: none !important; }
  .auth-panel { display: grid; width: min(430px, 100%); gap: var(--cf-space-5); border: 1px solid var(--cf-color-line); border-radius: var(--cf-radius-md); background: var(--cf-color-surface); box-shadow: var(--cf-shadow-panel); padding: clamp(24px, 4vw, 40px); }
  .auth-panel > img { width: 44px; height: 44px; object-fit: contain; }
  .auth-panel h1 { margin: var(--cf-space-2) 0 0; font-size: var(--cf-font-size-700); }
  .auth-message { border-left: 3px solid var(--cf-color-info); background: var(--cf-color-info-soft); padding: var(--cf-space-4); font-size: var(--cf-font-size-300); font-weight: 600; }
  .auth-message[data-state="authorized"] { border-color: var(--cf-color-positive); background: var(--cf-color-positive-soft); }
  .auth-message[data-state="unapproved"], .auth-message[data-state="unauthorized"], .auth-message[data-state="unverified"] { border-color: var(--cf-color-warning); background: var(--cf-color-warning-soft); }
  .auth-message[data-state="error"], .auth-message[data-state="expired"] { border-color: var(--cf-color-danger); background: var(--cf-color-danger-soft); }
  .auth-detail { margin: calc(-1 * var(--cf-space-2)) 0 0; color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .auth-detail:empty { display: none; }
  .auth-form { display: grid; gap: var(--cf-space-5); }
  .auth-secondary-actions { display: flex; gap: var(--cf-space-3); }
  .staging-shell { width: 100%; max-width: none; margin: 0; padding: clamp(16px, 1.5vw, 32px); }
  .workflow-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--cf-space-7); border-bottom: 1px solid var(--cf-color-line); padding: var(--cf-space-4) 0 var(--cf-space-7); }
  .workflow-header h1 { margin: var(--cf-space-2) 0 var(--cf-space-3); }
  .workflow-header .cf-body { color: var(--cf-color-muted); }
  .workflow-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--cf-space-4); }
  .week-board { margin-top: var(--cf-space-6); }
  .week-board-heading { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: var(--cf-space-6); border-bottom: 1px solid var(--cf-color-line-subtle); padding: var(--cf-space-5) var(--cf-space-6); }
  .week-board-heading h2 { margin: 0 0 var(--cf-space-1); font-size: var(--cf-font-size-500); font-weight: 600; }
  .week-board-heading p { margin: 0; color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .week-board-controls { display: flex; align-items: end; gap: var(--cf-space-4); }
  .week-date-field { min-width: 170px; }
  .visible-weeks-field { width: 92px; }
  .week-overview { margin-top: var(--cf-space-6); }
  .week-overview[hidden], .staging-grid[hidden] { display: none !important; }
  .week-overview-scroller { overflow-x: auto; scrollbar-gutter: stable; }
  .week-overview-grid { display: grid; grid-template-columns: repeat(7, minmax(178px, 1fr)); min-width: 1246px; background: var(--cf-color-line-subtle); gap: 1px; }
  .week-overview-day { display: grid; grid-template-rows: auto minmax(180px, 1fr) auto; min-width: 0; background: var(--cf-color-surface); }
  .week-overview-day > header { display: grid; gap: var(--cf-space-1); border-bottom: 1px solid var(--cf-color-line-subtle); background: var(--cf-color-paper); padding: var(--cf-space-5); }
  .week-overview-day > header strong { font-family: var(--cf-font-title); font-size: var(--cf-font-size-300); }
  .week-overview-day > header span { color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .week-overview-body { display: grid; align-content: start; gap: var(--cf-space-4); padding: var(--cf-space-5); }
  .week-overview-empty { color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .week-overview-workout-title { margin: 0; overflow-wrap: anywhere; font-family: var(--cf-font-title); font-size: var(--cf-font-size-300); font-weight: 600; }
  .week-overview-section { display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: var(--cf-space-3); border-top: 1px solid var(--cf-color-line-subtle); padding-top: var(--cf-space-4); }
  .week-overview-section-label { color: var(--cf-color-brand-600); font-weight: 700; }
  .week-overview-section-copy { display: grid; min-width: 0; gap: var(--cf-space-1); }
  .week-overview-section-copy strong { overflow-wrap: anywhere; font-size: var(--cf-font-size-200); font-weight: 600; }
  .week-overview-section-copy span { color: var(--cf-color-muted); font-size: var(--cf-font-size-100); }
  .week-overview-day > footer { display: grid; gap: var(--cf-space-3); border-top: 1px solid var(--cf-color-line-subtle); padding: var(--cf-space-4); }
  .week-overview-status { font-size: var(--cf-font-size-100); font-weight: 600; text-transform: uppercase; }
  .week-overview-day[data-status="staged"] .week-overview-status { color: var(--cf-color-positive); }
  .week-overview-day[data-status="review"] .week-overview-status { color: var(--cf-color-warning); }
  .week-overview-day[data-status="conflict"] .week-overview-status { color: var(--cf-color-danger); }
  .week-overview-day[data-status="draft"] .week-overview-status { color: var(--cf-color-info); }
  .week-overview-edit { min-height: 32px; }
  .multi-week-panel { margin-top: var(--cf-space-6); }
  .multi-week-scroller { overflow-x: auto; }
  .multi-week-list { display: grid; gap: var(--cf-space-5); padding: var(--cf-space-5); }
  .multi-week-row { min-width: 0; border: 1px solid var(--cf-color-line-subtle); border-radius: var(--cf-radius-sm); background: var(--cf-color-paper); }
  .multi-week-row[data-active="true"] { border-color: rgba(154, 12, 48, .42); box-shadow: 0 0 0 2px rgba(154, 12, 48, .08); }
  .multi-week-row > header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: var(--cf-space-5); border-bottom: 1px solid var(--cf-color-line-subtle); padding: var(--cf-space-4) var(--cf-space-5); }
  .multi-week-row > header span { color: var(--cf-color-muted); font-size: var(--cf-font-size-200); white-space: nowrap; }
  .multi-week-select { border: 0; background: transparent; color: var(--cf-color-ink); font-family: var(--cf-font-title); font-size: var(--cf-font-size-400); font-weight: 700; padding: 0; text-align: left; cursor: pointer; }
  .multi-week-select:hover { color: var(--cf-color-brand-600); }
  .multi-week-days { display: grid; width: 100%; min-width: 1680px; grid-template-columns: repeat(7, minmax(240px, 1fr)); align-items: stretch; gap: 1px; overflow: visible; background: var(--cf-color-line-subtle); }
  .multi-week-day { display: grid; min-width: 0; grid-template-rows: auto minmax(170px, 1fr) auto; min-height: 340px; background: var(--cf-color-surface); }
  .multi-week-day[data-active="true"] { outline: 3px solid var(--cf-color-brand-600); outline-offset: -3px; }
  .multi-week-day > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--cf-space-2) var(--cf-space-3); border-bottom: 1px solid var(--cf-color-line-subtle); padding: var(--cf-space-4); }
  .multi-week-day > header strong { min-width: 0; overflow-wrap: anywhere; font-family: var(--cf-font-title); font-size: var(--cf-font-size-300); }
  .multi-week-day > header span { color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .multi-week-day > header em { grid-column: 1 / -1; color: var(--cf-color-muted); font-size: var(--cf-font-size-100); font-style: normal; font-weight: 700; text-transform: uppercase; }
  .multi-week-day[data-status="draft"] > header em { color: var(--cf-color-info); }
  .multi-week-day[data-status="staged"] > header em { color: var(--cf-color-positive); }
  .multi-week-day[data-status="review"] > header em { color: var(--cf-color-warning); }
  .multi-week-day[data-status="conflict"] > header em { color: var(--cf-color-danger); }
  .multi-week-source { width: 100%; min-height: 170px; margin: 0; border: 0; border-radius: 0; outline: 0; background: transparent; box-shadow: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--cf-color-ink); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: var(--cf-space-4); resize: none; }
  .multi-week-source:focus { background: #fbfcfd; box-shadow: inset 0 0 0 2px rgba(154, 12, 48, .18); }
  .multi-week-source::placeholder { color: var(--cf-color-muted); }
  .multi-week-day > footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cf-space-3); border-top: 1px solid var(--cf-color-line-subtle); padding: var(--cf-space-4); }
  .multi-week-day > footer .cf-button:last-child { grid-column: 1 / -1; }
  .multi-week-day > footer .cf-button { min-height: 32px; padding-inline: var(--cf-space-3); }
  .staging-grid { display: grid; grid-template-columns: minmax(320px, 760px); gap: var(--cf-space-6); align-items: start; padding-top: var(--cf-space-6); }
  .workspace-panel { min-width: 0; border: 1px solid var(--cf-color-line); border-radius: var(--cf-radius-md); background: var(--cf-color-surface); box-shadow: var(--cf-shadow-panel); }
  .panel-heading { display: flex; min-height: 52px; border-bottom: 1px solid var(--cf-color-line-subtle); align-items: center; justify-content: space-between; gap: var(--cf-space-5); padding: var(--cf-space-5) var(--cf-space-6); }
  .panel-heading > div { display: flex; align-items: center; gap: var(--cf-space-4); }
  .panel-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--cf-space-3); }
  .panel-action-button { min-height: 32px; padding-inline: var(--cf-space-4); }
  .panel-heading h2 { margin: 0; font-size: var(--cf-font-size-500); font-weight: 600; }
  .step-number { display: inline-grid; width: 24px; height: 24px; border-radius: 50%; place-items: center; background: var(--cf-color-brand-600); color: white; font-family: var(--cf-font-title); font-size: var(--cf-font-size-200); font-weight: 700; }
  .panel-caption { color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .write-body, .handoff-body { padding: var(--cf-space-6); }
  .source-editor { width: 100%; min-height: calc(100vh - 270px); margin-top: var(--cf-space-3); border: 1px solid var(--cf-color-line); border-radius: var(--cf-radius-sm); background: #fbfcfd; box-shadow: inset 0 1px 2px rgba(31,35,40,.07); color: var(--cf-color-ink); font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: var(--cf-space-6); resize: vertical; tab-size: 2; }
  .editor-footer { display: flex; justify-content: space-between; gap: var(--cf-space-4); color: var(--cf-color-muted); font-size: var(--cf-font-size-200); padding-top: var(--cf-space-3); }
  .diagnostics { display: grid; gap: var(--cf-space-3); padding-top: var(--cf-space-5); }
  .diagnostic { border-left: 3px solid var(--cf-color-info); background: var(--cf-color-info-soft); padding: var(--cf-space-4); font-size: var(--cf-font-size-200); }
  .diagnostic.warning { border-color: var(--cf-color-warning); background: var(--cf-color-warning-soft); }
  .diagnostic.error { border-color: var(--cf-color-danger); background: var(--cf-color-danger-soft); }
  .empty-state { display: grid; min-height: 280px; place-content: center; gap: var(--cf-space-3); color: var(--cf-color-muted); padding: var(--cf-space-8); text-align: center; }
  .empty-state strong { color: var(--cf-color-ink); }
  .staged-sections { display: grid; gap: var(--cf-space-5); padding: var(--cf-space-5); }
  .stage-card { border: 1px solid var(--cf-color-line); border-radius: var(--cf-radius-sm); background: var(--cf-color-surface); }
  .stage-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--cf-space-4); border-bottom: 1px solid var(--cf-color-line-subtle); background: var(--cf-color-paper); padding: var(--cf-space-5); }
  .stage-badges { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: var(--cf-space-3); }
  .section-identity { display: flex; min-width: 0; gap: var(--cf-space-4); }
  .section-label { flex: 0 0 auto; color: var(--cf-color-brand-600); font-family: var(--cf-font-title); font-weight: 700; }
  .section-identity h3 { margin: 0 0 var(--cf-space-2); overflow-wrap: anywhere; font-size: var(--cf-font-size-400); font-weight: 600; }
  .section-identity p { margin: 0; color: var(--cf-color-muted); font-size: var(--cf-font-size-200); text-transform: capitalize; }
  .stage-card-body { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); gap: var(--cf-space-5); padding: var(--cf-space-5); }
  .parsed-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cf-space-4); margin: 0; }
  .parsed-facts div { min-width: 0; border-left: 2px solid var(--cf-color-line); padding-left: var(--cf-space-4); }
  .parsed-facts dt { color: var(--cf-color-muted); font-size: var(--cf-font-size-100); font-weight: 700; text-transform: uppercase; }
  .parsed-facts dd { margin: var(--cf-space-1) 0 0; overflow-wrap: anywhere; font-size: var(--cf-font-size-300); }
  .mapping-notes { grid-column: 1 / -1; }
  .mapping-note { margin: 0; border-left: 3px solid var(--cf-color-warning); background: var(--cf-color-warning-soft); padding: var(--cf-space-4); color: var(--cf-color-warning); font-size: var(--cf-font-size-200); }
  .consistency-issues { display: grid; grid-column: 1 / -1; gap: var(--cf-space-3); }
  .consistency-issue { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: var(--cf-space-4); margin: 0; border-left: 3px solid var(--cf-color-warning); background: var(--cf-color-warning-soft); padding: var(--cf-space-4); color: var(--cf-color-warning); font-size: var(--cf-font-size-200); }
  .consistency-issue.error { border-color: var(--cf-color-danger); background: var(--cf-color-danger-soft); color: var(--cf-color-danger); }
  .source-disclosure { grid-column: 1 / -1; border-top: 1px solid var(--cf-color-line-subtle); padding-top: var(--cf-space-4); }
  .source-disclosure summary, .payload-preview summary { cursor: pointer; color: var(--cf-color-muted); font-size: var(--cf-font-size-200); font-weight: 600; }
  .source-disclosure pre, .payload-preview pre { overflow: auto; max-height: 280px; border: 1px solid var(--cf-color-line-subtle); border-radius: var(--cf-radius-sm); background: var(--cf-color-paper); white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: var(--cf-space-5); }
  .handoff-panel { position: sticky; top: 80px; }
  .compatibility-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--cf-color-line-subtle); background: var(--cf-color-paper); }
  .compatibility-summary div { display: grid; gap: var(--cf-space-1); padding: var(--cf-space-4); text-align: center; }
  .compatibility-summary div + div { border-left: 1px solid var(--cf-color-line-subtle); }
  .compatibility-summary strong { font-family: var(--cf-font-title); font-size: var(--cf-font-size-500); }
  .compatibility-summary span { color: var(--cf-color-muted); font-size: var(--cf-font-size-100); text-transform: uppercase; }
  .handoff-note { margin-top: var(--cf-space-6); border-left: 3px solid var(--cf-color-info); background: var(--cf-color-info-soft); padding: var(--cf-space-5); }
  .handoff-note p { margin: var(--cf-space-2) 0 0; color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .bot-handoff { display: grid; gap: var(--cf-space-4); margin-top: var(--cf-space-5); border-left: 3px solid var(--cf-color-warning); background: var(--cf-color-warning-soft); padding: var(--cf-space-5); }
  .bot-handoff p { margin: 0; color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .bot-handoff .cf-field { gap: var(--cf-space-2); }
  .upload-policy, .upload-report ul { display: grid; gap: var(--cf-space-2); margin: 0; padding-left: var(--cf-space-5); color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .upload-report { display: grid; gap: var(--cf-space-3); border-top: 1px solid rgba(117, 79, 0, .18); padding-top: var(--cf-space-4); }
  .upload-report strong { font-size: var(--cf-font-size-200); }
  .upload-report li[data-level="queued"] { color: var(--cf-color-info); }
  .upload-report li[data-level="uploaded"] { color: var(--cf-color-positive); }
  .upload-report li[data-level="skipped"], .upload-report li[data-level="error"] { color: var(--cf-color-danger); font-weight: 600; }
  .upload-report li[data-level="warning"] { color: var(--cf-color-warning); font-weight: 600; }
  .bot-upload-status[data-status="success"] { color: var(--cf-color-positive); font-weight: 600; }
  .bot-upload-status[data-status="error"] { color: var(--cf-color-danger); font-weight: 600; }
  .consistency-status { display: grid; gap: var(--cf-space-1); margin-top: var(--cf-space-5); border-left: 3px solid var(--cf-color-positive); background: var(--cf-color-positive-soft); padding: var(--cf-space-4); }
  .consistency-status span { color: var(--cf-color-muted); font-size: var(--cf-font-size-200); }
  .consistency-status[data-status="warning"] { border-color: var(--cf-color-warning); background: var(--cf-color-warning-soft); }
  .consistency-status[data-status="error"] { border-color: var(--cf-color-danger); background: var(--cf-color-danger-soft); }
  .handoff-actions { display: grid; gap: var(--cf-space-4); padding: var(--cf-space-6) 0; }
  .payload-preview { border-top: 1px solid var(--cf-color-line-subtle); padding-top: var(--cf-space-5); }
  .upload-safety-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(820px, calc(100vh - 32px)); margin: auto; border: 1px solid var(--cf-color-line); border-radius: var(--cf-radius-md); background: var(--cf-color-surface); box-shadow: 0 28px 90px rgba(21, 24, 30, .28); color: var(--cf-color-ink); padding: 0; }
  .upload-safety-dialog::backdrop { background: rgba(21, 24, 30, .62); backdrop-filter: blur(2px); }
  .upload-safety-shell { display: grid; max-height: inherit; grid-template-rows: auto minmax(0, 1fr) auto; }
  .upload-safety-header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: var(--cf-space-5); border-bottom: 1px solid var(--cf-color-line-subtle); padding: var(--cf-space-5) var(--cf-space-6); }
  .upload-safety-header > div { display: flex; min-width: 0; align-items: center; gap: var(--cf-space-4); }
  .upload-safety-header h2 { margin: 0; overflow-wrap: anywhere; font-size: var(--cf-font-size-500); }
  .upload-safety-body { overflow: auto; padding: var(--cf-space-6); }
  .upload-safety-body > p { margin: 0; color: var(--cf-color-muted); }
  .upload-safety-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: var(--cf-space-5) 0 0; background: var(--cf-color-line-subtle); }
  .upload-safety-context div { min-width: 0; background: var(--cf-color-paper); padding: var(--cf-space-4); }
  .upload-safety-context dt { color: var(--cf-color-muted); font-size: var(--cf-font-size-100); font-weight: 700; text-transform: uppercase; }
  .upload-safety-context dd { margin: var(--cf-space-1) 0 0; overflow-wrap: anywhere; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
  .upload-safety-steps { display: grid; gap: var(--cf-space-3); margin: var(--cf-space-5) 0 0; padding-left: 24px; color: var(--cf-color-muted); font-size: var(--cf-font-size-300); }
  .upload-safety-options, .upload-safety-targets { display: grid; gap: 0; margin: var(--cf-space-6) 0 0; border: 1px solid var(--cf-color-line); border-radius: var(--cf-radius-sm); padding: 0; }
  .upload-safety-options[hidden], .upload-safety-targets[hidden], .upload-safety-acknowledgement[hidden] { display: none; }
  .upload-safety-options legend, .upload-safety-targets legend { margin-left: var(--cf-space-4); background: var(--cf-color-surface); padding: 0 var(--cf-space-2); font-size: var(--cf-font-size-200); font-weight: 700; }
  .upload-safety-option, .upload-safety-target { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--cf-space-3); align-items: start; padding: var(--cf-space-4); cursor: pointer; }
  .upload-safety-option + .upload-safety-option, .upload-safety-target + .upload-safety-target { border-top: 1px solid var(--cf-color-line-subtle); }
  .upload-safety-option:has(input:checked), .upload-safety-target:has(input:checked) { background: var(--cf-color-brand-100); }
  .upload-safety-option input, .upload-safety-target input, .upload-safety-acknowledgement input { margin-top: 3px; }
  .upload-safety-option span, .upload-safety-target span { display: grid; min-width: 0; gap: var(--cf-space-1); }
  .upload-safety-option small, .upload-safety-target small { color: var(--cf-color-muted); font-size: var(--cf-font-size-200); line-height: 1.45; }
  .upload-safety-target code { overflow-wrap: anywhere; color: var(--cf-color-muted); font-size: 11px; }
  .upload-safety-acknowledgement { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--cf-space-3); margin-top: var(--cf-space-5); border-left: 3px solid var(--cf-color-warning); background: var(--cf-color-warning-soft); padding: var(--cf-space-4); font-size: var(--cf-font-size-200); }
  .upload-safety-actions { display: flex; justify-content: flex-end; gap: var(--cf-space-3); border-top: 1px solid var(--cf-color-line-subtle); padding: var(--cf-space-5) var(--cf-space-6); }
  .review-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(21, 24, 30, .56); backdrop-filter: blur(2px); }
  .review-backdrop[hidden] { display: none; }
  .stage-panel, .handoff-panel { display: none; }
  body.review-open { overflow: hidden; }
  body.review-open .stage-panel,
  body.review-open .handoff-panel {
    display: block;
    position: fixed;
    z-index: 90;
    top: 84px;
    bottom: 28px;
    overflow: auto;
    box-shadow: 0 24px 80px rgba(21, 24, 30, .22);
  }
  body.review-open .stage-panel { left: 28px; right: min(460px, 34vw); margin-right: var(--cf-space-5); }
  body.review-open .handoff-panel { right: 28px; width: min(420px, calc(34vw - 28px)); min-width: 340px; }
  body.review-open .handoff-body { padding-bottom: var(--cf-space-8); }
  @media (max-width: 1180px) {
    .staging-grid { grid-template-columns: minmax(300px, 760px); }
    body.review-open .stage-panel { left: 20px; right: 20px; top: 76px; bottom: 45%; margin: 0; }
    body.review-open .handoff-panel { left: 20px; right: 20px; top: 58%; bottom: 20px; width: auto; min-width: 0; }
    body.review-open .handoff-body { display: grid; grid-template-columns: minmax(220px,.6fr) minmax(260px,1fr); gap: var(--cf-space-6); }
    body.review-open .handoff-actions { grid-column: 1; }
    body.review-open .payload-preview { grid-column: 2; grid-row: 1 / span 3; border: 0; padding: 0; }
  }
  @media (max-width: 760px) {
    .staging-topbar { position: static; }
    .api-state, .auth-nav-state { display: none; }
    .auth-gate { min-height: calc(100vh - 65px); padding: var(--cf-space-5); }
    .staging-shell { padding: var(--cf-space-5); }
    .workflow-header { align-items: stretch; flex-direction: column; }
    .workflow-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .workflow-actions .cf-button:last-child { grid-column: 1 / -1; }
    .week-board-heading, .week-board-controls { align-items: stretch; flex-direction: column; }
    .week-board-controls { width: 100%; }
    .week-board-controls .cf-button { width: 100%; }
    .visible-weeks-field { width: 100%; }
    .staging-grid { grid-template-columns: 1fr; }
    .source-editor { min-height: 420px; }
    .multi-week-day > footer { grid-template-columns: 1fr; }
    .stage-card-body, .handoff-body { grid-template-columns: 1fr; }
    .payload-preview { grid-column: auto; grid-row: auto; }
    .editor-footer { align-items: flex-start; flex-direction: column; }
    body.review-open .stage-panel,
    body.review-open .handoff-panel {
      left: var(--cf-space-4);
      right: var(--cf-space-4);
      width: auto;
      min-width: 0;
    }
    body.review-open .stage-panel { top: var(--cf-space-4); bottom: 50%; }
    body.review-open .handoff-panel { top: calc(50% + var(--cf-space-3)); bottom: var(--cf-space-4); }
    body.review-open .handoff-body { display: block; }
    .panel-heading-actions { align-items: flex-end; flex-direction: column; }
    .upload-safety-context { grid-template-columns: 1fr; }
    .upload-safety-actions { display: grid; grid-template-columns: 1fr 1fr; }
  }
}
