/* Shared site palette. Layout and motion remain in the page stylesheets. */
:root {
 --page-bg:#f5f5f5; --surface:#ffffff; --surface-soft:#efefef; --surface-hover:#e7e7e7;
 --surface-input:#fcfcfc; --border:#dedede; --text:#242424; --text-secondary:#555555;
 --text-muted:#6b6b6b; --accent:#292929; --accent-hover:#121212; --accent-ink:#ffffff;
 --accent-soft:#e7e7e7; --accent-muted:#6c6c6c; --focus:#aaaaaa; --danger:#656565;
 --danger-soft:#eeeeee; --success:#505050; --success-soft:#ececec; --warning:#686868;
 --warning-soft:#ededed; --shadow-theme:0 5px 25px #00000007;
 --hero-start:#242424; --hero-end:#494949; --hero-text:#fafafa; --hero-muted:#cecece;
 --ink:var(--text); --muted:var(--text-muted); --purple:var(--accent); --purple-deep:var(--accent-hover);
 --line:var(--border); --canvas:var(--page-bg); --card:var(--surface); --sidebar:var(--surface);
 --soft:var(--accent-soft); --green:var(--success); --shadow:var(--shadow-theme);
 color-scheme:light;
}
html[data-theme='dark'] {
 --page-bg:#111111; --surface:#1b1b1b; --surface-soft:#242424; --surface-hover:#303030;
 --surface-input:#171717; --border:#363636; --text:#f3f3f3; --text-secondary:#c7c7c7;
 --text-muted:#a3a3a3; --accent:#e7e7e7; --accent-hover:#ffffff; --accent-ink:#171717;
 --accent-soft:#323232; --accent-muted:#c4c4c4; --focus:#686868; --danger:#c7c7c7;
 --danger-soft:#303030; --success:#c7c7c7; --success-soft:#303030; --warning:#c7c7c7;
 --warning-soft:#303030; --shadow-theme:0 7px 28px #00000013;
 --hero-start:#202020; --hero-end:#3c3c3c; --hero-text:#f5f5f5; --hero-muted:#c9c9c9;
 color-scheme:dark;
}
html[data-theme] body {background:var(--page-bg)!important;color:var(--text)!important}
html[data-theme] :is(h1,h2,h3,h4) {color:var(--text)}
html[data-theme] :is(a,button,input,textarea,select,label[role='button']):focus-visible {outline-color:var(--focus)!important}
html[data-theme] ::selection {background:var(--accent-soft);color:var(--text)}
/* One control on every page; loaded in the head to avoid a theme flash. */
.theme-toggle {display:inline-grid;place-items:center;flex:0 0 36px;width:36px;height:36px;padding:0;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--accent);cursor:pointer;vertical-align:middle;transition:background .18s,border-color .18s,box-shadow .18s}
.theme-toggle:hover {background:var(--accent-soft);border-color:var(--focus);box-shadow:0 2px 8px #25513d0a}
.theme-toggle svg {display:block;width:17px;height:17px;flex-shrink:0;pointer-events:none}
.theme-toggle .theme-sun {display:none}
html[data-theme='dark'] .theme-toggle .theme-moon {display:none}
html[data-theme='dark'] .theme-toggle .theme-sun {display:block}
.theme-toggle--floating {position:fixed;top:22px;right:24px;z-index:300;box-shadow:var(--shadow-theme)}
/* Workspace navigation and chrome. */
html[data-theme] :is(.workspace .sidebar,.desktop-brandbar,.workspace .topbar,.dropdown-content,.mobile-navigation) {background:var(--surface)!important;border-color:var(--border)!important;color:var(--text-secondary)!important;box-shadow:none}
html[data-theme] :is(.workspace-switch,.workspace-avatar,.account-detail .detail-icon) {background:var(--surface-soft)!important;border-color:var(--border)!important;color:var(--accent-muted)!important}
html[data-theme] :is(.workspace-details strong,.account-caption strong,.menu-identity strong,.header-context strong) {color:var(--text-secondary)!important}
html[data-theme] :is(.workspace-details small,.account-caption small,.workspace-label,.header-context,.menu-identity small,.header-help,.workspace-footer,.workspace-footer>span) {color:var(--text-muted)!important}
html[data-theme] :is(.nav-divider,.header-separator) {background:var(--border)!important}
html[data-theme] .sidebar-menu a {color:var(--text-secondary)!important}
html[data-theme] :is(.sidebar-menu a:hover,.dropdown-content a:hover) {background:var(--surface-hover)!important;color:var(--text)!important}
html[data-theme] :is(.sidebar-menu a.active,.sidebar-menu a.active:hover,.mobile-navigation a.active) {background:var(--accent-soft)!important;color:var(--accent)!important}
html[data-theme] .sidebar-menu a.active svg {color:var(--accent)!important}
html[data-theme] .mobile-navigation a {color:var(--text-muted)}
html[data-theme] .upgrade-card {background:linear-gradient(135deg,var(--surface-soft),var(--accent-soft))!important;border-color:var(--border)!important}
html[data-theme] :is(.upgrade-card h4,.upgrade-card p) {color:var(--text-secondary)!important}
html[data-theme] :is(.upgrade-icon,.upgrade-card a) {background:var(--surface)!important;color:var(--accent)!important;border-color:var(--border)!important}
html[data-theme] .upgrade-spark {color:var(--accent);opacity:.12}
html[data-theme] :is(.workspace .sidebar .sidebar-header .sidebar-collapse,.desktop-sidebar-toggle) {background:var(--surface-soft)!important;color:var(--accent-muted)!important;border-color:var(--border)!important}
html[data-theme] .desktop-sidebar-toggle:hover {background:var(--accent-soft)!important;color:var(--accent)!important}
html[data-theme] :is(.page-intro h1,.dash-title,.section-heading h2) {color:var(--text)!important}
html[data-theme] :is(.page-intro p,.section-heading>span,.workspace-footer p,.mobile-secondary-links) {color:var(--text-muted)!important}
html[data-theme] .workspace-footer {border-color:var(--border)}
/* Surfaces, primary actions, and data. */
html[data-theme] :is(.metric-card,.panel,.activity-card,.form-card,.smtp-form,.form-container,.billing-card) {background:var(--surface)!important;border-color:var(--border)!important;box-shadow:var(--shadow-theme)!important}
html[data-theme] :is(.ui-button,.pagination-btn) {background:var(--surface)!important;border-color:var(--border)!important;color:var(--text-secondary)!important;box-shadow:none!important}
html[data-theme] :is(.ui-button:hover,.pagination-btn:hover) {background:var(--accent-soft)!important;color:var(--accent)!important;border-color:var(--focus)!important}
html[data-theme] :is(.ui-button.primary,.workspace .form-actions button,.billing-btn,.compose-send-row button,.sign-btn) {background:var(--accent)!important;border-color:var(--accent)!important;color:var(--accent-ink)!important;box-shadow:0 3px 9px #164e3910!important}
html[data-theme] :is(.ui-button.primary:hover,.workspace .form-actions button:hover,.billing-btn:hover,.compose-send-row button:hover,.sign-btn:hover) {background:var(--accent-hover)!important;border-color:var(--accent-hover)!important;color:var(--accent-ink)!important}
html[data-theme] :is(.metric-value,.panel-heading h2,.table-heading h2,.form-card h3,.message-cell strong,.outcome-ring strong) {color:var(--text)!important}
html[data-theme] :is(.metric-label,.panel-heading p,.table-heading p,.form-description,.outcome-row small,.account-detail small,.metric-note,.outcome-note,.table-footer,.duration) {color:var(--text-muted)!important}
html[data-theme] :is(.outcome-row strong,.outcome-row b,.account-detail strong,.features li) {color:var(--text-secondary)!important}
html[data-theme] :is(.purple,.metric-icon.purple,.message-icon,.soft-label,.type-label) {background:var(--accent-soft)!important;color:var(--accent-muted)!important}
html[data-theme] .blue {background:var(--surface-soft)!important;color:var(--text-muted)!important}
html[data-theme] .green {background:var(--success-soft)!important;color:var(--success)!important}
html[data-theme] .pink {background:var(--warning-soft)!important;color:var(--warning)!important}
html[data-theme] .outcome-ring {background:conic-gradient(var(--accent) 0deg var(--success-angle),var(--warning) var(--success-angle) 360deg)!important}
html[data-theme] .outcome-ring.is-empty {background:var(--surface-soft)!important}
html[data-theme] .outcome-ring>div {background:var(--surface)!important}
html[data-theme] .legend-dot.green {background:var(--accent)!important}
html[data-theme] .legend-dot.pink {background:var(--warning)!important}
html[data-theme] :is(.outcome-row,.account-detail,.table-footer,.activity-card>h3) {border-color:var(--border)!important}
html[data-theme] .outcome-ring small {color:var(--text-muted)}
html[data-theme] :is(.inline-link,.connection-help,.features li:before) {color:var(--accent)!important}
html[data-theme] :is(th,thead) {background:var(--surface-soft)!important;color:var(--text-muted)!important;border-color:var(--border)!important}
html[data-theme] td {color:var(--text-secondary)!important;border-color:var(--border)!important}
html[data-theme] tbody tr:hover td {background:var(--surface-soft)!important}
html[data-theme] .badge.success {background:var(--success-soft)!important;color:var(--success)!important}
html[data-theme] .badge.warning {background:var(--danger-soft)!important;color:var(--danger)!important}
html[data-theme] :is(.empty-state h3,.empty-state p) {color:var(--text-secondary)!important}
html[data-theme] .empty-icon {background:var(--accent-soft)!important;color:var(--accent)!important}
html[data-theme] .btn-danger {background:var(--surface)!important;border-color:var(--danger)!important;color:var(--danger)!important;box-shadow:none!important}
html[data-theme] .btn-danger:hover {background:var(--danger-soft)!important}
html[data-theme] .billing-card.relative {background:linear-gradient(var(--accent-soft),var(--surface))!important;border-color:var(--accent-muted)!important}
html[data-theme] .billing-badge {background:var(--accent)!important;color:var(--accent-ink)!important}
html[data-theme] :is(#pricing p,.billing-table-section p,.billing-card p) {color:var(--text-muted)!important}
html[data-theme] .billing-table {background:var(--surface)!important;border-color:var(--border)!important}
/* Banner uses the same evergreen family in either mode. */
html[data-theme] .welcome-banner {background:linear-gradient(110deg,var(--hero-start),var(--hero-end))!important;border-color:var(--hero-end)!important;color:var(--hero-text)!important}
html[data-theme] .welcome-copy h2 {color:var(--hero-text)!important}
html[data-theme] .welcome-copy p {color:var(--hero-muted)!important}
html[data-theme] .welcome-copy>a {background:var(--hero-text)!important;color:var(--hero-start)!important;border-color:var(--hero-text)!important}
html[data-theme] .spark {color:var(--hero-muted)}
/* Inputs and the complete composer. */
html[data-theme] :is(.input-group label,.message-label-row label,.form-section-heading h2,.compose-section legend) {color:var(--text-secondary)!important}
html[data-theme] :is(.input-group input:not([type='checkbox']):not([type='file']),.input-group textarea,.input-group select) {background:var(--surface-input)!important;border-color:var(--border)!important;color:var(--text)!important}
html[data-theme] :is(input,textarea)::placeholder {color:var(--text-muted)!important;opacity:.8}
html[data-theme] :is(.input-group input:focus,.input-group textarea:focus,.input-group select:focus) {border-color:var(--focus)!important;box-shadow:0 0 0 3px var(--accent-soft)!important}
html[data-theme] :is(.custom-file-upload,.compose-upload,.compose-options) {background:var(--surface-soft)!important;border-color:var(--border)!important}
html[data-theme] :is(.custom-file-upload label,.compose-upload strong,.upload-browse) {color:var(--accent-muted)!important}
html[data-theme] :is(.file-list,.compose-upload #file-list,.file-list-photo,.compose-options h3,.option-label,.field-optional,.form-section-heading p) {color:var(--text-muted)!important}
html[data-theme] :is(.compose-card-header,.compose-send-row,.message-editor-footer) {background:var(--surface-soft)!important;border-color:var(--border)!important}
html[data-theme] :is(.compose-card-header h2,.preview-heading-title h2) {color:var(--text)!important}
html[data-theme] :is(.compose-card-header p,.compose-status,.compose-send-row>span,.message-editor-footer,.message-label-row>span,.preview-heading p) {color:var(--text-muted)!important}
html[data-theme] :is(.compose-heading-icon,.section-number,.upload-mark,.compose-status) {background:var(--accent-soft)!important;color:var(--accent-muted)!important;border-color:var(--border)!important}
html[data-theme] .compose-section legend {border-color:var(--border)}
html[data-theme] .upload-browse {background:var(--surface)!important;border-color:var(--border)!important}
html[data-theme] .compose-options .option-label input[type='checkbox'] {background:var(--surface)!important;border-color:var(--focus)!important}
html[data-theme] .compose-options .option-label input[type='checkbox']:checked {background:var(--accent)!important;border-color:var(--accent)!important}
html[data-theme] .compose-options .option-label input[type='checkbox']:checked:before {border-color:var(--accent-ink)!important}
html[data-theme] :is(.connection-trigger,.connection-dropdown) {background:var(--surface)!important;border-color:var(--border)!important;color:var(--text)!important;box-shadow:var(--shadow-theme)!important}
html[data-theme] .connection-trigger:hover {background:var(--surface-soft)!important;border-color:var(--focus)!important}
html[data-theme] .connection-picker.is-open .connection-trigger {border-color:var(--focus)!important;box-shadow:0 0 0 3px var(--accent-soft)!important}
html[data-theme] :is(.connection-trigger-icon,.connection-option-mark,.connection-port) {background:var(--accent-soft)!important;border-color:var(--border)!important;color:var(--accent-muted)!important}
html[data-theme] :is(.connection-trigger-copy strong,.connection-option-copy strong) {color:var(--text-secondary)!important}
html[data-theme] :is(.connection-trigger-copy small,.connection-option-copy small,.connection-dropdown-heading,.connection-chevron) {color:var(--text-muted)!important}
html[data-theme] .connection-option {background:var(--surface)!important}
html[data-theme] :is(.connection-option[aria-selected='true'],.connection-option.is-highlighted,.connection-option:hover) {background:var(--accent-soft)!important}
html[data-theme] :is(.connection-option-check,.connection-manage) {color:var(--accent)!important;border-color:var(--border)!important}
/* Preview chrome follows the app. The isolated email canvas stays true to the message. */
html[data-theme] :is(.email-preview-stage) {background:var(--surface-soft)!important;border-color:var(--border)!important}
html[data-theme] .email-preview-window {background:var(--surface)!important;border-color:var(--border)!important;box-shadow:var(--shadow-theme)!important}
html[data-theme] :is(.email-window-toolbar,.email-envelope-header) {background:var(--surface)!important;border-color:var(--border)!important;color:var(--text-muted)!important}
html[data-theme] .email-envelope-header {border-top-color:var(--accent-muted)!important}
html[data-theme] .email-envelope-header h3 {color:var(--text)!important}
html[data-theme] .preview-sender-avatar {background:var(--accent-soft)!important;color:var(--accent-muted)!important}
html[data-theme] .preview-sender-row strong {color:var(--text-secondary)!important}
html[data-theme] :is(.preview-sender-row div>span,.preview-recipient-row,.preview-recipient-row strong,.preview-inbox-label,.preview-time,.preview-caption) {color:var(--text-muted)!important}
html[data-theme] :is(.preview-device-switch,.preview-attachment-row) {background:var(--surface-soft)!important;border-color:var(--border)!important;color:var(--text-muted)!important}
html[data-theme] .preview-device-switch button {color:var(--text-muted)!important}
html[data-theme] .preview-device-switch button.active {background:var(--surface)!important;color:var(--accent)!important}
/* Public landing page. */
html[data-theme] :is(.section-heading h2,.workflow h2) {color:var(--text)!important}
html[data-theme] .workflow {background:linear-gradient(110deg,var(--accent-soft),var(--surface-soft))!important;border-color:var(--border)!important}
/* Login, verification, and reset screens. */
html[data-theme] body:has(.forms-wrap)>main,html[data-theme] body:has(.forms-wrap)>main main {background:radial-gradient(ellipse at top left,var(--accent-soft),transparent 65%),var(--page-bg)!important}
html[data-theme] .box {background:var(--surface)!important;border-color:var(--border)!important;box-shadow:var(--shadow-theme)!important}
html[data-theme] :is(.heading h2,.auth-brand) {color:var(--text)!important}
html[data-theme] :is(.heading h6,.text,.input-wrap label) {color:var(--text-muted)!important}
html[data-theme] :is(.heading a,.text a,.auth-brand small) {color:var(--accent)!important}
html[data-theme] .input-field {color:var(--text)!important;border-color:var(--border)!important}
html[data-theme] .input-field.active {border-color:var(--accent)!important}
html[data-theme] .carousel {background:linear-gradient(145deg,var(--accent-soft),var(--surface-soft))!important;border-color:var(--border)!important}
html[data-theme] .text-group h2 {color:var(--text-secondary)!important}
html[data-theme] .bullets span {background:var(--border)!important}
html[data-theme] .bullets span.active {background:var(--accent)!important}
html[data-theme] .alert--success {background:var(--accent)!important;color:var(--accent-ink)!important}
html[data-theme] .alert--error {background:var(--text)!important;color:var(--surface)!important}
/* Standalone error screen. */
html[data-theme] .content:has(.main-text) {background:linear-gradient(var(--surface-soft),var(--page-bg))!important;color:var(--text-secondary)!important}
html[data-theme] .main-text {color:var(--text-secondary)!important}
html[data-theme] .ground {background:var(--surface)!important;box-shadow:0 0 10px 10px var(--surface)!important}
html[data-theme] .mound:before {background:var(--surface-soft)!important}
@media(max-width:760px){
 .theme-toggle{width:34px;height:34px;flex-basis:34px;border-radius:9px}
 .theme-toggle--floating{top:17px;right:17px}
 html[data-theme] .header-actions{gap:12px}
}
/* Keep supplied artwork, with legible contrast around it. */
html[data-theme] .auth-brand .auth-original-logo{display:block;width:180px;max-width:100%;height:auto;object-fit:contain}
html[data-theme] .carousel .image{filter:grayscale(1)}
html[data-theme='dark'] .carousel .image{filter:grayscale(1) brightness(.78)}
html[data-theme] .workspace .sidebar{scrollbar-color:var(--border) transparent!important}
html[data-theme] .compose-send-row button:after{color:currentColor;opacity:.75}
html[data-theme] .carousel .image{filter:grayscale(1)}
html[data-theme='dark'] .carousel .image{filter:grayscale(1) brightness(.78)}
html[data-theme] #email-preview-frame.is-placeholder{background:var(--surface)!important;color-scheme:inherit}
