.theme-toggle{
  flex:0 0 auto;width:40px;height:40px;min-height:40px;padding:0;border:1px solid var(--line-strong,#bdcdbf);border-radius:9px;
  background:var(--panel,#fff);color:var(--muted-strong,#415d52);font:inherit;cursor:pointer;box-shadow:none
}
.theme-toggle:hover{background:var(--panel-subtle,#edf3ec);color:var(--text,#182c27)}
.theme-toggle-glyph{font-size:20px;line-height:1}
.theme-toggle-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.standalone-theme-toggle{position:fixed;top:14px;right:14px;z-index:80}

html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#202923;--panel:#2a352f;--panel-subtle:#313d36;--text:#eef4f0;--muted:#aebbb3;--muted-strong:#d1dbd5;
  --line:#45544b;--line-strong:#5b6c62;--primary:#3eaa6d;--primary-dark:#94dfb1;--primary-soft:#294b38;
  --blue:#85b9f6;--danger:#ff9b9b;--warning:#edc774;--shadow:0 14px 38px rgba(4,12,8,.24);
  background:var(--bg);color:var(--text)
}
html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] .topbar{background:rgba(36,46,40,.97);border-color:var(--line)}
html[data-theme="dark"] .main-nav{background:var(--panel);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .secondary,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .source-options,
html[data-theme="dark"] .source-options .chip,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .speaker-tag,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .background-job,
html[data-theme="dark"] .speaker,
html[data-theme="dark"] .time,
html[data-theme="dark"] .lecture-frame,
html[data-theme="dark"] .account-panel,
html[data-theme="dark"] .account-route,
html[data-theme="dark"] .activation-steps li,
html[data-theme="dark"] #payment .payment-wrap,
html[data-theme="dark"] #payment .plan,
html[data-theme="dark"] #payment .plan-tier,
html[data-theme="dark"] .static-hero-note,
html[data-theme="dark"] .meetxt-support,
html[data-theme="dark"] .meetxt-support header{background:var(--panel);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .primary:hover{background:#318b58;border-color:#318b58}
html[data-theme="dark"] .ghost:hover,
html[data-theme="dark"] .link:hover,
html[data-theme="dark"] .source-options .chip:hover,
html[data-theme="dark"] .recent-item:hover{background:#344139;color:var(--text)}
html[data-theme="dark"] .sub-status{background:#294b38;border-color:#568e6c;color:#a8e8c0}
html[data-theme="dark"] .network-banner{background:#4b3e24;border-color:#6e5c34;color:#f6dda1}
html[data-theme="dark"] .recording-console,
html[data-theme="dark"] .background-panel,
html[data-theme="dark"] .recent-table-head,
html[data-theme="dark"] .pay-status,
html[data-theme="dark"] .calendar-list,
html[data-theme="dark"] .static-feature-grid article,
html[data-theme="dark"] .library-empty-state,
html[data-theme="dark"] .history-empty-state,
html[data-theme="dark"] .mobile-settings{background:var(--panel-subtle);border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .limit-box,
html[data-theme="dark"] #payment .plans-beta{background:#473c25;color:#f5e3b7;border-color:#c69b45}
html[data-theme="dark"] .status-error{background:#4a2e31;color:#ffb1b1}
html[data-theme="dark"] .status-success,
html[data-theme="dark"] .source-options .chip.active,
html[data-theme="dark"] .chip.active,
html[data-theme="dark"] .library-scope [aria-pressed="true"],
html[data-theme="dark"] .mobile-bottom-nav button[aria-current]{background:var(--primary-soft);color:#a8e8c0}
html[data-theme="dark"] .bar,
html[data-theme="dark"] .progress{background:#48564e}
html[data-theme="dark"] .diff-row-del{background:#4a2e31}
html[data-theme="dark"] .start-aside .meeting-panel,
html[data-theme="dark"] .start-aside .calendar-list,
html[data-theme="dark"] #payment .plan-tier.pro,
html[data-theme="dark"] #payment .plan.active,
html[data-theme="dark"] .account-plan-panel{background:#294638;border-color:#527961}
html[data-theme="dark"] .static-hero{background:linear-gradient(135deg,#2a352f 0%,#263d30 100%)}
html[data-theme="dark"] .pro-invite{background:linear-gradient(125deg,#2e4637,#2a352f);border-color:#557765;color:var(--text)}
html[data-theme="dark"] .pro-invite h2{color:var(--text)}
html[data-theme="dark"] #solutions .grid>.card{background:linear-gradient(145deg,#303c35,#29372f);color:var(--text);border-color:#53645a}
html[data-theme="dark"] #solutions .grid>.card:hover{box-shadow:0 10px 28px rgba(4,12,8,.34)}
html[data-theme="dark"] .pro-invite-kicker,
html[data-theme="dark"] .media-volume{color:#abd7bd}
html[data-theme="dark"] .mobile-bottom-nav{background:rgba(36,46,40,.98);border-color:var(--line)}
html[data-theme="dark"] .meetxt-support #support-messages .message-admin{background:#2c4051}
html[data-theme="dark"] .meetxt-support #support-messages .message-user{background:#294b38}
html[data-theme="dark"] .meetxt-support button{background:#294b38;color:#b9e9cb;border-color:#557665}
html[data-theme="dark"] .meetxt-support-open{background:#303c35;color:#b9e9cb;border-color:#5f8c73}
html[data-theme="dark"] #readiness-badge{background:#294b38!important;color:#b9e9cb!important;border-color:#557665!important}
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] button:disabled{background:#36413b!important;color:#9eaaa3!important;border-color:#4f5e55!important;opacity:1}
html[data-theme="dark"] .account-plan-badge,
html[data-theme="dark"] #payment .plan-tier-title span{background:#35433b;color:var(--text)}
html[data-theme="dark"] .device-state{background:#3c474f;color:#dbe3e8!important}
html[data-theme="dark"] .device-state.active{background:#294b38;color:#a8e8c0!important}
html[data-theme="dark"] .device-state.inactive{background:#4a2e31;color:#ffb1b1!important}
html[data-theme="dark"] .device-state.revoked{background:#4b3e24;color:#f6dda1!important}
html[data-theme="dark"] .mobile-mode-links>a,
html[data-theme="dark"] .mobile-mode-links>button{background:#294b38;color:#b9e9cb;border-color:#557665}
html[data-theme="dark"] .mobile-library-tools>summary,
html[data-theme="dark"] .account-route span,
html[data-theme="dark"] .activation-steps span,
html[data-theme="dark"] .account-plan-description,
html[data-theme="dark"] .account-facts span,
html[data-theme="dark"] .shared-filters label,
html[data-theme="dark"] .library-empty-steps,
html[data-theme="dark"] .library-empty-state p,
html[data-theme="dark"] .history-empty-state p{color:var(--muted-strong)}
html[data-theme="dark"] .account-library-stats strong,
html[data-theme="dark"] .library-empty-state,
html[data-theme="dark"] .history-empty-state{color:var(--text)}
html[data-theme="dark"] .process-demo{
  --process-demo-bg:#2d3932;
  --process-step-bg:#344139;
  --process-step-color:#b4c4ba;
  --process-active-bg:#294b38;
  --process-active-color:#b9e9cb;
  --process-active-border:#5f9474;
  --process-active-shadow:0 7px 18px rgba(3,12,7,.3);
  border-color:var(--line)
}
html[data-theme="dark"] .process-demo-label{color:#c0cec5}
html[data-theme="dark"] #solutions .scenario-details,
html[data-theme="dark"] .import-options,
html[data-theme="dark"] .account-secondary{background:var(--panel-subtle);border-color:var(--line);color:var(--text)}
html[data-theme="dark"] #solutions .scenario-details summary,
html[data-theme="dark"] .import-options summary,
html[data-theme="dark"] .account-secondary summary{color:var(--muted-strong)}

/* Standalone help, legal and on-device pages use the same calm palette. */
html[data-theme="dark"] .standalone-page main section{background:var(--panel);border-color:var(--line)}
html[data-theme="dark"] .standalone-page aside{background:#2c3d34;color:#c7d5cd;border-color:#659079}
html[data-theme="dark"] button.secondary{background:var(--panel);color:var(--primary-dark)}
html[data-theme="dark"] details{border-color:var(--line)}

/* The administrator uses the same preference without changing access controls. */
html[data-theme="dark"] .admin-body,
html[data-theme="dark"] .admin-body .layout,
html[data-theme="dark"] .admin-body main,
html[data-theme="dark"] .admin-body .rail{background:#26312b;color:#edf3ef}
html[data-theme="dark"] .admin-body{--line:#4b5b52;--muted:#b2bfb8}
html[data-theme="dark"] .admin-body button,
html[data-theme="dark"] .admin-body input,
html[data-theme="dark"] .admin-body select,
html[data-theme="dark"] .admin-body dialog,
html[data-theme="dark"] .admin-body .card{background:#303c35;color:#edf3ef;border-color:#53645a}
html[data-theme="dark"] .admin-body button:hover:not(:disabled){background:#3a4940}
html[data-theme="dark"] .admin-body .primary{background:#35865f;color:#fff}
html[data-theme="dark"] .admin-body .rail nav [aria-current]{background:#365344;border-color:#557361}
html[data-theme="dark"] .admin-body .hero{background:#354239;border-color:#53645a}
html[data-theme="dark"] .admin-body .notice{background:#4b3e27;color:#f4dfac}
html[data-theme="dark"] .admin-body th{background:#354239;color:#c6d4cc}
html[data-theme="dark"] .admin-body td{border-color:#526159}
html[data-theme="dark"] .admin-body tbody tr:nth-child(even){background:#2c3731}
html[data-theme="dark"] .admin-body .badge{background:#3a4740;color:#dce7e0}
html[data-theme="dark"] .admin-body .badge.good{background:#294b38;color:#a8e8c0}
html[data-theme="dark"] .admin-body .badge.bad{background:#4a2e31;color:#ffb1b1}
html[data-theme="dark"] .admin-body .badge.warn{background:#4b3e24;color:#f6dda1}
html[data-theme="dark"] .admin-body .job-bad td{background:#412f31}
html[data-theme="dark"] .admin-body .job-good td{background:#2b4134}
html[data-theme="dark"] .admin-body .job-warn td{background:#443b28}
html[data-theme="dark"] .admin-body .component{border-color:#45544b}
html[data-theme="dark"] .admin-body .chart,
html[data-theme="dark"] .admin-body .capacity-line,
html[data-theme="dark"] .admin-body .log-view,
html[data-theme="dark"] .admin-body .support-thread,
html[data-theme="dark"] .admin-body .support-unread{background:#303c35!important;color:#edf3ef!important;border-color:#53645a!important}
html[data-theme="dark"] .admin-body .telemetry-alert{background:#4b3e24!important;color:#f6dda1!important;border-color:#95732f!important}
html[data-theme="dark"] .admin-body .telemetry-alert.critical{background:#4a2e31!important;color:#ffb1b1!important;border-color:#b35a62!important}
html[data-theme="dark"] .admin-body .telemetry-alert.resolved{background:#294b38!important;color:#a8e8c0!important;border-color:#4f8d68!important}
html[data-theme="dark"] .admin-body .chart small,
html[data-theme="dark"] .admin-body .metric-legend{color:#b9c8bf!important}
html[data-theme="dark"] .admin-body .chart svg text{fill:#b9c8bf!important}
html[data-theme="dark"] .admin-body .chart-title{color:#b9e9cb!important;background:transparent!important}
html[data-theme="dark"] .admin-body .service-operation-pending{color:#edc774}

.audience-consent{position:fixed;left:50%;bottom:18px;z-index:95;transform:translateX(-50%);display:flex;align-items:center;gap:22px;width:min(760px,calc(100vw - 28px));padding:18px 20px;border:1px solid var(--line-strong,#bdcdbf);border-radius:14px;background:var(--panel,#fff);color:var(--text,#182c27);box-shadow:0 16px 44px rgba(8,34,23,.2)}
.audience-consent p{margin:6px 0 4px;line-height:1.45}.audience-consent a{color:var(--primary-dark,#126847)}.audience-consent-actions{display:flex;gap:8px;flex:0 0 auto}.audience-consent-actions button{min-height:42px;white-space:nowrap}.audience-settings{border:0;background:transparent;color:inherit;text-decoration:underline;text-underline-offset:3px;font:inherit;cursor:pointer;padding:0}.audience-settings-wrap{margin-top:28px}
html[data-theme="dark"] .audience-consent{background:#303c35;color:#edf3ef;border-color:#5b6c62}.audience-consent .primary{background:#24784f;color:#fff}

@media(max-width:680px){.audience-consent{align-items:stretch;flex-direction:column;gap:12px;bottom:calc(76px + env(safe-area-inset-bottom));max-height:min(70vh,520px);overflow:auto}.audience-consent-actions{display:grid;grid-template-columns:1fr 1fr}.audience-consent-actions button{white-space:normal}}

@media(max-width:900px){
  .top-actions>.theme-toggle{order:0}
  html[data-theme="dark"] .topbar{background:rgba(36,46,40,.97)}
  .screen{scroll-margin-top:122px}
}
@media(max-width:470px){
  .theme-toggle{width:38px;height:38px;min-height:38px;border-radius:8px}
  .theme-toggle-glyph{font-size:19px}
}
