/* Shared STRGO surface system. Scene canvases and authored imagery remain intact. */
html[data-strgo-theme="dark"] {color-scheme:dark}
html[data-strgo-ui][data-strgo-theme="light"] {color-scheme:light}
html[data-strgo-theme="light"] {
  color-scheme:light;
  --strgo-bg:#f5f8f7; --strgo-surface:#fff; --strgo-surface-raised:#edf4f1;
  --strgo-border:#d5e1dc; --strgo-text:#172c25; --strgo-muted:#526b61;
  --strgo-accent:#147957; --strgo-accent-ink:#fff; --strgo-accent-soft:#e2f2ea;
  --strgo-input:#fff; --strgo-warning:#80590d; --strgo-violet:#5544a3;
  --strgo-danger:#a82d2d; --strgo-danger-soft:#fae5e4;
}
html[data-strgo-theme] {scrollbar-color:var(--strgo-border) var(--strgo-bg)}
html[data-strgo-theme] :is(button,a,input,select,textarea,summary):focus-visible {outline-color:var(--strgo-accent)}
html[data-strgo-ui="tool"] :is(.panel,.card,.auth-card,.login-card,.post-card,.image-card,.composer,.job-card,dialog) {border-radius:var(--strgo-radius)}
html[data-strgo-ui="tool"] :is(input,textarea,select) {border-radius:10px}
html[data-strgo-product="forum"] .app-links {display:none}

/* AI workspace: its original gradients are dark-only, so use the shared surfaces. */
html[data-strgo-product="ai"] :is(.sidebar,.panel,.history,.music-card,.task-track,.overview-card,.member-drawer,dialog) {
  background:var(--strgo-surface);border-color:var(--strgo-border);color:var(--strgo-text);
}
html[data-strgo-product="ai"] :is(.nav-link,.brand-caption,.account small,.back-home,.breadcrumb,.node-indicator,.page-heading p,.track-meta,.task-track p,.privacy-note,.empty,.history-open,.history-foot,.overview-heading>p:last-child,.overview-card p,.recent-row small,.quota-metrics strong small,.quota-metrics>div>span,.table-note,.usage-block p,.model-cell small,.checkbox span small,.node-summary p,.node-summary small,.reconcile-row>span) {color:var(--strgo-muted)}
html[data-strgo-product="ai"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select,.segmented,.duration-options,.search-field input) {background:var(--strgo-input);color:var(--strgo-text);border-color:var(--strgo-border)}
html[data-strgo-product="ai"] :is(button:not(.primary):not(.danger),.secondary) {background-color:var(--strgo-surface-raised);color:var(--strgo-text);border-color:var(--strgo-border);background-image:none}
html[data-strgo-product="ai"] :is(.nav-link:hover,.nav-link.active,.history-row.active,.segmented button[aria-pressed="true"],.duration-options button[aria-pressed="true"]) {background:var(--strgo-accent-soft);color:var(--strgo-accent);border-color:var(--strgo-border)}
html[data-strgo-product="ai"] :is(.primary) {background:var(--strgo-accent);border-color:var(--strgo-accent);color:var(--strgo-accent-ink);box-shadow:none}
html[data-strgo-product="ai"] :is(label,legend,.breadcrumb strong,.empty h3,.overview-card h2,td strong,.member-drawer h3) {color:var(--strgo-text)}
html[data-strgo-product="ai"] :is(.quota-pill,.form-help,.info-note,.permission-check,.quote-summary,.node-device,.provider-logo,.empty-icon) {background:var(--strgo-accent-soft);border-color:var(--strgo-border);color:var(--strgo-text)}
html[data-strgo-product="ai"] .chat-entry {background:var(--strgo-surface)}
html[data-strgo-product="ai"][data-strgo-theme="light"] .overview-card:before {background:linear-gradient(0deg,var(--strgo-surface) 8%,var(--strgo-surface) 30%,#ffffff33 100%)}
html[data-strgo-product="ai"][data-strgo-theme="light"] .card-index {color:var(--strgo-muted)}
html[data-strgo-product="ai"] .quota-metrics strong {color:var(--strgo-accent)}
html[data-strgo-product="ai"] :is(th,td) {border-color:var(--strgo-border);color:var(--strgo-text)}
html[data-strgo-product="ai"] th {background:var(--strgo-surface-raised)}
html[data-strgo-product="ai"] .error {color:var(--strgo-danger)}
html[data-strgo-product="ai"] input::placeholder,html[data-strgo-product="ai"] textarea::placeholder {color:var(--strgo-muted)}

/* Image generation and video keep their existing workflows and primary actions. */
html[data-strgo-product="image"] :is(input,select,textarea,.composer textarea,.output-panel,.reference-picker,.preset-inspirations,.secondary,.sizes button) {background:var(--strgo-input);border-color:var(--strgo-border);color:var(--strgo-text)}
html[data-strgo-product="image"] :is(.tabs button[aria-pressed="true"],.sizes button[aria-pressed="true"],.library-tools button[aria-pressed="true"],#invite-result,.empty-icon) {background:var(--strgo-accent-soft);color:var(--strgo-text)}
html[data-strgo-product="image"] .primary {background:var(--strgo-accent);color:var(--strgo-accent-ink);border-color:var(--strgo-accent)}
html[data-strgo-product="image"] :is(.message.error,.delete-job,.delete-preset,.image-toolbar .delete-image) {color:var(--strgo-danger)}
html[data-strgo-product="image"] .account-tools .home-link {display:none}
html[data-strgo-product="video"][data-strgo-theme="light"] :is(.step-heading span,.slot-button:not(.has-file) .slot-label,.slot-symbol,.quiet,.job-body p,.job-status,#archive-status,#notice,#settings-status,#admin-status,#catalog-status,#enabled article p,#catalog-list article p,#confirm p) {color:var(--strgo-muted)}
html[data-strgo-product="video"][data-strgo-theme="light"] #workflow-source {color:#1e55b3}
html[data-strgo-product="video"][data-strgo-theme="light"] :is(.video-open,.slot-remove) {background:var(--strgo-surface-raised);color:var(--strgo-text)}
html[data-strgo-product="video"][data-strgo-theme="light"] .slot-button.has-file .slot-label {color:#fff}
html[data-strgo-product="panorama"] body {color-scheme:inherit}

/* The scene canvas keeps its artwork; its surrounding controls follow the site. */
html:is([data-strgo-product="home"],[data-strgo-product="dance"]) .scene-page {--ink:var(--strgo-text);--muted:var(--strgo-muted);--border:var(--strgo-border);--accent:var(--strgo-accent);--panel:var(--strgo-surface);background:var(--strgo-bg)}
html:is([data-strgo-product="home"],[data-strgo-product="dance"]) :is(.scene-header,.scene-footer,.scene-dock,.scene-overlay) {background:var(--strgo-surface);color:var(--strgo-text)}
html:is([data-strgo-product="home"],[data-strgo-product="dance"]) .scene-dock {border-radius:var(--strgo-radius);box-shadow:none}
html:is([data-strgo-product="home"],[data-strgo-product="dance"]) .scene-dock button[aria-pressed="true"] {background:var(--strgo-accent-soft);color:var(--strgo-accent)}
/* Labels over a light or dark canvas need their original scene contrast. */
html[data-strgo-product="home"] .scene-main {--ink:#343b31;--muted:#626b5e}
html[data-strgo-product="dance"] .scene-main {--ink:#ececde;--muted:#aebac3}
html:is([data-strgo-product="home"],[data-strgo-product="dance"]) :is(.scene-dock,.scene-overlay) {--ink:var(--strgo-text);--muted:var(--strgo-muted)}

/* Shared work surfaces in standalone creative worlds. */
html[data-strgo-product="polyverse"] {--bg:var(--strgo-bg);--panel:var(--strgo-surface);--line:var(--strgo-border);--cyan:var(--strgo-accent);--text:var(--strgo-text);--muted:var(--strgo-muted);--body:var(--strgo-font)}
html[data-strgo-product="polyverse"] :is(.site-header,.scene-titlebar,.parameters,.preset-sidebar,.scene-toolbar,.mobile-nav,dialog,.library-card,.empty-state) {background:var(--strgo-surface);border-color:var(--strgo-border);color:var(--strgo-text);border-radius:var(--strgo-radius)}
html[data-strgo-product="polyverse"] :is(.button,.filter-buttons button,.preset-button,.scene-tabs button) {border-radius:10px;border-color:var(--strgo-border);font-size:14px}
html[data-strgo-product="polyverse"] :is(.button.primary,.filter-buttons button.active,.preset-button.active) {background:var(--strgo-accent-soft);color:var(--strgo-accent);border-color:var(--strgo-accent)}
html[data-strgo-product="polyverse"] :is(input:not([type="range"]),select) {background:var(--strgo-input);color:var(--strgo-text);border-color:var(--strgo-border);border-radius:10px}
html[data-strgo-product="polyverse"][data-strgo-theme="light"] :is(.page-hero h1,.document h2,.document p,.document li,.library-card h2,.library-card p,.control>span,.panel-kicker,.filter-buttons button,.breadcrumbs,.breadcrumbs a,.scene-titlebar h1,.toolbar-time,.preset-button,.preset-button small) {color:var(--strgo-text)}
html[data-strgo-product="polyverse"][data-strgo-theme="light"] :is(.document code,.document pre,.selection-info) {background:var(--strgo-surface-raised);color:var(--strgo-text);border-color:var(--strgo-border)}
html[data-strgo-product="meow"] {--pink:var(--strgo-accent);--pink-light:var(--strgo-accent);--berry:var(--strgo-text);--text:var(--strgo-muted);--cream:var(--strgo-surface);--line:var(--strgo-border);--shadow:0 8px 25px #02090c12;--body:var(--strgo-font)}
html[data-strgo-product="meow"] body {background:var(--strgo-bg);color:var(--strgo-text)}
html[data-strgo-product="meow"] :is(.site-nav,.mobile-nav,.glass-panel,.cat-card,.gallery-card,.product-card,.form-panel,.profile-card,.companion-card,dialog) {background:var(--strgo-surface);border-color:var(--strgo-border);color:var(--strgo-text);border-radius:var(--strgo-radius);box-shadow:none}
html[data-strgo-product="meow"] :is(.site-nav,.glass-panel,.cat-card,.gallery-card,.product-card,.form-panel,.profile-card,.companion-card,dialog) :is(h1,h2,h3,p,small,label) {color:inherit}
html[data-strgo-product="meow"] :is(.action-button,.camera-tools button,.small-button,.filter-field select,.field select,.field input,.model-options select,.filter-search input) {background:var(--strgo-input);color:var(--strgo-text);border-color:var(--strgo-border);border-radius:10px}
html[data-strgo-product="swarmera"] {background:var(--strgo-bg);color:var(--strgo-text);--red:var(--strgo-accent);--muted:var(--strgo-muted);--line:var(--strgo-border)}
html[data-strgo-product="swarmera"] :is(.site-header,.mobile-nav,.entry-card,.control-panel,dialog) {background:var(--strgo-surface);border-color:var(--strgo-border);color:var(--strgo-text);border-radius:var(--strgo-radius);box-shadow:none}
html[data-strgo-product="swarmera"] :is(.desktop-nav a,.entry-card p,.entry-card small,.panel-hint,dialog>p,.page-intro p) {color:var(--strgo-muted)}
html[data-strgo-product="swarmera"] :is(.desktop-nav a.active,.desktop-nav a:hover,.action-button:hover) {color:var(--strgo-accent)}
html[data-strgo-product="swarmera"] :is(.action-button,select,input:not([type="range"]):not([type="checkbox"]):not([type="file"]),textarea) {background:var(--strgo-input);color:var(--strgo-text);border-color:var(--strgo-border);border-radius:10px}
html[data-strgo-product="dreams"] {--paper:var(--strgo-surface);--ink:var(--strgo-text);--muted:var(--strgo-muted);--gold:var(--strgo-accent);--deep:var(--strgo-bg)}
html[data-strgo-product="dreams"] :is(.chapters,.dream-reading) {background:var(--strgo-surface);color:var(--strgo-text)}
html[data-strgo-product="dreams"] :is(.dream-card,.paper-dialog) {background:var(--strgo-surface);border-color:var(--strgo-border);color:var(--strgo-text);border-radius:var(--strgo-radius);box-shadow:none}
html[data-strgo-product="dreams"] .card-copy {background:linear-gradient(0deg,var(--strgo-surface) 0%,var(--strgo-surface) 55%,transparent 100%)}
html[data-strgo-product="dreams"] :is(.card-copy p,.dialog-intro,.dialog-kicker,.panel-section-title,.dialog-languages) {color:var(--strgo-muted)}
html[data-strgo-product="dreams"] :is(.search-box input,.setting-row select) {background:var(--strgo-input);border-color:var(--strgo-border);color:var(--strgo-text)}
html[data-strgo-product="dreams"] :is(.not-found,.site-legal) {color:var(--strgo-text)}
html[data-strgo-product="nexus"] {--space:var(--strgo-bg);--muted:var(--strgo-muted);--blue:var(--strgo-accent);--border:var(--strgo-border)}
html[data-strgo-product="nexus"] :is(dialog,.menu-nav button,.panel-button) {background:var(--strgo-surface);border-color:var(--strgo-border);color:var(--strgo-text);border-radius:var(--strgo-radius);box-shadow:none}
html[data-strgo-product="nexus"] :is(.dialog-top>span,.dialog-bottom,.panel-lead,.search-field input) {color:var(--strgo-text)}
html[data-strgo-product="floating-island"] {--accent:var(--strgo-accent)}
html[data-strgo-product="floating-island"] :is(.journal-card,.panel-button,.v-card,.route-plate,.course-card,.helm-keys,.helm-guide,.port-panel,.moor) {border-color:var(--strgo-border);border-radius:var(--strgo-radius)}
html[data-strgo-product="floating-island"][data-strgo-theme="dark"] :is(.journal-card,.panel-button,.v-card,.route-plate,.course-card,.helm-keys,.helm-guide,.port-panel,.moor) {background:var(--strgo-surface);color:var(--strgo-text)}
html[data-strgo-product="floating-island"][data-strgo-theme="dark"] :is(.journal-card,.v-card,.route-plate,.course-card,.port-panel) :is(p,span,small,h2,h3,label) {color:inherit}

/* Classic reading pages use the same cards without covering their content. */
html[data-strgo-product="classic"][data-strgo-theme="light"] {--bg-surface:var(--strgo-surface);--bg-surface-hover:var(--strgo-surface-raised);--border-subtle:var(--strgo-border)}
html[data-strgo-product="classic"][data-strgo-theme="light"] :is(.floating-navbar,.bento-inner,.update-card,.explore-route,.image-tool-entry,dialog) {background:var(--strgo-surface);border-color:var(--strgo-border);color:var(--strgo-text)}
html[data-strgo-product="classic"][data-strgo-theme="light"] :is(.section-intro>p,.route-description,.update-card>p,.story-section>p:not(.mono),.content-footer>.mono) {color:var(--strgo-muted)}
@media(max-width:760px) {
  html[data-strgo-ui="tool"] :is(button,select) {min-height:44px}
  /* Leave room for the shared theme and language controls on narrow screens. */
  html[data-strgo-product="forum"] .topbar-inner {padding-inline:12px;gap:6px}
  html[data-strgo-product="forum"] .brand-divider {display:none}
  html[data-strgo-product="forum"] .product {display:block;flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html[data-strgo-product="forum"] .account-button {flex-shrink:0}
  html[data-strgo-product="polyverse"] :is(.site-header,.scene-titlebar,.scene-toolbar) {border-radius:0}
}
@media(prefers-reduced-motion:reduce) {
  html[data-strgo-ui] {scroll-behavior:auto}
  html[data-strgo-ui] :is(button,a) {transition-duration:.01ms}
}
