:root{--pref-paper:#242d28;--pref-ink:#f1f5ef;--pref-muted:#bdcdb2;--pref-line:#465441;--pref-hover:#34432e;--pref-accent:#c3f37b;color-scheme:dark}
html[data-theme="light"]{--pref-paper:#fff;--pref-ink:#243026;--pref-muted:#516048;--pref-line:#cbd5c4;--pref-hover:#edf3e7;--pref-accent:#567c2c;color-scheme:light}
.settings-wrap{position:relative;justify-self:end;line-height:1.5;z-index:30}
.settings-toggle{display:grid;place-items:center;width:42px;height:42px;padding:9px;border:1px solid transparent;background:transparent;color:var(--pref-muted);border-radius:6px}
.settings-toggle:hover,.settings-toggle[aria-expanded="true"]{background:var(--pref-hover);color:var(--pref-ink);border-color:var(--pref-line)}
.settings-toggle svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.7}
.settings-panel{position:absolute;right:0;top:calc(100% + 10px);width:292px;max-width:calc(100vw - 30px);background:var(--pref-paper);color:var(--pref-ink);border:1px solid var(--pref-line);border-radius:8px;box-shadow:0 12px 40px #0003;padding:16px;text-align:left;font:14px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.settings-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}
.settings-heading h2{font-size:16px;font-weight:600;margin:0;color:var(--pref-ink)}
.settings-heading button{border:0;background:transparent;color:var(--pref-muted);font-size:24px;line-height:1;width:32px;height:32px;padding:0}
.settings-panel fieldset{border:0;padding:10px 0 0;margin:10px 0 0;min-width:0}
.settings-panel fieldset+fieldset{border-top:1px solid var(--pref-line);padding-top:15px}
.settings-panel legend{font-size:13px;font-weight:600;color:var(--pref-muted);padding:0;margin-bottom:4px}
.settings-panel label{display:flex;align-items:center;gap:10px;padding:9px 5px;min-height:40px;border-radius:4px;color:var(--pref-ink);cursor:pointer}
.settings-panel label:hover{background:var(--pref-hover)}
.settings-panel input[type="radio"]{width:17px;height:17px;margin:0;accent-color:var(--pref-accent);flex-shrink:0}
.settings-wrap button:focus-visible,.settings-panel input:focus-visible{outline:2px solid var(--pref-accent);outline-offset:3px}
.theme-workbench .app-header>.settings-wrap{grid-column:3;grid-row:1}
@media(max-width:900px){.theme-workbench .app-header>.settings-wrap{grid-column:2;grid-row:1}}
/* Light workbench: preserve green identity with dark, readable text. */
html[data-theme="light"] .theme-workbench{--bg:#eef2eb;--paper:#fff;--ink:#243026;--muted:#52614a;--line:#cbd5c4;--green:#52772b;--light:#e6efdd;background:var(--bg);color:var(--ink)}
html[data-theme="light"] .theme-workbench :is(.app-header,.app-footer){background:#f5f7f1;border-color:#cbd5c4;color:#34452d}
html[data-theme="light"] .theme-workbench :is(.usage-bar,.usage-separator,.panel-number,.section-label,.private,.previous-note,.privacy-note p,.time-text,#time-caption,.sender time,.footer-caption,.app-footer button){color:#526449}
html[data-theme="light"] .theme-workbench :is(.panel-title,.inbox-top,.subpanel-title,.inbox-bottom){background:#e8efdf;border-color:#cbd5c4;color:#304628}
html[data-theme="light"] .theme-workbench :is(.panel-title h1,.inbox-title h2,.empty h3,.reader-placeholder h3,#subject){color:#243923}
html[data-theme="light"] .theme-workbench :is(.message-pane,.list-heading){background:#f4f7ee;color:#526449;border-color:#d0dac8}
html[data-theme="light"] .theme-workbench .message-pane{border-right-color:#d5dfcd;border-bottom-color:#d5dfcd}
html[data-theme="light"] .theme-workbench .reading-pane{background:#fff}
html[data-theme="light"] .theme-workbench .address-field{background:#f5f8f0;border-color:#b8c7ab}
html[data-theme="light"] .theme-workbench .address-field input{color:#243923}
html[data-theme="light"] .theme-workbench :is(.timer-block,.sender,.privacy-note,.app-footer){border-color:#cbd5c4}
html[data-theme="light"] .theme-workbench .privacy-note{background:#f0f5e9}
html[data-theme="light"] .theme-workbench :is(.privacy-note strong,.sender strong,#body){color:#30412b}
html[data-theme="light"] .theme-workbench :is(.empty p,.reader-placeholder p,#connection,.inbox-bottom){color:#53684a}
html[data-theme="light"] .theme-workbench :is(.previous-note a,#back,#refresh-inbox){color:#436b24}
html[data-theme="light"] .theme-workbench :is(#countdown,.inbox-title>svg,.panel-title>svg,.usage-bar svg,.time>svg,.privacy-note>svg){color:#50742d}
html[data-theme="light"] .theme-workbench :is(#extend-time,#new-address,#test-mail){background:#edf3e6;border-color:#b6c7a7;color:#30452a}
html[data-theme="light"] .theme-workbench :is(#extend-time,#new-address,#test-mail):hover:not(:disabled){background:#dfeccd}
html[data-theme="light"] .theme-workbench :is(#extend-time,#new-address) .action-icon{color:#53782d}
html[data-theme="light"] .theme-workbench #copy-address{background:#c3f37b;border-color:#9fc75f;color:#213018}
html[data-theme="light"] .theme-workbench #copy-address:hover:not(:disabled){background:#b5e56d}
html[data-theme="light"] .theme-workbench .mail-row{border-color:#d4dfca;color:#31462a}
html[data-theme="light"] .theme-workbench .mail-row span:nth-child(2){color:#4c6241}
html[data-theme="light"] .theme-workbench .mail-row time{color:#566e49}
html[data-theme="light"] .theme-workbench .mail-row:hover{background:#eaf3df}
html[data-theme="light"] .theme-workbench .mail-row.selected{background:#dcebc9;box-shadow:inset 3px 0 #6b963c;color:#273b20}
html[data-theme="light"] .theme-workbench :is(.waiting,.mail-illustration,.inbox-title>span,#attachments){background:#e2edd5;color:#4c6a30}
html[data-theme="light"] .theme-workbench .text-badge{border-color:#bdcfae;color:#526e3e}
html[data-theme="light"] .theme-workbench .reader-placeholder>svg{color:#8b9e7c}
html[data-theme="light"] .theme-workbench .notice{background:#e6f2d8;border-color:#a9c58b;color:#355123}
html[data-theme="light"] .theme-workbench .notice.error{background:#fff0e8;border-color:#ddb09a;color:#81452a}
html[data-theme="light"] .theme-workbench :is(progress,progress::-webkit-progress-bar){background:#d7e4c9}
html[data-theme="light"] .theme-workbench progress::-webkit-progress-value{background:#6f9b3f}
html[data-theme="light"] .theme-workbench progress::-moz-progress-bar{background:#6f9b3f}
html[data-theme="light"] .theme-workbench dialog{background:#fff;color:#243923;border-color:#bdcfae}
html[data-theme="light"] .theme-workbench dialog p{color:#455b39}
html[data-theme="light"] .theme-workbench :is(.dialog-top .eyebrow,#close-info){color:#52772b}
/* Management shares the same stored preferences. */
html[data-theme="dark"] body:not(.theme-workbench){--bg:#171d1d;--paper:#242d28;--ink:#e5eee0;--green:#c3f37b;--accent:#36492c;--muted:#b5c6aa;--line:#42503b;--orange:#e3c285;--red:#e5aba1;background:var(--bg);color:var(--ink)}
html[data-theme="dark"] body:not(.theme-workbench) :is(.topbar,.panel,.stat-card,.notice,dialog,.text-input,.search-field,.toolbar,select){background:#242d28;color:#dce8d2;border-color:#42503b}
html[data-theme="dark"] body:not(.theme-workbench) :is(th,.panel-heading,.messages,.reader-empty,.dev-banner){background:#202921;color:#c0d1b4;border-color:#42503b}
html[data-theme="dark"] body:not(.theme-workbench) :is(td,.message-top,.sender,.dialog-actions){border-color:#42503b}
html[data-theme="dark"] body:not(.theme-workbench) :is(.address-open,.address-name,.page-heading h1,#message-subject,#message-body,dialog h2){color:#e1edd7}
html[data-theme="dark"] body:not(.theme-workbench) :is(p,.address-email,.sender time,.field-hint,.footer-tagline,.selected-address){color:#b6c9a8}
html[data-theme="dark"] body:not(.theme-workbench) :is(.badge,.ttl,.count,.secondary,.message-item.selected,tr.selected,.address-icon,.mail-numbers){background:#35482a;color:#d1e8bb;border-color:#4e653e}
html[data-theme="dark"] body:not(.theme-workbench) .primary{background:#c3f37b;color:#23321a}
html[data-theme="dark"] body:not(.theme-workbench) :is(.icon-button,.close,.text-input input,.search-field input){color:#d2e4c1}
html[data-theme="light"] .theme-workbench{color-scheme:light}
body:not(.theme-workbench) .sidebar{background:#1c2520;color:#dce8d2;border-color:#42503b}
body:not(.theme-workbench) .sidebar :is(.workspace,.sidebar-tip){background:#242f25;border-color:#42503b}
body:not(.theme-workbench) .sidebar :is(.workspace strong,.sidebar-tip strong){color:#e0ebd8}
body:not(.theme-workbench) .sidebar :is(.workspace>div>span,.nav-label,.nav-item,.sidebar-tip p,.session-note,.session-note>span:last-child){color:#b7c9aa}
body:not(.theme-workbench) .sidebar :is(.workspace-avatar,.tip-icon,.nav-item.selected,.nav-item:hover){background:#36492c;color:#d6edbf;border-color:#4f6541}
body:not(.theme-workbench) .sidebar :is(.nav-item>span,.sidebar-tip button){color:#c3f37b}
html[data-theme="dark"] body:not(.theme-workbench) :is(.stat,.search,.privacy-strip){background:#242d28;border-color:#42503b;color:#d4e1c9}
html[data-theme="dark"] body:not(.theme-workbench) :is(.stat-label,.stat-foot,.stat-value>span,.filter,.table-footer,.breadcrumb,.breadcrumb strong,.privacy-strip strong,.privacy-strip button,footer,.reader-empty h3,.reader-empty p,.text-only,.eyebrow,.auto-note){color:#b9cdae}
html[data-theme="dark"] body:not(.theme-workbench) .stat-value strong{color:#e3efd9}
html[data-theme="dark"] body:not(.theme-workbench) :is(.green-pill,.dev-chip,.avatar){background:#3b5030;color:#d6edbf}
html[data-theme="dark"] body:not(.theme-workbench) .filter.active{color:#c3f37b;border-color:#c3f37b}
html[data-theme="dark"] body:not(.theme-workbench) :is(.search input,.message-item){color:#d5e5c8}
html[data-theme="dark"] body:not(.theme-workbench) .search input::placeholder{color:#a8bc9b}
html[data-theme="dark"] body:not(.theme-workbench) :is(.message-item.selected,.message-item:hover){background:#35482a}
body:not(.theme-workbench) .sidebar .nav-item>span{background:#405634;color:#e0f0cc}
html[data-theme="light"] .theme-workbench :is(.dot,#connection:before){background:#709642}
