.theme-toggle { min-width:44px; min-height:44px; padding:0 10px; border:1px solid var(--border,#c2bcae); border-radius:50%; background:var(--surface,#f7f3ea); color:var(--text,#153428); font-size:25px; line-height:1; cursor:pointer; }
.mode-help { border:0; background:transparent; color:var(--text-soft); text-decoration:underline; padding:5px 0; font-size:12px; min-height:36px; }
.product-sheet { box-sizing:border-box; width:min(460px,calc(100% - 24px)); max-height:calc(var(--app-vh,100dvh) - 28px); margin:auto; padding:22px; border:1px solid var(--border,#ddd); border-radius:22px; color:var(--text,#20352a); background:var(--surface,#fff); box-shadow:0 20px 90px #0005; overflow:auto; overscroll-behavior:contain; }
.product-sheet::backdrop { background:#091911a6; }
.product-sheet header { display:flex; align-items:center; gap:12px; justify-content:space-between; }
.product-sheet h2 { margin:0; font-size:25px; line-height:1.15; }
.product-sheet .sheet-close { flex-shrink:0; width:44px; height:44px; border-radius:50%; border:0; color:inherit; background:var(--surface-subtle,#eee); font-size:26px; }
.product-sheet p { margin:14px 0; line-height:1.5; }
.product-sheet blockquote { margin:16px 0; border-left:2px solid var(--brand,#41715d); padding-left:14px; }
.product-sheet .sheet-footnote { font-size:13px; color:var(--text-soft,#616b65); }
.product-sheet label { display:block; font-size:14px; }
.product-sheet textarea { box-sizing:border-box; width:100%; min-height:76px; max-height:140px; margin-top:8px; padding:12px; font:inherit; font-size:16px; border:1px solid var(--border,#ccc); border-radius:12px; background:var(--surface-subtle,#f3f5f2); color:inherit; resize:vertical; }
.product-sheet .primary { width:100%; min-height:48px; padding:10px 16px; border-radius:12px; background:var(--brand,#315f52); color:white; border:0; cursor:pointer; }
.product-sheet button:focus-visible { outline:3px solid #ac8f4c; outline-offset:2px; }
.screenshot-preview { display:block; max-width:100%; max-height:200px; margin:12px auto; object-fit:contain; border-radius:10px; }
.toast { pointer-events:none; }
.toast button { pointer-events:auto; }
.studio-extra-options { padding:12px; border:1px solid var(--border); border-radius:12px; }
.studio-extra-options summary { cursor:pointer; min-height:36px; font-weight:600; }
.studio-extra-options[open] summary { margin-bottom:12px; }
.studio-publication-preview .studio-publication-camera-controls { margin-top:12px; }
:root[data-theme="dark"] { color-scheme:dark; --canvas:#101b17; --surface:#19261f; --surface-subtle:#23352b; --text:#eff4ee; --text-soft:#afc0b4; --border:#3e5145; --border-strong:#66836f; --brand:#386e57; --brand-hover:#498767; --brand-soft:#243e30; --companion:#aacbd2; --companion-soft:#233a40; --warmth:#d6a1a1; --warmth-soft:#432b30; --progress:#d0b57f; --progress-soft:#3b3425; --danger:#ffb2b4; --danger-soft:#492c30; --success:#9fd0ad; --success-soft:#233e2f; --ink:var(--text); --muted:var(--text-soft); --paper:var(--canvas); --wash:var(--surface-subtle); --panel:var(--surface); --line:var(--border); }
:root[data-theme="dark"] .topbar, :root[data-theme="dark"] .bottom-nav, :root[data-theme="dark"] .sidebar { background:var(--surface); color:var(--text); }
:root[data-theme="dark"] :is(.conversation-panel,.work-panel,.tool-card,.test-card,.profile-identity,.profile-action-list button,.support-intent,.support-intent-control button,.action-tile,.center-panel,.price-card,.memory-hero,.lab-mode-banner,.studio-video-composer,.studio-form-panel,.studio-video-preview-panel,.chat-media-actions,.composer) { background:var(--surface); color:var(--text); border-color:var(--border); }
:root[data-theme="dark"] :is(input,textarea,select,.feature-tour-panel) { background:var(--surface-subtle); color:var(--text); border-color:var(--border); }
:root[data-theme="dark"] :is(.feature-tour-panel h2,.feature-tour-panel p,.feature-tour-panel .feature-tour-label,.feature-tour-panel .feature-tour-note) { color:var(--text); }
:root[data-theme="dark"] :is(.message-body,.lab-result-card,.memory-item,.test-list-item) { background:var(--surface-subtle); border-color:var(--border); }
:root[data-theme="dark"] .message.user .message-body { background:var(--brand); }
:root[data-theme="dark"] .chat-text-cost { background:var(--surface); }
:root[data-theme="dark"] .app-shell :is(.secondary,.ghost,.theme-toggle,.token-balance,.support-intent-control button) { color:var(--text); background:var(--surface-subtle); border-color:var(--border); }
:root[data-theme="dark"] .app-shell .support-intent-control button.active { background:var(--brand); color:#fff; }
:root[data-theme="dark"] .app-shell :is(.studio-panel-switch,.studio-format-switch,.studio-duration-switch,.studio-theme-switch,.studio-option-switch,.call-mode-switch) { background:var(--surface-subtle); border-color:var(--border); }
:root[data-theme="dark"] .app-shell :is(.studio-panel-switch,.studio-format-switch,.studio-duration-switch,.studio-theme-switch,.studio-option-switch,.call-mode-switch) button { background:transparent; color:var(--text-soft); }
:root[data-theme="dark"] .app-shell :is(.studio-panel-switch,.studio-format-switch,.studio-duration-switch,.studio-theme-switch,.studio-option-switch,.call-mode-switch) button.active { background:var(--brand); color:#fff; }
:root[data-theme="dark"] .app-shell :is(.bottom-nav,.main-nav) button.active { background:var(--brand); color:#fff; }
:root[data-theme="dark"] .app-shell .soft-label { color:var(--text); }
:root[data-theme="dark"] .app-shell :is(.media-token-cost,.message-body strong) { color:var(--text-soft); }
:root[data-theme="dark"] #chatMediaHint { background:var(--surface-subtle); color:var(--text); border-color:var(--border); }
:root[data-theme="dark"] #chatMediaHint[data-tone="error"] { background:var(--danger-soft); color:var(--danger); }
:root[data-theme="dark"] body:is(.lab-page,.editorial-landing) { --paper-warm:#1d2d24; --ink-soft:#b7c6b9; --line-light:#3e5145; }
:root[data-theme="dark"] .cinematic-landing .theme-toggle, :root[data-theme="dark"] .auth-scene-header .theme-toggle { color:#f6f2e6; border-color:#566254; background:#213529; }
:root[data-theme="light"] body:is(.lab-page,.editorial-landing) { --paper:#f5f1e8; --ink:#192e24; }
@media(max-width:960px) {
  .studio-publication-workspace { display:flex; flex-direction:column; }
  .studio-publication-preview { order:-1; position:static; }
  .studio-video-stage { width:min(100%,225px,22.5dvh); max-height:none; max-width:none; margin-inline:auto; }
  .studio-video-stage :is(canvas,video) { min-height:0; max-height:100%; }
  #view-chat.active { display:flex; flex-direction:column; height:calc(var(--app-vh,100dvh) - 142px - env(safe-area-inset-bottom,0px)); min-height:280px; padding-top:8px; padding-bottom:0; }
  .toast { top:calc(var(--app-vtop,0px) + 70px); bottom:auto; left:12px; right:12px; width:auto; max-width:none; max-height:100px; overflow:auto; font-size:12px; line-height:1.4; }
  #view-chat .support-intent { flex:0 0 auto; padding:6px 0; gap:4px; }
  #view-chat .support-intent h2 { display:none; }
  #view-chat .support-intent-control button { display:flex; min-height:40px; flex-direction:row; gap:6px; font-size:13px; }
  #view-chat .mode-help { margin-top:0; min-height:28px; }
  #view-chat .chat-layout { flex:1; height:auto; min-height:0; }
  #view-chat .conversation-panel { display:flex; flex-direction:column; min-height:0; height:100%; }
  #view-chat .chat-media-actions { grid-template-columns:repeat(4,minmax(0,1fr)); padding:5px; }
  #view-chat .chat-media-actions button { min-height:46px; padding:4px 2px; font-size:10px; }
  #view-chat .conversation-presence { display:none; }
  #view-chat .messages { min-height:60px; padding:12px 8px; }
  .chat-text-cost { font-size:10px; padding-bottom:4px; }
  .product-sheet { padding:18px; }
  :root[data-keyboard] #view-chat.active { height:calc(var(--app-vh) - 64px); min-height:180px; }
  :root[data-keyboard] .bottom-nav { display:none; }
  :root[data-keyboard] .app-shell:not(.hidden) { padding-bottom:0; }
  :root[data-keyboard] #view-chat .mode-help { display:none; }
  :root[data-keyboard] #view-chat .support-intent { display:none; }
  :root[data-keyboard] #view-chat .chat-media-actions .button-label { font-size:10px; }
  .product-sheet[open] { position:fixed; top:calc(var(--app-vtop,0px) + 12px); bottom:auto; }
}
