/* Theme is opt-in and only changes the platform UI, never media/PDF content. */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink:#e6edf7; --muted:#afbdd0; --muted-2:#9baac0;
  --canvas:#101722; --surface:#192332; --line:#2e3c50; --line-strong:#43546c;
  --sidebar:#101927; --sidebar-muted:#acbad0; --sidebar-hover:#25364b;
  --blue:#84b3ff; --blue-soft:#203653; --blue-deep:#a3c6ff;
  --green:#7ce1af; --green-soft:#193b32; --amber:#ffd08a; --amber-soft:#3c3020;
  --shadow:0 12px 30px #0003; --float:0 22px 60px #0006;
  color:var(--ink); background:var(--canvas);
}
.platform-theme-toggle {display:inline-flex;align-items:center;justify-content:center;gap:7px;flex-shrink:0;min-height:35px;padding:6px 9px;border:1px solid var(--line-strong,#dce1ea);border-radius:8px;background:var(--surface,#fff);color:var(--ink,#17213a);font:600 12px/1.3 "Segoe UI",sans-serif;cursor:pointer}
.platform-theme-toggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.platform-theme-toggle:focus-visible{outline:3px solid #84b3ff;outline-offset:3px}
.platform-theme-toggle:hover{background:var(--blue-soft,#eef4ff)}
@media(max-width:1100px){.platform-theme-toggle span{display:none}.platform-theme-toggle{width:35px;padding:7px}}
@media(max-width:560px){.topbar-actions{gap:5px}.topbar-actions .topbar-avatar{display:none}}
@media(pointer:coarse){.platform-theme-toggle{min-width:44px;min-height:44px}}

html[data-theme="dark"] :is(.topbar,.frame,.attention,.quick-card,.bot-list,.settings-side,.integration-card,.quick-menu,.modal,.palette,.right-drawer,.notification-panel,.telegram-panel,.media-card,.media-preview,.builder-panel,.builder-inspector,.builder-toolbar,.smm-account-box,.smm-account-platform,.planner-section,.planner-card,.planner-summary,.planner-composer,.planner-draft,.planner-text-check,.planner-telegram-link-popover,.automations-settings-list,.automations-resolution,.automations-menu div,.transcription-list,.transcription-metrics article,.transcription-viewer section,.automations-recorder){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] :is(.page-header h1,.stat-value,.section-heading h2,.row-title,.calendar-day strong,.quick-card strong,.bot-name,.cell-value,.empty-state h2,.builder-empty h1,.settings-row-title,.integration-card strong,.settings-side h3,.modal h2,.drawer-title,.automations-page,.smm-accounts-page,.planner-page,.automations-recorder strong,.transcription-viewer pre){color:var(--ink)}
html[data-theme="dark"] :is(.secondary-button,.command-button,.filter-button,.select-control,.input-wrap,.automations-media-button,.automations-settings-button,.automations-setting input,.automations-resolution input,.automations-menu button,.transcription-viewer button,.planner-file-choice,.planner-vidiq-actions button){background:var(--surface);border-color:var(--line-strong);color:var(--ink)}
html[data-theme="dark"] :is(input,textarea,select){background-color:var(--surface);border-color:var(--line-strong);color:var(--ink)}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--muted-2)}
html[data-theme="dark"] :is(.primary-button,.nav-item.is-active){background:#326bd1;border-color:#326bd1;color:#fff}
html[data-theme="dark"] .primary-button:hover{background:#3e79e3;border-color:#3e79e3}
html[data-theme="dark"] :is(.icon-button,.row-chevron,.activity-icon,.settings-row-icon){color:var(--muted)}
html[data-theme="dark"] :is(.activity-icon,.settings-row-icon,.command-button kbd,.empty-steps span,.builder-notes span,.automations-now,.automations-node-tabs,.automations-table th,.planner-text-check-group,.smm-account-empty,.smm-account-count,.planner-media-preview,.planner-provider-field-note){background:#202d3e;color:var(--muted);border-color:var(--line)}
html[data-theme="dark"] :is(.attention:hover,.bot-row:hover,.quick-card:hover,.icon-button:hover){background:#223147;color:var(--ink)}
html[data-theme="dark"] :is(.section-navigation button,.transcription-filters button,.automations-node-tabs button){color:var(--muted)}
html[data-theme="dark"] :is(.section-navigation button[aria-current="page"],.section-navigation button:hover,.automations-node-tabs button.is-active){color:#bdd5ff;background:#243d62;border-color:#426392;box-shadow:none}
html[data-theme="dark"] .transcription-filters button.is-active{color:#bdb1ff;border-color:#a795ff}
html[data-theme="dark"] :is(.automations-file-link,.automations-folder,.automations-media-button svg,.automations-settings-button,.text-link,.transcription-details summary,.smm-account-platform a,.planner-account-link){color:#9fc3ff}
html[data-theme="dark"] :is(.automations-crumbs,.automations-route,.automations-live,.automations-now small,.automations-file-meta,.automations-source-note,.automations-resolution small,.automations-settings-copy,.automations-setting small,.automations-loading,.automations-empty,.automations-manual-list small,.automations-manual-status,.transcription-connection,.transcription-connection b,.transcription-metrics small,.transcription-metrics em,.transcription-completion-note,.transcription-table td small,.transcription-details,.transcription-flow,.automations-recorder small){color:var(--muted)}
html[data-theme="dark"] :is(.automations-table-wrap,.automations-table td,.automations-setting,.transcription-list .automations-table-wrap,.transcription-filters,.transcription-viewer header,.transcription-table tbody tr,.automations-file-row){border-color:var(--line)}
html[data-theme="dark"] .automations-live-separator{background:var(--line)}
html[data-theme="dark"] :is(.metric-icon,.bot-avatar,.topbar-avatar){color:#c2b8ff;background:#352e56}
html[data-theme="dark"] .metric-icon.is-blue{color:#9fc9ff;background:#203c5c}
html[data-theme="dark"] .metric-icon.is-green{color:#8ee6b6;background:#1e4032}
html[data-theme="dark"] :is(.transcription-status,.automations-manual-status.is-done){color:#bdb1ff}
html[data-theme="dark"] :is(.transcription-status.is-done,.automations-live-status,.automations-recorder.is-recording strong){color:#83e3ae}
html[data-theme="dark"] :is(.transcription-status.is-needs_action,.transcription-status.is-failed,.transcription-status.is-waiting_retry,.automations-manual-status.is-failed,.automations-manual-status.is-needs_action){color:#ffcf86}
html[data-theme="dark"] .automations-recorder.is-recording{background:#152e25;border-color:#3c9765}
html[data-theme="dark"] :is(.automations-attention,.automations-attention button,.automations-recorder.is-error,.automations-recorder.is-unavailable,.automations-recorder.is-reconnecting,.planner-notice.is-warning,.planner-conflict,.planner-provider-field-note.is-warning,.planner-preserved-fields){background:#342a1d;border-color:#8d6636;color:#ffd598}
html[data-theme="dark"] :is(.automations-error,.text-danger,.planner-text-check-status.pl-OVER_LIMIT,.planner-text-check-status.pl-INVALID){color:#ffaba4;background:#392126;border-color:#92545c}
html[data-theme="dark"] :is(.smm-account-mode,.planner-mode-note,.planner-notice,.planner-help,.planner-info,.planner-dropzone,.smm-provider-preparation){background:#1b2d45;border-color:#345077;color:var(--muted)}
html[data-theme="dark"] :is(.smm-account-platform.is-telegram,.smm-account-platform.is-instagram,.smm-account-platform.is-youtube){background:var(--surface);border-color:var(--line)}
html[data-theme="dark"] :is(.smm-account-box p,.smm-account-box li,.smm-account-empty strong,.smm-account-platform p,.smm-account-platform-status,.smm-oauth-requirements summary,.smm-oauth-requirements ul,.smm-oauth-requirements code,.smm-oauth-callback code,.planner-mode-note strong,.planner-inline-empty strong,.planner-text-check small,.planner-text-check-status,.planner-text-check-group ul,.planner-optional,.planner-help,.planner-conflict p){color:var(--muted)}
html[data-theme="dark"] :is(.smm-account-mode>span,.is-telegram .smm-account-platform-status){color:#a5caff}
html[data-theme="dark"] .is-instagram .smm-account-platform-status{color:#e5b4ff}
html[data-theme="dark"] .is-youtube .smm-account-platform-status{color:#ffb6ae}
html[data-theme="dark"] :is(.planner-list-heading h2 span,.planner-draft-state,.smm-account-provider-mark){background:#26364c;color:#bfccdf}
html[data-theme="dark"] :is(.smm-accounts-page button:disabled,.planner-account.is-disabled){background:#233044;border-color:var(--line);color:var(--muted)}
html[data-theme="dark"] .planner-account small{color:var(--muted)}
html[data-theme="dark"] .transcription-viewer{background:#040810b3}
html[data-theme="dark"] :is(button,a,summary,input,textarea,select):focus-visible{outline-color:#96beff}
html[data-theme="dark"] :is(.automations-secondary,.automations-manual-list){background:var(--surface);border-color:var(--line-strong);color:var(--ink)}
html[data-theme="dark"] .automations-manual-notice{background:var(--green-soft);border-color:#3d8065;color:var(--green)}
html[data-theme="dark"] .app-main:has(.planner-page),html[data-theme="dark"] .app-main:has(.smm-accounts-page),html[data-theme="dark"] .section-navigation[aria-label="Разделы SMM"]{background:var(--canvas)}
html[data-theme="dark"] :is(.planner-page,.smm-accounts-page){--smm-ink:#e6edf7;--smm-muted:#afbdd0;--smm-cyan:#203b4d;--smm-lilac:#342e4d;--smm-mint:#243d32}
html[data-theme="dark"] .planner-page :is(.planner-workspace-hero,.planner-empty,.planner-draft-card,.planner-section,.planner-summary-sticky,.planner-inline-empty,.planner-media-thumb,.planner-media-meta,.planner-caption,.planner-disclosure,.planner-text-check,.planner-calendar,.planner-calendar-day,.planner-schedule-editor>div){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .planner-page .planner-workspace-hero{background:var(--smm-cyan)}
html[data-theme="dark"] :is(.planner-workspace-hero,.smm-accounts-page .page-header)::after{border-color:#416379}
html[data-theme="dark"] :is(.planner-page,.smm-accounts-page) :is(.eyebrow,.planner-workspace-hero p,.page-header p,.planner-inline-empty strong,.planner-inline-empty p,.planner-text-check summary,.planner-media-send-mode label,.planner-schedule-fields label>span,.planner-timing-label,.planner-override legend,.planner-override label,.planner-more-actions,.planner-field-explainer){color:var(--muted)}
html[data-theme="dark"] .planner-page :is(.planner-segmented,.planner-calendar-toolbar,.planner-calendar-weekdays,.planner-calendar-day.is-outside,.planner-period-day>header,.planner-summary-sticky .planner-next-step,.planner-media-preview,.planner-media-add,.planner-dropzone,.planner-dropzone:hover,.planner-account.is-selected){background:#203349;border-color:var(--line-strong);color:var(--ink)}
html[data-theme="dark"] .planner-page :is(.planner-segmented button,.planner-calendar-day>span,.planner-calendar-weekdays span,.planner-calendar-head small,.planner-calendar-more,.planner-period-empty,.planner-scheduled-main span,.planner-scheduled-main small){color:var(--muted)}
html[data-theme="dark"] .planner-page .planner-segmented button.is-active{background:#365477;color:#fff;box-shadow:none}
html[data-theme="dark"] .planner-page :is(.planner-scheduled-card,.planner-scheduled-card.is-paused,.planner-scheduled-card.is-queued,.planner-scheduled-card.is-action-required,.planner-month-event){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .planner-page :is(.planner-scheduled-time,.planner-scheduled-card.is-queued .planner-scheduled-time){color:#9fc9ff}
html[data-theme="dark"] .planner-page .planner-scheduled-card.is-paused .planner-scheduled-time{color:#ffcf86}
html[data-theme="dark"] .planner-page .planner-scheduled-card.is-action-required .planner-scheduled-time{color:#ffaba4}
html[data-theme="dark"] :is(.planner-page,.smm-accounts-page) :is(input,select,textarea,.secondary-button,.planner-file-choice,.planner-media-actions button){background:var(--surface);border-color:var(--line-strong);color:var(--ink)}
html[data-theme="dark"] :is(.planner-page,.smm-accounts-page) button:disabled{background:#233044;border-color:var(--line);color:var(--muted)}
html[data-theme="dark"] .smm-accounts-page :is(.smm-account-mode,.smm-account-empty,.smm-account-platform.is-telegram,.smm-account-onboarding>summary){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .planner-page :is(.planner-content-tabs,.planner-vidiq,.planner-youtube-tags,.planner-vidiq-title,.planner-youtube-tag){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .planner-page :is(.planner-content-tabs button,.planner-vidiq header strong,.planner-vidiq p,.planner-youtube-tags>header strong,.planner-youtube-tags>header span,.planner-youtube-tag-group>div:first-child strong){color:var(--muted)}
html[data-theme="dark"] .planner-page .planner-content-tabs button.is-active{background:#365477;color:#fff;box-shadow:none}
html[data-theme="dark"] .planner-page .planner-content-tabs button span{background:#253b48;color:#c1dace}
