/* ============================================================
   StoryBoard SaaS Light Theme
   Late-loaded product polish layer for legacy dark-page styles.
   ============================================================ */

:root {
    --sb-canvas: #f5f8fc;
    --sb-canvas-warm: #fffdf8;
    --sb-surface: #ffffff;
    --sb-surface-soft: #f8fbff;
    --sb-surface-blue: #eef5ff;
    --sb-border: #dbe5f0;
    --sb-border-strong: #c5d4e6;
    --sb-text: #172033;
    --sb-text-soft: #2d3a4f;
    --sb-text-muted: #56657c;
    --sb-blue: #1f5eff;
    /* Text-safe blue. #1f5eff clears AA on white (5.12:1) but lands at 4.41:1
       on our tinted surfaces (#e7eff9 rails, the cream header) — just under
       the 4.5 floor. Use this for blue TEXT; --sb-blue stays the fill colour,
       where the 3:1 non-text rule applies and it passes comfortably. */
    --sb-blue-text: #1954df;
    --sb-blue-strong: #1746b8;
    --sb-blue-soft: #e9f1ff;
    --sb-teal: #0f8b8d;
    --sb-green: #047857;
    --sb-amber: #a16207;
    --sb-red: #b42318;
    --sb-shadow-sm: 0 8px 20px rgba(23, 32, 51, 0.06);
    --sb-shadow-md: 0 18px 44px rgba(23, 32, 51, 0.08);
    --sb-shadow-blue: 0 18px 38px rgba(31, 94, 255, 0.14);
    --bg-primary: var(--sb-canvas);
    --bg-secondary: var(--sb-surface);
    --bg-card: var(--sb-surface);
    --bg-card-hover: var(--sb-surface-soft);
    --bg-input: var(--sb-surface-soft);
    --surface-subtle: #f1f6fd;
    --surface-muted: #e7eff9;
    --accent-primary: var(--sb-blue);
    --accent-text: var(--sb-blue-text);
    --accent-secondary: var(--sb-blue-strong);
    --accent-tertiary: var(--sb-teal);
    --accent-glow: rgba(31, 94, 255, 0.16);
    --border-subtle: var(--sb-border);
    --border-light: var(--sb-border-strong);
    --border-focus: rgba(31, 94, 255, 0.34);
    --text-primary: var(--sb-text);
    --text-secondary: var(--sb-text-soft);
    --text-muted: var(--sb-text-muted);
    --text-accent: var(--sb-blue);
    --success: var(--sb-green);
    --warning: var(--sb-amber);
    --error: var(--sb-red);
    --gradient-accent: linear-gradient(135deg, #1f5eff 0%, #1954df 58%, #0f8b8d 100%);
    --gradient-card: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    --shadow-card: var(--sb-shadow-sm);
    --shadow-glow: var(--sb-shadow-blue);

    /* Motion system — one set of durations/easings the whole app shares, so
       transitions feel coherent instead of ad hoc. */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    --duration-fast: 140ms;
    --duration-base: 240ms;
    --duration-slow: 420ms;

    /* Working-screen type system shared with the public site. */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Bricolage Grotesque', 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

html {
    background: var(--sb-canvas);
}

body {
    background:
        radial-gradient(circle at 12% 0%, rgba(31, 94, 255, 0.08), transparent 28rem),
        radial-gradient(circle at 88% 8%, rgba(15, 139, 141, 0.10), transparent 26rem),
        linear-gradient(180deg, var(--sb-canvas-warm) 0%, var(--sb-canvas) 54%, #edf3fb 100%) !important;
    color: var(--sb-text) !important;
}

a {
    color: var(--sb-blue);
}

/* Button-styled anchors (any "btn"/"Btn" class) keep their own colour on hover. */
a:not([class*="btn" i]):hover {
    color: var(--sb-blue-strong);
}

button,
a,
input,
textarea,
select {
    touch-action: manipulation;
}

/* Tabular-nums on common numeric chrome — prevents digit-width shift when
   counts or balances change. Add new selectors here rather than per-page. */
.account-stat-value,
.dashboard-stat-value,
.projects-filter-count,
.projects-header-meta,
.project-card-meta,
.project-card-updated,
.continue-pin-meta,
.account-pill-credits,
.account-pill-menu-credit-row,
.account-pill-menu-plan-meta,
.ledger-row time,
.ledger-row .ledger-amount,
.workspace-stat-value,
[data-tabular-nums] {
    font-variant-numeric: tabular-nums;
}

button,
.new-btn,
.submit-btn,
.home-nav-btn,
.home-cta,
.nav-link,
.workspace-filter-btn,
.recent-workspace-filter-btn,
.scene-action-btn,
.select-btn,
.review-display-btn,
.review-filter-btn,
.casting-filter-btn,
.cast-action-btn,
.review-ghost-btn,
.shot-btn,
.file-browse-btn {
    min-height: 44px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(31, 94, 255, 0.36) !important;
    outline-offset: 3px !important;
}

.header,
.home-header {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom: 1px solid var(--sb-border) !important;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.05) !important;
}

.header-inner {
    gap: 1rem;
}

.logo-text,
.page-title h1,
.card-header h1,
.card-header h2,
.section-header h2,
.active-workspace-title,
.workspace-card h2,
.workspace-card h3,
.home-hero-title,
.home-sidebar-title,
.scene-setting,
.sequence-group-title,
.sequence-shot-title,
.frame-title,
.review-rail-title,
.cast-name,
.cast-display-name,
.project-card-header h3,
.workspace-status-row,
.workspace-status-copy h1,
.an-card h2,
.cp-card h2,
.ws-card h2,
.support-title {
    color: var(--sb-text) !important;
}

.tagline,
.home-brand-subtitle,
.home-hero-subtitle,
.home-sidebar-copy,
.home-feature-copy,
.home-process-copy,
.home-upload-header p,
.card-header p,
.section-header p,
.active-workspace-copy,
.active-workspace-note,
.workspace-intro,
.workspace-card p,
.workspace-note,
.scene-description,
.scene-meta,
.scene-review-nav-header p,
.scene-review-panel-header p,
.sequence-group-copy,
.sequence-shot-caption,
.frame-subtitle,
.frame-description,
.review-display-copy,
.review-kicker,
.cast-meta,
.cast-shot-copy,
.cast-priority-note,
.casting-guidance-card p,
.review-guidance-card p,
.recent-workspace-copy,
.recent-workspace-filter-summary,
.project-card-description,
.ws-copy,
.cp-copy,
.support-copy,
.an-stat-sub,
.loading-note {
    color: var(--sb-text-soft) !important;
}

.home-brand-kicker,
.home-kicker,
.active-workspace-eyebrow,
.workspace-status-eyebrow,
.workspace-filter-label,
.recent-workspace-filter-label,
.scene-filter-label,
.review-filter-label,
.casting-filter-label,
.dna-label,
.stat-label,
.stat-block .stat-label,
.meta-label,
.scene-review-nav-meta,
.scene-review-counts,
.char-count,
.file-hint,
.counter-text,
.upload-counter,
.an-kicker,
.an-stat-label,
.cp-kicker,
.ws-kicker {
    color: var(--sb-text-muted) !important;
    letter-spacing: 0.06em !important;
}

.main,
.results-main,
.projects-container,
.upload-container,
.home-layout {
    width: 100%;
}

.active-workspace-shell {
    display: grid;
    gap: 1rem;
}

.active-workspace-top,
.workspace-status-topline,
.home-sidebar-head,
.recent-workspace-head {
    gap: 1rem;
}

.active-workspace-tabs {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 0.7rem !important;
}

.active-workspace-tab {
    min-height: 78px !important;
    padding: 0.85rem !important;
    background: var(--sb-surface-soft) !important;
    border: 1px solid var(--sb-border) !important;
    border-radius: 16px !important;
    color: var(--sb-text-soft) !important;
    box-shadow: none !important;
}

.active-workspace-tab.state-active,
.active-workspace-tab.state-ready {
    background: var(--sb-blue-soft) !important;
    border-color: rgba(31, 94, 255, 0.30) !important;
    color: var(--sb-blue-strong) !important;
}

.active-workspace-tab.state-done {
    background: #effcf6 !important;
    border-color: #b7efd3 !important;
    color: var(--sb-green) !important;
}

.active-workspace-tab.state-locked,
.active-workspace-tab.state-upcoming {
    opacity: 1 !important;
    color: var(--sb-text-muted) !important;
}

.active-workspace-tab-step {
    background: #ffffff !important;
    border: 1px solid var(--sb-border) !important;
    color: inherit !important;
}

.active-workspace-tab-label {
    color: var(--sb-text) !important;
}

.active-workspace-tab-note {
    color: var(--sb-text-soft) !important;
}

/* Workspace detail audit pass */
.section {
    padding: 1.25rem !important;
    margin-bottom: 1.15rem !important;
}

.section-header {
    min-height: 44px;
    padding: 0 0 0.95rem !important;
    margin-bottom: 1rem !important;
    border-bottom: 1px solid #edf2f7;
}

.section-header h2,
.section > h2 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: clamp(1.08rem, 1.4vw, 1.35rem) !important;
}

.section-header h2::before {
    content: "";
    width: 0.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--sb-blue), var(--sb-teal));
}

.section-content {
    display: grid;
    gap: 1rem;
}

.section.collapsed {
    padding-bottom: 1.25rem !important;
}

.collapse-icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--sb-surface-soft);
    border: 1px solid var(--sb-border);
    color: var(--sb-text-muted) !important;
}

.ghost-btn,
.review-ghost-btn {
    min-height: 44px;
    border-radius: 14px !important;
    font-weight: 700 !important;
}

.workspace-next-step {
    background: var(--sb-blue-soft) !important;
    border: 1px solid rgba(31, 94, 255, 0.18) !important;
    color: var(--sb-text-soft) !important;
}

.upload-card,
.loading-card,
.section,
.summary-banner,
.active-workspace-shell,
.workspace-card,
.workspace-section-nav-card,
.workspace-intro,
.workspace-shell-card,
.home-hero-card,
.home-sidebar-card,
.home-upload-card,
.project-card,
.scene-card,
.guidance-card,
.review-guidance-card,
.casting-guidance-card,
.casting-summary-card,
.cast-ai-planning-panel,
.cast-prompt-suggestion,
.cast-card,
.char-upload-card,
.scene-review-nav,
.scene-review-panel,
.review-focus-card,
.review-rail-card,
.sequence-view-card,
.sequence-shot-card,
.review-frame-card,
.review-rail-item,
.shot-card,
.frame-card,
.mapping-card,
.char-summary-card,
.env-card,
.dna-card,
.stats-bar,
.stat,
.stat-block,
.dna-item,
.scene-panel-stat,
.workspace-filter-toolbar,
.workspace-item,
.ws-card,
.ws-item,
.an-card,
.an-stat,
.cp-card,
.cp-alert,
.support-card,
.support-panel,
.support-stat,
.support-table-wrap {
    background: var(--sb-surface) !important;
    border-color: var(--sb-border) !important;
    color: var(--sb-text) !important;
    box-shadow: var(--sb-shadow-sm) !important;
}

.continuity-summary-card,
.continuity-scene-card,
.continuity-metric-card,
.continuity-inline-card,
.scene-sidebar,
.scene-detail-card,
.scene-nav-item,
.review-empty,
.workspace-empty,
.scene-empty-state,
.scene-catalog-note {
    background: var(--sb-surface) !important;
    border-color: var(--sb-border) !important;
    color: var(--sb-text) !important;
    box-shadow: none !important;
}

.home-feature-card,
.home-process-card,
.home-upload-intro-card,
.recent-workspace-card,
.recent-workspace-stat,
.detail-char-card,
.story-preview,
.workspace-script-preview,
.workspace-script-viewer,
.sequence-shot-thumb,
.project-thumbnail,
.frame-image,
.frame-empty,
.pending-card-body,
.cast-image-zone,
.live-debug-json,
.live-debug-card pre {
    background: var(--sb-surface-soft) !important;
    border-color: var(--sb-border) !important;
    color: var(--sb-text-soft) !important;
    box-shadow: none !important;
}

.continuity-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    margin-bottom: 0 !important;
}

.continuity-summary-card {
    display: grid;
    align-content: start;
    min-height: 170px;
    padding: 1.15rem !important;
    border-radius: 20px !important;
    border-left: 4px solid rgba(31, 94, 255, 0.42) !important;
}

.continuity-summary-card span,
.continuity-metric-card span,
.continuity-inline-card span {
    color: var(--sb-text-muted) !important;
    font-size: 0.73rem !important;
    letter-spacing: 0.08em !important;
}

.continuity-summary-card strong {
    color: var(--sb-text) !important;
    font-size: 1.7rem !important;
    line-height: 1.1 !important;
}

.continuity-summary-card p,
.continuity-metric-card p,
.continuity-inline-card p {
    color: var(--sb-text-soft) !important;
    font-size: 0.86rem !important;
    line-height: 1.55 !important;
}

.section-content > .continuity-note {
    margin: 0 !important;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: var(--sb-blue-soft);
    border: 1px solid rgba(31, 94, 255, 0.16);
    color: var(--sb-text-soft) !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
}

.continuity-scene-list {
    gap: 1rem !important;
}

.continuity-scene-card {
    gap: 1rem !important;
    padding: 1.25rem !important;
    border-radius: 24px !important;
    box-shadow: var(--sb-shadow-sm) !important;
}

.continuity-scene-head {
    align-items: center !important;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #edf2f7;
}

.continuity-scene-head h3 {
    color: var(--sb-text) !important;
    font-size: 1.05rem !important;
    letter-spacing: -0.02em;
}

.continuity-scene-head p {
    color: var(--sb-text-soft) !important;
    font-size: 0.9rem !important;
}

.continuity-scene-metrics,
.continuity-inline-grid {
    gap: 0.85rem !important;
}

.continuity-metric-card,
.continuity-inline-card {
    min-height: 128px;
    padding: 0.95rem 1rem !important;
    border-radius: 18px !important;
    background: var(--sb-surface-soft) !important;
    border: 1px solid var(--sb-border) !important;
}

.continuity-metric-card strong,
.continuity-inline-card strong {
    color: var(--sb-text) !important;
    font-size: 0.96rem !important;
    line-height: 1.4 !important;
}

.continuity-scene-actions {
    padding-top: 0.15rem;
}

.continuity-scene-actions .continuity-note {
    flex: 1 1 460px;
    color: var(--sb-text-soft) !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
}

.continuity-flag-list {
    gap: 0.55rem !important;
}

.continuity-flag {
    min-height: 36px;
    background: var(--sb-surface-soft) !important;
    border: 1px solid var(--sb-border) !important;
    color: var(--sb-text-soft) !important;
}

.continuity-flag small {
    opacity: 1 !important;
    color: inherit !important;
}

.continuity-empty,
.workspace-empty,
.scene-empty-state {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: var(--sb-green) !important;
}

.scene-workspace {
    gap: 1rem !important;
}

.shot-review-workspace {
    gap: 1.25rem !important;
    overflow: hidden !important;
}

.scene-review-nav,
.scene-review-panel,
.review-guidance-card,
.scene-review-item,
.shot-card,
.scene-panel-stat,
.scene-editor-actions {
    border-radius: 8px !important;
}

.scene-review-panel-body {
    gap: 1rem !important;
}

.scene-review-item {
    min-height: 116px !important;
    display: flex !important;
    flex-direction: column !important;
}

.scene-review-item-top {
    align-items: center !important;
}

.scene-review-counts {
    margin-top: auto !important;
    padding-top: 0.45rem !important;
}

.scene-sidebar,
.scene-detail-card {
    border-radius: 22px !important;
    overflow: hidden;
    box-shadow: var(--sb-shadow-sm) !important;
}

.scene-sidebar-header,
.scene-detail-header {
    background: var(--sb-surface-soft);
    border-bottom-color: var(--sb-border) !important;
}

.scene-nav-list {
    gap: 0.65rem !important;
    padding: 0.85rem !important;
}

.scene-nav-item {
    border-radius: 16px !important;
    background: var(--sb-surface) !important;
}

.scene-nav-item:hover,
.scene-nav-item.active {
    background: var(--sb-blue-soft) !important;
    border-color: rgba(31, 94, 255, 0.30) !important;
    box-shadow: none !important;
}

.scene-catalog-note {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: var(--sb-amber) !important;
}

.workspace-script-preview::after {
    background: linear-gradient(180deg, rgba(248, 251, 255, 0), var(--sb-surface-soft)) !important;
}

.scene-card:hover,
.scene-card.selected,
.sequence-shot-card:hover,
.sequence-shot-card.active,
.scene-review-item:hover,
.scene-review-item.active,
.shot-card.selected,
.review-rail-item:hover,
.review-rail-item.active,
.project-card:hover,
.cast-card:hover,
.char-upload-card:hover {
    background: var(--sb-surface-blue) !important;
    border-color: rgba(31, 94, 255, 0.34) !important;
    box-shadow: var(--sb-shadow-blue) !important;
    transform: translateY(-1px);
}

.scene-card.analyzed {
    background: #f0fdf4 !important;
    border-color: rgba(21, 128, 61, 0.30) !important;
    box-shadow: 0 12px 26px rgba(21, 128, 61, 0.07) !important;
}

.scene-card.analyzed .scene-selection-badge,
.scene-selection-badge.analyzed {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #047857 !important;
}

.home-nav-btn,
.home-user-chip,
.nav-link,
.workspace-section-btn,
.workspace-filter-btn,
.recent-workspace-filter-btn,
.review-display-btn,
.review-filter-btn,
.casting-filter-btn,
.scene-filter-btn,
.scene-action-btn,
.select-btn,
.btn-secondary,
.new-btn,
.review-ghost-btn,
.shot-btn,
.cast-action-btn,
.file-browse-btn,
.recent-workspace-ghost,
.ws-btn,
.cp-btn,
.support-btn {
    background: var(--sb-surface) !important;
    border: 1px solid var(--sb-border) !important;
    color: var(--sb-text) !important;
    box-shadow: none !important;
}

.home-nav-btn:hover,
.nav-link:hover,
.workspace-section-btn:hover,
.workspace-filter-btn:hover,
.workspace-filter-btn.active,
.recent-workspace-filter-btn:hover,
.recent-workspace-filter-btn.active,
.review-display-btn:hover,
.review-display-btn.active,
.review-filter-btn:hover,
.review-filter-btn.active,
.casting-filter-btn:hover,
.casting-filter-btn.active,
.scene-filter-btn:hover,
.scene-filter-btn.active,
.scene-action-btn:hover,
.select-btn:hover,
.btn-secondary:hover,
.new-btn:hover,
.review-ghost-btn:hover,
.shot-btn:hover,
.cast-action-btn:hover,
.file-browse-btn:hover,
.recent-workspace-ghost:hover,
.ws-btn:hover,
.cp-btn:hover,
.support-btn:hover {
    background: var(--sb-blue-soft) !important;
    border-color: rgba(31, 94, 255, 0.34) !important;
    color: var(--sb-blue-strong) !important;
}

.home-nav-btn.primary,
.home-cta.primary,
.submit-btn,
.review-ghost-btn.primary,
.cast-action-btn.primary,
.shot-btn.primary,
.ws-btn.primary,
.cp-btn.primary,
.support-btn.primary,
.btn-primary {
    background: linear-gradient(135deg, var(--sb-blue), var(--sb-blue-strong)) !important;
    border-color: var(--sb-blue) !important;
    color: #ffffff !important;
    box-shadow: var(--sb-shadow-blue) !important;
}

.home-nav-btn.danger,
.nav-link[style*="f87171"],
.danger,
.danger-link {
    color: var(--sb-red) !important;
}

.feedback-nav-btn {
    appearance: none;
    font: inherit;
    cursor: pointer;
}

.feedback-modal[hidden] {
    display: none !important;
}

.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.feedback-modal-open {
    overflow: hidden;
}

.feedback-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.feedback-modal-card {
    position: relative;
    width: min(100%, 560px);
    background:
        radial-gradient(circle at 12% 0%, rgba(31, 94, 255, 0.10), transparent 16rem),
        var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
    padding: 1.25rem;
}

.feedback-modal-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.feedback-modal-kicker {
    margin: 0 0 0.35rem;
    color: var(--sb-text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.feedback-modal-card h2 {
    margin: 0;
    color: var(--sb-text);
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.1;
}

.feedback-modal-close {
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid var(--sb-border);
    border-radius: 999px;
    background: var(--sb-surface-soft);
    color: var(--sb-text-muted);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}

.feedback-modal-form {
    display: grid;
    gap: 0.95rem;
}

.feedback-modal-field {
    display: grid;
    gap: 0.35rem;
    color: var(--sb-text);
    font-weight: 700;
    font-size: 0.9rem;
}

.feedback-modal-field select,
.feedback-modal-field textarea,
.feedback-modal-field input[type="file"] {
    width: 100%;
    border: 1px solid var(--sb-border);
    border-radius: 14px;
    background: var(--sb-surface-soft);
    color: var(--sb-text);
    font: inherit;
    font-weight: 500;
}

.feedback-modal-field select,
.feedback-modal-field input[type="file"] {
    min-height: 44px;
    padding: 0.65rem 0.8rem;
}

.feedback-modal-field textarea {
    padding: 0.8rem 0.9rem;
    resize: vertical;
    min-height: 132px;
}

.feedback-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
}

.feedback-modal-secondary,
.feedback-modal-primary {
    min-height: 44px;
    border-radius: 999px;
    padding: 0.7rem 1.05rem;
    font-weight: 800;
    cursor: pointer;
}

.feedback-modal-secondary {
    border: 1px solid var(--sb-border);
    background: var(--sb-surface);
    color: var(--sb-text);
}

.feedback-modal-primary {
    border: 1px solid var(--sb-blue);
    background: linear-gradient(135deg, var(--sb-blue), var(--sb-blue-strong));
    color: #ffffff;
    box-shadow: var(--sb-shadow-blue);
}

.active-workspace-chip,
.workspace-pill,
.scene-insight-chip,
.scene-char-tag,
.scene-number,
.review-rail-count,
.scene-review-status,
.shot-approval-badge,
.status-pill,
.workspace-status-chip,
.workspace-status-pill,
.recent-workspace-filter-count,
.workspace-filter-count,
.scene-status-pill {
    background: var(--sb-blue-soft) !important;
    border: 1px solid rgba(31, 94, 255, 0.16) !important;
    color: var(--sb-blue-strong) !important;
}

.pill-success,
.tone-success,
.active-workspace-chip.tone-success,
.workspace-status-chip.tone-success,
.workspace-status-pill.tone-success,
.scene-status-pill.status-generated,
.review-status-chip.approved,
.frame-badge.success,
.frame-badge.generated {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: var(--sb-green) !important;
}

.pill-warning,
.tone-warning,
.active-workspace-chip.tone-warning,
.workspace-status-chip.tone-warning,
.workspace-status-pill.tone-warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: var(--sb-amber) !important;
}

.scene-status-pill.status-partial,
.scene-status-pill.status-queued,
.scene-status-pill.status-needs_analysis,
.scene-status-pill.status-not_generated,
.continuity-flag.tone-warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: var(--sb-amber) !important;
}

.scene-status-pill.status-ready,
.workspace-status-chip.tone-info,
.workspace-status-pill.tone-info,
.continuity-flag.tone-info {
    background: var(--sb-blue-soft) !important;
    border-color: rgba(31, 94, 255, 0.22) !important;
    color: var(--sb-blue-strong) !important;
}

.scene-status-pill.status-generated,
.continuity-flag.tone-success {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: var(--sb-green) !important;
}

.scene-status-pill.status-not_selected,
.scene-status-pill.status-removed,
.workspace-status-chip.tone-muted,
.workspace-status-pill.tone-muted,
.continuity-flag.tone-muted {
    background: #f8fafc !important;
    border-color: var(--sb-border) !important;
    color: var(--sb-text-muted) !important;
}

.pill-danger,
.tone-danger,
.active-workspace-chip.tone-danger,
.workspace-status-chip.tone-danger,
.workspace-status-pill.tone-danger,
.scene-status-pill.status-failed,
.continuity-flag.tone-danger {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: var(--sb-red) !important;
}

input,
textarea,
select,
.text-input,
.cp-input,
.cp-select,
.ws-input {
    min-height: 44px;
    background: var(--sb-surface) !important;
    border: 1px solid var(--sb-border-strong) !important;
    color: var(--sb-text) !important;
}

textarea {
    min-height: 150px;
}

input::placeholder,
textarea::placeholder {
    color: #8a98aa !important;
}

input:focus,
textarea:focus,
select:focus,
.text-input:focus,
.cp-input:focus,
.cp-select:focus,
.ws-input:focus {
    border-color: rgba(31, 94, 255, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.14) !important;
    outline: none !important;
}

.file-upload-area {
    background: var(--sb-surface-soft) !important;
    border-color: var(--sb-border-strong) !important;
    color: var(--sb-text-soft) !important;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    background: var(--sb-blue-soft) !important;
    border-color: rgba(31, 94, 255, 0.45) !important;
}

.loading-overlay {
    background: rgba(15, 23, 42, 0.42) !important;
    backdrop-filter: blur(10px);
}

.loading-card {
    max-width: 440px;
}

.loading-bar {
    background: #e5edf8 !important;
}

.loading-bar-fill,
.progress-fill,
.an-bar {
    background: linear-gradient(90deg, var(--sb-blue), var(--sb-teal)) !important;
}

.alert-error,
.error-banner {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: var(--sb-red) !important;
}

.alert-success,
.success-banner {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: var(--sb-green) !important;
}

.alert-warning,
.warning-banner {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: var(--sb-amber) !important;
}

.an-table th,
.cp-table th,
.support-table th {
    color: var(--sb-text-muted) !important;
    border-bottom-color: var(--sb-border) !important;
}

.an-table td,
.cp-table td,
.support-table td {
    color: var(--sb-text-soft) !important;
    border-bottom-color: #edf2f7 !important;
}

[style*="rgba(255,255,255"],
[style*="rgba(255, 255, 255"],
[style*="#FCA5A5"],
[style*="#6EE7B7"],
[style*="#FCD34D"] {
    color: var(--sb-text-soft) !important;
}

[style*="color:#f87171"],
[style*="color: #f87171"] {
    color: var(--sb-red) !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1180px) {
    .continuity-summary-grid,
    .continuity-scene-metrics,
    .continuity-inline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 980px) {
    .home-primary-stack,
    .home-layout,
    .workspace-overview,
    .review-shell,
    .shot-review-workspace,
    .casting-guidance,
    .workspace-grid,
    .continuity-summary-grid,
    .continuity-scene-metrics,
    .continuity-inline-grid {
        grid-template-columns: 1fr !important;
    }

    .scene-review-nav-list {
        max-height: none !important;
    }
}

@media (max-width: 640px) {
    .main,
    .home-main {
        padding: 1rem 0.85rem 3rem !important;
    }

    .header-inner,
    .home-header-inner {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .header-nav,
    .home-header-actions {
        width: 100%;
        justify-content: flex-start !important;
    }

    .upload-card,
    .home-hero-card,
    .home-upload-card,
    .home-sidebar-card,
    .active-workspace-shell,
    .section,
    .workspace-card {
        padding: 1rem !important;
        border-radius: 16px !important;
    }
}

/* ============================================================
   Navigation feedback (paired with /static/nav_progress.js)
   Multi-page app: full reloads otherwise feel "stuck" on click.
   ============================================================ */
#nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--accent-primary, #1f5eff);
    box-shadow: 0 0 10px var(--accent-glow, rgba(31, 94, 255, 0.5));
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: width 0.2s ease, opacity 0.3s ease;
}
#nav-progress.is-active { opacity: 1; }

/* Busy state on the clicked link / submit button while the page loads. */
.nav-progress-busy {
    position: relative !important;
    opacity: 0.72;
    pointer-events: none;
    cursor: progress;
}
.nav-progress-busy::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0.6em;
    width: 0.85em;
    height: 0.85em;
    margin-top: -0.45em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: navProgressSpin 0.6s linear infinite;
}
@keyframes navProgressSpin { to { transform: rotate(360deg); } }

/* Skeleton utility for any async-loaded content (generation status, etc.). */
.skeleton {
    background: linear-gradient(100deg,
        var(--surface-subtle, #f1f6fd) 30%,
        var(--surface-muted, #e7eff9) 50%,
        var(--surface-subtle, #f1f6fd) 70%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: navSkeletonShimmer 1.4s ease-in-out infinite;
}
@keyframes navSkeletonShimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-progress-busy::after { animation-duration: 1.2s; }
    .skeleton { animation: none; }
    #nav-progress { transition: opacity 0.2s ease; }
}

/* ============================================================
   Phase 3 — calmer, less text-heavy screens
   Hover-help tooltip + progressive disclosure (see _ui_macros.html),
   and a gentle tone-down of confirmed secondary helper text so working
   screens lead with the action, not walls of explanatory copy.
   ============================================================ */

/* Inline hover/focus help marker (ui.help). CSS-only tooltip. */
.sb-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    cursor: help;
    vertical-align: middle;
    color: var(--text-muted, #56657c);
}
.sb-help-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 10px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    font-family: var(--font-mono);
}
.sb-help-label { font-size: 0.82em; }
.sb-help:hover, .sb-help:focus-visible { color: var(--accent-primary, #1f5eff); }
.sb-help:focus-visible { outline: 2px solid var(--border-focus, rgba(31,94,255,0.34)); outline-offset: 2px; border-radius: 4px; }
.sb-help::after {
    content: attr(data-sb-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 260px;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: var(--sb-text, #172033);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
    z-index: 9600;
}
.sb-help:hover::after, .sb-help:focus::after, .sb-help:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Progressive disclosure (ui.disclosure). */
.sb-disclosure { margin: 0.5rem 0; }
.sb-disclosure > summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-primary, #1f5eff);
    user-select: none;
}
.sb-disclosure > summary::-webkit-details-marker { display: none; }
.sb-disclosure > summary::before {
    content: "";
    width: 0; height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.15s ease;
}
.sb-disclosure[open] > summary::before { transform: rotate(90deg); }
.sb-disclosure > summary:focus-visible { outline: 2px solid var(--border-focus, rgba(31,94,255,0.34)); outline-offset: 2px; border-radius: 4px; }
.sb-disclosure-body {
    margin-top: 0.5rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #2d3a4f);
}

/* Gentle calm-down of confirmed secondary helper text — smaller + muted so
   screens lead with the action. Explicit class list (no wildcards) so we never
   shrink an input/control by accident. */
.np-helper,
.np-dropzone-hint,
.shot-editor-hint,
.director-field-hint,
.director-panel-desc,
.removed-shot-row-desc,
.frame-subtitle,
.review-focus-subtitle,
.review-focus-note,
.review-rail-description,
.version-compare-subtitle,
.version-note-copy,
.sequence-shot-caption,
.quality-pulse-note,
.cast-blocking-note,
.loading-note {
    color: var(--text-muted, #56657c) !important;
    font-weight: 400 !important;
}

/* ============================================================
   Page-shell alignment — every page's content starts at the SAME left gutter
   as the header logo. Workflow pages (.upload-container / .results-main /
   .workspace-layout) are already full-width at the 1.5rem gutter; the capped
   settings/team/admin shells were centered (margin: 0 auto) and drifted right.
   Left-align them (keep their max-width as a readability cap) so their left
   edge lines up with the logo on every page and width.
   ============================================================ */
.main .account-shell,
.main .ws-shell,
.main .an-shell,
.main .cp-shell,
.main .coh-shell,
.main .ut-shell,
.main .acu-shell {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* ============================================================
   Header nav — consistent pills, a clear circular Help button, and one primary
   CTA (New Project), all in the working sans. Scoped to .header so other pages
   are untouched.
   ============================================================ */
.header .header-nav { gap: 0.5rem; }

/* Brand wordmark — a bold Inter treatment so the logo reads as a
   title, not body text. */
.header .logo-text {
    font-family: 'Inter', var(--font-sans) !important;
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    letter-spacing: -0.02em !important;
    line-height: 1 !important;
}
.header .logo-accent {
    color: var(--accent-primary) !important;
    font-style: normal !important;
    font-weight: 700 !important;
    -webkit-text-fill-color: currentColor;
}

/* One consistent control system for EVERY header button: same font, size,
   height, radius, and vertical alignment. */
.header .nav-link,
.header .new-btn,
.header .account-pill {
    font-family: var(--font-sans) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

.header .nav-link {
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    justify-content: center;
}
.header .nav-link:hover {
    border-color: var(--border-focus);
    background: var(--surface-subtle);
    color: var(--accent-primary);
}

/* Help — compact circular control, same height as its sibling pills. */
.header .help-btn {
    width: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
    font-size: 1rem !important;   /* icon glyph reads a touch larger than labels */
    font-weight: 700 !important;
    color: var(--text-muted);
}
.header .help-btn:hover { color: var(--accent-primary); }

/* Primary CTA — New Project stands apart from the secondary pills. */
.header .new-btn--primary {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(31, 94, 255, 0.22) !important;
}
.header .new-btn--primary:hover {
    background: var(--accent-secondary) !important;
    border-color: var(--accent-secondary) !important;
    color: #fff !important;
}

/* ============================================================
   Centered Screen Navigation Loader Overlay
   ============================================================ */
#nav-centered-loader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: navCenteredLoaderFadeIn 0.2s ease-out;
}
#nav-centered-loader.is-active {
    display: flex;
}
.nav-centered-loader-card {
    background: var(--sb-surface, #ffffff);
    border: 1px solid var(--sb-border, #edf2f7);
    padding: 2.2rem 2.8rem;
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    width: min(90%, 340px);
}
.nav-centered-loader-card p {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--sb-text, #172033);
}
@keyframes navCenteredLoaderFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================================
   DESIGN SYSTEM — shared primitives
   One canonical look for the patterns each pipeline page used to
   reinvent (stat cards, boxed helper text). Rendered via the
   macros in _ui_macros.html so every screen stays identical.
   Loaded globally, so it applies wherever the macros are used.
   ============================================================ */

/* Metric cards — replaces .script-metric-card / .scene-summary-bar /
   .stats-bar / .casting-summary-card / .stat-block, which each styled
   the same "number + label" differently. */
.sb-stat-grid {
    display: grid;
    grid-template-columns: repeat(var(--sb-stat-cols, auto-fit), minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.sb-stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 1rem;
    background: var(--sb-surface-soft);
    border: 1px solid var(--sb-border);
    border-radius: 14px;
}

.sb-stat-label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sb-text-muted);
}

/* Calmer than the old 700–800 weight at huge sizes. One weight, one
   restrained responsive size for every screen — tames the oversized
   Shots/Boards numerals without shouting on lighter screens like Cast. */
.sb-stat-value {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
    line-height: 1.15;
    color: var(--sb-text);
    font-variant-numeric: tabular-nums;
}

.sb-stat-hint {
    font-size: 0.72rem;
    color: var(--sb-text-muted);
}

.sb-stat.is-accent .sb-stat-value { color: var(--sb-blue); }
.sb-stat.is-success .sb-stat-value { color: var(--sb-green); }
.sb-stat.is-danger .sb-stat-value { color: var(--sb-red); }

@media (max-width: 640px) {
    .sb-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Quiet helper line — replaces boxed instruction cards
   (.casting-guidance-card and friends) so a single sentence of
   guidance no longer competes with real content. */
.sb-note {
    margin: 0 0 1rem;
    padding-left: 0.85rem;
    border-left: 2px solid var(--sb-border-strong);
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--sb-text-muted);
}

.sb-note strong { color: var(--sb-text-soft); font-weight: 600; }

/* ============================================================
   Empty / zero states — ONE shared treatment for "no projects",
   "no results", 404, etc. Centered illustration + heading + copy
   + actions, so every void in the app reads as intentional.
   ============================================================ */
.sb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    max-width: 560px;
    margin: clamp(1.5rem, 7vh, 5rem) auto;
    padding: 2.4rem 2rem;
}

.sb-empty-art {
    width: clamp(150px, 22vw, 220px);
    height: auto;
    margin-bottom: 0.9rem;
}

.sb-empty h1,
.sb-empty h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.45rem, 1.1rem + 1.5vw, 2rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--sb-text);
    margin: 0;
}

.sb-empty h1 em,
.sb-empty h2 em { color: var(--sb-blue); font-style: italic; }

.sb-empty p {
    color: var(--sb-text-muted);
    font-size: 0.96rem;
    line-height: 1.6;
    margin: 0.4rem 0 1.4rem;
    max-width: 46ch;
}

.sb-empty-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
}

.sb-empty-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--sb-text-muted);
}

.sb-empty-note strong { color: var(--sb-text-soft); font-weight: 600; }

/* Reusable buttons for empty/error states (and anywhere needing a clean
   primary/secondary pair that isn't tied to a page's local CSS). */
.sb-btn,
.sb-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0 1.3rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.sb-btn {
    background: var(--sb-blue);
    border: 1px solid var(--sb-blue);
    color: #ffffff;
    box-shadow: var(--sb-shadow-blue);
}
.sb-btn:hover {
    background: var(--sb-blue-strong);
    border-color: var(--sb-blue-strong);
    color: #ffffff;
    transform: translateY(-1px);
}
.sb-btn-ghost {
    background: var(--sb-surface);
    border: 1px solid var(--sb-border-strong);
    color: var(--sb-text-soft);
}
.sb-btn-ghost:hover {
    border-color: var(--sb-blue);
    color: var(--sb-blue);
}
/* A disabled button must LOOK disabled. Without this a blocked primary action
   renders fully saturated and invites a click that does nothing. */
.sb-btn:disabled,
.sb-btn-ghost:disabled,
.sb-btn[aria-disabled="true"],
.sb-btn-ghost[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}
.sb-btn:disabled:hover,
.sb-btn-ghost:disabled:hover,
.sb-btn[aria-disabled="true"]:hover,
.sb-btn-ghost[aria-disabled="true"]:hover {
    transform: none;
    background: var(--sb-blue);
    border-color: var(--sb-blue);
}
.sb-btn-ghost:disabled:hover,
.sb-btn-ghost[aria-disabled="true"]:hover {
    background: var(--sb-surface);
    border-color: var(--sb-border-strong);
    color: var(--sb-text-soft);
}

/* Cookie-consent banner (analytics opt-in; pairs with _consent_banner.html) */
.sb-consent {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    display: flex;
    justify-content: center;
}
.sb-consent-inner {
    max-width: 720px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--sb-surface, #fff);
    border: 1px solid var(--sb-border-strong, #e3e8f0);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(20, 30, 60, .14);
    padding: 14px 18px;
}
.sb-consent-text {
    flex: 1 1 320px;
    margin: 0;
    font-size: .88rem;
    line-height: 1.5;
    color: var(--sb-text-soft, #2a2f3a);
}
.sb-consent-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}
@media (max-width: 520px) {
    .sb-consent-actions { width: 100%; }
    .sb-consent-actions .sb-btn,
    .sb-consent-actions .sb-btn-ghost { flex: 1; }
}

/* Inline / panel-level empty placeholders — ONE calm look for "no match",
   "no saved boards", "no cast in view", etc. (the small in-page voids, not
   the full-page .sb-empty hero). Visual props only — display is left to the
   element/[hidden]/JS so toggled placeholders still hide correctly.
   !important so it unifies the per-page definitions without editing each. */
.sb-empty-inline,
.review-empty,
.sequence-empty,
.workspace-empty,
.casting-empty-state {
    text-align: center !important;
    color: var(--sb-text-muted) !important;
    font-size: 0.85rem !important;
    font-style: normal !important;
    line-height: 1.55 !important;
    padding: 1.25rem !important;
    border: 1px dashed var(--sb-border-strong) !important;
    border-radius: 12px !important;
    background: var(--sb-surface-soft) !important;
}
.sb-empty-inline strong,
.review-empty strong,
.sequence-empty strong,
.workspace-empty strong,
.casting-empty-state strong {
    color: var(--sb-text-soft) !important;
    font-weight: 600 !important;
}

/* ============================================================================
   GLOBAL SKELETON SYSTEM
   One shimmer animation + a small set of shape primitives, used by every
   loading state so they're cohesive. Pages compose these into context-shaped
   placeholders (a gallery skeletons cards; a list skeletons rows) — same motion,
   different silhouette. See frontend/src/ui/Skeleton.tsx.
   ============================================================================ */
@keyframes sb-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.sb-skeleton {
    display: block;
    background: linear-gradient(
        100deg,
        var(--surface-subtle, #f1f6fd) 30%,
        var(--surface-muted, #e7eff9) 50%,
        var(--surface-subtle, #f1f6fd) 70%
    );
    background-size: 200% 100%;
    animation: sb-shimmer 1.5s var(--ease-in-out, ease-in-out) infinite;
    border-radius: var(--radius-md, 12px);
}

.sb-skeleton--text   { height: 0.8rem; border-radius: 6px; }
.sb-skeleton--title  { height: 1.5rem; border-radius: 8px; }
.sb-skeleton--card   { border-radius: var(--radius-lg, 16px); aspect-ratio: 16 / 10; }
.sb-skeleton--thumb  { border-radius: var(--radius-md, 12px); aspect-ratio: 16 / 9; }
.sb-skeleton--circle { border-radius: 50%; }
.sb-skeleton--pill   { height: 2.2rem; border-radius: 999px; }
.sb-skeleton--block  { height: 100%; }

@media (prefers-reduced-motion: reduce) {
    .sb-skeleton { animation: none; }
}

/* App-wide reduced-motion guard: kill non-essential motion + transforms for
   users who ask for it, without each component having to remember. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Smooth focus on form fields app-wide — replaces the instant outline snap. */
input,
textarea,
select {
    transition: border-color var(--duration-fast, 140ms) var(--ease-out, ease),
                box-shadow var(--duration-fast, 140ms) var(--ease-out, ease);
}

/* Tonal variants for .sb-note (React <Note tone>). The base note is a bare
   left-rule paragraph; once a tone adds a background the text needs breathing
   room on every side, and a rounded edge so it reads as a card, not a smear. */
.sb-note--warning,
.sb-note--danger {
    padding: 0.7rem 0.95rem;
    border-radius: 10px;
}
.sb-note--warning {
    color: var(--warning, #a16207) !important;
    background: rgba(161, 98, 7, 0.08) !important;
    border-color: rgba(161, 98, 7, 0.28) !important;
}
.sb-note--danger {
    color: var(--error, #b42318) !important;
    background: rgba(180, 35, 24, 0.08) !important;
    border-color: rgba(180, 35, 24, 0.28) !important;
}

/* A note that carries its remedy (React <Note actions>): message + real
   buttons in ONE block, so a warning is never a text blob with its fix
   floating somewhere else. */
.sb-note-body {
    margin: 0;
}
.sb-note-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
}

/* Pending-count badge on the admin "Invites" nav link — at-a-glance signal that
   new waitlist requests are awaiting review. */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent-primary, #1f5eff);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
