*{box-sizing:border-box}
:root{
    --sidebar:230px;
    --bg:#f4f6f8;
    --surface:#fff;
    --line:#e4e8ee;
    --line-soft:#edf0f3;
    --text:#1d2633;
    --muted:#667085;
    --nav:#111827;
    --nav-hover:#1f2937;
    --blue:#2563eb;
}
html,body{margin:0;width:100%;max-width:100%;min-height:100%;overflow-x:hidden}
body{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--text)}
img{display:block;max-width:100%}
a{color:inherit}
button,input,select,textarea{font:inherit}

/* shell */
.sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:var(--sidebar);
    height:100vh;
    padding:18px;
    background:var(--nav);
    color:#fff;
    z-index:1000;
    overflow-y:auto;
    overflow-x:hidden;
    scrollbar-width:none;
    -ms-overflow-style:none;
}
.sidebar::-webkit-scrollbar{width:0;height:0}
.brand{font-size:24px;font-weight:800;margin:4px 0 22px}
.brand small{font-size:11px;color:#8190a5}
.sidebar a,.sidebar button{
    display:block;width:100%;padding:10px 12px;margin:3px 0;
    color:#dbe4f0;text-decoration:none;background:transparent;border:0;
    text-align:left;border-radius:8px
}
.sidebar a:hover,.sidebar button:hover{background:var(--nav-hover)}
.sidebar .section{font-size:11px;color:#7f8da3;margin:18px 8px 6px;letter-spacing:.08em}
.logout-form{margin-top:25px}

.app-main{
    margin-left:var(--sidebar);
    min-height:100vh;
    min-width:0;
}
.app-header{
    height:58px;background:#fff;border-bottom:1px solid #e5e7eb;
    padding:18px 28px;text-align:right
}
.page-content{
    width:100%;
    min-width:0;
    padding:0 28px 32px;
}
.page-content>h1{margin:28px 0}
.page-content>.panel,
.page-content>.cards,
.page-content>.grid2,
.page-content>.page-head,
.page-content>.trend-card-list{margin-left:0;margin-right:0}

/* common */
h1{font-size:32px}
h2{margin-top:0}
.card,.panel{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:12px;
    padding:18px;
    box-shadow:0 1px 2px rgba(0,0,0,.03);
    min-width:0
}
.panel{overflow:hidden}
.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}
.metric{font-size:32px;font-weight:800}
.metric-date{font-size:20px;line-height:1.25}
.grid2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:18px}
.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.muted{color:var(--muted);font-size:13px}
.small{font-size:12px}
.alert{padding:10px 12px;background:#fee2e2;color:#991b1b;border-radius:8px;margin-bottom:12px}
.alert.success{background:#dcfce7;color:#166534}
label{display:block;font-size:13px;font-weight:700;margin:12px 0 5px}
input,select,textarea{width:100%;padding:10px 11px;border:1px solid #d7dce2;border-radius:8px;background:#fff;min-width:0}
textarea{resize:vertical}
button,.primary{border:0;border-radius:8px;padding:10px 14px;cursor:pointer}
.primary{background:var(--blue);color:#fff;font-weight:700;margin-top:14px}
.big{padding:13px 18px}
.btnlink{display:inline-block;padding:7px 10px;background:#eef2ff;color:#3730a3;text-decoration:none;border-radius:7px;font-size:12px;font-weight:700}
.action-strong{font-weight:800}
.danger-btn{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}
.badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:11px;font-weight:700}
.badge.danger{background:#fee2e2;color:#991b1b}

/* generic tables stay inside their panel */
.table-scroll{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:11px;border-bottom:1px solid var(--line-soft);font-size:14px}
th{font-size:12px;color:var(--muted);text-transform:uppercase;white-space:nowrap}

/* project video cards */
.video-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.video-card{display:grid;grid-template-columns:210px minmax(0,1fr);border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;background:#fff}
.video-card img{width:100%;height:100%;min-height:120px;object-fit:cover}
.video-body{padding:14px;min-width:0}
.video-body h3{margin:0 0 8px;font-size:16px;overflow-wrap:anywhere}
.video-stats{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}
.video-stats span{background:#f3f4f6;padding:5px 8px;border-radius:7px;font-size:12px}
.page-head{margin:28px 0}
.page-head h1{margin:0}
.research-cards{grid-template-columns:repeat(3,minmax(0,1fr))}

/* trend filters */
.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.trend-filters{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    align-items:end;
    margin:14px 0 18px
}
.checkbox-inline{display:flex;align-items:center;gap:8px;min-height:42px;margin:0}
.checkbox-inline input{width:auto}
.filter-action{display:flex;align-items:end}
.filter-action .primary{width:100%}
.trend-notice{padding:11px 13px;border:1px solid #e5e7eb;background:#f9fafb;border-radius:10px;font-size:13px;color:#4b5563}

/* trend cards */
.trend-card-list{display:grid;gap:12px;margin-top:16px;margin-bottom:18px}
.trend-video-card{
    display:grid;
    grid-template-columns:180px minmax(0,1fr);
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 1px 2px rgba(0,0,0,.03)
}
.trend-video-card.is-provisional{opacity:.9}
.trend-thumb{background:#eef1f5;min-height:138px}
.trend-thumb img{width:100%;height:100%;object-fit:cover}
.thumb-placeholder{height:100%;min-height:138px;display:grid;place-items:center;color:var(--muted);font-weight:700}
.trend-card-main{padding:15px;min-width:0}
.trend-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.signal-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.trend-card-main h3{font-size:17px;margin:10px 0 6px;overflow-wrap:anywhere}
.trend-meta{display:flex;gap:8px 14px;flex-wrap:wrap;color:var(--muted);font-size:12px}
.trend-metrics{
    display:grid;
    grid-template-columns:repeat(8,minmax(84px,1fr));
    gap:8px;
    margin:14px 0
}
.trend-metric{padding:9px 10px;background:#f8fafc;border:1px solid #eef1f5;border-radius:9px;min-width:0}
.trend-metric>span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;font-weight:700;margin-bottom:3px}
.trend-metric strong{display:block;font-size:15px;overflow-wrap:anywhere}
.trend-metric small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.primary-metric{background:#eef4ff;border-color:#dbe7ff}
.trend-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid var(--line-soft);padding-top:12px}
.trend-reason{min-width:0}
.trend-reason span{display:block;font-size:10px;color:var(--muted);text-transform:uppercase;font-weight:700}
.trend-reason strong{font-size:12px;font-weight:600;overflow-wrap:anywhere}

/* badges */
.trend-status{display:inline-block;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.02em}
.status-hot{background:#fee2e2;color:#991b1b}
.status-rising{background:#dcfce7;color:#166534}
.status-new{background:#dbeafe;color:#1d4ed8}
.status-watch{background:#f3f4f6;color:#374151}
.status-cooling{background:#fef3c7;color:#92400e}
.mode-badge{display:inline-block;padding:3px 7px;border-radius:999px;font-size:10px;font-weight:800}
.mode-live{background:#dcfce7;color:#166534}
.mode-provisional{background:#f3f4f6;color:#6b7280}
.confidence{display:inline-block;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800}
.confidence-low{background:#f3f4f6;color:#6b7280}
.confidence-medium{background:#fef3c7;color:#92400e}
.confidence-high{background:#dcfce7;color:#166534}
.score-pill{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:36px;padding:0 8px;border-radius:10px;background:#111827;color:#fff;font-weight:800}
.trend-up{color:#067647;font-weight:700}
.trend-down{color:#b42318;font-weight:700}
.status-help{display:flex;gap:12px;flex-wrap:wrap}
.status-help>div{display:flex;gap:7px;align-items:center}
.empty-state{text-align:center;color:var(--muted)}

/* login */
.login-page{display:flex;min-height:100vh;align-items:center;justify-content:center}
.login-card{width:min(390px,92vw);background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:28px;box-shadow:0 12px 30px rgba(0,0,0,.08)}
.login-card h1{margin:0}
.login-card button{width:100%}

/* mobile drawer */
.mobile-menu-btn{display:none}
.sidebar-backdrop{display:none}

@media(max-width:1180px){
    .cards{grid-template-columns:repeat(3,minmax(0,1fr))}
    .grid2{grid-template-columns:1fr}
    .video-grid{grid-template-columns:1fr}
    .trend-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
}

@media(max-width:900px){
    .sidebar{
        width:min(82vw,290px);
        transform:translateX(-105%);
        transition:transform .2s ease;
        box-shadow:12px 0 28px rgba(0,0,0,.22)
    }
    body.menu-open .sidebar{transform:translateX(0)}
    body.menu-open{overflow:hidden}
    .app-main{margin-left:0}
    .app-header{height:58px;padding:18px 16px 18px 64px}
    .page-content{padding:0 14px 24px}
    .mobile-menu-btn{
        display:block;position:fixed;top:9px;left:10px;z-index:1100;
        width:40px;height:40px;padding:9px;background:#fff;border:1px solid #dbe1e8;
        border-radius:9px;box-shadow:0 2px 10px rgba(0,0,0,.08)
    }
    .mobile-menu-btn span{display:block;height:2px;background:#111827;margin:4px 0;border-radius:2px}
    .sidebar-backdrop{position:fixed;inset:0;background:rgba(17,24,39,.45);z-index:999}
    body.menu-open .sidebar-backdrop{display:block}
    .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
    .trend-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
    .trend-video-card{grid-template-columns:150px minmax(0,1fr)}
    .trend-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:600px){
    .page-content{padding:0 10px 20px}
    .page-content>h1{font-size:25px;margin:18px 0}
    .cards,.research-cards{grid-template-columns:1fr}
    .card,.panel{padding:13px}
    .metric{font-size:27px}
    .metric-date{font-size:17px}
    .trend-filters{grid-template-columns:1fr;gap:8px}
    .filter-action .primary{margin-top:0}
    .trend-video-card{display:block}
    .trend-thumb{height:auto;min-height:0;aspect-ratio:16/9}
    .trend-thumb img{height:100%}
    .trend-card-main{padding:13px}
    .trend-card-top{align-items:center}
    .trend-card-main h3{font-size:16px}
    .trend-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
    .trend-card-bottom{display:grid;grid-template-columns:1fr}
    .trend-card-bottom .btnlink{text-align:center;padding:10px}
    .row{grid-template-columns:1fr}
    .video-card{display:block}
    .video-card img{width:100%;height:auto;aspect-ratio:16/9;min-height:0}
    .table-scroll{margin:0 -3px;padding-bottom:4px}
    table{min-width:640px}
    th,td{font-size:12px;padding:9px 8px}
}

@media(max-width:380px){
    .trend-metrics{grid-template-columns:1fr}
}


/* ===== VideoAI 0.3.7 universal card UI ===== */
.title-link{color:inherit;text-decoration:none}
.title-link:hover{text-decoration:underline}
.meta-link{color:#475467;text-decoration:none;font-weight:700}
.meta-link:hover{color:#2563eb}
.btn-youtube{background:#fff0f0;color:#b42318}
.card-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.card-actions form{margin:0}
.trend-thumb{display:block;text-decoration:none}
.trend-thumb:hover img{transform:scale(1.015)}
.trend-thumb img{transition:transform .15s ease}

.entity-card-list{display:grid;gap:12px;margin-bottom:18px}
.compact-list{gap:10px}
.entity-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    min-width:0;
    padding:16px 18px;
    background:#fff;
    border:1px solid #e4e8ee;
    border-radius:12px;
    box-shadow:0 1px 2px rgba(0,0,0,.03)
}
.entity-main{min-width:0;flex:1}
.entity-main h3{margin:3px 0 8px;font-size:16px;overflow-wrap:anywhere}
.entity-eyebrow{
    font-size:10px;
    font-weight:800;
    color:#667085;
    text-transform:uppercase;
    letter-spacing:.06em
}
.entity-meta{display:flex;gap:7px 15px;flex-wrap:wrap;color:#667085;font-size:12px}
.entity-side{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    flex-wrap:wrap
}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}
.inline-error{
    margin-top:9px;
    padding:8px 10px;
    background:#fff1f2;
    color:#9f1239;
    border-radius:7px;
    font-size:12px;
    overflow-wrap:anywhere
}
.cost-value{font-size:22px;font-weight:800;white-space:nowrap}
.mini-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.mini-card{
    padding:13px;
    border:1px solid #e8ebef;
    border-radius:10px;
    background:#f9fafb
}
.mini-card span{display:block;font-size:11px;color:#667085;margin-bottom:4px}
.mini-card strong{font-size:18px}
.progress{height:6px;background:#e5e7eb;border-radius:99px;overflow:hidden;margin-top:9px}
.progress i{display:block;height:100%;background:#2563eb;border-radius:99px}
.audit-list{grid-template-columns:repeat(2,minmax(0,1fr))}
.audit-card{align-items:flex-start}

@media(max-width:900px){
    .audit-list{grid-template-columns:1fr}
}

@media(max-width:600px){
    .entity-card{
        display:grid;
        grid-template-columns:1fr;
        gap:12px;
        padding:13px
    }
    .entity-side{
        width:100%;
        justify-content:flex-start
    }
    .entity-side>.btnlink,
    .entity-side>form,
    .entity-side>.card-actions{
        max-width:100%
    }
    .entity-side form button{min-height:40px}
    .card-actions{
        width:100%;
        justify-content:flex-start
    }
    .card-actions .btnlink{flex:1;text-align:center}
    .mini-card-grid{grid-template-columns:1fr}
    .cost-value{font-size:19px}
}

/* ===== VideoAI 0.4 Channel Intelligence / Trend-to-Studio ===== */
.intel-strip{
    display:grid;
    grid-template-columns:repeat(4,minmax(90px,1fr));
    gap:8px;
    margin-top:12px
}
.intel-strip>div{
    padding:9px 10px;
    border:1px solid #e8ebef;
    border-radius:9px;
    background:#f8fafc;
    min-width:0
}
.intel-strip span{
    display:block;
    color:#667085;
    font-size:10px;
    text-transform:uppercase;
    font-weight:700
}
.intel-strip strong{
    display:block;
    margin-top:2px;
    font-size:16px;
    overflow-wrap:anywhere
}
.trend-seed-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:13px;
    margin-bottom:14px;
    border:1px solid #bfdbfe;
    border-radius:10px;
    background:#eff6ff
}
.channel-intel-card .entity-main{min-width:0}
@media(max-width:900px){
    .intel-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
    .intel-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
    .trend-seed-card{display:grid;grid-template-columns:1fr}
}
@media(max-width:360px){
    .intel-strip{grid-template-columns:1fr}
}

/* ===== VideoAI 0.4.2 project actions ===== */
.project-page-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px
}
.project-page-head>div{min-width:0;flex:1}
.project-page-head form{flex:0 0 auto}
@media(max-width:600px){
    .project-page-head{
        display:grid;
        grid-template-columns:1fr
    }
    .project-page-head form,
    .project-page-head .danger-btn{
        width:100%
    }
}


/* ===== VideoAI 0.5 Fact Graph + Script ===== */
.llm-settings{
    margin:16px 0;
    padding:14px;
    border:1px solid #dbeafe;
    border-radius:10px;
    background:#f8fbff
}
.ai-action-panel,
.ai-working{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-bottom:18px;
    border-color:#bfdbfe;
    background:#f8fbff
}
.ai-action-panel h2,
.ai-working h2{margin:3px 0 7px}
.spinner-dot{
    flex:0 0 auto;
    width:14px;
    height:14px;
    border-radius:50%;
    background:#2563eb;
    box-shadow:0 0 0 8px rgba(37,99,235,.12)
}
.brief-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px
}
.brief-box{
    padding:13px;
    border:1px solid #e8ebef;
    border-radius:10px;
    background:#f9fafb
}
.brief-wide{grid-column:1/-1}
.brief-box>span{
    display:block;
    color:#667085;
    font-size:10px;
    text-transform:uppercase;
    font-weight:800;
    letter-spacing:.04em
}
.brief-box p{margin:7px 0 0;line-height:1.55}
.brief-box ul{margin:8px 0 0;padding-left:18px}
.confidence-big{
    font-size:24px;
    font-weight:800;
    text-align:right
}
.confidence-big small{
    display:block;
    color:#667085;
    font-size:10px;
    font-weight:600
}
.fact-card-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px
}
.fact-card{
    padding:13px;
    border:1px solid #e5e7eb;
    border-left-width:4px;
    border-radius:10px;
    background:#fff
}
.fact-card.risk-low{border-left-color:#22c55e}
.fact-card.risk-medium{border-left-color:#f59e0b}
.fact-card.risk-high{border-left-color:#ef4444}
.fact-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px
}
.fact-category{
    display:inline-block;
    margin-right:6px;
    color:#475467;
    font-size:10px;
    font-weight:800
}
.fact-card p{line-height:1.5}
.fact-foot{
    display:flex;
    gap:6px 12px;
    flex-wrap:wrap;
    color:#667085;
    font-size:10px
}
.script-editor-panel textarea{
    line-height:1.5
}
.script-textarea{
    min-height:520px;
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
    font-size:13px
}
.section-card-list{display:grid;gap:10px}
.section-card{
    display:grid;
    grid-template-columns:48px minmax(0,1fr);
    gap:12px;
    padding:13px;
    border:1px solid #e6e9ee;
    border-radius:10px;
    background:#fff
}
.section-index{
    width:40px;
    height:40px;
    display:grid;
    place-items:center;
    border-radius:10px;
    background:#111827;
    color:#fff;
    font-weight:800
}
.section-content h3{margin:4px 0 7px}
.section-content p{margin:0;line-height:1.55}

@media(max-width:900px){
    .fact-card-list{grid-template-columns:1fr}
}

@media(max-width:600px){
    .ai-action-panel,
    .ai-working{
        display:grid;
        grid-template-columns:1fr
    }
    .ai-action-panel form,
    .ai-action-panel button{width:100%}
    .brief-grid{grid-template-columns:1fr}
    .brief-wide{grid-column:auto}
    .confidence-big{text-align:left}
    .section-card{grid-template-columns:38px minmax(0,1fr)}
    .section-index{width:34px;height:34px}
    .script-textarea{min-height:420px}
}

/* ===== VideoAI 0.5.1 Multi LLM Router ===== */
.preset-help{
    margin-top:12px;
    padding:10px;
    border:1px dashed #cbd5e1;
    border-radius:9px;
    background:#fff;
    color:#475467;
    font-size:12px;
    line-height:1.6
}
.preset-help strong{display:block;margin-bottom:4px;color:#111827}
.preset-help code{font-weight:700}

/* ===== VideoAI 0.5.2 Groq reasoning ===== */
#groqReasoning{
    margin-top:12px;
    padding:11px;
    border:1px solid #e5e7eb;
    border-radius:9px;
    background:#fff
}

/* ===== VideoAI 0.5.3 Research Quality + Script Length Control ===== */
.duration-fit{
    margin-top:9px;
    max-width:420px;
    display:grid;
    grid-template-columns:auto auto;
    gap:4px 10px;
    align-items:center
}
.duration-fit span{font-size:10px;color:#667085;text-transform:uppercase;font-weight:800}
.duration-fit strong{font-size:12px;text-align:right}
.duration-fit i{
    grid-column:1/-1;
    display:block;
    height:7px;
    background:#e5e7eb;
    border-radius:99px;
    overflow:hidden
}
.duration-fit b{display:block;height:100%;border-radius:99px;background:#2563eb}
.duration-fit.fit-warn b{background:#f59e0b}
.duration-fit.fit-bad b{background:#ef4444}
.relevance-chip{font-weight:800}
.relevance-chip.rel-high{background:#ecfdf3;color:#027a48}
.relevance-chip.rel-mid{background:#fffaeb;color:#b54708}
.relevance-chip.rel-low{background:#fff1f3;color:#c01048}

/* ===== VideoAI 0.5.5 Script Length Guarantee ===== */
.script-length-status{
    display:inline-block;
    margin-top:8px;
    padding:4px 8px;
    border-radius:999px;
    font-size:10px;
    font-weight:900;
    letter-spacing:.04em
}
.script-length-status.length-pass{background:#ecfdf3;color:#027a48}
.script-length-status.length-short{background:#fff1f3;color:#c01048}

.role-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:7px 0 14px}
.role-check{display:flex;align-items:center;gap:7px;padding:8px;border:1px solid #e5e7eb;border-radius:8px;background:#fff}
.role-check input{width:auto;margin:0}.role-check span{font-size:12px}
@media(max-width:600px){.role-grid{grid-template-columns:1fr}}


/* VideoAI 0.6.4 - generation trace / section QC */
.generation-trace,.script-qc-panel{margin-top:14px;padding:12px 14px;border:1px solid var(--border,#dfe5ee);border-radius:12px;background:var(--surface-soft,#f8fafc)}
.trace-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px}
.trace-chips span,.provider-chip,.qc-chip{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border:1px solid var(--border,#dfe5ee);border-radius:999px;background:#fff;font-size:12px;line-height:1.2}
.trace-chips b{font-weight:700}
.script-qc-panel ul{margin:8px 0 0 18px;padding:0}
.section-meta-line{display:flex;align-items:center;flex-wrap:wrap;gap:6px 9px}
.section-meta-line>span:not(.provider-chip):not(.qc-chip){display:inline-flex}
.provider-chip{font-weight:700;text-transform:none;letter-spacing:0}
.qc-chip{font-weight:700}
.qc-pass{border-color:#b8e6c8;background:#f0fbf4}
.qc-short,.qc-warn{border-color:#f2d39e;background:#fff9ec}
.qc-fail{border-color:#efb5b5;background:#fff1f1}
@media(max-width:700px){
  .trace-chips{display:grid;grid-template-columns:1fr}
  .trace-chips span{justify-content:space-between}
  .section-meta-line{align-items:flex-start}
}

/* ===== Generic compute runtime status ===== */
.runtime-info{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0}
.runtime-info>div{padding:9px 10px;border:1px solid #eaecf0;border-radius:9px;background:#fcfcfd;min-width:0}
.runtime-info span{display:block;color:#667085;font-size:10px;margin-bottom:3px;text-transform:uppercase;letter-spacing:.03em}
.runtime-info strong{display:block;font-size:12px;overflow-wrap:anywhere}
.badge.status-ready{background:#dcfce7;color:#166534}
.badge.status-downloading,.badge.status-allocating,.badge.status-starting,.badge.status-warming{background:#dbeafe;color:#1d4ed8}
.badge.status-stopping{background:#fef3c7;color:#92400e}
.badge.status-stopped{background:#f3f4f6;color:#475467}
.badge.status-not-found{background:#fee2e2;color:#991b1b}
@media(max-width:560px){.runtime-info{grid-template-columns:1fr 1fr}}

/* ===== VideoAI 0.8.2 Production Foundation ===== */
.studio-mode-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}
.studio-mode-tabs a{display:inline-flex;align-items:center;padding:9px 12px;border:1px solid #d0d5dd;border-radius:10px;background:#fff;color:#344054;text-decoration:none;font-weight:800;font-size:12px}
.studio-mode-tabs a.active{background:#111827;color:#fff;border-color:#111827}
.studio-two-col{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(280px,.7fr);gap:14px;align-items:start}
.engine-status-card{position:sticky;top:18px}
.ai-chat-layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:14px;align-items:start}
.ai-chat-sidebar{padding:12px;position:sticky;top:18px;max-height:calc(100vh - 60px);overflow:auto}
.chat-new-form{display:grid;gap:8px;margin-bottom:12px}
.chat-conversation-list{display:grid;gap:6px}
.chat-conversation{display:grid;gap:3px;padding:9px 10px;border:1px solid #eaecf0;border-radius:9px;background:#fff;text-decoration:none;color:#101828}
.chat-conversation.active{border-color:#98a2b3;background:#f9fafb}
.chat-conversation span{font-size:10px;color:#667085}
.ai-chat-main{min-height:70vh}
.chat-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border-bottom:1px solid #eaecf0;padding-bottom:10px}
.chat-head h2{margin:3px 0}
.router-chips{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.chat-messages{display:grid;gap:12px;padding:14px 0}
.chat-message{max-width:88%;padding:12px 14px;border-radius:14px;border:1px solid #e4e7ec;background:#fff}
.chat-message.role-user{margin-left:auto;background:#f2f4f7}
.chat-message.role-assistant{margin-right:auto;border-left:4px solid #2563eb}
.chat-role{font-size:10px;font-weight:900;text-transform:uppercase;color:#667085;margin-bottom:6px}
.chat-content{line-height:1.62;overflow-wrap:anywhere}
.chat-meta,.chat-actions,.chat-composer-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.chat-meta{margin-top:9px;color:#667085;font-size:10px}
.chat-actions{margin-top:9px}
.chat-actions form{margin:0}
.chat-actions button{font-size:11px;padding:7px 9px}
.chat-composer{position:sticky;bottom:0;padding-top:10px;background:#fff;border-top:1px solid #eaecf0}
.chat-composer textarea{min-height:110px}
.chat-composer-row{justify-content:space-between}
.generation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:18px}
.generation-card{min-width:0}
.generation-card p{line-height:1.55;overflow-wrap:anywhere}
.generation-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:8px}
.media-engine-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
@media(max-width:980px){.studio-two-col,.ai-chat-layout{grid-template-columns:1fr}.engine-status-card,.ai-chat-sidebar{position:static;max-height:none}.generation-grid{grid-template-columns:1fr}}
@media(max-width:600px){.studio-mode-tabs{display:grid;grid-template-columns:1fr}.studio-mode-tabs a{justify-content:center}.chat-message{max-width:100%}.chat-head,.media-engine-banner{display:grid}.router-chips{justify-content:flex-start}.chat-composer-row{align-items:stretch}.chat-composer-row button{width:100%}}

/* 0.8.3 AI Chat routing */
.chat-routing-bar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:12px 0 2px;padding:10px 12px;border:1px solid #e4e7ec;border-radius:12px;background:#f8fafc}
.chat-routing-copy{display:grid;gap:2px}.chat-routing-status{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.route-pill{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:10px;font-weight:800}
.chat-route-controls{display:grid;grid-template-columns:180px minmax(280px,1fr);gap:10px;margin-bottom:10px}
.chat-route-controls label{display:grid;gap:5px}.chat-route-controls label>span{font-size:10px;font-weight:900;text-transform:uppercase;color:#667085}
#manualTargetWrap[hidden]{display:none!important}.route-ready{font-size:11px;font-weight:800;color:#067647}
.chat-content p{margin:0 0 9px}.chat-content p:last-child{margin-bottom:0}.chat-content h1,.chat-content h2,.chat-content h3,.chat-content h4{margin:12px 0 7px;line-height:1.3}.chat-content h1{font-size:20px}.chat-content h2{font-size:18px}.chat-content h3{font-size:16px}.chat-content h4{font-size:14px}.chat-content ul,.chat-content ol{margin:6px 0 10px 22px;padding:0}.chat-content li{margin:3px 0}.chat-content code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:#f2f4f7;padding:2px 4px;border-radius:5px;font-size:.92em}.chat-content pre{overflow:auto;background:#101828;color:#f2f4f7;padding:10px;border-radius:8px}.chat-content pre code{background:transparent;padding:0;color:inherit}.chat-content hr{border:0;border-top:1px solid #e4e7ec;margin:12px 0}
@media(max-width:700px){.chat-routing-bar{display:grid}.chat-routing-status{justify-content:flex-start}.chat-route-controls{grid-template-columns:1fr}}

/* 0.8.4 AI Chat workspaces + conversation delete */
.chat-workspace-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px}
.chat-workspace-tabs a{display:inline-flex;align-items:center;padding:8px 11px;border:1px solid #d0d5dd;border-radius:999px;background:#fff;color:#344054;text-decoration:none;font-size:11px;font-weight:850}
.chat-workspace-tabs a.active{background:#111827;border-color:#111827;color:#fff}
.chat-field-label{font-size:10px;font-weight:900;text-transform:uppercase;color:#667085}
.chat-conversation-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 30px;gap:4px;align-items:stretch;border:1px solid #eaecf0;border-radius:9px;background:#fff;overflow:hidden}
.chat-conversation-row.active{border-color:#98a2b3;background:#f9fafb}
.chat-conversation-row .chat-conversation{border:0;border-radius:0;background:transparent;min-width:0}
.chat-conversation-titleline{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}
.chat-conversation-titleline strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workspace-mini,.workspace-badge{display:inline-flex;align-items:center;border-radius:999px;font-weight:900;white-space:nowrap}
.workspace-mini{padding:3px 6px;font-size:8px;letter-spacing:.03em}
.workspace-mini.general,.workspace-badge.general{background:#ecfdf3;color:#067647}
.workspace-mini.video,.workspace-badge.video{background:#eef2ff;color:#3730a3}
.workspace-badge{padding:5px 8px;font-size:10px}
.chat-delete-form{display:flex;margin:0;border-left:1px solid #eaecf0}
.chat-delete-button{width:100%;min-width:30px;padding:0;border:0;border-radius:0;background:transparent;color:#98a2b3;font-size:20px;line-height:1;cursor:pointer}
.chat-delete-button:hover{background:#fff1f0;color:#b42318}
.chat-title-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.workspace-explainer{display:flex;gap:8px;align-items:flex-start;margin:12px 0 2px;padding:9px 11px;border-radius:10px;font-size:11px;line-height:1.45}
.workspace-explainer strong{white-space:nowrap}
.workspace-explainer.general{background:#ecfdf3;color:#05603a}
.workspace-explainer.video{background:#eef2ff;color:#3730a3}
@media(max-width:600px){.chat-workspace-tabs{display:grid;grid-template-columns:repeat(3,1fr)}.chat-workspace-tabs a{justify-content:center}.workspace-explainer{display:grid}.chat-conversation-row{grid-template-columns:minmax(0,1fr) 36px}}

/* ===== VideoAI Production Status ===== */
.production-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:4px 0 10px}
.production-page-head h2{margin-bottom:3px}
.production-live-indicator{display:inline-flex;align-items:center;gap:7px;font-size:10px;font-weight:900;letter-spacing:.08em;color:#067647;white-space:nowrap}
.production-live-indicator span{width:8px;height:8px;border-radius:50%;background:#12b76a;box-shadow:0 0 0 4px #dcfae6}
.production-grid{align-items:start}
.production-card{display:grid;gap:12px}
.production-title-row{margin:0;align-items:flex-start}
.production-status-badge{display:inline-flex;align-items:center;justify-content:center;min-height:26px;padding:5px 9px;border-radius:999px;font-size:10px;font-weight:900;letter-spacing:.02em;white-space:nowrap;background:#f2f4f7;color:#344054}
.production-status-badge.tone-ok{background:#dcfae6;color:#067647}
.production-status-badge.tone-active{background:#dbeafe;color:#1d4ed8}
.production-status-badge.tone-wait{background:#fff3cd;color:#8a5a00}
.production-status-badge.tone-bad{background:#fee4e2;color:#b42318}
.production-status-badge.tone-neutral{background:#f2f4f7;color:#344054}
.production-steps{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.production-step{position:relative;display:grid;justify-items:center;align-content:start;gap:6px;text-align:center;min-width:0;color:#98a2b3;font-size:9px;font-weight:800;line-height:1.25}
.production-step:before{content:"";position:absolute;top:7px;left:-50%;width:100%;height:2px;background:#e4e7ec;z-index:0}
.production-step:first-child:before{display:none}
.production-step-dot{position:relative;z-index:1;width:16px;height:16px;border:3px solid #e4e7ec;border-radius:50%;background:#fff}
.production-step.done{color:#067647}.production-step.done .production-step-dot{border-color:#12b76a;background:#12b76a}.production-step.done:before{background:#12b76a}
.production-step.active{color:#1d4ed8}.production-step.active .production-step-dot{border-color:#2563eb;background:#fff;box-shadow:0 0 0 3px #dbeafe}.production-step.active:before{background:#12b76a}
.production-step.error{color:#b42318}.production-step.error .production-step-dot{border-color:#f04438;background:#fee4e2}.production-step.error:before{background:#fda29b}
.production-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.production-metrics>div{padding:8px 9px;border:1px solid #eaecf0;border-radius:9px;background:#fcfcfd;min-width:0}
.production-metrics span,.production-output>span,.production-prompt>span{display:block;margin-bottom:3px;color:#667085;font-size:9px;text-transform:uppercase;letter-spacing:.04em;font-weight:800}
.production-metrics strong{display:block;font-size:11px;overflow-wrap:anywhere}
.production-prompt{padding:10px 11px;border:1px solid #eaecf0;border-radius:10px;background:#fff}
.production-prompt p{margin:0;font-size:12px;max-height:150px;overflow:auto}
.production-output{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 10px;align-items:center;padding:10px 11px;border:1px solid #a6f4c5;border-radius:10px;background:#ecfdf3}
.production-output>span{grid-column:1/-1;color:#067647;margin:0}
.production-output code,.production-media-path{min-width:0;overflow-wrap:anywhere;font-size:10px;color:#344054}
.production-error{padding:9px 10px;border:1px solid #fda29b;border-radius:9px;background:#fff1f0;color:#b42318;font-size:11px;line-height:1.45;overflow-wrap:anywhere}
.production-actions{margin-top:0}
.production-media-path{display:block;margin:7px 0 10px;padding:8px 9px;border-radius:8px;background:#f2f4f7}
@media(max-width:760px){
  .production-page-head{display:grid;align-items:start}.production-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .production-steps{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:12px}.production-step:before{display:none}
}
@media(max-width:480px){.production-metrics{grid-template-columns:1fr 1fr}.production-output{grid-template-columns:1fr}.production-output .btnlink{justify-content:center}.production-status-badge{white-space:normal;text-align:center}}

/* ===== Video generation progress + private video preview ===== */


/* VideoAI Media delete + pagination + mobile */
.production-delete-form .danger{
    border-color:#dc2626;
    color:#b91c1c;
    background:#fff;
}
.production-delete-form .danger:hover{
    background:#fef2f2;
}

.media-pagination{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin:18px 0 28px;
}
.media-pagination-count{
    font-size:13px;
    color:#64748b;
}
.media-pagination-actions{
    display:flex;
    align-items:center;
    gap:8px;
}

@media (max-width:760px){
    .media-engine-banner{
        flex-direction:column;
        align-items:stretch;
        gap:14px;
    }

    .media-engine-banner > .btnlink{
        width:100%;
        box-sizing:border-box;
        text-align:center;
    }

    .production-page-head{
        align-items:flex-start;
        gap:10px;
    }

    .production-title-row{
        align-items:flex-start;
        gap:10px;
    }

    .production-status-badge{
        flex:0 0 auto;
        white-space:nowrap;
    }

    .production-steps{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px;
    }

    .production-step{
        min-width:0;
    }

    .production-metrics-primary{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    }

    .production-card .card-actions{
        display:grid;
        grid-template-columns:1fr;
        gap:8px;
    }

    .production-card .card-actions form,
    .production-card .card-actions button{
        width:100%;
        box-sizing:border-box;
    }

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

    .production-output > .btnlink{
        width:100%;
        box-sizing:border-box;
        text-align:center;
    }

    .production-video video{
        display:block;
        width:100%;
        max-width:100%;
        height:auto;
    }

    .production-prompt p,
    .production-output code,
    .production-tech-details strong{
        overflow-wrap:anywhere;
        word-break:break-word;
    }

    .media-pagination{
        flex-direction:column;
        align-items:stretch;
    }

    .media-pagination-actions{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .media-pagination-actions .btnlink{
        text-align:center;
    }
}

@media (max-width:480px){
    .production-metrics-primary{
        grid-template-columns:1fr !important;
    }

    .production-title-row{
        flex-direction:column;
    }

    .production-status-badge{
        align-self:flex-start;
    }

    .media-pagination-actions{
        grid-template-columns:1fr;
    }
}


/* VideoAI prompt collapse + bulk cleanup */
.production-prompt-details{
    margin-top:12px;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#fff;
    overflow:hidden;
}
.production-prompt-details > summary{
    padding:12px 14px;
    cursor:pointer;
    user-select:none;
    font-weight:700;
}
.production-prompt-details[open] > summary{
    border-bottom:1px solid #e2e8f0;
}
.production-prompt-details .production-prompt{
    margin:0;
    padding:14px;
    border:0;
}
.prompt-summary-open{
    display:none;
}
.production-prompt-details[open] .prompt-summary-open{
    display:inline;
}
.production-prompt-details[open] .prompt-summary-closed{
    display:none;
}

.media-cleanup-bar{
    margin-bottom:16px;
}
.media-cleanup-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:18px;
}
.media-cleanup-head p{
    margin-bottom:0;
}
.media-select-page{
    display:flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
    font-size:13px;
    cursor:pointer;
}
.media-cleanup-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}
.media-cleanup-actions button{
    width:auto;
}
.production-title-main{
    display:flex;
    align-items:flex-start;
    gap:10px;
    min-width:0;
}
.generation-select-wrap{
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:24px;
    min-height:24px;
    cursor:pointer;
}
.generation-select{
    width:18px;
    height:18px;
    margin:0;
    cursor:pointer;
    accent-color:currentColor;
}

@media (max-width:760px){
    .media-cleanup-head{
        flex-direction:column;
        align-items:stretch;
    }

    .media-select-page{
        white-space:normal;
    }

    .media-cleanup-actions{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .media-cleanup-actions button{
        width:100%;
        min-width:0;
    }
}

@media (max-width:480px){
    .media-cleanup-actions{
        grid-template-columns:1fr;
    }

    .production-title-main{
        width:100%;
    }
}


/* VideoAI automatic cleanup */
.media-auto-cleanup-form{
    margin-top:14px;
    padding:14px;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#f8fafc;
}

.media-auto-cleanup-row{
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
}

.media-auto-switch{
    display:flex;
    align-items:center;
    gap:9px;
    cursor:pointer;
    white-space:nowrap;
}

.media-auto-switch input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.media-auto-switch-ui{
    position:relative;
    width:42px;
    height:24px;
    flex:0 0 42px;
    border-radius:999px;
    background:#cbd5e1;
    transition:.18s ease;
}

.media-auto-switch-ui::after{
    content:"";
    position:absolute;
    width:18px;
    height:18px;
    top:3px;
    left:3px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 1px 3px rgba(15,23,42,.25);
    transition:.18s ease;
}

.media-auto-switch input:checked + .media-auto-switch-ui{
    background:#16a34a;
}

.media-auto-switch input:checked + .media-auto-switch-ui::after{
    transform:translateX(18px);
}

.media-auto-days{
    display:flex;
    align-items:center;
    gap:8px;
    flex:1 1 360px;
    min-width:260px;
}

.media-auto-days input{
    width:82px;
    flex:0 0 82px;
    margin:0;
}

.media-auto-cleanup-form > small{
    display:block;
    margin-top:9px;
}

/* Prompt = Teknik Detaylar ile aynı component */
.production-prompt-details{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:12px;
}

.production-prompt-details > summary{
    padding:12px 14px;
}

.production-prompt-details[open] > summary{
    border-bottom:1px solid #e2e8f0;
}

.production-prompt-details .production-prompt{
    padding:14px;
    background:transparent;
}

@media (max-width:760px){
    .media-auto-cleanup-row{
        display:grid;
        grid-template-columns:1fr;
        align-items:stretch;
    }

    .media-auto-switch{
        width:100%;
    }

    .media-auto-days{
        min-width:0;
        width:100%;
        align-items:center;
    }

    .media-auto-cleanup-row > button{
        width:100%;
    }
}

@media (max-width:480px){
    .media-auto-days{
        align-items:flex-start;
    }

    .media-auto-days span{
        line-height:1.35;
    }
}


/* VideoAI cleanup panel final layout */
.media-cleanup-bar{
    display:grid;
    gap:14px;
}

.media-cleanup-intro > strong{
    display:block;
    font-size:16px;
}

.media-cleanup-intro p{
    margin:6px 0 0;
}

.media-cleanup-section{
    padding:14px;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#f8fafc;
}

.media-cleanup-section-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:12px;
}

.media-cleanup-section-head strong{
    display:block;
}

.media-auto-cleanup-form{
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
}

.media-auto-cleanup-row{
    display:grid;
    grid-template-columns:minmax(210px,auto) minmax(220px,320px) auto;
    align-items:end;
    gap:14px;
}

.media-auto-switch{
    display:flex;
    align-items:center;
    gap:10px;
    margin:0;
    min-height:42px;
    cursor:pointer;
}

.media-auto-switch input{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    min-width:0 !important;
    padding:0 !important;
    margin:0 !important;
    opacity:0 !important;
    pointer-events:none;
}

.media-auto-switch-ui{
    position:relative;
    display:block;
    width:44px;
    height:24px;
    flex:0 0 44px;
    border-radius:999px;
    background:#cbd5e1;
    transition:.18s ease;
}

.media-auto-switch-ui::after{
    content:"";
    position:absolute;
    width:18px;
    height:18px;
    top:3px;
    left:3px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 1px 3px rgba(15,23,42,.25);
    transition:.18s ease;
}

.media-auto-switch input:checked + .media-auto-switch-ui{
    background:#16a34a;
}

.media-auto-switch input:checked + .media-auto-switch-ui::after{
    transform:translateX(20px);
}

.media-auto-switch-copy{
    display:grid;
    gap:1px;
}

.media-auto-switch-copy small{
    color:#64748b;
    font-weight:500;
}

.media-auto-days{
    display:grid;
    gap:5px;
    margin:0;
    min-width:0;
}

.media-field-label{
    font-size:12px;
    color:#64748b;
    font-weight:700;
}

.media-auto-days-control{
    display:flex;
    align-items:center;
    gap:8px;
}

.media-auto-days-control input{
    width:88px !important;
    min-width:88px !important;
    flex:0 0 88px !important;
    margin:0 !important;
}

.media-auto-days-control > span{
    font-weight:700;
}

.media-auto-save{
    margin:0;
    white-space:nowrap;
    min-height:42px;
}

.media-auto-description{
    margin:10px 0 0;
    font-size:12px;
}

.media-select-page{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0;
    cursor:pointer;
    white-space:nowrap;
}

.media-select-page input{
    width:18px !important;
    min-width:18px !important;
    height:18px;
    margin:0 !important;
    padding:0 !important;
}

.media-cleanup-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:0;
}

.media-cleanup-actions button{
    width:auto;
    margin:0;
}

/* Prompt ve Teknik Detaylar aynı visual component */
.production-card .production-prompt-details{
    margin-top:12px;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#f8fafc;
    overflow:hidden;
}

.production-card .production-prompt-details > summary{
    padding:12px 14px;
    cursor:pointer;
    user-select:none;
    font-weight:700;
}

.production-card .production-prompt-details[open] > summary{
    border-bottom:1px solid #e2e8f0;
}

.production-card .production-prompt-details .production-prompt{
    margin:0;
    padding:14px;
    border:0;
    background:transparent;
}

@media (max-width:760px){
    .media-cleanup-section-head{
        align-items:flex-start;
        flex-direction:column;
    }

    .media-auto-cleanup-row{
        grid-template-columns:1fr;
        align-items:stretch;
    }

    .media-auto-switch{
        width:100%;
    }

    .media-auto-days{
        width:100%;
    }

    .media-auto-days-control{
        justify-content:flex-start;
    }

    .media-auto-save{
        width:100%;
    }

    .media-select-page{
        width:100%;
        white-space:normal;
    }

    .media-cleanup-actions{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .media-cleanup-actions button{
        width:100%;
    }
}

@media (max-width:480px){
    .media-cleanup-section{
        padding:12px;
    }

    .media-cleanup-actions{
        grid-template-columns:1fr;
    }
}


/* VideoAI mobile generation summary */
.production-summary-mobile{
    display:none;
}

.production-summary-list{
    display:grid;
    gap:0;
}

.production-summary-list > div{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:10px 14px;
    border-bottom:1px solid #e2e8f0;
}

.production-summary-list > div:last-child{
    border-bottom:0;
}

.production-summary-list span{
    color:#64748b;
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.production-summary-list strong{
    text-align:right;
    overflow-wrap:anywhere;
}

@media (max-width:760px){
    .production-metrics-desktop{
        display:none;
    }

    .production-summary-mobile{
        display:block;
        margin-top:12px;
    }

    .production-summary-mobile > summary{
        padding:12px 14px;
    }

    .production-card{
        padding-bottom:14px;
    }

    .production-steps{
        margin-bottom:10px;
    }

    .generation-progress{
        margin-top:10px;
        margin-bottom:10px;
    }

    .entity-meta{
        gap:12px;
        flex-wrap:wrap;
    }
}

@media (min-width:761px){
    .production-metrics-desktop{
        display:block;
    }
}


/* VideoAI dashboard system metrics */
.dashboard-systems{
    margin:18px 0;
}

.dashboard-section-title{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:18px;
    margin-bottom:12px;
}

.dashboard-section-title h2{
    margin:2px 0 0;
}

.dashboard-section-title p{
    margin:0;
}

.dashboard-system-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}

.dashboard-system-card{
    margin:0;
}

.dashboard-system-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:14px;
}

.dashboard-system-head h3{
    margin:2px 0 0;
    font-size:17px;
}

.system-inline-metrics{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin-bottom:14px;
}

.system-inline-metrics-gpu{
    grid-template-columns:repeat(4,minmax(0,1fr));
}

.system-inline-metrics > div{
    padding:10px 11px;
    border:1px solid #e2e8f0;
    border-radius:10px;
    background:#f8fafc;
}

.system-inline-metrics span,
.dashboard-worker-foot span{
    display:block;
    margin-bottom:3px;
    color:#64748b;
    font-size:11px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.035em;
}

.system-inline-metrics strong{
    font-size:14px;
}

.resource-block{
    margin-top:12px;
}

.resource-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:6px;
    font-size:13px;
}

.resource-head strong{
    text-align:right;
}

.resource-track{
    height:9px;
    border-radius:999px;
    overflow:hidden;
    background:#e2e8f0;
}

.resource-track i{
    display:block;
    height:100%;
    min-width:0;
    max-width:100%;
    border-radius:inherit;
    background:var(--blue);
    transition:width .25s ease;
}

.resource-block small{
    display:block;
    margin-top:5px;
    color:#64748b;
    font-size:11px;
}

.dashboard-worker-foot{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin-top:14px;
    padding-top:12px;
    border-top:1px solid #e2e8f0;
}

.dashboard-worker-foot strong{
    overflow-wrap:anywhere;
    font-size:12px;
}

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

@media(max-width:600px){
    .dashboard-section-title{
        align-items:flex-start;
        flex-direction:column;
        gap:5px;
    }

    .system-inline-metrics,
    .system-inline-metrics-gpu{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .dashboard-worker-foot{
        grid-template-columns:1fr;
    }

    .resource-head{
        align-items:flex-start;
        flex-direction:column;
        gap:2px;
    }

    .resource-head strong{
        text-align:left;
    }
}

/* ===== VideoAI 0.9.0 OpenRouter Image Router + AI Chat Image ===== */
.image-settings{
    margin:16px 0;
    padding:14px;
    border:1px solid #dbeafe;
    border-radius:10px;
    background:#f8fbff
}
.chat-route-controls{grid-template-columns:150px 150px minmax(260px,1fr)}
.chat-message.image-message{width:min(88%,860px);max-width:88%}
.chat-generated-image-wrap{
    margin-top:6px;
    overflow:hidden;
    border:1px solid #e4e7ec;
    border-radius:12px;
    background:#f8fafc
}
.chat-generated-image-wrap a{display:block;line-height:0}
.chat-generated-image{
    display:block;
    width:100%;
    max-width:100%;
    max-height:680px;
    object-fit:contain;
    background:#111827
}
.chat-actions .btnlink{font-size:11px;padding:7px 9px}
#storyboardProgressBar{transition:width .35s ease}
@media(max-width:700px){
    .chat-route-controls{grid-template-columns:1fr}
    .chat-message.image-message{width:100%;max-width:100%}
}

/* =========================================================
   0.9.12 Semantic status palette — panel-wide
   success=green, active/info=blue, warning=amber,
   error/failure=red, inactive/neutral=gray.
   ========================================================= */
:root{
  --ui-success-bg:#ecfdf3;--ui-success-fg:#067647;--ui-success-border:#abefc6;
  --ui-info-bg:#eff8ff;--ui-info-fg:#175cd3;--ui-info-border:#b2ddff;
  --ui-warning-bg:#fffaeb;--ui-warning-fg:#b54708;--ui-warning-border:#fedf89;
  --ui-danger-bg:#fef3f2;--ui-danger-fg:#b42318;--ui-danger-border:#fecdca;
  --ui-neutral-bg:#f2f4f7;--ui-neutral-fg:#475467;--ui-neutral-border:#d0d5dd;
}
.ui-tone-success{background:var(--ui-success-bg)!important;color:var(--ui-success-fg)!important;border-color:var(--ui-success-border)!important}
.ui-tone-info{background:var(--ui-info-bg)!important;color:var(--ui-info-fg)!important;border-color:var(--ui-info-border)!important}
.ui-tone-warning{background:var(--ui-warning-bg)!important;color:var(--ui-warning-fg)!important;border-color:var(--ui-warning-border)!important}
.ui-tone-danger{background:var(--ui-danger-bg)!important;color:var(--ui-danger-fg)!important;border-color:var(--ui-danger-border)!important}
.ui-tone-neutral{background:var(--ui-neutral-bg)!important;color:var(--ui-neutral-fg)!important;border-color:var(--ui-neutral-border)!important}
.alert.warning,.flash.warning{background:var(--ui-warning-bg);color:var(--ui-warning-fg);border-color:var(--ui-warning-border)}
.alert.info,.flash.info{background:var(--ui-info-bg);color:var(--ui-info-fg);border-color:var(--ui-info-border)}
.local-gpu-model-panel{margin:12px 0 14px;padding:12px;border:1px solid #e4e7ec;border-radius:12px;background:#fcfcfd}
.local-gpu-model-panel-head>div{display:grid;gap:3px}.local-gpu-model-panel-head span{font-size:11px;color:#667085}
.local-gpu-model-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:10px}
.local-gpu-model-card{border:1px solid #e4e7ec;border-radius:10px;padding:10px;background:#fff;min-width:0}
.local-gpu-model-title{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.local-gpu-model-title strong{font-size:12px}
.local-gpu-capabilities{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.local-gpu-capabilities span{font-size:9px;padding:3px 6px;border-radius:999px;background:#f2f4f7;color:#475467}
.local-gpu-route-state{margin-top:8px;padding:6px 7px;border-radius:7px;font-size:9px;font-weight:900;letter-spacing:.02em}.local-gpu-route-state.ready{background:var(--ui-success-bg);color:var(--ui-success-fg)}.local-gpu-route-state.pending{background:var(--ui-warning-bg);color:var(--ui-warning-fg)}
@media(max-width:980px){.local-gpu-model-grid{grid-template-columns:1fr}}

/* ===== VideoAI 0.9.13.2 API Manager states + dashboard live ===== */
.provider-local-section{margin:0 0 18px}.provider-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:12px}.provider-section-head h2{margin:4px 0 4px}.provider-local-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.provider-state-card{transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;border-width:1px}.provider-state-connected{border-color:var(--ui-success-border);background:linear-gradient(135deg,#fff 0%,var(--ui-success-bg) 160%);box-shadow:0 0 0 1px rgba(6,118,71,.06),0 8px 20px rgba(6,118,71,.08)}.provider-state-disabled{border-color:var(--ui-danger-border);background:linear-gradient(135deg,#fff 0%,var(--ui-danger-bg) 155%);box-shadow:0 0 0 1px rgba(180,35,24,.08),0 8px 20px rgba(180,35,24,.10)}.provider-state-error{border-color:var(--ui-warning-border);background:linear-gradient(135deg,#fff 0%,var(--ui-warning-bg) 155%);box-shadow:0 0 0 1px rgba(181,71,8,.08),0 8px 20px rgba(181,71,8,.10)}.provider-state-untested,.provider-state-standby{border-color:var(--ui-neutral-border);background:linear-gradient(135deg,#fff 0%,var(--ui-neutral-bg) 170%);box-shadow:0 4px 14px rgba(71,84,103,.06)}.provider-card-labels{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-bottom:7px}.provider-origin-badge,.provider-kind-badge,.provider-state-badge{display:inline-flex;align-items:center;padding:5px 8px;border-radius:7px;font-size:10px;font-weight:900;letter-spacing:.04em;border:1px solid var(--ui-neutral-border);background:#fff;color:var(--ui-neutral-fg)}.provider-origin-local{background:var(--ui-info-bg);border-color:var(--ui-info-border);color:var(--ui-info-fg)}.provider-state-badge-connected{background:var(--ui-success-bg);border-color:var(--ui-success-border);color:var(--ui-success-fg)}.provider-state-badge-disabled{background:var(--ui-danger-bg);border-color:var(--ui-danger-border);color:var(--ui-danger-fg)}.provider-state-badge-error{background:var(--ui-warning-bg);border-color:var(--ui-warning-border);color:var(--ui-warning-fg)}.provider-state-badge-untested,.provider-state-badge-standby{background:var(--ui-neutral-bg);border-color:var(--ui-neutral-border);color:var(--ui-neutral-fg)}.provider-capability-row{display:flex;gap:5px;flex-wrap:wrap;margin-top:10px}.provider-capability-row span{padding:4px 7px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:10px;color:var(--muted)}#dashboardLiveState{font-weight:800;color:var(--ui-success-fg)}#dashboardLiveState.dashboard-live-error{color:var(--ui-danger-fg)}
@media(max-width:1100px){.provider-local-grid{grid-template-columns:1fr}.provider-section-head{display:grid}}

/* ===== VideoAI 0.9.13.3 API Manager compact local catalog ===== */
.provider-local-section-compact{margin-bottom:16px}
.provider-section-head-compact{margin-bottom:9px;align-items:center}
.provider-section-head-compact h2{margin:2px 0 2px}
.provider-local-summary{margin:0;line-height:1.35}
.provider-local-grid-compact{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;align-items:start}
.provider-local-card{
    min-width:0;padding:11px 12px;border:1px solid #e4e7ec;border-radius:10px;
    background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.03)
}
.provider-local-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:7px;margin-bottom:6px}
.provider-card-labels-compact{margin:0;gap:4px}
.provider-card-labels-compact .provider-origin-badge,
.provider-card-labels-compact .provider-kind-badge,
.provider-local-card-head .provider-state-badge{padding:3px 5px;border-radius:6px;font-size:8px;line-height:1.1}
.provider-local-card h3{font-size:14px;line-height:1.22;margin:0 0 2px;overflow-wrap:anywhere}
.provider-local-mode{font-size:10px;font-weight:800;color:#475467;margin-bottom:8px;text-transform:uppercase;letter-spacing:.025em}
.provider-local-facts{display:grid;grid-template-columns:1fr 1fr;gap:6px 10px;margin:0;padding:8px 0;border-top:1px solid rgba(208,213,221,.7);border-bottom:1px solid rgba(208,213,221,.7)}
.provider-local-facts>div{min-width:0}
.provider-local-facts dt{margin:0 0 1px;font-size:8px;font-weight:900;letter-spacing:.045em;text-transform:uppercase;color:#98a2b3}
.provider-local-facts dd{margin:0;font-size:10px;line-height:1.25;color:#344054;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.provider-capability-row-compact{margin-top:7px;gap:4px}
.provider-capability-row-compact span{font-size:8px;padding:3px 5px;line-height:1.1}
.provider-capability-row-compact .provider-capability-more{font-weight:900;background:var(--ui-neutral-bg);color:var(--ui-neutral-fg)}
.provider-local-grid-compact .provider-state-connected,
.provider-local-grid-compact .provider-state-disabled,
.provider-local-grid-compact .provider-state-error,
.provider-local-grid-compact .provider-state-untested,
.provider-local-grid-compact .provider-state-standby{box-shadow:0 2px 8px rgba(16,24,40,.05)}
@media(max-width:1180px){.provider-local-grid-compact{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.provider-local-grid-compact{grid-template-columns:1fr}.provider-local-facts{grid-template-columns:1fr 1fr}}
.provider-external-list{gap:7px}
.provider-external-card{padding:10px 11px;gap:10px;align-items:flex-start}
.provider-external-card .provider-card-labels{margin-bottom:4px;gap:4px}
.provider-external-card .provider-origin-badge,
.provider-external-card .provider-kind-badge,
.provider-external-card .provider-state-badge{padding:3px 5px;font-size:8px;border-radius:6px}
.provider-external-card .entity-eyebrow{font-size:8px}
.provider-external-card .entity-main h3{font-size:13px;line-height:1.25;margin:2px 0 5px}
.provider-external-card .entity-meta{font-size:10px;gap:3px 9px;line-height:1.25}
.provider-external-card .entity-main>.muted{font-size:9px;line-height:1.25;margin-top:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.provider-external-card .entity-side{gap:5px;align-items:center;padding-top:1px}
.provider-external-card .card-actions{gap:4px}
.provider-external-card .card-actions .btnlink,
.provider-external-card .card-actions button{font-size:9px;padding:5px 7px;min-height:0}

/* 0.9.13.4 local runtime + project action states */
.provider-state-running{border-color:rgba(37,99,235,.45)!important;box-shadow:0 0 0 1px rgba(37,99,235,.08),0 8px 24px rgba(37,99,235,.10)!important;background:rgba(239,246,255,.78)!important}
.provider-state-resident,.provider-state-ready{border-color:rgba(16,185,129,.34)!important;background:rgba(236,253,245,.55)!important}
.provider-state-offline{border-color:rgba(239,68,68,.34)!important;background:rgba(254,242,242,.72)!important}
.provider-state-standby{border-color:rgba(148,163,184,.34)!important;background:rgba(248,250,252,.72)!important}
.provider-state-badge-running{color:#1d4ed8!important;border-color:#93c5fd!important;background:#dbeafe!important}
.provider-state-badge-resident,.provider-state-badge-ready{color:#047857!important;border-color:#86efac!important;background:#dcfce7!important}
.provider-state-badge-offline,.provider-state-badge-disabled{color:#b91c1c!important;border-color:#fecaca!important;background:#fee2e2!important}
.provider-state-badge-standby{color:#475569!important;border-color:#cbd5e1!important;background:#f1f5f9!important}
.provider-runtime-line{margin-top:5px;font-size:11px;font-weight:700;color:#334155}
.project-action-strip{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;margin:10px 0;border:1px solid rgba(127,127,127,.22);border-radius:10px}
.project-action-strip-warning{background:rgba(255,247,237,.7);border-color:rgba(245,158,11,.34)}
.project-action-strip form{margin:0;flex:0 0 auto}.project-reset-reference-form{margin-top:8px}
button.danger{background:#dc2626;color:#fff;border-color:#dc2626}button.danger.ghost{background:#fff;color:#b91c1c;border-color:#fecaca}

/* ===== VideoAI 0.9.13.6 project pipeline + final assembly ===== */
.pipeline-summary-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:10px 0 14px}
.pipeline-summary-card{border:1px solid #e4e7ec;border-radius:10px;background:#fff;padding:10px 11px;min-width:0}
.pipeline-summary-card span{display:block;font-size:9px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:#98a2b3;margin-bottom:3px}
.pipeline-summary-card strong{font-size:15px;line-height:1.2;color:#101828;overflow-wrap:anywhere}
.pipeline-stage-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
.pipeline-stage-card{border:1px solid #e4e7ec;border-radius:12px;background:#fff;padding:12px;min-width:0;box-shadow:0 1px 2px rgba(16,24,40,.03)}
.pipeline-stage-head,.pipeline-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.pipeline-stage-head h3,.pipeline-history-head h3{margin:2px 0 0;font-size:15px}.stage-kicker{display:block;font-size:8px;font-weight:900;letter-spacing:.08em;color:#667085}
.pipeline-status-chip{display:inline-flex;align-items:center;justify-content:center;padding:4px 7px;border-radius:999px;border:1px solid var(--ui-neutral-border);background:var(--ui-neutral-bg);color:var(--ui-neutral-fg);font-size:9px;font-weight:900;letter-spacing:.03em;white-space:nowrap}
.pipeline-status-chip.is-ok{background:var(--ui-success-bg);border-color:var(--ui-success-border);color:var(--ui-success-fg)}
.pipeline-status-chip.is-running{background:var(--ui-info-bg);border-color:var(--ui-info-border);color:var(--ui-info-fg)}
.pipeline-status-chip.is-wait{background:var(--ui-warning-bg);border-color:var(--ui-warning-border);color:var(--ui-warning-fg)}
.pipeline-status-chip.is-bad{background:var(--ui-danger-bg);border-color:var(--ui-danger-border);color:var(--ui-danger-fg)}
.pipeline-status-chip.is-stale{background:#f9f5ff;border-color:#d6bbfb;color:#6941c6}.pipeline-status-chip.is-neutral{background:var(--ui-neutral-bg);color:var(--ui-neutral-fg)}
.pipeline-stage-progress{height:7px;background:#eaecf0;border-radius:999px;overflow:hidden;margin:10px 0 8px}.pipeline-stage-progress.large{height:10px}
.pipeline-stage-progress>span{display:block;height:100%;background:#2563eb;border-radius:999px;transition:width .35s ease}
.pipeline-stage-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px;font-size:10px;color:#667085}.pipeline-stage-facts span{min-width:0}.pipeline-stage-facts b{color:#344054;overflow-wrap:anywhere}
.pipeline-stage-note{margin-top:8px;padding-top:7px;border-top:1px solid #f2f4f7;font-size:10px;color:#667085;overflow-wrap:anywhere}
.pipeline-detail-panel{margin-top:14px;padding:13px 14px;border:1px solid #e4e7ec;border-radius:12px;background:#fcfcfd}.pipeline-detail-head strong{display:block;font-size:15px;margin-top:2px}.pipeline-detail-count{display:flex;gap:8px;align-items:baseline;margin:6px 0 9px}.pipeline-detail-count strong{font-size:18px}.pipeline-detail-count span{font-size:11px;color:#667085}.pipeline-video-stats{grid-template-columns:repeat(6,minmax(0,1fr))!important;margin-top:8px!important}.pipeline-video-stats .mini-card{min-width:0}.pipeline-video-stats .mini-card strong{font-size:13px;overflow-wrap:anywhere}
.pipeline-history-block{margin-top:16px;padding-top:14px;border-top:1px solid #eaecf0}.pipeline-history-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:8px}.pipeline-history-head>div{min-width:0}.pipeline-job-list{display:grid;gap:7px}.pipeline-job-card{display:grid;grid-template-columns:54px minmax(0,1fr);gap:10px;padding:10px;border:1px solid #e4e7ec;border-radius:10px;background:#fff}.pipeline-job-id{font-size:15px;font-weight:900;color:#344054}.pipeline-job-main{min-width:0}.pipeline-job-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.pipeline-job-meta{display:flex;flex-wrap:wrap;gap:5px 12px;margin-top:4px;font-size:9px;color:#667085}.pipeline-job-error{margin-top:5px;padding:6px 8px;border-radius:7px;background:var(--ui-danger-bg);color:var(--ui-danger-fg);font-size:9px}
.scene-render-table-wrap{max-height:430px;overflow:auto;border:1px solid #e4e7ec;border-radius:10px}.scene-render-table{width:100%;border-collapse:collapse;font-size:10px;background:#fff}.scene-render-table th{position:sticky;top:0;z-index:1;background:#f9fafb;text-align:left;color:#667085;font-size:9px;text-transform:uppercase;letter-spacing:.04em}.scene-render-table th,.scene-render-table td{padding:7px 8px;border-bottom:1px solid #f2f4f7;vertical-align:middle}.scene-render-table tbody tr:last-child td{border-bottom:0}.mono-small{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:9px;max-width:230px;overflow-wrap:anywhere}
@media(max-width:1100px){.pipeline-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.pipeline-stage-grid{grid-template-columns:1fr}.pipeline-video-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:680px){.pipeline-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pipeline-stage-facts{grid-template-columns:1fr}.pipeline-video-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}.pipeline-history-head{display:grid}.pipeline-job-card{grid-template-columns:44px minmax(0,1fr)}}

/* 0.9.13.7 Project pipeline information architecture cleanup */
.pipeline-technical-wrap{margin:4px 0 14px}
.pipeline-technical-details,.pipeline-final-versions,.pipeline-history-details,.pipeline-scene-details{border:1px solid #e4e7ec;border-radius:12px;background:#fff;overflow:hidden}
.pipeline-technical-details>summary,.pipeline-final-versions>summary,.pipeline-history-details>summary,.pipeline-scene-details>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;user-select:none}
.pipeline-technical-details>summary::-webkit-details-marker,.pipeline-final-versions>summary::-webkit-details-marker,.pipeline-history-details>summary::-webkit-details-marker,.pipeline-scene-details>summary::-webkit-details-marker{display:none}
.pipeline-technical-details>summary:after,.pipeline-final-versions>summary:after,.pipeline-history-details>summary:after,.pipeline-scene-details>summary:after{content:'▾';font-size:12px;color:#667085;transition:transform .2s ease}
.pipeline-technical-details[open]>summary:after,.pipeline-final-versions[open]>summary:after,.pipeline-history-details[open]>summary:after,.pipeline-scene-details[open]>summary:after{transform:rotate(180deg)}
.pipeline-technical-body{padding:0 13px 13px;border-top:1px solid #f2f4f7}
.pipeline-tech-section{padding:13px 0;border-bottom:1px solid #f2f4f7}.pipeline-tech-section:last-of-type{border-bottom:0}
.pipeline-tech-facts{margin-top:10px;grid-template-columns:repeat(4,minmax(0,1fr))}
.reference-qc-detail-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0}
.reference-qc-detail-card{padding:9px 10px;border:1px solid #eaecf0;border-radius:9px;min-width:0;background:#fcfcfd}.reference-qc-detail-card .entity-eyebrow{margin-top:3px}.reference-qc-detail-card .muted{margin-top:3px;font-size:9px;line-height:1.35}
.pipeline-telemetry-grid{grid-template-columns:repeat(7,minmax(0,1fr))!important;margin-top:10px!important}.pipeline-telemetry-grid .mini-card{min-width:0}.pipeline-telemetry-grid .mini-card strong{font-size:13px;overflow-wrap:anywhere}.compact-code{font-size:11px!important}.pipeline-telemetry-note{margin-top:8px}
.pipeline-final-versions{margin:0 0 14px}.final-version-list{display:grid;gap:7px;padding:0 12px 12px;border-top:1px solid #f2f4f7}.final-version-row{display:grid;grid-template-columns:180px minmax(0,1fr);gap:12px;align-items:center;padding:9px 10px;border:1px solid #eaecf0;border-radius:9px;background:#fcfcfd}.final-version-row.is-current{border-color:#abefc6;background:#f6fef9}.final-version-row>div:first-child{display:flex;align-items:center;gap:8px}.final-version-meta{display:flex;flex-wrap:wrap;gap:5px 12px;align-items:center;color:#667085;font-size:9px;min-width:0}.final-version-meta .mono-small{max-width:none}
.pipeline-history-details{margin-top:9px;background:#fcfcfd}.pipeline-history-details>summary{font-size:10px;font-weight:800;color:#475467}.pipeline-history-details>summary span{font-weight:600;color:#98a2b3}.pipeline-old-jobs{padding:0 9px 9px;border-top:1px solid #f2f4f7}.pipeline-old-jobs .pipeline-job-card{background:#fcfcfd}.is-current-job{border-left:3px solid #2563eb}.pipeline-current-jobs{grid-template-columns:repeat(2,minmax(0,1fr))}.pipeline-current-jobs .pipeline-job-card{height:100%}
.pipeline-scene-details{padding:0;margin-top:16px}.pipeline-scene-details>.pipeline-history-head{margin:0;align-items:center}.pipeline-scene-summary{font-size:10px;color:#667085}.pipeline-scene-details .scene-render-table-wrap{border:0;border-top:1px solid #e4e7ec;border-radius:0;max-height:430px}
@media(max-width:1250px){.pipeline-telemetry-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}.reference-qc-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pipeline-current-jobs{grid-template-columns:1fr}}
@media(max-width:760px){.pipeline-tech-facts{grid-template-columns:repeat(2,minmax(0,1fr))}.pipeline-telemetry-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.reference-qc-detail-grid{grid-template-columns:1fr}.final-version-row{grid-template-columns:1fr}.pipeline-technical-details>summary,.pipeline-final-versions>summary,.pipeline-scene-details>summary{align-items:flex-start;flex-direction:column}}

/* 0.9.13.8 Final video preview / open / download */
.final-media-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px;padding-top:8px;border-top:1px solid #f2f4f7}
.final-media-button{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:6px 10px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;color:#344054;font-size:10px;font-weight:800;text-decoration:none;line-height:1;transition:background .15s ease,border-color .15s ease,color .15s ease}
.final-media-button:hover{background:#f9fafb;border-color:#98a2b3;color:#101828}.final-media-button.primary{background:#2563eb;border-color:#2563eb;color:#fff}.final-media-button.primary:hover{background:#1d4ed8;border-color:#1d4ed8;color:#fff}
.final-preview-panel,.final-version-preview{margin-top:8px;border:1px solid #e4e7ec;border-radius:9px;background:#fcfcfd;overflow:hidden}
.final-preview-panel>summary,.final-version-preview>summary{list-style:none;cursor:pointer;padding:8px 10px;font-size:10px;font-weight:850;color:#344054;user-select:none}.final-preview-panel>summary::-webkit-details-marker,.final-version-preview>summary::-webkit-details-marker{display:none}
.final-preview-panel video,.final-version-preview video{display:block;width:100%;max-height:430px;background:#101828;border-top:1px solid #e4e7ec}
.final-version-row{grid-template-columns:180px minmax(0,1fr) auto}.final-version-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.final-version-preview{grid-column:1/-1;margin-top:0}
@media(max-width:900px){.final-version-row{grid-template-columns:1fr}.final-version-actions{justify-content:flex-start}.final-version-preview{grid-column:auto}}

/* ===== VideoAI 0.9.15 project revision controls ===== */
.project-revision-panel{margin-top:18px}
.project-revision-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}
.project-revision-head h2{margin:0 0 4px}
.project-revision-meta{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.project-revision-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.project-revision-action{border:1px solid var(--line);border-radius:10px;padding:14px;background:#fafbfc;min-width:0}
.project-revision-action h3{margin:0 0 6px;font-size:15px}
.project-revision-action p{margin:0 0 11px;color:var(--muted);font-size:12px;line-height:1.5}
.project-revision-action form{margin:0}
.project-revision-action button{margin:0;min-width:190px;font-weight:800}
.project-revision-note{margin-top:12px;padding:9px 11px;border-radius:8px;background:#f8fafc;border:1px solid var(--line-soft);font-size:11px;color:var(--muted)}
@media(max-width:700px){.project-revision-grid{grid-template-columns:1fr}.project-revision-head{display:grid}.project-revision-action button{width:100%}}


/* ===== VideoAI 0.9.15.2 revision actions + final QC approval ===== */
.project-revision-panel-top{margin:0 0 14px;border-color:#dbe5f3;background:linear-gradient(135deg,#fff 0%,#f8fbff 100%)}
.project-revision-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.project-revision-toolbar-main{min-width:240px;flex:1 1 360px}
.project-revision-toolbar-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.project-revision-toolbar-title h2{margin:0;font-size:16px}
.project-revision-toolbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.project-revision-toolbar-actions form{margin:0}
.project-revision-toolbar-actions button{margin:0;min-width:0;font-weight:850}
.project-revision-final-state{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:8px;border:1px solid var(--ui-warning-border);background:var(--ui-warning-bg);color:var(--ui-warning-fg);font-size:10px;font-weight:850}
.project-revision-final-state.is-ready{border-color:var(--ui-success-border);background:var(--ui-success-bg);color:var(--ui-success-fg)}
.project-revision-final-state.is-blocked{border-color:var(--ui-neutral-border);background:var(--ui-neutral-bg);color:var(--ui-neutral-fg)}
.final-approve-btn{background:#079455!important;border-color:#079455!important;color:#fff!important}
.final-approve-btn:hover{background:#067647!important;border-color:#067647!important}
.project-revision-details{margin-top:9px;padding-top:9px;border-top:1px solid #eaecf0;display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.project-revision-details .muted{font-size:10px}
@media(max-width:760px){.project-revision-toolbar{display:grid}.project-revision-toolbar-actions{justify-content:flex-start}.project-revision-toolbar-actions form,.project-revision-toolbar-actions button{width:100%}.project-revision-final-state{width:100%;justify-content:center}}

/* VIDEOAI_ASYNC_AI_CHAT_R1 */
.async-chat-status{
    display:flex;align-items:flex-start;gap:12px;margin:12px 0;padding:12px 14px;
    border:1px solid #bfdbfe;border-radius:10px;background:#eff6ff;color:#1e3a8a
}
.async-chat-status[hidden]{display:none!important}
.async-chat-status[data-state="error"]{border-color:#fecaca;background:#fff1f2;color:#991b1b}
.async-chat-status[data-state="success"]{border-color:#bbf7d0;background:#f0fdf4;color:#166534}
.async-chat-status strong{display:block;font-size:13px;margin-bottom:3px}
.async-chat-status span{display:block;font-size:12px;line-height:1.45;overflow-wrap:anywhere}
.async-chat-spinner{width:16px;height:16px;flex:0 0 16px;margin-top:2px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:asyncChatSpin .8s linear infinite}
.async-chat-status[data-state="error"] .async-chat-spinner,.async-chat-status[data-state="success"] .async-chat-spinner{animation:none;border-right-color:currentColor}
.chat-composer :disabled{cursor:not-allowed;opacity:.62}
@keyframes asyncChatSpin{to{transform:rotate(360deg)}}
@media(max-width:600px){.async-chat-status{padding:11px 12px}.async-chat-status span{font-size:11px}}
/* /VIDEOAI_ASYNC_AI_CHAT_R1 */