/* Neutral dark surfaces; the orange brand remains the action color. */
html[data-mode=dark]{color-scheme:dark;--bg:#080808;--paper:#151515;--surface:#151515;--text:#f5f5f5;--ink:#f5f5f5;--muted:#ababab;--dark:#f5f5f5;--line:#303030;background:#080808}
html[data-mode=dark] body,html[data-mode=dark] .workspace{background:#080808;color:var(--text)}
html[data-mode=dark] :is(.sidebar,.topbar,.post,.settings-panel,.profile-card,.stat,.result-user,.empty,dialog,.mobile-bar){background:#151515;color:var(--text);border-color:var(--line)}
html[data-mode=dark] :is(input,select,textarea,.secondary,.chip,.options-menu button,.composer-preview,.searchbox input,.tag,.community-tile){background:#222;color:var(--text);border-color:var(--line)}
html[data-mode=dark] :is(.hero,.community,.side-note,.continue-reading,.after-reading,.generated-cover,.share-cover,.notice,.notification.unread){background:#1c1c1c;color:var(--text);border-color:var(--line)}
html[data-mode=dark] :is(.hero h1,.hero h1 em,.community h3,.brand,.nav button,.mobile-bar button.active){color:var(--text)}
html[data-mode=dark] :is(.hero p,.eyebrow,.community p,.community button,.legal p,.check,.demo-note,.post .caption,.sender,.chat-header,.chat-footer){color:var(--muted)}
html[data-mode=dark] :is(.nav .active,.nav button:hover,.poll button[aria-pressed=true],.editor-modes [aria-pressed=true]){background:#303030;color:#fff}
html[data-mode=dark] .chip.active{background:#383838;color:#fff;border-color:#666}
html[data-mode=dark] .eyebrow:before{background:var(--coral)}
html[data-mode=dark] .hero{border-color:#333}
html[data-mode=dark] .hero em{color:var(--text)}
html[data-mode=dark] .chat{background:#1c1c1c;color:var(--text)}
html[data-mode=dark] .bubble{background:#303030;color:#fff}
html[data-mode=dark] .right .bubble{background:var(--coral);color:#fff}
html[data-mode=dark] .post-actions{border-color:#303030}
html[data-mode=dark] .simple-composer .composer-actions{background:#151515}
html[data-mode=dark] #toast{background:#ededed;color:#111}
html[data-mode=dark] .image-viewer,html[data-mode=dark] .image-viewer .iv-shell{background:#080808;color:#fff}
/* Bottom sheet: no centered floating card, no blur behind it. */
#modal.comments-sheet{position:fixed;inset:auto 0 var(--keyboard-bottom,0);margin:0 auto;padding:0;width:100%;max-width:620px;height:var(--comments-height,66dvh);max-height:85dvh;border:0;border-radius:20px 20px 0 0;display:flex;flex-direction:column;overflow:hidden;background:var(--paper);color:var(--text);box-shadow:0 -8px 32px #0002}
#modal.comments-sheet:not([open]){display:none}
#modal.comments-sheet::backdrop{background:#0002;backdrop-filter:none}
.comments-sheet .modal-heading{flex:none;position:relative;align-items:center;justify-content:center;padding:16px 52px;margin:0;border-bottom:1px solid var(--line);min-height:58px}
.comments-sheet .modal-heading h2{font-size:16px;letter-spacing:0;text-align:center}
.comments-sheet .modal-heading>.icon-button{position:absolute;right:10px;top:8px}
.comments-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:0 16px}
.comments-scroll>.form-error{margin:12px 0}
.comments-sheet .comment{padding:16px 0;border-bottom:0}
.comments-sheet .comment>.avatar{width:36px;height:36px;border:0}
.comments-sheet .comment strong{font-size:12px;color:var(--muted)}
.comments-sheet .comment p{font-size:14px;line-height:1.4;margin:5px 0}
.comments-sheet .comment .inline-actions{font-size:11px;gap:12px;margin:3px 0}
.comments-sheet .comment .link{font-size:11px;min-height:28px;color:var(--muted)}
.comments-sheet #comments-list>.muted{padding:32px 12px;text-align:center}
.comments-compose{flex:none;padding:8px 12px calc(8px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--paper);position:relative}
.comments-sheet #comment-form{display:flex;align-items:flex-end;gap:6px;padding:5px;border-radius:25px;background:#f2f2f2}
.comments-sheet #comment-form textarea{flex:1;min-width:0;min-height:38px;max-height:96px;resize:none;background:transparent;border:0;border-radius:18px;padding:10px 9px;line-height:18px;font-size:14px;box-shadow:none}
.comments-sheet #comment-form button{width:40px;height:40px;min-height:40px;flex:none;padding:9px;border-radius:50%;margin:0}
.comments-sheet .mention-button{font-size:26px;font-weight:700;padding:0!important}
.comments-sheet #reply-target p{font-size:12px;margin:0 6px 7px;color:var(--muted)}
.comments-sheet #reply-target button{padding:0 8px;font-size:12px;min-height:30px}
.comments-sheet #comment-error{font-size:12px;margin:6px 0 0}
#mention-results{position:absolute;bottom:100%;left:12px;right:12px;max-height:200px;overflow:auto;background:var(--paper);border:1px solid var(--line);border-radius:14px;box-shadow:0 -4px 20px #0002}
#mention-results button{display:flex;align-items:center;gap:10px;width:100%;padding:8px 12px;text-align:left}
#mention-results button:hover,#mention-results button:focus-visible{background:var(--accent-soft)}
#mention-results strong,#mention-results small{display:block;font-size:12px}
#mention-results p{padding:12px;font-size:12px;color:var(--muted)}
html[data-mode=dark] .comments-sheet #comment-form{background:#272727}
html[data-mode=dark] #modal.comments-sheet{background:#151515}
@media(prefers-reduced-motion:no-preference){#modal.comments-sheet[open]{animation:comments-rise .18s ease-out}@keyframes comments-rise{from{transform:translateY(40px);opacity:.6}to{transform:translateY(0);opacity:1}}}

/* Neutral reading controls and a single accessible image picker. */
html[data-mode=dark] .story-deck,html[data-mode=dark] .story-controls{background:#292929}
html[data-mode=dark] .story-controls .secondary{background:#202020;color:#eeeeee;border-color:#383838}
html[data-mode=dark] .story-progress{accent-color:#c8c8c8}
html[data-mode=dark] .story-progress::-webkit-progress-bar{background:#484848}
html[data-mode=dark] .story-progress::-webkit-progress-value{background:#c8c8c8}
html[data-mode=dark] .story-progress::-moz-progress-bar{background:#c8c8c8}
.image-upload{position:relative;display:flex;align-items:center;gap:6px;padding:18px;border:1px dashed var(--muted);border-radius:14px;cursor:pointer;text-align:center;background:var(--paper)}
.image-upload>span{display:flex;align-items:center;justify-content:center;gap:8px;font-weight:750;font-size:16px}
.image-upload svg{width:24px;height:24px}.image-upload>small{font-weight:400;color:var(--muted);font-size:12px}
.accessible-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;padding:0!important;border:0!important}
.image-upload:focus-within{outline:3px solid var(--accent);outline-offset:3px}
.image-upload:has(input:disabled){opacity:.5;cursor:default}

.image-upload{flex-direction:column}.image-upload>span{width:100%}html[data-mode=dark] #modal::backdrop{background:#0008}

/* One startup surface shared with Android's centered 112dp mark. */
.startup-loading-layer{position:fixed;inset:0;z-index:200;background:#f6f7f3;display:grid;place-items:center}
.startup-loading-layer[hidden]{display:none}.startup-loading #app{visibility:hidden}
.startup-mark{width:112px;height:112px}.startup-mark img{display:block;width:112px;height:112px;object-fit:contain;animation:startup-pulse 1.5s ease-in-out infinite}
#startup-failure{position:absolute;top:calc(50% + 80px);left:20px;right:20px;text-align:center;font-size:14px}#startup-failure button{margin-top:16px}.connection-failed .startup-mark img{animation:none}
html[data-mode=dark] .startup-loading-layer{background:#080808}
@keyframes startup-pulse{0%,100%{opacity:.72}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){.startup-mark img{animation:none}}
#preferences select[name=theme]{background:var(--bg);color:var(--text);border:2px solid #626262}
html[data-mode=dark] #preferences select[name=theme]{background:#151515;color:#fff;border-color:#ddd}
.settings-panel [data-action=logout]{background:var(--coral);color:#fff;border-color:var(--coral)}
.avatar{border-color:var(--coral)!important}
.plus-profile{justify-content:center}.plus-button{display:inline-flex;align-items:center;gap:9px;min-height:46px;padding:12px 23px;border-radius:13px;font-size:16px;font-weight:750;background:linear-gradient(115deg,#3155df15,#ffffff05),#222;color:#fff;border:1px solid #9e623d;box-shadow:0 0 0 3px #3155df08,0 3px 12px #0002}
.plus-button:hover{background:linear-gradient(115deg,#3155df25,#ffffff0a),#292929;border-color:var(--coral)}
.plus-button span{font-size:25px;line-height:1;color:var(--coral)}
