html.service-runtime-active .app-sidebar{display:none!important}
html.service-runtime-active .app-shell{grid-template-columns:minmax(0,1fr)!important}
html.service-runtime-active .app-main{grid-column:1!important;min-width:0}
html.service-runtime-active .module-notice[hidden]{display:none!important}
html.service-runtime-active .service-nav-sections{display:contents}
html.service-runtime-active .service-nav-sections .clean-nav-section{display:block;margin-top:18px}
html.service-runtime-active .service-nav-sections nav button{font-size:var(--type-navigation)}
html.service-runtime-active .clean-reference-banner{margin-bottom:18px;border-style:dashed}
html.service-runtime-active .project-card[hidden]{display:none!important}
html.service-runtime-active [data-action="new-project"][hidden]{display:none!important}
html.service-runtime-active .service-project-empty,html.service-runtime-active .service-library-empty{margin:18px 0;padding:28px;border:1px dashed var(--line);border-radius:var(--radius-row);background:var(--app-surface-subtle);color:var(--app-muted)}
html.service-runtime-active .service-project-empty strong,html.service-runtime-active .service-library-empty strong{display:block;margin-bottom:8px;color:var(--app-ink);font-size:var(--type-panel-title)}
html.service-runtime-active .service-project-empty p,html.service-runtime-active .service-library-empty p{margin:0;font-size:var(--type-helper);line-height:1.7}

/* Keep project cards at a stable desktop size. One or two projects occupy the
 * same card width they would have in a three-column row instead of stretching
 * across the whole workspace. */
html.service-runtime-active .project-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:1180px){html.service-runtime-active .project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){html.service-runtime-active .project-grid{grid-template-columns:minmax(0,1fr)}}

/* Neutral detail-page surfaces. Editing controls, selection states, icons and
 * inspector accents keep their UI colors; only artboard/preview/page-related
 * neutral surfaces are desaturated. */
html.service-runtime-active{
 --editor-canvas-bg:var(--app-canvas);
 --editor-canvas-grid:var(--app-line);
 --editor-canvas-shadow:rgba(0,0,0,.12);
 --detail-placeholder-bg:#ededed;
 --detail-placeholder-soft:#f7f7f7;
 --detail-placeholder-line:#d9d9d9;
 --detail-placeholder-text:#777;
 --detail-page-text:#2f2f2f;
}

/* Editor stage is app chrome; the actual page retains its content palette. */
html.service-runtime-active .editor-center,
html.service-runtime-active .canvas-scroll{background-color:var(--editor-canvas-bg)}
html.service-runtime-active .canvas-scroll{background-image:radial-gradient(var(--editor-canvas-grid) .6px,transparent .6px)}
html.service-runtime-active .canvas-stage>.page-viewport{box-shadow:0 6px 24px var(--editor-canvas-shadow)}
html.service-runtime-active .artboard .page-viewport{box-shadow:0 6px 22px rgba(0,0,0,.10)}

/* App frames around pages/thumbnails follow the theme; their contents stay independent. */
html.service-runtime-active .project-art,
html.service-runtime-active .comparison-preview,
html.service-runtime-active .module-preview{background:var(--app-surface-subtle)}

/* Quick-flow wireframe previews are content previews, not application chrome. */
html.service-runtime-active .quick-preview .preview-photo{background:var(--detail-placeholder-bg)}
html.service-runtime-active .quick-preview .preview-photo span{color:#858585}
html.service-runtime-active .quick-preview .preview-lines>*{background:#e3e3e3}
html.service-runtime-active .quick-preview .preview-lines b{background:#bdbdbd}
html.service-runtime-active .quick-preview .preview-tiles span{background:#f1f1f1;color:#858585}

/* Neutral placeholders inside editable/generated detail pages. Real uploaded
 * imagery is not filtered or recolored. */
html.service-runtime-active .detail-page{color:var(--detail-page-text)}

html.service-runtime-active .engine-image:not(.has-media),
html.service-runtime-active .engine-video{background:var(--detail-placeholder-bg)}
html.service-runtime-active .engine-image>span,
html.service-runtime-active .engine-empty{color:var(--detail-placeholder-text)}
html.service-runtime-active .detail-foot{background:#fafafa;color:#8a8a8a}

/* Missing-image placeholders keep their own neutral surface above. Their
 * presence must not override the Core composition's chosen background. */
html.service-runtime-active .detail-page .engine-section:has(.engine-image>span){
 color:var(--detail-page-text)!important;
}

/* Compact left navigation: about 80% of the original row height. */
html.service-runtime-active .global-nav nav{gap:3px}
html.service-runtime-active .global-nav nav button{padding:8px 10px;min-height:0;cursor:pointer;transition:background-color var(--motion-fast) ease,color var(--motion-fast) ease}
html.service-runtime-active .global-nav nav button:hover:not(.active){background:var(--control-hover);color:var(--control-text)}
html.service-runtime-active .global-nav nav button:hover:not(.active) span,
html.service-runtime-active .global-nav nav button.active span{color:inherit}

/* The service sidebar must keep identical row metrics even if a verification
 * route fails before the service activation class is applied. */
.global-nav.service-global-nav nav{gap:3px}
.global-nav.service-global-nav .service-nav-row{padding:8px 10px!important;min-height:0!important;margin:0!important;line-height:1.6;cursor:pointer;transition:background-color var(--motion-fast) ease,color var(--motion-fast) ease}
.global-nav.service-global-nav .service-nav-row:hover:not(.active){background:var(--control-hover);color:var(--control-text)}
.global-nav.service-global-nav .service-nav-row:hover:not(.active) span,
.global-nav.service-global-nav .service-nav-row.active span{color:inherit}

/* Shared primary-button foreground states.
 * Service CSS may change a primary button's background on hover, but its label
 * and nested icons must keep enough contrast everywhere in the service UI. */
html.service-runtime-active .btn.primary:not(:disabled),
html.service-runtime-active .btn.primary:visited,
html.service-runtime-active .btn.primary:hover:not(:disabled),
html.service-runtime-active .btn.primary:not(:disabled):focus-visible,
html.service-runtime-active .btn.primary:not(:disabled):active{color:var(--app-surface)!important}
/* The button owns its foreground in every state, including disabled. Nested
 * labels/icons inherit it without a dynamic-pseudo + universal descendant rule
 * that broadens unrelated :has() invalidation across the Editor. */
html.service-runtime-active .btn.primary *{color:inherit!important}

/* Zero-user-project service surfaces belong to the canonical service runtime. */
.core-zero-page{padding-bottom:80px}
.core-zero-panel,.core-zero-note{margin-top:18px;padding:28px}
.core-zero-panel strong,.core-zero-note strong{display:block;margin-bottom:8px;font-size:var(--type-panel-title);color:var(--ink)}
.core-zero-panel p,.core-zero-note p{margin:0;color:var(--muted);font-size:var(--type-helper);line-height:1.8}
.project-start-actions{display:grid;grid-auto-rows:1fr;gap:var(--space-3);margin-top:var(--space-5);width:100%;max-width:820px}
.btn.project-start-action{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);width:100%;min-width:0;min-height:96px;padding:var(--space-5) var(--space-6);border-radius:var(--radius-single);background:var(--app-surface);color:var(--app-ink);white-space:normal;text-align:left}
.btn.project-start-action:hover{background:var(--control-hover)}
.btn.project-start-action[data-nav="quick"]:not(:disabled){border-color:var(--app-accent)}
.btn.project-start-action:is([data-nav="quick"],[data-action="import-dps"]):hover:not(:disabled){background:var(--app-accent-soft)}
.project-start-action:is([data-nav="quick"],[data-action="import-dps"]):not(:disabled) :is(.project-start-title,.project-start-arrow){color:var(--app-accent)}
.project-start-copy{display:grid;gap:var(--space-2);min-width:0}
.project-start-title{font-size:var(--type-body-emphasis);font-weight:700;line-height:1.5}
.project-start-description{font-size:var(--type-helper);font-weight:400;line-height:1.7;color:var(--app-muted);overflow-wrap:anywhere}
.project-start-arrow{flex:none;font-size:var(--type-body-emphasis);color:var(--app-muted)}
.project-start-actions[aria-busy="true"]{cursor:progress}
@media(max-width:650px){.btn.project-start-action{padding:var(--space-4);gap:var(--space-3)}.core-zero-panel{padding:var(--space-5)}}
.core-zero-note{margin-bottom:0}

/* Connections and Review distribution reuse service controls and appearance tokens. */
.connections-content{display:grid;gap:var(--space-4)}
.connection-list{display:grid;gap:var(--space-3)}
.connection-section-heading{margin-bottom:var(--space-4)}
.connection-section-heading h3{margin:0;font-size:var(--type-section-title)}
.connection-section-heading p{margin:var(--space-2) 0 0;line-height:1.6}
.connection-ai-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,24rem),1fr))}
.connection-card,.connection-row{border:1px solid var(--line);border-radius:var(--radius-row);padding:var(--space-4);min-width:0}
.connection-card{display:flex;flex-direction:column;align-items:flex-start}
.connection-card .section-heading{width:100%;align-items:flex-start;flex-wrap:wrap;gap:var(--space-2)}
.connection-card h4{margin:0;font-size:var(--type-panel-title)}
.connection-card p{margin:0 0 var(--space-3);font-size:var(--type-body-sm);line-height:1.6}
.connection-card>.btn{margin-top:auto}
.connection-status-note{margin:var(--space-3) 0 0}
.connection-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);font-size:var(--type-body-sm)}
.connection-market-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:var(--space-2)}
.connection-market-grid .connection-row{padding:var(--space-3);gap:var(--space-2)}
.connection-market-grid strong{min-width:0;word-break:keep-all}
.connection-market-grid .btn{flex-shrink:0}
.connections-advanced summary{cursor:pointer;font-size:var(--type-panel-title)}
.connections-advanced-body{padding-top:var(--space-4);display:grid;gap:var(--space-4)}
.connections-advanced-body details{min-width:0}
.connections-method[open]>summary{margin-bottom:var(--space-3)}
.connections-method>.rt-connect{margin-bottom:0}
.connection-inline-status{margin-top:var(--space-3);min-height:6em;overflow-wrap:anywhere}
.connection-inline-status p{margin:var(--space-2) 0 0}
.connection-technical{margin-top:var(--space-3)}
#dialog[data-ai-history]{width:min(1120px,calc(100vw - 32px));max-width:1120px}
#dialog[data-ai-history] .rt-workspace{grid-template-columns:minmax(200px,.7fr) minmax(0,1.8fr);margin:0;min-height:0}
#dialog[data-ai-history] .rt-task time{font-size:var(--type-meta);color:var(--app-muted)}
#dialog[data-ai-history] .rt-detail{min-width:0;overflow-wrap:anywhere}
#dialog[data-ai-history] pre{white-space:pre-wrap;overflow-wrap:anywhere}
.review-distribution .actions{display:flex;flex-wrap:wrap}
@media(max-width:700px){#dialog[data-ai-history] .rt-workspace{grid-template-columns:minmax(0,1fr)}#dialog[data-ai-history] .rt-task-list{max-height:220px;overflow:auto}#dialog[data-ai-history] .rt-request-grid{grid-template-columns:minmax(0,1fr)}}
