/* Shared color tokens. Existing light designs remain unchanged. */
html[data-color-scheme="light"]{color-scheme:light!important}
html[data-color-scheme="dark"]{color-scheme:dark!important;background:#202124;--appearance-bg:#202124;--appearance-surface:#292a2d;--appearance-input:#303134;--appearance-text:#e8eaed;--appearance-muted:#b6bbc3;--appearance-line:#4a4d52;--appearance-link:#8ab4f8}
html[data-color-scheme="dark"] body:not([data-appearance="error"]){background:var(--appearance-bg)!important;color:var(--appearance-text)!important}
html[data-color-scheme="dark"] input,html[data-color-scheme="dark"] textarea{caret-color:#e8eaed}
html[data-color-scheme="dark"] ::placeholder{color:#9aa0a6!important;opacity:1}
html[data-color-scheme="dark"] :focus-visible{outline-color:#8ab4f8!important}
/* Google homepage */
html[data-color-scheme="dark"] body[data-appearance="home"]{--bg:#202124;--text:#e8eaed;--muted:#bdc1c6;--footer:#171717;--button:#303134;--border:#5f6368}
html[data-color-scheme="dark"] [data-appearance="home"] .google-logo,html[data-color-scheme="dark"] .app-brand img{filter:grayscale(1) brightness(0) invert(1)}
html[data-color-scheme="dark"] [data-appearance="home"] .ai-mode{background:#303134;color:#e8eaed}
html[data-color-scheme="dark"] [data-appearance="home"] .ai-mode:hover{background:#3c4043}
html[data-color-scheme="dark"] [data-appearance="home"] .small-menu,html[data-color-scheme="dark"] [data-appearance="home"] dialog{border-color:#5f6368}
html[data-color-scheme="dark"] [data-appearance="home"] .sign-in,html[data-color-scheme="dark"] [data-appearance="home"] #sign-out{background:#8ab4f8;color:#202124}
html[data-color-scheme="dark"] [data-appearance="home"] .sign-in.signed-in{background:#394457;color:#d3e3fd}
/* Apps launcher and quick exit */
html[data-color-scheme="dark"] .liltc-launcher{background:#282a2e;color:#e8eaed;scrollbar-color:#65686d transparent;box-shadow:0 6px 20px #0006}
html[data-color-scheme="dark"] .launcher-inner{background:#202124}
html[data-color-scheme="dark"] .launcher-heading h2,html[data-color-scheme="dark"] .launcher-tile,html[data-color-scheme="dark"] .launcher-order-row,html[data-color-scheme="dark"] .launcher-trigger{color:#e8eaed}
html[data-color-scheme="dark"] .launcher-edit,html[data-color-scheme="dark"] .launcher-move{background:#394457;color:#d3e3fd}
html[data-color-scheme="dark"] .launcher-tile:hover,html[data-color-scheme="dark"] .launcher-trigger:hover,html[data-color-scheme="dark"] .launcher-trigger[aria-expanded="true"]{background:#303134}
html[data-color-scheme="dark"] .panic-dock .panic-exit{background:#303134!important;color:#e8eaed!important;border-color:#5f6368!important;box-shadow:0 2px 8px #0004!important}
/* Wi-Fi, time capsule, messages and legacy feature requests */
html[data-color-scheme="dark"] [data-appearance="tools"] :is(.panel,.meter,.store,.release,.request,.bubble,.developer-message,.faq details,.content-card){background:#292a2d!important;border-color:#4a4d52!important;color:#e8eaed!important}
html[data-color-scheme="dark"] [data-appearance="tools"] :is(textarea,input[type="password"],input[type="text"],.picker,.files a){background:#202124!important;color:#e8eaed!important;border-color:#5f6368!important}
html[data-color-scheme="dark"] [data-appearance="tools"] :is(.intro,.note,#status,#empty,.status,.message-status,.test-result,header p,.eyebrow,.faq h2,.developer-message label,.files small,.content-title){color:#bdc1c6!important}
html[data-color-scheme="dark"] [data-appearance="tools"] :is(.faq p,#thoughts-content,.reading,.countdown,#presence,.faq summary,.faq summary h2){color:#e8eaed!important}
html[data-color-scheme="dark"] [data-appearance="tools"] :is(.faq a,#pair-link,.files a){color:#8ab4f8!important}
html[data-color-scheme="dark"] [data-appearance="tools"] button:not(.back):not(.voice-switch):not(.launcher-trigger):not(.launcher-edit):not(.launcher-move):not(.launcher-close):not(.panic-exit){background:#8ab4f8!important;color:#172c49!important}
html[data-color-scheme="dark"] [data-appearance="tools"] button.secondary{background:#394457!important;color:#d3e3fd!important}
html[data-color-scheme="dark"] [data-appearance="tools"] .app-toolbar{background:#202124;border-color:#3c4043}
html[data-color-scheme="dark"] [data-appearance="tools"] .back{background:#303134!important;color:#e8eaed!important}
html[data-color-scheme="dark"] [data-appearance="tools"] .grid{stroke:#4a4d52!important}
html[data-color-scheme="dark"] [data-appearance="tools"] .chart polyline{stroke:#8ab4f8!important}
html[data-color-scheme="dark"] [data-appearance="tools"] .voice-switch{background:#4a4d52!important;border-color:#9aa0a6!important}
html[data-color-scheme="dark"] [data-appearance="tools"] .voice-switch[aria-checked="true"]{background:#394457!important;border-color:#8ab4f8!important}
html[data-color-scheme="dark"] [data-appearance="tools"] .voice-switch[aria-checked="true"]::after{background:#8ab4f8!important}
/* Reddit */
html[data-color-scheme="dark"] [data-appearance="reddit"]{--ink:#e8eaed;--muted:#a9bac1;--line:#3c4549;--soft:#292f33;--orange:#ff6b35}
html[data-color-scheme="dark"] [data-appearance="reddit"] :is(.reddit-header,.sidebar,.composer,.image-dropdown,.load-more){background:#202124;color:#e8eaed}
html[data-color-scheme="dark"] [data-appearance="reddit"] :is(#feed-search,.community-about,.quick-compose,.guest-avatar,.post-avatar,.side-link.active,.side-link:hover,.action-pill,.vote-pill,.mobile-filters button,.preview button){background:#2c3439;color:#dce6eb}
html[data-color-scheme="dark"] [data-appearance="reddit"] :is(.composer input:not([type="file"]),.composer textarea,.comment-form textarea){background:#292f33;color:#e8eaed;border-color:#4a545a}
html[data-color-scheme="dark"] [data-appearance="reddit"] .post-body{color:#dce6eb}
html[data-color-scheme="dark"] [data-appearance="reddit"] .comments,html[data-color-scheme="dark"] [data-appearance="reddit"] .comment{border-color:#3c4549}
html[data-color-scheme="dark"] [data-appearance="reddit"] .flair{background:#283b53;color:#bbd5ff}
html[data-color-scheme="dark"] [data-appearance="reddit"] .mobile-filters button.active{background:#536870;color:#fff}
html[data-color-scheme="dark"] [data-appearance="reddit"] .post-media :is(img,video){background:#191c1e}
html[data-color-scheme="dark"] [data-appearance="reddit"] .vote-pill button[aria-pressed="true"]{background:#66351f;color:#ffb08a}
/* ChatGPT presentation; media pixels are never inverted. */
html[data-color-scheme="dark"] [data-appearance="chat"]{--line:#424242;--muted:#aaa;--blue:#4d8de5}
html[data-color-scheme="dark"] [data-appearance="chat"],html[data-color-scheme="dark"] [data-appearance="chat"] :is(.rail,.topbar){background:#212121!important;color:#ececec!important}
html[data-color-scheme="dark"] [data-appearance="chat"] .brand img{filter:invert(1)}
html[data-color-scheme="dark"] [data-appearance="chat"] :is(.segments,.nav-item.selected){background:#2f2f2f}
html[data-color-scheme="dark"] [data-appearance="chat"] .segments button{color:#b4b4b4!important}
html[data-color-scheme="dark"] [data-appearance="chat"] .segments button[aria-selected="true"]{background:#3a3a3a;border-color:#484848;color:#ececec!important;box-shadow:none}
html[data-color-scheme="dark"] [data-appearance="chat"] :is(.composer-shell,.quality-menu,.attachment,.toast,dialog){background:#2f2f2f;border-color:#424242;color:#ececec;box-shadow:none}
html[data-color-scheme="dark"] [data-appearance="chat"] textarea{color:#ececec}
html[data-color-scheme="dark"] [data-appearance="chat"] :is(#panel-content,.file-name){color:#ccc}
html[data-color-scheme="dark"] [data-appearance="chat"] :is(button:hover,.quality-menu [aria-checked="true"],.turn.user){background:#3a3a3a}
html[data-color-scheme="dark"] [data-appearance="chat"] :is(#panel-content input,.settings-button,.search-result){background:#292929;color:#ececec;border-color:#4a4a4a}
html[data-color-scheme="dark"] [data-appearance="chat"] .submit{background:#ececec;color:#212121}
html[data-color-scheme="dark"] [data-appearance="chat"] .submit.voice{background:#3674d5;color:#fff}
html[data-color-scheme="dark"] [data-appearance="chat"] .has-messages .composer-dock,html[data-color-scheme="dark"] [data-appearance="chat"] main.has-messages .composer-dock{background:linear-gradient(transparent,#212121 20%)}
html[data-color-scheme="dark"] [data-appearance="chat"] .panic-dock .panic-exit{background:transparent!important;color:#ececec!important;border:0!important;box-shadow:none!important}
html[data-color-scheme="dark"] [data-appearance="chat"] #status.error{color:#f28b82}
/* Developer portal */
html[data-color-scheme="dark"] [data-appearance="dev"] :is(.top,.login-card,.panel){background:#292a2d;border-color:#45484d}
html[data-color-scheme="dark"] [data-appearance="dev"] :is(input,textarea){background:#202124;color:#e8eaed;border-color:#5f6368}
html[data-color-scheme="dark"] [data-appearance="dev"] :is(a,.feedback){color:#8ab4f8}
html[data-color-scheme="dark"] [data-appearance="dev"] button{background:#8ab4f8;color:#152e50}
html[data-color-scheme="dark"] [data-appearance="dev"] button.secondary{background:#394457;color:#d3e3fd;border-color:#596579}
html[data-color-scheme="dark"] [data-appearance="dev"] :is(.private,.eyebrow,.description,#status,.connection dt,.community-row span){color:#bdc1c6}
html[data-color-scheme="dark"] [data-appearance="dev"] .connection{background:#202124}
html[data-color-scheme="dark"] [data-appearance="dev"] .summary a{background:#293b54;color:#bdd4ff}
html[data-color-scheme="dark"] [data-appearance="dev"] .summary a:nth-child(2){background:#233d2b;color:#b1dfbc}
html[data-color-scheme="dark"] [data-appearance="dev"] .summary a:nth-child(3){background:#3c2c4a;color:#ddc2f7}
html[data-color-scheme="dark"] [data-appearance="dev"] :is(.request,.community-row,#setup){border-color:#45484d}
html[data-color-scheme="dark"] [data-appearance="dev"] :is(#login-status,.community-row button){color:#f6aaa4}
html[data-color-scheme="dark"] [data-appearance="dev"] .community-row button{background:#5b2926}
/* Preserve Chromium's original error-page theme variables for both explicit modes. */
html[data-color-scheme="dark"] [data-appearance="error"]{--background-color:#202124;--error-code-color:#9aa0a6;--heading-color:#9aa0a6;--link-color:#8ab4f8;--primary-button-fill-color-active:rgb(129,162,208);--primary-button-fill-color:#8ab4f8;--primary-button-text-color:#202124;--quiet-background-color:#202124;--secondary-button-border-color:#5f6368;--secondary-button-fill-color:#202124;--secondary-button-hover-fill-color:rgb(48,51,57);--secondary-button-text-color:#8ab4f8;--small-link-color:#8ab4f8;--text-color:#9aa0a6}
html[data-color-scheme="light"] [data-appearance="error"]{--background-color:#fff;--error-code-color:#5f6368;--heading-color:#202124;--link-color:rgb(88,88,88);--primary-button-fill-color-active:#1967d2;--primary-button-fill-color:#1a73e8;--primary-button-text-color:#fff;--quiet-background-color:rgb(247,247,247);--secondary-button-border-color:#9aa0a6;--secondary-button-fill-color:#fff;--secondary-button-hover-fill-color:#f8f9fa;--secondary-button-text-color:#5f6368;--small-link-color:#5f6368;--text-color:#5f6368}
html[data-color-scheme="dark"] [data-appearance="chat"] main{background:#212121}
html[data-color-scheme="dark"] [data-appearance="error"] .icon{filter:invert(1)}
html[data-color-scheme="light"] [data-appearance="error"] .icon{filter:none}
html[data-color-scheme="dark"] [data-appearance="error"] #suggestions-list a{color:var(--link-color)}
html[data-color-scheme="dark"] body[data-appearance="chat"]{background:#212121!important;color:#ececec!important}
html[data-color-scheme="dark"] [data-appearance="tools"] .voice-switch::after{background:#bdc1c6!important}
html[data-color-scheme="dark"] [data-appearance="tools"] .voice-switch[aria-checked="true"]::after{background:#8ab4f8!important}
html[data-color-scheme="dark"] [data-appearance="reddit"] .quick-compose:hover{background:#343c42}
html[data-color-scheme="dark"] [data-appearance="reddit"] .composer-close{background:#3b454d;color:#dce6eb}
html[data-color-scheme="dark"] .launcher-move{border-color:#5f6368}
html[data-color-scheme="dark"] [data-appearance="home"] img[src*="/assets/icons/lens.svg"],html[data-color-scheme="dark"] [data-appearance="home"] .ai-mode img{filter:brightness(0) invert(1)}
html[data-color-scheme="dark"] [data-appearance="reddit"] .primary{background:#d93900;color:#fff}
