@font-face {
    font-family: "Cover Montserrat";
    src: url("/assets/fonts/Montserrat.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Montserrat";
    src: url("/assets/fonts/Montserrat-Italic.ttf") format("truetype");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Lora";
    src: url("/assets/fonts/Lora.ttf") format("truetype");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Lora";
    src: url("/assets/fonts/Lora-Italic.ttf") format("truetype");
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Playfair Display";
    src: url("/assets/fonts/PlayfairDisplay.ttf") format("truetype");
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Playfair Display";
    src: url("/assets/fonts/PlayfairDisplay-Italic.ttf") format("truetype");
    font-weight: 400 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Quicksand";
    src: url("/assets/fonts/Quicksand.ttf") format("truetype");
    font-weight: 300 700;
    font-display: swap;
}

@font-face {
    font-family: "Cover Source Serif 4";
    src: url("/assets/fonts/SourceSerif4-Light.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Source Serif 4";
    src: url("/assets/fonts/SourceSerif4-LightItalic.otf") format("opentype");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Source Serif 4";
    src: url("/assets/fonts/SourceSerif4-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Source Serif 4";
    src: url("/assets/fonts/SourceSerif4-Italic.otf") format("opentype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Source Serif 4";
    src: url("/assets/fonts/SourceSerif4-Semibold.otf") format("opentype");
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Source Serif 4";
    src: url("/assets/fonts/SourceSerif4-SemiboldItalic.otf") format("opentype");
    font-weight: 600 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Inter";
    src: url("/assets/fonts/Inter-Light.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Inter";
    src: url("/assets/fonts/Inter-LightItalic.otf") format("opentype");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Inter";
    src: url("/assets/fonts/Inter-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Inter";
    src: url("/assets/fonts/Inter-Italic.otf") format("opentype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Inter";
    src: url("/assets/fonts/Inter-SemiBold.otf") format("opentype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Inter";
    src: url("/assets/fonts/Inter-SemiBoldItalic.otf") format("opentype");
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Cover Inter";
    src: url("/assets/fonts/Inter-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cover Inter";
    src: url("/assets/fonts/Inter-BoldItalic.otf") format("opentype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

.cover-logo-preview {
    width: 120px;
    height: 64px;
    object-fit: contain;
    object-position: left center;
    padding: .5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background: #182130;
}

.cover-designer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, .85fr);
    gap: 1.5rem;
    padding: 0 1.5rem 1.5rem;
    align-items: start;
}

.cover-designer-page-grid {
    display: grid;
    grid-template-columns: minmax(360px, .8fr) minmax(520px, 1.35fr);
    gap: 1.5rem;
    align-items: start;
}

.cover-designer-controls {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1rem;
}

.cover-designer-preview-column {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    min-width: 0;
}

.cover-preview-stage {
    --cover-dim: .48;
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: .75rem;
    background: #070b13;
    color: #f8f9fc;
    box-shadow: 0 16px 42px rgb(2 8 23 / 24%);
    font-family: "Cover Lora", serif;
    container-type: inline-size;
}

.project-cover-preview {
    width: min(100%, 760px);
}

.cover-preview-fallback {
    background:
        radial-gradient(circle at 76% 28%, rgb(244 204 137 / 55%), transparent 24%),
        linear-gradient(145deg, #183a4a, #18243c 56%, #3f3150);
}

.cover-preview-background,
.cover-preview-dim,
.cover-preview-content {
    position: absolute;
    inset: 0;
}

.cover-preview-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-preview-dim {
    background: rgb(3 8 18 / var(--cover-dim));
}

.cover-preview-content {
    padding: 0;
}

.cover-preview-logo {
    position: absolute;
    top: var(--cover-logo-y, 3.75cqw);
    left: var(--cover-logo-x, 5.625cqw);
    width: min(var(--cover-logo-size, 20.3125cqw), 42%);
    height: min(calc(var(--cover-logo-size, 20.3125cqw) * .354), 22%);
    object-fit: contain;
    object-position: left center;
    margin-bottom: 5%;
}

.cover-preview-copy {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    text-shadow: 0 3px 16px rgb(0 0 0 / 55%);
}

.cover-preview-copy strong {
    position: absolute;
    top: var(--cover-title-y, 16.40625cqw);
    left: var(--cover-title-x, 5.625cqw);
    width: min(var(--cover-title-width, 88.75cqw), calc(100% - var(--cover-title-x, 5.625cqw)));
    font-size: var(--cover-title-size, 6.09375cqw);
    line-height: 1.18;
    letter-spacing: var(--cover-title-spacing, 0);
}

.cover-title-stylized .cover-preview-copy::before {
    position: absolute;
    top: var(--cover-title-y, 16.40625cqw);
    left: var(--cover-title-x, 5.625cqw);
    width: max(2px, .3125cqw);
    height: calc(
        var(--cover-subtitle-y, 39.0625cqw)
        - var(--cover-title-y, 16.40625cqw)
        + var(--cover-subtitle-size, 2.34375cqw)
        + 1cqw
    );
    border-radius: 999px;
    background: #a58960;
    content: "";
}

.cover-title-stylized .cover-preview-copy strong {
    left: calc(var(--cover-title-x, 5.625cqw) + 3.28125cqw);
    width: min(
        calc(var(--cover-title-width, 88.75cqw) - 3.28125cqw),
        calc(100% - var(--cover-title-x, 5.625cqw) - 3.28125cqw)
    );
}

.cover-title-stylized [data-cover-title-word]:nth-of-type(even) {
    color: rgb(248 249 252 / 70%);
    font-style: italic;
}

.cover-preview-copy > span {
    position: absolute;
    top: var(--cover-subtitle-y, 39.0625cqw);
    left: var(--cover-subtitle-x, 5.625cqw);
    width: calc(100% - var(--cover-subtitle-x, 5.625cqw) - 5.625cqw);
    color: #e0e5ee;
    font-size: var(--cover-subtitle-size, 2.34375cqw);
    letter-spacing: var(--cover-subtitle-spacing, .234375cqw);
}

.cover-title-stylized .cover-preview-copy > span {
    left: calc(var(--cover-subtitle-x, 5.625cqw) + 3.28125cqw);
    width: calc(100% - var(--cover-subtitle-x, 5.625cqw) - 3.28125cqw - 5.625cqw);
}

.cover-preview-content > small {
    position: absolute;
    top: var(--cover-cta-y, 49.21875cqw);
    left: var(--cover-cta-x, 5.625cqw);
    width: calc(100% - var(--cover-cta-x, 5.625cqw) - 5.625cqw);
    color: #fff;
    font-size: var(--cover-cta-size, 1.796875cqw);
    letter-spacing: var(--cover-cta-spacing, .15625cqw);
}

.cover-preview-note {
    margin: .65rem 0 0;
    font-size: .78rem;
}

.cover-designer-form .notice {
    margin: 0;
}

.cover-control-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.cover-position-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}

@media (max-width: 900px) {
    .cover-designer-grid {
        grid-template-columns: 1fr;
    }

    .cover-designer-page-grid {
        grid-template-columns: 1fr;
    }

    .cover-designer-preview-column {
        position: static;
        grid-row: 1;
    }
}

@media (max-width: 520px) {
    .cover-control-pair {
        grid-template-columns: 1fr;
    }

    .cover-position-grid {
        grid-template-columns: 1fr;
    }
}
:root {
    --bg: #f4f5f2;
    --surface: #ffffff;
    --surface-subtle: #f8f9f7;
    --ink: #18211d;
    --muted: #66716b;
    --line: #dfe4df;
    --line-strong: #cbd3cc;
    --brand: #315f4d;
    --brand-dark: #214739;
    --brand-soft: #e4eee8;
    --accent: #a7743c;
    --danger: #a64242;
    --danger-soft: #f8e9e7;
    --warning: #8f671f;
    --warning-soft: #faf0d8;
    --success: #26704f;
    --success-soft: #e4f2ea;
    --shadow: 0 10px 30px rgba(27, 45, 36, .06);
    --radius: 14px;
    --radius-small: 9px;
    --bs-primary: #315f4d;
    --bs-primary-rgb: 49, 95, 77;
    --bs-body-color: #18211d;
    --bs-body-bg: #f4f5f2;
    --bs-secondary-color: #66716b;
    --bs-border-color: #dfe4df;
    --bs-border-radius: 9px;
    --bs-border-radius-lg: 14px;
    --bs-font-sans-serif: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }
button, summary, select { cursor: pointer; }
code, .code-input, .json-view {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 248px;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 14px;
    background: #17251f;
    color: #dfe9e3;
    border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    background: linear-gradient(145deg, #7ba58d, #315f4d);
    color: white;
    font-family: Georgia, serif;
    font-size: 22px;
    box-shadow: inset 0 1px rgba(255,255,255,.25);
}
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.brand strong { letter-spacing: .01em; }
.brand small { color: #9fb0a7; font-size: 11px; }
.sidebar > .brand { padding: 0 9px 15px; }
.project-switcher {
    margin: 0 4px 8px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    background: rgba(255,255,255,.035);
}
.project-switcher label {
    margin-bottom: 5px;
    color: #8fa097;
    font-size: 9px;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.project-switcher .form-select {
    min-height: 36px;
    border-color: rgba(255,255,255,.12);
    background-color: #21342b;
    color: #edf7f1;
    font-size: 12px;
    font-weight: 700;
}
.project-switcher .form-select:focus {
    border-color: #719984;
    box-shadow: 0 0 0 3px rgba(113,153,132,.18);
}
.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-color: rgba(142,177,158,.45) transparent;
    scrollbar-width: thin;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(142,177,158,.35);
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(142,177,158,.6); }
.project-tab-nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 9px;
    color: #b9c8c0;
    font-size: 14px;
    transition: .16s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.055); color: white; }
.sidebar-nav a.active { background: rgba(129, 170,147,.16); color: #edf7f1; }
.nav-icon { width: 18px; color: #8eb19e; font-size: 16px; text-align: center; }
.nav-label {
    padding: 20px 11px 7px;
    color: #72867b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.nav-spacer { flex: 1; }
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #89948e;
}
.status-dot.active, .status-dot.completed, .status-dot.published, .status-dot.approved { background: #55b985; box-shadow: 0 0 0 3px rgba(85,185,133,.12); }
.status-dot.paused, .status-dot.queued, .status-dot.warning { background: #d5a24a; }
.status-dot.failed, .status-dot.rejected, .status-dot.error { background: #d36565; }
.status-dot.draft, .status-dot.archived { background: #89948e; }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 15px;
    padding: 11px 8px 3px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2c4238;
    color: white;
    font-weight: 700;
}
.user-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy small { color: #8fa097; font-size: 10px; }
.main { width: calc(100% - 248px); min-width: 0; margin-left: 248px; padding: 38px clamp(24px, 4vw, 58px) 70px; }
.mobile-header { display: none; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto 28px;
    max-width: 1540px;
}
.page-head h1 { margin: 2px 0 3px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 3vw, 43px); font-weight: 500; letter-spacing: -.025em; line-height: 1.15; }
.page-head p { max-width: 780px; margin: 4px 0 0; }
.eyebrow { margin: 0 0 4px !important; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted); }
.title-row, .actions, .inline-form, .filter-bar { display: flex; align-items: center; gap: 10px; }
.actions { flex-wrap: wrap; justify-content: flex-end; }
.actions form { margin: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; color: var(--muted); font-size: 12px; list-style: none; }
.breadcrumb a:hover { color: var(--brand); }

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 650;
}
.btn-sm { min-height: 32px; border-radius: 7px; font-size: 11px; }
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
}
.btn-outline-secondary {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface-subtle);
    --bs-btn-hover-border-color: #9eaaa2;
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--surface-subtle);
}
.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius);
    background: var(--surface);
}
.shadow-sm { box-shadow: var(--shadow) !important; }
.icon-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
}
.icon-button:hover { background: rgba(127,127,127,.12); }
.icon-button.danger { color: var(--danger); }
.text-link { color: var(--brand); font-size: 13px; font-weight: 700; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.panel {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.panel.lower, .lower { margin-top: 22px; }
.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 17px; }
.panel-head p { margin: 3px 0 0; font-size: 12px; }
.panel.callout { background: linear-gradient(140deg, #f3f8f5, #fff); }
.panel.callout h2 { margin: 3px 0 8px; font-family: Georgia, serif; font-weight: 500; }
.panel.callout > p:not(.eyebrow) { color: #4e5f56; }

.metric-grid {
    display: grid;
    max-width: 1540px;
    margin: 0 auto 22px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.dashboard-stack {
    display: flex;
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    flex-direction: column;
    gap: 24px;
}
.dashboard-stack > .row {
    max-width: none;
    margin: 0 calc(-.5 * var(--bs-gutter-x));
}
.metric-card {
    min-width: 0;
    padding: 19px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.metric-card > span { display: block; }
.metric-card strong { display: block; margin: 4px 0 2px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.metric-card small { color: var(--muted); font-size: 11px; }
.metric-label { color: #526159; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.compact-metrics { margin-bottom: 20px; }
.compact-metrics .metric-card { padding: 16px 18px; }

.split-grid { display: grid; max-width: 1540px; margin: 0 auto; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr); gap: 22px; }
.grow { min-width: 0; flex: 1; }
.project-list, .compact-list, .failure-list, .asset-mini-list, .token-list { display: flex; flex-direction: column; }
.project-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 5px;
    border-top: 1px solid var(--line);
}
.project-row:first-child { border-top: 0; }
.project-row:hover strong { color: var(--brand); }
.project-row .grow, .compact-list .grow, .asset-mini-list .grow, .token-list .grow { display: flex; min-width: 0; flex-direction: column; }
.project-row small, .compact-list small, .asset-mini-list small, .token-list small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.project-count { color: var(--muted); font-size: 11px; }
.project-glyph, .profile-icon {
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 800;
}
.compact-list > div { display: flex; align-items: center; gap: 11px; padding: 10px 1px; border-top: 1px solid var(--line); }
.compact-list > div:first-child { border-top: 0; }
.failure-list article { padding: 12px 1px; border-top: 1px solid var(--line); }
.failure-list article:first-child { border-top: 0; }
.failure-list article > div { display: flex; justify-content: space-between; margin-bottom: 6px; }
.failure-list article > strong { font-size: 13px; }
.failure-list article p { overflow: hidden; margin: 3px 0 0; color: var(--danger); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf0ed;
    color: #59635d;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .055em;
    line-height: 1;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}
.badge.active, .badge.completed, .badge.approved, .badge.published, .badge.success, .badge.ready { background: var(--success-soft); color: var(--success); }
.badge.paused, .badge.queued, .badge.running, .badge.moderating, .badge.revision, .badge.media, .badge.review, .badge.warning, .badge.uploading { background: var(--warning-soft); color: var(--warning); }
.badge.failed, .badge.rejected, .badge.error, .badge.cancelled { background: var(--danger-soft); color: var(--danger); }
.badge.neutral, .badge.draft, .badge.archived { background: #edf0ed; color: #59635d; }

.table-wrap { width: 100%; overflow: auto; }
.table-wrap.tall { max-height: 720px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
    padding: 8px 10px;
    color: #758078;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: top; }
td > small, td > a + small, td > strong + small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
td a:hover { color: var(--brand); }
.error-cell { max-width: 260px; color: var(--danger); }
.stage-pill { padding: 4px 7px; border-radius: 6px; background: #eef1ef; color: #4c5952; font-size: 10px; text-transform: capitalize; white-space: nowrap; }

.empty { padding: 55px 20px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 4px; color: var(--ink); }
.empty p { margin: 3px 0; }
.empty.compact { padding: 25px 14px; }
.success-state { border-radius: 10px; background: var(--success-soft); color: #4c6c5b; }

.tabs {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    max-width: 1540px;
    margin: 0 auto 24px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line-strong);
    background: rgba(244,245,242,.94);
    backdrop-filter: blur(10px);
}
.tabs a { padding: 12px 15px 10px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tabs a:hover, .tabs a.active { border-bottom-color: var(--brand); color: var(--brand); }
.tab-section { display: none; max-width: 1540px; margin: 0 auto; scroll-margin-top: 72px; }
.tab-section.active { display: block; animation: reveal .18s ease; }
@keyframes reveal { from { opacity: .25; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 4px 0 19px;
}
.section-head h2 { margin: 1px 0 3px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.section-head p { margin: 0; }

.stack { display: flex; flex-direction: column; gap: 15px; }
label { display: flex; flex-direction: column; gap: 6px; color: #3f4a44; font-size: 11px; font-weight: 700; }
label > span small { color: var(--muted); font-weight: 500; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.form-control):not(.form-check-input),
select:not(.form-select),
textarea:not(.form-control) {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    outline: none;
    background: white;
    color: var(--ink);
    font-size: 13px;
    font-weight: 450;
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.form-control):not(.form-check-input):focus,
select:not(.form-select):focus,
textarea:not(.form-control):focus { border-color: #6c9480; box-shadow: 0 0 0 3px rgba(66,117,91,.1); }
input[type="checkbox"]:not(.form-check-input), input[type="radio"]:not(.form-check-input) {
    width: 17px;
    height: 17px;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 17px;
    accent-color: var(--brand);
}
input[type="file"]:not(.form-control) { padding: 12px; background: var(--surface-subtle); }
.form-label { margin-bottom: 6px; color: #3f4a44; font-size: 11px; font-weight: 700; }
.form-control, .form-select {
    min-height: 40px;
    border-color: var(--line-strong);
    border-radius: 8px;
    color: var(--ink);
    font-size: 13px;
}
.form-control:focus, .form-select:focus {
    border-color: #6c9480;
    box-shadow: 0 0 0 3px rgba(66,117,91,.1);
}
.form-check-label { display: inline-block; color: var(--ink); font-size: 13px; }
.form-check-input:checked { border-color: var(--brand); background-color: var(--brand); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.form-actions.align-end { align-items: flex-end; }
.form-divider { height: 1px; background: var(--line); }
.form-pad { padding: 18px 2px 3px; }
.compact-field { flex-direction: row; align-items: center; }
.compact-field input { width: 65px; }

.concept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.concept-card, .accordion > details, .editor-drawer {
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
    box-shadow: 0 5px 18px rgba(27,45,36,.035);
}
.concept-card > summary, .accordion > details > summary, .profile-card > summary {
    display: flex;
    min-height: 75px;
    align-items: center;
    gap: 11px;
    padding: 15px;
    list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; }
.concept-card summary .grow { display: flex; flex-direction: column; }
.concept-card summary small, .accordion summary small, .profile-card summary small { color: var(--muted); font-size: 10px; font-weight: 500; }
.concept-card[open], .accordion details[open], .profile-card[open] { grid-column: span 2; }
.concept-card[open] > summary, .accordion details[open] > summary, .profile-card[open] > summary { border-bottom: 1px solid var(--line); }
.new-card { border-style: dashed; }

.variable-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.variable-list { display: flex; flex-direction: column; gap: 14px; }
.variable-card { overflow: hidden; border-color: var(--line); }
.variable-card > summary {
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    list-style: none;
}
.variable-card > summary .grow { display: flex; min-width: 0; flex-direction: column; }
.variable-card > summary small { margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.variable-card[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.variable-card > .card-body { padding: 24px; }
.variable-form { display: flex; max-width: 860px; flex-direction: column; gap: 20px; }
.variable-rules {
    display: grid;
    overflow: hidden;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 10px;
}
.variable-rules .form-check {
    min-height: 66px;
    margin: 0;
    padding: 13px 14px 12px 48px;
}
.variable-rules .form-check + .form-check { border-left: 1px solid var(--line); }
.variable-rules .form-check-input { margin-left: -34px; }
.variable-rules label { display: flex; flex-direction: column; }
.variable-rules label small,
.answer-limits-title small,
.variable-danger small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.answer-limits {
    padding: 16px;
    border-radius: 10px;
    background: var(--surface-subtle);
}
.answer-limits-title { display: flex; margin-bottom: 12px; flex-direction: column; }
.choice-editor {
    max-width: 980px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.choice-editor-head { margin-bottom: 12px; }
.choice-editor-head h4 { margin: 0; font-size: 16px; }
.choice-editor-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.choice-enabled { margin: 2px 0 0; }
.variable-danger {
    display: flex;
    max-width: 980px;
    margin-top: 28px;
    padding-top: 20px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
}
.variable-danger > div { display: flex; flex-direction: column; }
.switch-card {
    min-height: 62px;
    margin: 0;
    padding: 11px 12px 11px 48px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-subtle);
}
.switch-card .form-check-input { margin-left: -34px; }
.switch-card label { display: flex; flex-direction: column; }
.switch-card label small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 400; }
.option-editor-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.option-editor { display: block; padding: 14px; background: var(--surface); }
.option-editor + .option-editor { border-top: 1px solid var(--line); }
.option-editor-new { background: var(--surface-subtle); }
.option-switch { min-height: 40px; display: flex; align-items: center; margin: 0; padding: 9px 8px 8px 40px; border: 1px solid var(--line-strong); border-radius: 8px; }
.option-switch .form-check-input { margin-left: -30px; }
.binding-fields, .condition-builder {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-subtle);
}
.binding-fields legend, .condition-builder legend { float: none; width: auto; margin: 0; padding: 0 4px; font-size: 12px; font-weight: 800; }
.binding-fields > p { margin: 0 0 12px; font-size: 10px; }
.rule-condition { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.option-group { min-width: 0; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.option-group legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 800; }
.option-group > p { margin: -3px 0 12px; color: var(--muted); font-size: 10px; }
.check-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 5px;
    border-top: 1px solid #edf0ed;
    cursor: pointer;
}
.check-row:first-of-type { border-top: 0; }
.check-row input { margin-top: 2px; }
.check-row > span { display: flex; min-width: 0; flex-direction: column; }
.check-row strong { font-size: 11px; }
.check-row small { color: var(--muted); font-size: 9px; font-weight: 450; }
.compact-check { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.horizontal-options { display: flex; flex-wrap: wrap; gap: 8px; }
.horizontal-options legend { width: 100%; }
.chip-check { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; margin: 0; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip-check:has(input:checked) { border-color: #89a998; background: var(--brand-soft); color: var(--brand); }
.chip-check input {
    width: 14px;
    height: 14px;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex-basis: 14px;
}
.selection-card { min-width: 0; overflow: hidden; border-color: var(--line); box-shadow: none; }
.selection-card > legend.card-header {
    float: none;
    display: flex;
    width: 100%;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
    font-size: 14px;
    font-weight: 800;
}
.selection-card > legend small { color: var(--muted); font-size: 9px; font-weight: 600; }
.selection-options { display: flex; flex-direction: column; gap: 7px; }
.selection-options > .form-control + .form-control { margin-top: 2px; }
.option-choice {
    display: grid;
    min-width: 0;
    grid-template-columns: 19px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}
.option-choice:hover { border-color: #aebbb3; background: var(--surface-subtle); }
.option-choice:has(.form-check-input:checked) { border-color: #89a998; background: var(--brand-soft); }
.option-choice .form-check-input { margin: 2px 0 0; }
.option-choice > span { display: flex; min-width: 0; flex-direction: column; }
.option-choice strong { color: var(--ink); font-size: 12px; }
.option-choice small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 450; line-height: 1.4; }
.duration-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.option-choice-compact { align-items: center; }

.accordion { display: flex; flex-direction: column; gap: 10px; }
.accordion > details > summary { min-height: 62px; }
.accordion > details[open] { grid-column: auto; }
.code-input { font-size: 11px; tab-size: 2; }
.research-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.research-list .panel { width: 100%; margin: 0; }
.research-list h3 { font-size: 14px; line-height: 1.35; }
.research-details { display: flex; flex-direction: column; margin: 0 0 14px; }
.research-details > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.research-details dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.research-details dd { margin: 0; font-size: 11px; }

.policy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.policy-card { width: 100%; margin: 0; }
.pipeline-card { border-color: var(--line); }
.concept-count { width: 74px; }
.split-grid > *, .policy-grid > *, .concept-grid > * { min-width: 0; }
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.toggle-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.toggle-row > span { display: flex; flex-direction: column; }
.toggle-row > span small { color: var(--muted); font-size: 9px; }
.toggle-row.contained { min-height: 51px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.toggle-row input[type="checkbox"] { width: 33px; height: 19px; min-height: 19px; appearance: none; border: 0; border-radius: 999px; background: #cbd2cd; transition: .15s; }
.toggle-row input[type="checkbox"]::after { display: block; width: 15px; height: 15px; margin: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.18); content: ""; transition: .15s; }
.toggle-row input[type="checkbox"]:checked { background: var(--brand); }
.toggle-row input[type="checkbox"]:checked::after { transform: translateX(14px); }
.settings-group { padding: 5px 0 22px; border-bottom: 1px solid var(--line); }
.settings-group:last-of-type { border-bottom: 0; }
.settings-group h3 { margin: 0 0 13px; font-size: 15px; }
.settings-group > label, .settings-group > .field-grid { margin-top: 13px; }

.notice { padding: 12px 14px; border: 1px solid #d9e3dc; border-radius: 9px; background: #f3f7f4; color: #47574e; font-size: 11px; }
.notice strong { color: var(--ink); }
.notice p { margin: 3px 0 0; }
.batch-layout { grid-template-columns: minmax(0, 1.6fr) minmax(280px, .55fr); }
.sticky-panel { position: sticky; top: 68px; align-self: start; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-subtle); font-size: 10px; white-space: nowrap; }
.tag small { color: var(--muted); font-size: 8px; text-transform: uppercase; }

.batch-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.batch-cards article { padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.batch-cards article > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.batch-cards article small { color: var(--muted); font-size: 10px; }
.progress { display: block; height: 6px; margin: 11px 0 7px; overflow: hidden; border-radius: 999px; background: #e7ebe8; }
.progress > span, .progress > .progress-bar { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brand); }

.stage-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 20px;
}

.story-timeline { margin-top: 20px; }
.milestone-timeline {
    display: grid;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    list-style: none;
}
.milestone {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    flex-direction: column;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}
.milestone::before {
    position: absolute;
    z-index: 0;
    top: 15px;
    right: 50%;
    left: -50%;
    height: 2px;
    background: var(--line);
    content: "";
}
.milestone:first-child::before { display: none; }
.milestone-dot {
    display: inline-grid;
    z-index: 1;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
}
.milestone.completed::before,
.milestone.succeeded::before,
.milestone.completed .milestone-dot,
.milestone.succeeded .milestone-dot { border-color: var(--success); background: var(--success); color: white; }
.milestone.completed::before,
.milestone.succeeded::before { background: var(--success); }
.milestone.running .milestone-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.milestone.queued .milestone-dot,
.milestone.ready .milestone-dot { border-color: var(--brand); color: var(--brand); }
.milestone.paused .milestone-dot,
.milestone.waiting_retry .milestone-dot,
.milestone.waiting_approval .milestone-dot { border-color: var(--warning); color: var(--warning); }
.milestone.cancelled .milestone-dot { border-color: var(--muted); background: var(--surface-subtle); color: var(--muted); }
.milestone.failed .milestone-dot,
.milestone.waiting_input .milestone-dot { border-color: var(--danger); background: var(--danger); color: white; }
.milestone strong { overflow: hidden; max-width: 100%; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.milestone-controls { display: flex; min-height: 31px; align-items: center; justify-content: center; gap: 4px; }
.milestone-controls form { margin: 0; }
.milestone-controls .btn { display: inline-grid; width: 28px; height: 28px; padding: 0; place-items: center; }

@media (max-width: 900px) {
    .milestone-timeline {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .milestone {
        align-items: center;
        flex-direction: row;
        text-align: left;
    }
    .milestone::before {
        top: -10px;
        bottom: auto;
        left: 14px;
        width: 2px;
        height: 20px;
    }
    .milestone strong { min-width: 90px; }
    .milestone-controls { margin-left: auto; }
}

.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.story-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: .18s ease; }
.story-card:hover { transform: translateY(-2px); border-color: #aebbb3; box-shadow: 0 10px 24px rgba(27,45,36,.08); }
.story-cover-placeholder { display: grid; position: relative; width: 100%; height: auto; aspect-ratio: 16 / 9; place-items: center; background: radial-gradient(circle at 40% 35%, #71947f, #2e5444 58%, #1e3a2f); color: white; }
.story-cover-placeholder img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.story-card:hover .story-cover-placeholder.has-cover img { transform: scale(1.025); }
.story-cover-placeholder > span { font-family: Georgia, serif; font-size: 45px; opacity: .72; }
.story-cover-placeholder small { position: absolute; right: 10px; bottom: 9px; padding: 3px 7px; border-radius: 999px; background: rgba(0,0,0,.45); font-size: 9px; backdrop-filter: blur(5px); }
.story-card-body { padding: 15px; }
.story-card-body > div { display: flex; justify-content: space-between; }
.story-card-body h2 { margin: 10px 0 6px; font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.story-card-body p { display: -webkit-box; min-height: 42px; margin: 0 0 15px; overflow: hidden; color: var(--muted); font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.story-card-body footer { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.score-bubble { position: absolute; top: 10px; right: 10px; display: grid; width: 35px; height: 35px; place-items: center; border: 2px solid rgba(255,255,255,.8); border-radius: 50%; background: rgba(23,44,35,.75); color: white; font-size: 11px; font-weight: 800; backdrop-filter: blur(5px); }

.story-summary-bar { display: grid; max-width: 1540px; margin: 0 auto 20px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); grid-template-columns: repeat(6, 1fr); }
.story-summary-bar > div { padding: 3px 15px; border-left: 1px solid var(--line); }
.story-summary-bar > div:first-child { border-left: 0; }
.story-summary-bar span, .story-summary-bar strong { display: block; text-align: center; }
.story-summary-bar span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.story-summary-bar strong { margin-top: 2px; font-size: 13px; }
.story-layout { display: grid; max-width: 1540px; margin: 0 auto; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; }
.story-main, .story-aside { display: flex; min-width: 0; flex-direction: column; gap: 20px; }
.story-aside .panel { width: 100%; margin: 0; padding: 17px; box-shadow: none; }
.story-aside .panel-head { margin-bottom: 12px; }
.story-metadata-grid { display: grid; max-width: 1540px; margin: 0 auto 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.story-metadata-grid .panel { min-width: 0; margin: 0; }
.story-metadata-fields { display: flex; flex-direction: column; }
.story-metadata-field { padding: 12px 0; border-top: 1px solid var(--line); }
.story-metadata-field:first-child { padding-top: 0; border-top: 0; }
.story-metadata-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.story-metadata-field p { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.6; }
.media-panel video { display: block; width: 100%; max-height: 720px; border-radius: 9px; background: #101512; }
.media-panel audio { width: 100%; }
.story-prose { max-width: 760px; margin: 5px auto 25px; color: #25312b; font-family: Georgia, serif; font-size: 17px; line-height: 1.9; }
.editor-drawer { margin-top: 15px; }
.editor-drawer > summary { padding: 12px 14px; color: var(--brand); font-size: 12px; font-weight: 700; }
.editor-drawer[open] > summary { border-bottom: 1px solid var(--line); }
.planning-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.planning-detail-grid details { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); }
.planning-detail-grid summary { padding: 12px 14px; color: var(--ink); font-weight: 700; cursor: pointer; }
.planning-detail-grid pre { max-height: 440px; margin: 0; padding: 14px; overflow: auto; border-top: 1px solid var(--line); color: var(--ink); font-size: 11px; white-space: pre-wrap; }
@media (max-width: 900px) {
    .planning-detail-grid { grid-template-columns: 1fr; }
    .story-metadata-grid { grid-template-columns: 1fr; }
}
.review-list { display: flex; flex-direction: column; gap: 14px; }
.review-list article { padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.review-list header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.score-grid div { padding: 8px; border-radius: 7px; background: var(--surface-subtle); }
.score-grid span, .score-grid strong { display: block; }
.score-grid span { color: var(--muted); font-size: 8px; text-transform: capitalize; }
.score-grid strong { margin-top: 2px; font-size: 13px; }
.finding-list { margin: 12px 0 0; padding: 0; list-style: none; }
.finding-list li { padding: 8px 10px; border-left: 3px solid #aab4ae; background: #f6f7f6; font-size: 11px; }
.finding-list li + li { margin-top: 6px; }
.finding-list li.blocking { border-color: var(--danger); background: var(--danger-soft); }
.finding-list li.warning { border-color: #d59b38; background: var(--warning-soft); }
.finding-list blockquote { margin: 5px 0 0; color: #59625d; font-style: italic; }
.image-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.image-strip a { position: relative; overflow: hidden; border-radius: 8px; background: #dde3df; aspect-ratio: 16 / 10; }
.image-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.image-strip a:hover img { transform: scale(1.025); }
.image-strip span { position: absolute; right: 5px; bottom: 5px; padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.45); color: white; font-size: 8px; }
.visual-scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.visual-scene-card { display: flex; min-width: 0; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.visual-scene-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.visual-scene-image { display: block; overflow: hidden; border-radius: 9px; aspect-ratio: 16 / 9; background: #dde3df; }
.visual-scene-image img { width: 100%; height: 100%; object-fit: cover; }
.visual-scene-video { display: block; width: 100%; border-radius: 9px; aspect-ratio: 16 / 9; background: #101512; }
.visual-clip-form { margin-top: auto; }
.visual-clip-form textarea { min-height: 180px; resize: vertical; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11px; line-height: 1.45; }
.meta-list { margin: 0; }
.meta-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 10px; }
.meta-list > div:first-child { border-top: 0; }
.meta-list dt { color: var(--muted); text-transform: capitalize; }
.meta-list dd { margin: 0; font-weight: 700; text-align: right; }
.asset-mini-list a, .token-list article { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid var(--line); }
.asset-mini-list a:first-child, .token-list article:first-child { border-top: 0; }
.asset-kind { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 7px; background: #edf1ee; color: #53615a; font-size: 8px; font-weight: 900; }
.json-view { max-height: 500px; overflow: auto; margin: 12px 0 0; padding: 10px; border-radius: 7px; background: #19221e; color: #dfe9e3; font-size: 9px; white-space: pre-wrap; }

.panel-filter { margin-bottom: 18px; }
.filter-bar select { width: auto; min-width: 150px; }
.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.asset-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.asset-preview { display: grid; position: relative; height: 125px; place-items: center; overflow: hidden; background: linear-gradient(145deg, #e8ece9, #d9e2dc); }
.asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-preview .badge { position: absolute; top: 8px; left: 8px; }
.asset-symbol { color: var(--brand); font-family: Georgia, serif; font-size: 38px; opacity: .72; }
.asset-card-body { padding: 12px; }
.asset-card-body > strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-body p { overflow: hidden; margin: 3px 0 10px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-body footer { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }

.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 17px; }
.profile-card { width: 100%; margin: 0; padding: 0; }
.profile-card[open] { grid-column: span 2; }
.inline-test { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.inline-test small { color: var(--muted); }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.secret-reveal { position: relative; margin-bottom: 16px; padding: 17px; border: 1px solid #d4bf83; border-radius: 10px; background: #fff9e8; }
.secret-reveal strong, .secret-reveal code, .secret-reveal p { display: block; }
.secret-reveal code { margin: 9px 0; padding: 10px; overflow: auto; border: 1px dashed #c8a85b; border-radius: 6px; background: #fffdf6; font-size: 11px; }
.secret-reveal p { margin: 4px 0 0; color: #715b29; font-size: 10px; }
.account-card { display: flex; width: 100%; align-items: center; gap: 11px; margin: 0; }

.flash-stack { position: fixed; z-index: 80; top: 18px; right: 22px; display: flex; width: min(430px, calc(100vw - 30px)); flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 14px; border: 1px solid #bdd8c8; border-radius: 9px; background: #edf8f1; color: #23563d; box-shadow: 0 8px 30px rgba(0,0,0,.1); font-size: 12px; }
.flash.error { border-color: #e6c2bd; background: var(--danger-soft); color: var(--danger); }
.flash button { border: 0; background: transparent; color: inherit; font-size: 18px; }

.auth-page { display: grid; min-height: 100vh; padding: 20px; place-items: center; background: radial-gradient(circle at 30% 20%, #e8efe9, #f5f5f1 50%, #e8ebe8); }
.auth-card { display: flex; width: min(430px, 100%); flex-direction: column; gap: 25px; padding: 34px; border: 1px solid rgba(92,113,102,.2); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 24px 80px rgba(30,54,42,.12); }
.auth-brand { margin-bottom: 4px; }
.auth-card h1 { margin: 2px 0 4px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.auth-card p { margin: 0; }
.auth-note { color: var(--muted); font-size: 10px; text-align: center; }
.error-page { display: flex; min-height: 70vh; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.error-page h1 { margin: 3px 0 8px; font-family: Georgia, serif; font-size: 35px; font-weight: 500; }
.error-page p { max-width: 520px; margin: 0 0 20px; color: var(--muted); }
.error-mark { display: grid; width: 55px; height: 55px; margin-bottom: 15px; place-items: center; border-radius: 50%; background: var(--danger-soft); color: var(--danger); font-family: Georgia, serif; font-size: 28px; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .variable-grid, .policy-grid, .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .concept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,.22); }
    .main { width: 100%; margin-left: 0; padding: 78px 18px 50px; }
    .mobile-header { display: flex; position: fixed; z-index: 25; inset: 0 0 auto; height: 55px; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(10px); }
    .page-head { align-items: flex-start; flex-direction: column; }
    .actions { justify-content: flex-start; }
    .split-grid, .batch-layout, .story-layout { grid-template-columns: 1fr; }
    .sticky-panel { position: static; }
    .story-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .story-summary-bar { grid-template-columns: repeat(3, 1fr); }
    .story-summary-bar > div:nth-child(4) { border-left: 0; }
    .story-summary-bar > div:nth-child(n+4) { border-top: 1px solid var(--line); }
    .research-list, .profile-grid { grid-template-columns: 1fr; }
    .profile-card[open], .concept-card[open] { grid-column: auto; }
    .batch-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .main { padding-inline: 12px; }
    .metric-grid, .variable-grid, .policy-grid, .story-grid, .concept-grid, .asset-grid, .role-grid, .field-grid, .field-grid.three, .check-grid, .batch-cards, .research-list, .profile-grid { grid-template-columns: 1fr; }
    .metric-card strong { font-size: 25px; }
    .page-head h1 { font-size: 31px; }
    .section-head { align-items: flex-start; flex-direction: column; }
    .inline-form, .filter-bar { width: 100%; align-items: stretch; flex-direction: column; }
    .variable-rules { grid-template-columns: 1fr; }
    .variable-rules .form-check + .form-check { border-top: 1px solid var(--line); border-left: 0; }
    .variable-danger { align-items: stretch; flex-direction: column; }
    .filter-bar select { width: 100%; }
    .story-summary-bar { grid-template-columns: repeat(2, 1fr); }
    .story-summary-bar > div:nth-child(odd) { border-left: 0; }
    .story-summary-bar > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .story-aside { grid-template-columns: 1fr; }
    .score-grid { grid-template-columns: repeat(2, 1fr); }
    .image-strip { grid-template-columns: repeat(2, 1fr); }
    .visual-scene-grid { grid-template-columns: 1fr; }
    .duration-options { grid-template-columns: 1fr; }
    .panel { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* StoryGen design system
 *
 * This is the canonical visual layer for both the legacy studio primitives
 * above and Bootstrap-native workflow views. New UI should use these tokens
 * and the shared page-head, panel/card, form, table, status, and empty-state
 * patterns instead of introducing page-specific colors.
 */
:root {
    --bg: #f3f7f4;
    --surface: #ffffff;
    --surface-subtle: #f7faf8;
    --surface-muted: #edf3ef;
    --ink: #17251f;
    --ink-soft: #33473d;
    --muted: #607168;
    --line: #dce6df;
    --line-strong: #c4d3c9;
    --brand: #276749;
    --brand-dark: #174c35;
    --brand-bright: #71a78a;
    --brand-soft: #e7f3ec;
    --accent: #0f7c83;
    --accent-soft: #e5f4f4;
    --danger: #b4233d;
    --danger-soft: #fdf0f2;
    --warning: #9a5b09;
    --warning-soft: #fff5df;
    --success: #087a52;
    --success-soft: #e8f7ef;
    --info: #116b82;
    --info-soft: #e9f5f8;
    --shadow: 0 1px 2px rgba(20, 52, 37, .035), 0 10px 28px rgba(20, 52, 37, .055);
    --shadow-hover: 0 18px 44px rgba(20, 52, 37, .12);
    --radius: 15px;
    --radius-small: 10px;
    --sidebar-width: 264px;
    --header-height: 70px;
    --bs-primary: #276749;
    --bs-primary-rgb: 39, 103, 73;
    --bs-success: #087a52;
    --bs-success-rgb: 8, 122, 82;
    --bs-danger: #b4233d;
    --bs-danger-rgb: 180, 35, 61;
    --bs-warning: #b66a0d;
    --bs-warning-rgb: 182, 106, 13;
    --bs-info: #116b82;
    --bs-info-rgb: 17, 107, 130;
    --bs-body-color: #17251f;
    --bs-body-bg: #f3f7f4;
    --bs-secondary-color: #607168;
    --bs-border-color: #dce6df;
    --bs-link-color: #276749;
    --bs-link-color-rgb: 39, 103, 73;
    --bs-link-hover-color: #174c35;
    --bs-link-hover-color-rgb: 23, 76, 53;
    --bs-border-radius: 10px;
    --bs-border-radius-lg: 15px;
    --bs-font-sans-serif: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { background: var(--bg); }
body {
    background:
        radial-gradient(circle at 93% -4%, rgba(39, 103, 73, .1), transparent 30rem),
        radial-gradient(circle at 20% 105%, rgba(15, 124, 131, .055), transparent 30rem),
        var(--bg);
    color: var(--ink);
    font-size: 15px;
    letter-spacing: -.004em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: #cce7d8; color: #123426; }
:focus-visible { outline: 3px solid rgba(39, 103, 73, .3); outline-offset: 2px; }
a, button, .card, .panel, input, select, textarea { transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, transform .18s ease; }
.skip-link {
    position: fixed;
    z-index: 1000;
    top: 10px;
    left: 12px;
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    box-shadow: var(--shadow-hover);
    transform: translateY(-160%);
}
.skip-link:focus { color: #fff; transform: translateY(0); }

.shell { min-height: 100dvh; }
.sidebar {
    width: var(--sidebar-width);
    padding: 18px 14px 14px;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% -2%, rgba(113, 167, 138, .2), transparent 17rem),
        linear-gradient(180deg, #10251c 0%, #0a1812 100%);
    border-right: 1px solid rgba(205, 231, 217, .1);
    box-shadow: 10px 0 32px rgba(10, 31, 21, .08);
}
.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 7px 17px;
}
.sidebar > .brand { padding: 0; }
.brand { gap: 12px; }
.brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 13px;
    background: linear-gradient(145deg, #8fc2a6, #347a57 58%, #194b35);
    font-family: inherit;
    font-size: 19px;
    box-shadow: 0 8px 24px rgba(14, 74, 47, .34), inset 0 1px rgba(255, 255, 255, .3);
}
.brand strong { color: #fff; font-size: 15px; letter-spacing: -.01em; }
.brand small { color: #9ab3a6; font-size: 10px; letter-spacing: .025em; }
.sidebar-close { display: none; color: #d1e0d7; }
.project-switcher {
    margin: 0 3px 10px;
    padding: 11px;
    border-color: rgba(148, 163, 184, .16);
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
}
.project-switcher label { color: #9db5a8; font-size: 10px; letter-spacing: .12em; }
.project-switcher .form-select {
    min-height: 38px;
    padding-left: 10px;
    border-color: rgba(148, 163, 184, .2);
    background-color: rgba(8, 27, 18, .72);
    color: #f8fafc;
    font-size: 12px;
}
.project-switcher .form-select:focus {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 3px rgba(113, 167, 138, .2);
}
.sidebar-nav { gap: 3px; padding: 2px 3px 0; }
.sidebar-nav a {
    position: relative;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #afc1b7;
    font-size: 13.5px;
    font-weight: 590;
}
.sidebar-nav a:hover {
    border-color: rgba(148, 163, 184, .08);
    background: rgba(255, 255, 255, .055);
    color: #f8fafc;
}
.sidebar-nav a.active {
    border-color: rgba(137, 192, 161, .22);
    background: linear-gradient(90deg, rgba(57, 133, 91, .38), rgba(39, 103, 73, .15));
    color: #fff;
    box-shadow: inset 3px 0 #86c5a3;
}
.nav-icon { width: 20px; color: #829b8e; font-size: 16px; }
.sidebar-nav a.active .nav-icon { color: #b9dfca; }
.nav-label { padding: 18px 11px 6px; color: #708b7c; font-size: 9px; letter-spacing: .14em; }
.sidebar-nav { scrollbar-color: rgba(113, 167, 138, .46) transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(113, 167, 138, .34); }
.sidebar-user {
    margin-top: 12px;
    padding: 13px 7px 2px;
    border-top-color: rgba(148, 163, 184, .14);
}
.sidebar-user .avatar { background: linear-gradient(145deg, #4f8e6d, #245a3f); }
.user-copy strong { color: #f1f5f9; }
.user-copy small { color: #7f8da3; }
.sidebar-user .icon-button { color: #9ab3a6; }

.main {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 0;
}
.app-header {
    position: sticky;
    z-index: 24;
    top: 0;
    display: flex;
    height: var(--header-height);
    align-items: center;
    gap: 13px;
    padding: 0 clamp(20px, 3vw, 44px);
    border-bottom: 1px solid rgba(220, 230, 223, .92);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 1px 0 rgba(20, 52, 37, .025);
    backdrop-filter: blur(18px);
}
.app-header > [data-sidebar-toggle] { display: none; }
.app-header-context { display: flex; min-width: 0; flex-direction: column; line-height: 1.25; }
.app-header-context span { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: .09em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.app-header-context strong { overflow: hidden; color: var(--ink); font-size: 14.5px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.app-header-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.app-header .icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 16px;
}
.app-header .icon-button:hover { border-color: var(--line); background: var(--surface-subtle); color: var(--brand); }
.header-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    margin-left: 5px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #6ea989, #276749);
    color: #fff;
    box-shadow: 0 0 0 1px var(--line);
    font-size: 12px;
    font-weight: 800;
}
.sidebar-backdrop { display: none; }
.content-shell {
    width: 100%;
    max-width: 1660px;
    min-height: calc(100dvh - var(--header-height));
    margin: 0 auto;
    padding: 36px clamp(24px, 3.2vw, 54px) 76px;
}
.content-shell > .container-fluid {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 !important;
}

.page-head,
.content-shell > .container-fluid > .page-head {
    align-items: flex-start;
    margin-bottom: 28px;
}
.page-head h1,
.section-head h2,
.content-shell > .container-fluid > :first-child h1,
.error-page h1,
.auth-card h1 {
    margin-top: 3px;
    color: var(--ink);
    font-family: inherit;
    font-weight: 750;
    letter-spacing: -.038em;
}
.page-head h1 { font-size: clamp(30px, 3vw, 42px); }
.content-shell > .container-fluid > :first-child h1 { font-size: clamp(28px, 2.7vw, 38px); }
.page-head p,
.content-shell > .container-fluid > :first-child p { max-width: 780px; color: var(--muted); line-height: 1.65; }
.eyebrow,
.content-shell > .container-fluid > :first-child > div > .text-uppercase,
.content-shell > .container-fluid > :first-child > .text-uppercase {
    color: var(--brand) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: .14em;
}
.breadcrumb {
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
}
.breadcrumb a { color: var(--brand); font-weight: 650; }
.title-row { flex-wrap: wrap; }

.btn {
    min-height: 42px;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .005em;
    box-shadow: 0 1px 2px rgba(20, 52, 37, .05);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.is-submitting { pointer-events: none; opacity: .78; }
.btn.is-submitting::after {
    width: 13px;
    height: 13px;
    margin-left: 2px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    content: "";
    animation: button-spin .7s linear infinite;
}
@keyframes button-spin { to { transform: rotate(360deg); } }
.btn-sm { min-height: 35px; padding: 6px 11px; border-radius: 8px; font-size: 11.5px; }
.btn-lg { min-height: 48px; padding: 11px 18px; border-radius: 12px; font-size: 13px; }
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: #123f2b;
    --bs-btn-active-border-color: #123f2b;
    --bs-btn-disabled-bg: #668c78;
    --bs-btn-disabled-border-color: #668c78;
    box-shadow: 0 7px 17px rgba(39, 103, 73, .22);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: #b8d3c4;
    --bs-btn-hover-bg: var(--brand-soft);
    --bs-btn-hover-color: var(--brand-dark);
    --bs-btn-hover-border-color: #8eb8a2;
    --bs-btn-active-bg: #d9ece1;
    --bs-btn-active-color: var(--brand-dark);
}
.btn-outline-secondary {
    --bs-btn-color: #475569;
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface-subtle);
    --bs-btn-hover-border-color: #94a3b8;
}
.btn-link { box-shadow: none; }

.panel,
.card {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .975);
    box-shadow: var(--shadow);
}
.card.border-0 { border: 1px solid var(--line) !important; }
.shadow-sm { box-shadow: var(--shadow) !important; }
.panel { padding: 24px; }
.panel:hover,
a.card:hover { border-color: #d4dbea !important; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover) !important; }
.card-header,
.card-footer {
    border-color: var(--line);
    background: transparent !important;
}
.card-header:first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.card-body { color: var(--ink); }
.panel-head { margin-bottom: 18px; }
.panel-head h2,
.panel-head h3,
.card-header h2,
 .card-header h3 { color: var(--ink); font-size: 17px; font-weight: 750; letter-spacing: -.018em; }
.panel-head p { font-size: 12px; line-height: 1.55; }
.panel.callout {
    border-color: #c8d9cf !important;
    background: linear-gradient(145deg, #edf4ef, #fff 60%);
}
.panel.callout h2 { font-family: inherit; font-weight: 720; }
.section-head h2 { font-size: 29px; }
.lower,
.panel.lower { margin-top: 20px; }

.metric-grid { gap: 15px; }
.metric-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border-color: var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.metric-card::after {
    position: absolute;
    top: -28px;
    right: -28px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(95, 127, 111, .11), transparent 68%);
    content: "";
}
.metric-card strong {
    margin: 7px 0 3px;
    color: var(--ink);
    font-family: inherit;
    font-size: 32px;
    font-weight: 750;
    letter-spacing: -.04em;
}
.metric-card small { color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.metric-label { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.content-shell > .container-fluid > .row.g-3.mb-4 > [class*="col-"] .card-body .h3,
.content-shell > .container-fluid > .row.g-3.mb-4 > [class*="col-"] .card-body .h4 {
    margin-top: 6px;
    font-weight: 750;
    letter-spacing: -.035em;
}

.badge {
    min-height: 24px;
    padding: 5px 9px;
    border: 1px solid transparent;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .045em;
}
.badge.active, .badge.completed, .badge.approved, .badge.published, .badge.success, .badge.ready,
.text-bg-success { border-color: #addfc5; background: var(--success-soft) !important; color: var(--success) !important; }
.badge.paused, .badge.queued, .badge.running, .badge.moderating, .badge.revision, .badge.media, .badge.review, .badge.warning, .badge.uploading,
.text-bg-warning { border-color: #efd19a; background: var(--warning-soft) !important; color: var(--warning) !important; }
.badge.failed, .badge.rejected, .badge.error, .badge.cancelled, .badge.danger,
.text-bg-danger { border-color: #efbdc7; background: var(--danger-soft) !important; color: var(--danger) !important; }
.badge.neutral, .badge.draft, .badge.archived, .text-bg-light, .text-bg-secondary {
    border-color: var(--line);
    background: var(--surface-muted) !important;
    color: #526075 !important;
}
.text-bg-primary { border-color: #b8d3c4; background: var(--brand-soft) !important; color: var(--brand-dark) !important; }
.status-dot.active, .status-dot.completed, .status-dot.published, .status-dot.approved { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .12); }
.status-dot.paused, .status-dot.queued, .status-dot.warning { background: #f59e0b; }
.status-dot.failed, .status-dot.rejected, .status-dot.error { background: #ef4444; }

.table-wrap,
.table-responsive {
    border-radius: 0 0 var(--radius) var(--radius);
    scrollbar-color: #cbd5e1 transparent;
}
table, .table { margin-bottom: 0; font-size: 13px; }
th, .table > thead th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .085em;
}
td, .table > tbody td {
    padding: 14px;
    border-color: var(--line);
    color: var(--ink-soft);
    vertical-align: middle;
}
tbody tr { transition: background-color .15s ease; }
tbody tr:hover { background: #fafbff; }
td a, .table td a { color: var(--ink); font-weight: 700; }
td a:hover, .table td a:hover { color: var(--brand); }
.table-wrap.tall { max-height: min(720px, 72vh); }
.table-wrap.tall thead { position: sticky; z-index: 2; top: 0; }

label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.form-label { margin-bottom: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.form-control,
.form-select,
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.form-control):not(.form-check-input),
select:not(.form-select),
textarea:not(.form-control) {
    min-height: 44px;
    border-color: var(--line-strong);
    border-radius: 10px;
    background-color: #fff;
    color: var(--ink);
    font-size: 14px;
}
.form-control:hover,
.form-select:hover,
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.form-control):not(.form-check-input):hover,
select:not(.form-select):hover,
textarea:not(.form-control):hover { border-color: #91aa9a; }
.form-control:focus,
.form-select:focus,
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.form-control):not(.form-check-input):focus,
select:not(.form-select):focus,
textarea:not(.form-control):focus {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 4px rgba(39, 103, 73, .12);
}
.form-control::placeholder,
textarea::placeholder { color: #9aa6b8; }
.form-text { color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-check-input { border-color: #9eb2a5; }
.form-check-input:checked { border-color: var(--brand); background-color: var(--brand); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 4px rgba(95, 127, 111, .12); }
label.form-check {
    display: block;
    color: var(--ink);
    font-size: 13px;
}
.form-check.border,
.form-check.border.rounded,
.form-check.border.rounded-3 {
    border-color: var(--line) !important;
    background: var(--surface-subtle);
}
.form-check.border:has(.form-check-input:checked) {
    border-color: #a9c1b4 !important;
    background: var(--brand-soft);
}
.field-grid { gap: 16px; }
.option-choice {
    padding: 12px;
    border-color: var(--line);
    border-radius: 11px;
}
.option-choice:hover { border-color: #94b5a3; background: #f5faf7; }
.option-choice:has(.form-check-input:checked) { border-color: var(--brand-bright); background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(39, 103, 73, .09); }
.toggle-row.contained, .switch-card, .answer-limits, .binding-fields, .condition-builder { border-color: var(--line); background: var(--surface-subtle); }

.accordion { display: block; }
.accordion:has(> details) { display: grid; gap: 11px; }
.accordion-item {
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: #fff;
}
.accordion-button {
    min-height: 62px;
    border-radius: 12px !important;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    box-shadow: none !important;
}
.accordion-button:not(.collapsed) { background: var(--brand-soft) !important; color: var(--brand-dark); }
.accordion-button:focus { box-shadow: inset 0 0 0 2px rgba(39, 103, 73, .26) !important; }
.accordion-body { border-top: 1px solid var(--line); }
details > summary { display: flex; align-items: center; gap: 10px; border-radius: inherit; }
details > summary:hover { background: var(--surface-subtle); }
details > summary::after {
    display: inline-grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin-left: auto;
    place-items: center;
    border-radius: 7px;
    background: var(--surface-muted);
    color: var(--muted);
    content: "+";
    font-size: 16px;
    line-height: 1;
}
details[open] > summary::after { content: "−"; }

.list-group-item {
    border-color: var(--line);
    background: transparent;
    color: var(--ink-soft);
}
.list-group-item-action:hover { background: var(--surface-subtle); color: var(--brand); }
.project-row { border-color: var(--line); border-radius: 9px; }
.project-row:hover { padding-right: 10px; padding-left: 10px; background: var(--surface-subtle); }
.project-glyph,
.profile-icon,
.stage-icon {
    background: var(--brand-soft);
    color: var(--brand);
}
.project-glyph { border: 1px solid #c9ded2; }
.stage-icon { width: 44px; height: 44px; border-radius: 13px; }
.tag { border-color: var(--line); border-radius: 7px; background: var(--surface-subtle); color: #475569; }
.stage-pill { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
.progress {
    height: 7px;
    margin: 10px 0 8px;
    overflow: hidden;
    background: #e8edf4;
}
.progress > span,
.progress > .progress-bar { background: linear-gradient(90deg, var(--brand), var(--accent)); }
.notice,
.alert-light {
    border-color: #dbe3ef !important;
    background: #f8fafc !important;
    color: #475569;
}
.empty {
    min-height: 180px;
    display: grid;
    place-content: center;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 0, rgba(39, 103, 73, .055), transparent 13rem),
        var(--surface-subtle);
}
.empty.compact { min-height: 100px; }
.success-state { border-color: #a7f3d0; background: var(--success-soft); }

.tabs {
    top: var(--header-height);
    margin-bottom: 30px;
    padding: 5px;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 5px 18px rgba(20, 52, 37, .045);
}
.tabs a {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
}
.tabs a:hover,
.tabs a.active { border: 0; background: var(--brand-soft); color: var(--brand-dark); }
.tab-section { scroll-margin-top: calc(var(--header-height) + 20px); }

.story-card {
    border-color: var(--line);
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .035);
}
.story-card:hover { border-color: #b8d3c4; box-shadow: var(--shadow-hover); }
.story-grid .story-card:nth-child(4n+1) .story-cover-placeholder { background: radial-gradient(circle at 32% 24%, #8fc2a6, #347a57 55%, #194b35); }
.story-grid .story-card:nth-child(4n+2) .story-cover-placeholder { background: radial-gradient(circle at 32% 24%, #61b8bc, #167c82 55%, #174f54); }
.story-grid .story-card:nth-child(4n+3) .story-cover-placeholder { background: radial-gradient(circle at 32% 24%, #a8b98a, #66774d 55%, #3d4a2d); }
.story-grid .story-card:nth-child(4n+4) .story-cover-placeholder { background: radial-gradient(circle at 32% 24%, #d3a45d, #9a651c 55%, #5d3c13); }
.story-cover-placeholder { height: auto; aspect-ratio: 16 / 9; }
.story-cover-placeholder > span { font-family: inherit; font-weight: 750; }
.story-card-body h2 { font-family: inherit; font-size: 18px; font-weight: 740; letter-spacing: -.022em; line-height: 1.28; }
.story-card-body p { font-size: 12px; line-height: 1.65; }
.story-summary-bar {
    overflow: hidden;
    border-color: var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.story-summary-bar > div { padding: 9px 15px; }
.story-prose { color: #283a31; font-family: ui-serif, Georgia, serif; font-size: 18px; line-height: 1.95; }
.media-panel video { border-radius: 12px; }
.image-strip a { border: 1px solid var(--line); border-radius: 10px; }
.asset-card { border-color: var(--line); border-radius: 13px; box-shadow: 0 3px 12px rgba(15, 23, 42, .035); }
.asset-card:hover { transform: translateY(-2px); border-color: #b8d3c4; box-shadow: var(--shadow-hover); }
.asset-preview { height: 145px; background: linear-gradient(145deg, #edf4ef, #dce9e1); }
.asset-symbol { color: var(--brand); font-family: inherit; }
.asset-list { display: flex; flex-direction: column; }
.asset-list article {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.asset-list article:first-child { border-top: 0; }
.asset-list .grow { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.asset-list small { color: var(--muted); font-size: 10px; }
.danger-text { color: var(--danger) !important; }
.score-bubble { background: rgba(13, 67, 49, .88); border-color: rgba(255, 255, 255, .92); }

.modal-content {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .2);
}
.modal-header,
.modal-footer { padding: 18px 22px; border-color: var(--line); }
.modal-body { padding: 22px; }
.modal-backdrop.show { opacity: .42; }
.flash-stack { top: calc(var(--header-height) + 14px); right: 22px; }
.flash-stack .alert { border: 1px solid currentColor; border-radius: 12px; font-size: 12px; }

.auth-page {
    position: relative;
    min-height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 16%, rgba(113, 167, 138, .34), transparent 24rem),
        radial-gradient(circle at 82% 88%, rgba(15, 124, 131, .22), transparent 28rem),
        linear-gradient(145deg, #0a1812, #163f2c 60%, #113b3e);
}
.auth-page::before,
.auth-page::after {
    position: fixed;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: "";
}
.auth-page::before { width: 34rem; height: 34rem; top: -18rem; right: -10rem; }
.auth-page::after { width: 22rem; height: 22rem; bottom: -12rem; left: -8rem; }
.auth-card {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    padding: 38px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 32px 100px rgba(5, 31, 19, .38);
    backdrop-filter: blur(20px);
}
.auth-card .brand strong { color: var(--ink); }
.auth-card .brand small { color: var(--muted); }
.auth-card h1 { font-size: 30px; }
.auth-card .btn { min-height: 46px; }
.auth-note { font-size: 10px; line-height: 1.5; }
.error-page { min-height: calc(100dvh - var(--header-height) - 120px); }
.error-mark {
    width: 64px;
    height: 64px;
    border: 1px solid #fecaca;
    font-family: inherit;
    font-weight: 800;
}

@media (max-width: 1180px) {
    :root { --sidebar-width: 248px; }
    .content-shell { padding-right: 26px; padding-left: 26px; }
    .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .sidebar {
        z-index: 60;
        width: min(310px, calc(100vw - 44px));
        transform: translateX(-105%);
        transition: transform .22s ease;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 24px 0 70px rgba(5, 31, 19, .38); }
    .sidebar-close { display: inline-grid; }
    .sidebar-backdrop {
        position: fixed;
        z-index: 55;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(7, 27, 18, .52);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
        backdrop-filter: blur(2px);
    }
    body.sidebar-open .sidebar-backdrop { display: block; opacity: 1; pointer-events: auto; }
    body.sidebar-open { overflow: hidden; }
    .main { width: 100%; margin-left: 0; padding: 0; }
    .app-header > [data-sidebar-toggle] { display: inline-grid; flex: 0 0 38px; }
    .content-shell { min-height: calc(100dvh - var(--header-height)); padding-top: 28px; }
    .story-layout, .split-grid, .batch-layout { grid-template-columns: 1fr; }
    .story-summary-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .story-summary-bar > div:nth-child(5) { border-left: 0; }
    .story-summary-bar > div:nth-child(n+5) { border-top: 1px solid var(--line); }
    .sticky-panel, .sticky-xl-top { position: static !important; }
}

@media (max-width: 767px) {
    :root { --header-height: 60px; }
    .app-header { padding: 0 14px; }
    .app-header-actions .icon-button { display: none; }
    .app-header > [data-sidebar-toggle],
    .sidebar .icon-button { width: 44px; height: 44px; }
    .btn-sm { min-height: 38px; }
    .header-avatar { width: 32px; height: 32px; }
    .content-shell { padding: 22px 14px 52px; }
    .page-head {
        gap: 18px;
        margin-bottom: 22px;
    }
    .page-head h1 { font-size: 29px; }
    .page-head > form,
    .page-head > .actions { width: 100%; }
    .page-head > form > .btn,
    .page-head > .btn { width: 100%; }
    .actions { width: 100%; justify-content: stretch; }
    .actions > *,
    .actions > form,
    .actions > form > .btn { flex: 1 1 auto; }
    .panel { padding: 17px; border-radius: 14px; }
    .card { border-radius: 14px; }
    .panel-head { align-items: flex-start; flex-direction: column; gap: 10px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .metric-card { padding: 16px; }
    .metric-card strong { font-size: 25px; }
    .story-grid, .asset-grid, .policy-grid, .variable-grid, .role-grid, .concept-grid { grid-template-columns: 1fr; }
    .story-aside { grid-template-columns: 1fr; }
    .tabs { top: var(--header-height); margin-right: -14px; margin-left: -14px; border-right: 0; border-left: 0; border-radius: 0; }
    .tabs a { padding: 9px 12px; }
    .filter-bar { width: 100%; }
    .filter-bar .btn { width: 100%; }
    .flash-stack { top: calc(var(--header-height) + 10px); right: 10px; width: calc(100vw - 20px); }
    .table-responsive,
    .table-wrap { margin-right: -17px; margin-left: -17px; border-radius: 0 0 14px 14px; }
    .table-responsive table,
    .table-wrap table { min-width: 680px; }
    .story-summary-bar { grid-template-columns: repeat(2, 1fr); }
    .story-summary-bar > div:nth-child(odd) { border-left: 0; }
    .story-summary-bar > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .story-summary-bar > div { min-height: 58px; display: grid; place-content: center; }
    .modal-dialog { margin: 10px; }
    .modal-content { border-radius: 16px; }
    .auth-page { padding: 14px; }
    .auth-card { padding: 28px 24px; border-radius: 19px; }
}

@media (max-width: 480px) {
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-metrics > .col { width: 50%; }
    .metric-card small { font-size: 9px; }
    .story-cover-placeholder { height: auto; }
    .field-grid, .field-grid.three, .variable-rules, .check-grid, .score-grid { grid-template-columns: 1fr; }
    .duration-options { grid-template-columns: 1fr; }
    .page-head .title-row { align-items: flex-start; flex-direction: column; gap: 7px; }
}

/* Campaign planner */
.campaign-page { isolation: isolate; }
.campaign-page-head {
    align-items: center;
    padding-bottom: 4px;
}
.campaign-page-head .breadcrumb { margin-bottom: 9px; }
.campaign-draft-cue {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid #b8d3c4;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}
.campaign-step-card,
.campaign-summary-card,
.campaign-preview-card { overflow: hidden; }
.campaign-step-head {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 13px;
    padding: 18px 23px;
    border-bottom: 1px solid var(--line);
}
.campaign-step-head > div { min-width: 0; }
.campaign-step-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -.02em;
}
.campaign-step-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}
.campaign-step-number {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 5px 12px rgba(39, 103, 73, .2);
}
.campaign-step-card > .card-body { padding-top: 21px; padding-bottom: 23px; }
.campaign-dimensions {
    display: grid;
    gap: 9px;
}
.campaign-dimensions .accordion-item {
    overflow: hidden;
    border-radius: 12px !important;
    box-shadow: none;
}
.campaign-dimensions .accordion-button {
    min-height: 56px;
    padding: 13px 17px;
    background: #fff !important;
}
.campaign-dimensions .accordion-button:not(.collapsed) {
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle) !important;
}
.campaign-dimensions .accordion-button .badge { margin-left: 8px !important; }
.campaign-dimensions .accordion-body {
    padding: 18px;
    border-top: 0;
    background: #fff;
}
.campaign-dimensions fieldset {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-subtle);
}
.campaign-dimensions fieldset .form-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding-left: 0;
}
.campaign-dimensions fieldset .form-check-input { float: none; margin: 0; }
.campaign-mode-picker { padding: 14px !important; }
.campaign-mode-picker > legend {
    float: none;
    width: auto;
    margin: 0 0 10px;
    padding: 0;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.campaign-mode-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.campaign-mode-option {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 74px;
    grid-template-columns: 36px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.campaign-mode-option:hover { border-color: #94b5a3; background: #f8fcf9; }
.campaign-mode-option:has(input:focus-visible) {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 4px rgba(39, 103, 73, .12);
}
.campaign-mode-option:has(input:checked) {
    border-color: var(--brand-bright);
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px rgba(39, 103, 73, .08);
}
.campaign-mode-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0 !important;
    opacity: 0;
    pointer-events: none;
}
.campaign-mode-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 9px;
    background: var(--surface-muted);
    color: #64748b;
    font-size: 15px;
}
.campaign-mode-option:has(input:checked) .campaign-mode-icon {
    background: var(--brand);
    color: #fff;
}
.campaign-mode-copy { display: flex; min-width: 0; flex-direction: column; }
.campaign-mode-copy strong { color: var(--ink); font-size: 13px; }
.campaign-mode-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.45; }
.campaign-mode-check {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    color: transparent;
    font-size: 11px;
}
.campaign-mode-option:has(input:checked) .campaign-mode-check {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}
.campaign-pool-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}
.campaign-pool-toolbar > div:first-child { min-width: 0; }
.campaign-pool-toolbar strong { color: #334155; font-size: 11px; }
.campaign-pool-toolbar [data-campaign-selection-count] {
    margin-left: 6px;
    color: var(--brand-dark);
    font-size: 10px;
    font-weight: 750;
}
.campaign-pool-toolbar p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.campaign-pool-toolbar .btn-group { flex: 0 0 auto; }
.campaign-pool-toolbar .btn { min-width: 76px; box-shadow: none; }
.campaign-dimensions [data-campaign-fixed],
.campaign-dimensions [data-campaign-random] { margin-top: 15px; }
.campaign-option {
    display: flex !important;
    min-height: 66px;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.campaign-option:hover { border-color: #94b5a3; background: #f7fbf8; }
.campaign-option:has(.form-check-input:checked) {
    border-color: var(--brand-bright);
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px rgba(39, 103, 73, .08);
}
.campaign-option .form-check-input { flex: 0 0 auto; margin-top: 2px; }
.campaign-option-copy { display: flex; min-width: 0; flex-direction: column; }
.campaign-option-copy strong { color: var(--ink); font-size: 13px; }
.campaign-option-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.5; }
.campaign-summary-card {
    z-index: 5;
    top: calc(var(--header-height) + 22px) !important;
}
.campaign-summary-card .campaign-step-head { min-height: 88px; }
.campaign-setup-list .list-group-item {
    min-height: 43px;
    align-items: center;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    font-size: 12px;
}
.campaign-setup-list strong { color: #334155; font-size: 11px; text-align: right; }
.campaign-summary-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}
.campaign-summary-note i { margin-top: 1px; color: var(--brand); }
.campaign-preview-card {
    border-color: #b8d3c4 !important;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .07);
}
.campaign-preview-head {
    padding: 21px 23px;
    border-bottom: 1px solid #d5e3da;
    background: linear-gradient(135deg, var(--brand-soft), #fff) !important;
}
.campaign-preview-head .eyebrow { margin-bottom: 4px !important; }
.campaign-preview-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 760;
    letter-spacing: -.025em;
}
.campaign-preview-head p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.campaign-preview-head code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .7);
    color: var(--brand-dark);
    font-size: 10px;
}
.campaign-coverage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.campaign-coverage-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-subtle);
}
.campaign-coverage-card h3 {
    margin: 0 0 8px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .035em;
}
.campaign-coverage-card ul { margin: 0; padding: 0; list-style: none; }
.campaign-coverage-card li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}
.campaign-coverage-card li:first-child { border-top: 0; }
.campaign-coverage-card li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-coverage-card li strong {
    display: grid;
    min-width: 25px;
    height: 22px;
    place-items: center;
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font-size: 10px;
}
.campaign-queue-bar {
    display: flex;
    margin-top: 20px;
    padding-top: 18px;
    align-items: center;
    flex-wrap: wrap;
    gap: 13px;
    border-top: 1px solid var(--line);
}
.campaign-queue-bar > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
}
.campaign-queue-bar > span i { color: var(--brand); }

@media (max-width: 1199px) {
    .campaign-summary-card { position: static !important; }
}

@media (max-width: 1024px) {
    .app-header { z-index: 70; }
    .sidebar {
        z-index: 60;
        top: var(--header-height);
        bottom: 0;
        height: calc(100dvh - var(--header-height));
    }
    .sidebar-backdrop {
        z-index: 55;
        top: var(--header-height);
        height: calc(100dvh - var(--header-height));
    }
}

@media (max-width: 767px) {
    .campaign-page-head { align-items: flex-start; }
    .campaign-draft-cue { white-space: normal; }
    .campaign-step-head { min-height: 76px; padding: 16px; }
    .campaign-step-card > .card-body,
    .campaign-summary-card > .card-body,
    .campaign-preview-card > .card-body { padding: 16px !important; }
    .campaign-dimensions .accordion-body { padding: 13px; }
    .campaign-mode-options { grid-template-columns: 1fr; }
    .campaign-pool-toolbar { align-items: flex-start; flex-direction: column; }
    .campaign-pool-toolbar .btn-group { width: 100%; }
    .campaign-pool-toolbar .btn { flex: 1; }
    .campaign-coverage-grid { grid-template-columns: 1fr; }
    .campaign-queue-bar { align-items: stretch; flex-direction: column; }
    .campaign-queue-bar .btn { width: 100%; }
}

/* Shared workflow refinements */
.content-shell > .container-fluid > .page-head,
.content-shell > .container-fluid > .workflow-page-head {
    max-width: 1540px;
    margin-right: auto;
    margin-left: auto;
}

.workflow-page-head {
    display: flex;
    margin-bottom: 28px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.workflow-page-head h1 {
    margin: 3px 0 5px;
    color: var(--ink);
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 750;
    letter-spacing: -.038em;
    line-height: 1.1;
}

.workflow-page-head p:last-child {
    max-width: 780px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.65;
}

.workflow-page-head .eyebrow,
.workflow-page-head > div > .text-uppercase {
    margin-bottom: 6px !important;
    color: var(--brand) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: .14em;
}

.filter-bar {
    flex-wrap: wrap;
    gap: 9px;
}

.filter-bar select {
    min-width: 170px;
    padding-right: 38px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2351695c' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m3 6 5 5 5-5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 12px;
}

.panel-filter {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.taxonomy-actions {
    display: flex;
    max-width: 100%;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.taxonomy-actions form {
    margin: 0;
}

.taxonomy-dimension-card {
    scroll-margin-top: calc(var(--header-height) + 18px);
}

.taxonomy-dimension-card .card-header {
    padding-bottom: 20px;
}

.taxonomy-dimension-card .table-responsive {
    border-top: 1px solid var(--line);
}

.taxonomy-dimension-card tbody tr:has(+ tr .collapse.show) {
    background: var(--brand-soft);
}

.taxonomy-dimension-card .collapse.bg-body-tertiary {
    background: var(--surface-subtle) !important;
}

.sticky-xl-top {
    top: calc(var(--header-height) + 22px) !important;
}

[data-stage-card] {
    position: relative;
    overflow: hidden;
}


[data-stage-card] .card-body {
    padding-top: 18px;
}

[data-stage-card] .row.g-2 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

[data-stage-card] .row.g-2 > .col {
    width: auto;
    padding-right: 3px;
    padding-left: 3px;
}

.account-card {
    min-height: 76px;
}

.profile-icon,
.stage-icon,
.project-glyph {
    border: 1px solid #c9ded2;
}

.text-link {
    color: var(--brand);
    font-size: 13px;
    font-weight: 750;
}

.text-link:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

input[type="range"] {
    accent-color: var(--brand);
}

.form-control.font-monospace,
textarea.code-input,
.json-view {
    font-size: 12px;
    line-height: 1.6;
}

.table-responsive,
.table-wrap {
    overscroll-behavior-inline: contain;
}

.table-responsive:focus-within,
.table-wrap:focus-within {
    outline: 2px solid rgba(39, 103, 73, .16);
    outline-offset: 2px;
}

.table > tbody > tr:last-child > td,
table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.btn-outline-warning {
    --bs-btn-color: var(--warning);
    --bs-btn-border-color: #ddbe87;
    --bs-btn-hover-bg: var(--warning-soft);
    --bs-btn-hover-color: #704005;
    --bs-btn-hover-border-color: #c4974f;
}

.btn-outline-danger {
    --bs-btn-color: var(--danger);
    --bs-btn-border-color: #e6aab6;
    --bs-btn-hover-bg: var(--danger-soft);
    --bs-btn-hover-color: #861a30;
    --bs-btn-hover-border-color: #d68193;
}

.btn-outline-success {
    --bs-btn-color: var(--success);
    --bs-btn-border-color: #a8d8be;
    --bs-btn-hover-bg: var(--success-soft);
    --bs-btn-hover-color: #075d40;
    --bs-btn-hover-border-color: #78bb99;
}

.alert {
    border-radius: 12px;
    line-height: 1.55;
}

.alert-info {
    border-color: #b9dde4;
    background: var(--info-soft);
    color: #174f60;
}

.story-summary-bar strong {
    color: var(--ink);
    font-size: 14px;
}

.story-summary-bar span {
    font-size: 12px;
}

.meta-list > div {
    font-size: 12px;
}

.nav-label,
.metric-label,
.badge,
.form-text,
.tag small,
.asset-card-body p,
.asset-card-body footer,
.campaign-mode-copy small,
.campaign-pool-toolbar strong,
.campaign-pool-toolbar [data-campaign-selection-count],
.campaign-pool-toolbar p,
.campaign-option-copy small,
.campaign-summary-note,
.campaign-queue-bar > span {
    font-size: 12px;
}

.concurrency-input {
    width: 5rem;
}

.panel p a,
.card p a,
.alert a,
.story-prose a {
    text-decoration: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: .16em;
}

.cover-designer-controls > .btn:last-child {
    position: sticky;
    z-index: 4;
    bottom: 14px;
    box-shadow: 0 12px 34px rgba(20, 52, 37, .2);
}

.api-tester-notice {
    margin-bottom: 20px;
}

.api-tester-shell {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 20px;
    align-items: start;
}

.api-tester-request,
.api-tester-response {
    min-width: 0;
}

.api-tester-response {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    max-height: calc(100vh - var(--header-height) - 40px);
    overflow: auto;
}

.api-tester-target {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
}

.api-tester-body {
    min-height: 260px;
    resize: vertical;
}

.api-tester-actions {
    flex-wrap: wrap;
}

.api-tester-response-meta,
.api-tester-output-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.api-tester-output-head {
    margin-bottom: 8px;
}

.api-tester-output-head h3 {
    margin: 0;
    font-size: 13px;
}

.api-tester-output {
    overflow: auto;
    max-height: 240px;
    margin: 0;
    padding: 14px;
    border: 1px solid #27352d;
    border-radius: var(--radius-small);
    background: #111a15;
    color: #dcebe2;
    font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.api-tester-output-body {
    min-height: 280px;
    max-height: 520px;
}

.form-error {
    margin: 0;
    color: var(--danger);
    font-size: 12px;
    font-weight: 650;
}

.campaign-destination-option {
    display: block;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--surface);
    cursor: pointer;
}

.campaign-destination-option:has(input[data-destination-key]:checked) {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent);
}

.campaign-destination-option.is-unavailable {
    opacity: .7;
    cursor: not-allowed;
}

.story-section-nav {
    position: sticky;
    top: 8px;
    z-index: 20;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow-small);
    backdrop-filter: blur(12px);
}

.production-page .table td,
.story-library-page .table td {
    vertical-align: middle;
}

.production-page .form-control[type="number"] {
    min-width: 84px;
}

.story-library-page .object-fit-cover {
    object-fit: cover;
}

@media (max-width: 1024px) {
    .workflow-page-head {
        flex-wrap: wrap;
    }

    .taxonomy-actions {
        justify-content: flex-start;
    }

    .cover-designer-preview-column {
        grid-row: auto;
    }

    .api-tester-shell {
        grid-template-columns: 1fr;
    }

    .api-tester-response {
        position: static;
        max-height: none;
    }
}

@media (max-width: 767px) {
    body {
        font-size: 14px;
    }

    .workflow-page-head {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
        margin-bottom: 22px;
    }

    .workflow-page-head h1 {
        font-size: 29px;
    }

    .workflow-page-head > .btn,
    .workflow-page-head > form,
    .workflow-page-head > form > .btn {
        width: 100%;
    }

    .filter-bar,
    .filter-bar select,
    .filter-bar .btn {
        width: 100%;
    }

    .taxonomy-actions {
        width: 100%;
        align-items: stretch;
    }

    .taxonomy-actions form,
    .taxonomy-actions form .btn,
    .taxonomy-actions > .btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .taxonomy-actions form:first-of-type {
        display: grid !important;
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .taxonomy-dimension-card .card-header {
        padding: 18px !important;
    }

    .taxonomy-dimension-card .table-responsive {
        margin: 0;
    }

    .cover-designer-controls > .btn:last-child {
        bottom: 8px;
    }

    .api-tester-target {
        grid-template-columns: 1fr;
    }

    .api-tester-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .metrics,
    .metric-grid {
        grid-template-columns: 1fr;
    }
}

@media (forced-colors: active) {
    :focus-visible {
        outline: 2px solid Highlight;
    }

    .sidebar-nav a.active,
    .option-choice:has(input:checked),
    .campaign-mode-option:has(input:checked),
    .campaign-option:has(.form-check-input:checked) {
        border: 2px solid Highlight;
    }

    .panel,
    .card,
    .btn,
    .form-control,
    .form-select {
        border-color: CanvasText;
        box-shadow: none;
    }
}

/* Production workflow admin surfaces */
.content-shell a:not(.btn):not(.card):not(.nav-link):not(.list-group-item-action) {
    color: var(--bs-link-color);
}

.content-shell a:not(.btn):not(.card):not(.nav-link):not(.list-group-item-action):hover {
    color: var(--bs-link-hover-color);
}

.content-shell a.link-secondary,
.content-shell .link-secondary {
    color: var(--muted) !important;
}

.content-shell .table td a:not(.btn) {
    color: var(--brand);
}

.nav-tabs {
    border-bottom-color: var(--line);
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--line-strong);
    color: var(--brand);
}

.nav-tabs .nav-link.active {
    border-bottom-color: var(--brand);
    background: transparent;
    color: var(--brand-dark);
}

.campaign-index,
.campaign-detail,
.campaign-page,
.story-library-page,
.production-dashboard {
    max-width: 1540px;
    margin: 0 auto;
}

.campaign-filter-toolbar,
.story-library-filter-form,
.production-filter-toolbar {
    background: var(--surface);
}

.campaign-filter-toolbar .form-control,
.campaign-filter-toolbar .form-select,
.story-library-filter-form .form-control,
.story-library-filter-form .form-select {
    min-height: 40px;
}

.campaign-results-feedback {
    color: var(--muted);
    font-size: 12px;
}

.campaign-list-grid {
    --bs-gutter-x: 18px;
    --bs-gutter-y: 18px;
}

.campaign-list-card {
    color: var(--ink);
}

.campaign-list-card .card-body {
    padding: 22px;
}

.campaign-card-title {
    color: var(--brand);
    font-weight: 760;
    letter-spacing: -.018em;
}

.campaign-card-meta,
.campaign-card-progress-label {
    color: var(--muted);
}

.campaign-card-progress {
    margin-top: 22px;
}

.campaign-card-progress .progress {
    height: 7px;
    margin: 9px 0 7px;
}

.campaign-card-attention {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.campaign-pagination {
    margin-top: 18px;
}

.campaign-outcome-summary .card-body,
.campaign-story-head,
.campaign-bulk-toolbar {
    padding-inline: 24px;
}

.campaign-outcome-stat,
.production-health-item {
    border-color: var(--line) !important;
    background: var(--surface-subtle);
}

.campaign-outcome-stat strong,
.campaign-stage-complete strong {
    color: var(--ink);
    letter-spacing: -.035em;
}

.campaign-outcome-attention {
    border-color: #efbdc7 !important;
    background: var(--danger-soft);
}

.campaign-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.campaign-section-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 750;
}

.campaign-stage-card {
    box-shadow: none !important;
}

.campaign-stage-card .card-body {
    padding: 16px;
}

.campaign-stage-states {
    min-height: 24px;
}

.campaign-bulk-actions .form-select {
    min-width: 155px;
}

.campaign-story-table td:first-child,
.campaign-story-table th:first-child {
    width: 46px;
}

.campaign-step-overview {
    counter-reset: campaign-step;
}

.campaign-step-overview li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
}

.campaign-step-overview li:first-child {
    border-color: #b8d3c4;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.campaign-production-setup {
    top: calc(var(--header-height) + 18px);
}

.campaign-setup-section + .campaign-setup-section {
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.campaign-dimension-name {
    color: var(--ink);
    font-weight: 740;
}

.campaign-dimension-summary {
    margin-right: 8px;
}

.campaign-preview-summary-card {
    box-shadow: none !important;
}

.story-library-shell {
    overflow: hidden;
}

.story-library-tabs,
.production-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

.story-library-tabs .nav-link,
.production-tabs .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
}

.story-library-filter-form {
    padding: 18px 24px;
}

.story-library-advanced-filters {
    border-color: var(--line) !important;
}

.story-library-bulk-toolbar {
    border-bottom: 1px solid var(--line) !important;
    background: var(--surface-subtle) !important;
}

.story-library-bulk-select {
    width: auto;
    min-width: 170px;
}

.story-library-page table {
    min-width: 1040px;
}

.story-library-page th:first-child,
.story-library-page td:first-child {
    width: 48px;
    text-align: center;
}

.story-library-page th:nth-child(2) {
    min-width: 330px;
}

.story-library-story-copy {
    min-width: 0;
}

.story-library-story-copy > a {
    display: inline-block;
    color: var(--brand) !important;
    font-size: 14px;
}

.story-library-thumbnail {
    width: 88px;
    height: 88px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    object-fit: cover;
}

.story-library-thumbnail-fallback {
    font-size: 24px;
}

.story-library-summary {
    display: -webkit-box;
    max-width: 520px;
    overflow: hidden;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.story-detail-section + .story-detail-section {
    margin-top: 20px;
}

.story-timeline.story-detail-section {
    margin-top: 0;
}

.production-stage-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.production-stage-group {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.production-stage-group > h3 {
    margin: 0 0 13px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.production-stage-list {
    display: flex;
    margin: 0;
    padding: 0;
    flex-direction: column;
    gap: 8px;
    list-style: none;
}

.production-stage {
    display: grid;
    min-height: 76px;
    padding: 11px;
    align-items: start;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    text-align: left;
}

.production-stage::before {
    display: none;
}

.production-stage .milestone-dot {
    width: 28px;
    height: 28px;
    grid-row: 1 / span 2;
}

.production-stage-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
}

.production-stage-copy strong {
    overflow: visible;
    color: var(--ink);
    font-size: 12px;
    white-space: normal;
}

.production-stage-copy small {
    overflow-wrap: anywhere;
}

.production-stage-controls {
    min-height: 30px;
    margin-top: 5px;
    justify-content: flex-start;
    grid-column: 2;
}

.production-stage-action,
.milestone-controls .production-stage-action {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 7px;
    box-shadow: none;
}

.story-summary-bar-seven {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.story-collapsible-panel {
    padding: 0;
    overflow: hidden;
}

.story-collapsible-summary {
    min-height: 76px;
    margin: 0;
    padding: 20px 24px;
    align-items: center;
    list-style: none;
}

.story-collapsible-summary::-webkit-details-marker {
    display: none;
}

.story-collapsible-summary::after {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--muted);
    font-family: bootstrap-icons;
    font-size: 16px;
    content: "\f282";
    transition: transform .18s ease;
}

.story-collapsible-panel[open] > .story-collapsible-summary {
    border-bottom: 1px solid var(--line);
}

.story-collapsible-panel[open] > .story-collapsible-summary::after {
    transform: rotate(180deg);
}

.story-collapsible-content {
    padding: 22px 24px 24px;
}

.asset-manifest-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.asset-manifest-group > h3 {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.asset-manifest-group + .asset-manifest-group {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.production-dashboard__header {
    align-items: center;
}

.production-metric-card {
    color: var(--ink);
    box-shadow: var(--shadow) !important;
}

.production-metric-card .h3 {
    color: var(--ink);
}

.production-metric-card--attention {
    background: linear-gradient(145deg, #fff, var(--danger-soft));
}

.production-panel {
    overflow: hidden;
}

.production-panel__header {
    border-color: var(--line) !important;
}

.production-stage-card {
    position: relative;
    overflow: hidden;
    border-color: #cfe0d6 !important;
    background:
        radial-gradient(circle at 94% 4%, rgba(39, 103, 73, .1), transparent 9rem),
        linear-gradient(150deg, #fff 35%, #f7fbf8);
    box-shadow: 0 12px 30px rgba(30, 73, 51, .07) !important;
}

.production-stage-card::before {
    position: absolute;
    z-index: 1;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), #1b8d83);
    content: "";
}

.production-stage-card:hover {
    border-color: #9fc5ae !important;
    box-shadow: 0 18px 38px rgba(30, 73, 51, .13) !important;
    transform: translateY(-2px);
}

.production-stage-card > a {
    position: relative;
    z-index: 2;
    padding: 20px;
    color: var(--ink);
}

.production-stage-card__header {
    display: grid;
    align-items: center;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
}

.production-stage-card__icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid #c8dfd1;
    border-radius: 13px;
    background: linear-gradient(145deg, #edf7f1, #dfefe6);
    color: var(--brand);
    font-size: 19px;
    box-shadow: inset 0 1px rgba(255, 255, 255, .8);
}

.production-stage-card__title {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.production-stage-card__title > span {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.production-stage-card__title > div {
    display: flex;
    align-items: baseline;
    gap: 5px;
    line-height: 1;
}

.production-stage-card__title strong {
    color: var(--ink);
    font-size: 28px;
    font-weight: 780;
    letter-spacing: -.045em;
}

.production-stage-card__title small {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 680;
}

.production-stage-card__failure {
    display: inline-flex;
    min-height: 28px;
    padding: 5px 9px;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
    color: var(--muted);
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.production-stage-card__failure strong {
    color: inherit;
    font-size: 11px;
}

.production-stage-card__failure.has-failures {
    border-color: #efbdc7;
    background: var(--danger-soft);
    color: var(--danger);
}

.production-stage-card__metrics {
    display: grid;
    min-height: 58px;
    margin-top: 17px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.production-stage-card__metrics > span:not(.visually-hidden) {
    display: grid;
    min-width: 0;
    padding: 9px 11px;
    align-items: center;
    grid-template-columns: 18px auto minmax(0, 1fr);
    gap: 5px;
    border: 1px solid rgba(207, 224, 214, .9);
    border-radius: 10px;
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
}

.production-stage-card__metrics i {
    color: var(--brand);
    font-size: 13px;
}

.production-stage-card__metrics strong {
    color: var(--ink);
    font-size: 14px;
}

.production-stage-card__metrics small {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-stage-card__footer {
    display: flex;
    min-height: 42px;
    padding: 10px 20px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(207, 224, 214, .9);
    background: rgba(239, 246, 242, .72);
    color: var(--muted);
    font-size: 11px;
}

.production-stage-card__footer > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.production-stage-card__footer > span i {
    color: var(--success);
}

.production-stage-card__footer strong {
    color: var(--ink);
    font-size: 12px;
}

.production-stage-card__footer > .bi-arrow-right {
    color: var(--brand);
    transition: transform .18s ease;
}

.production-stage-card:hover .production-stage-card__footer > .bi-arrow-right {
    transform: translateX(3px);
}

.production-health-item {
    min-height: 86px;
}

.production-empty-state {
    color: var(--muted);
}

.production-table th {
    white-space: nowrap;
}

.production-work-table td:nth-child(7) {
    min-width: 220px;
}

.production-policy-table input[type="number"] {
    max-width: 104px;
}

.production-activity-list .list-group-item-action {
    color: var(--ink);
}

@media (max-width: 1199px) {
    .production-stage-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .story-summary-bar-seven {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .story-summary-bar-seven > div:nth-child(4n+1) {
        border-left: 0;
    }

    .story-summary-bar-seven > div:nth-child(n+5) {
        border-top: 1px solid var(--line);
    }

    .story-library-bulk-select {
        flex: 1 1 180px;
    }
}

@media (max-width: 767px) {
    .campaign-filter-toolbar,
    .story-library-filter-form {
        padding: 16px;
    }

    .campaign-list-card .card-body,
    .campaign-outcome-summary .card-body {
        padding: 18px;
    }

    .campaign-section-heading,
    .campaign-bulk-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .campaign-bulk-actions,
    .campaign-bulk-actions .form-select,
    .campaign-bulk-actions .btn,
    .story-library-bulk-toolbar .btn,
    .story-library-bulk-toolbar .form-select {
        width: 100%;
    }

    .story-library-tabs,
    .production-tabs {
        margin-right: -1px;
        margin-left: -1px;
    }

    .story-library-page table {
        min-width: 920px;
    }

    .story-library-thumbnail {
        width: 72px;
        height: 72px;
    }

    .production-stage-groups {
        grid-template-columns: 1fr;
    }

    .story-summary-bar-seven {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .story-summary-bar-seven > div:nth-child(odd) {
        border-left: 0;
    }

    .story-summary-bar-seven > div:nth-child(n+3) {
        border-top: 1px solid var(--line);
    }

    .story-collapsible-summary {
        padding: 17px;
    }

    .story-collapsible-summary .badge {
        display: none;
    }

    .story-collapsible-content {
        padding: 17px;
    }

    .production-dashboard__header {
        align-items: stretch;
    }

    .production-dashboard__header > div:last-child {
        align-items: flex-start !important;
    }

    .production-stage-card > a {
        padding: 17px;
    }

    .production-stage-card__header {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 9px 11px;
    }

    .production-stage-card__icon {
        width: 40px;
        height: 40px;
        grid-row: 1 / span 2;
    }

    .production-stage-card__failure {
        width: max-content;
        grid-column: 2;
    }

    .production-stage-card__footer {
        padding-inline: 17px;
    }
}
