:root{--surface:#fff;--surface-2:#f4f7f3;--border:#e1e8df;--text:#223b36;--subtext:#6b7e6d}
.login-layout{grid-template-columns:minmax(0,450px);justify-content:center;gap:0}.page-heading{min-height:0}.rail-topic h2{font-size:1rem;margin-top:12px}.rail-topic .topic-button{margin-top:16px}.brand>span{line-height:1}.discover-search{border-color:var(--border)}
html[data-theme=dark] .discover-search{background:var(--surface);border-color:var(--border)}html[data-theme=dark] .discover-search input,html[data-theme=dark] .search-box input{background:transparent}html[data-theme=dark] .discover-search>.icon{color:var(--subtext)}
.gallery-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px}.investigation-media img{max-width:260px;max-height:260px;object-fit:contain;border-radius:9px}
.sidebar{overflow-y:auto}.sidebar .brand{margin-bottom:20px}.sidebar nav{gap:2px}.nav-link{min-height:42px;padding-top:8px;padding-bottom:8px}.compose-nav{margin-top:15px}.sidebar-bottom{padding-top:18px}.settings-sections{display:grid;gap:18px;margin-bottom:22px}.settings-panel{margin-bottom:20px}.settings-panel h2{margin-bottom:18px}.settings-panel label:not(.setting-toggle){margin:15px 0}.setting-toggle{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:15px;padding:14px 0;border-bottom:1px solid var(--border);font-weight:500}.setting-toggle input{width:20px;height:20px;accent-color:var(--green);flex-shrink:0}.feature-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:18px 0}.public-profile{overflow:hidden;margin-bottom:22px}.public-profile .profile-inner{padding-bottom:24px}.profile-bio{white-space:pre-wrap;overflow-wrap:anywhere;margin:13px 0;font-size:1rem}.profile-stats{color:var(--subtext);font-size:.875rem}.mute-form{display:flex;gap:8px;flex-wrap:wrap}.mute-form select{width:auto}.mute-form input{flex:1;min-width:130px}.mute-row{display:flex;justify-content:space-between;gap:15px;padding:14px 0;border-bottom:1px solid var(--border)}.mute-row span{overflow-wrap:anywhere;min-width:0}.composer-extra{display:flex;flex-wrap:wrap;align-items:center;gap:16px;border-top:1px solid var(--border);padding-top:12px;margin-top:12px}.composer-extra .tool-button{font-size:.875rem}.new-posts{width:100%;background:var(--soft);color:var(--green);border:1px solid #92b6a1;padding:12px;border-radius:10px;margin:0 0 16px;font-weight:600}.new-posts[hidden]{display:none}#extra-feed-tabs{display:inline-flex;gap:14px}#extra-feed-tabs .tab{margin:0}.feed-tabs{flex-wrap:wrap;gap:14px}.feed-tabs>span:last-child{margin-left:auto}.advanced-search{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.advanced-search select,.advanced-search input{width:auto;flex:1;min-width:120px;font-size:.8125rem}.shared-post{border:1px solid var(--border);border-radius:12px;padding:16px;margin:15px 0;background:var(--surface-2)}.shared-post p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.875rem;margin-top:8px}.shared-post img{max-height:180px;object-fit:cover;border-radius:8px;margin-top:12px}.shared-post small{font-weight:400;color:var(--subtext)}.post-pin{display:block;color:var(--subtext);font-size:.75rem;margin:8px 0}.thread-link{display:block;color:var(--green);font-size:.875rem;margin:12px 0}.post-video{display:block;width:100%;max-height:470px;border-radius:12px;background:#121714}.comment-reply{margin-left:22px;border-left:2px solid var(--border);padding-left:13px}.reply-context{background:var(--surface-2);border-left:3px solid #aac5a9;padding:7px 10px;color:var(--subtext);font-size:.75rem;white-space:pre-wrap;overflow-wrap:anywhere;margin-bottom:7px}.message-tools{display:flex;gap:5px;align-items:center;flex-wrap:wrap;padding-top:4px}.message-emoji{padding:3px 5px;border:1px solid transparent;border-radius:5px;font-size:.75rem}.message-emoji.selected{border-color:#8dac90;background:var(--soft)}.message-tools .text-button{font-size:.75rem;margin-right:5px}.dm-image{max-width:260px;max-height:260px;object-fit:contain;border-radius:8px;margin-top:8px}#dm-extra{padding:8px 20px;background:var(--surface);flex-shrink:0}#dm-extra>.tool-button,#dm-extra>.text-button{display:inline-flex;margin-right:15px;font-size:.75rem}.dm-history-actions{display:flex;gap:15px;padding:2px 20px;flex-shrink:0}.dm-history-actions .text-button{font-size:.75rem}#dm-image-preview{display:flex;align-items:center;gap:10px}#dm-image-preview img{height:65px;width:65px;object-fit:cover;border-radius:8px}.message-form{flex-shrink:0}.recovery-code{display:block;padding:15px;border:1px solid var(--border);border-radius:9px;overflow-wrap:anywhere;white-space:pre-wrap;background:var(--surface-2);font-size:.9375rem}.image-order{position:absolute;bottom:3px;left:3px;background:#fff;color:#174c36;border-radius:5px;padding:0 9px}.challenge-progress{display:grid;gap:10px;margin-top:16px}.challenge-progress .primary{justify-self:start}.challenge-updates{margin-top:20px}.challenge-updates p{border-top:1px solid var(--border);padding:10px 0;font-size:.875rem}#upload-progress{font-size:.8125rem;color:var(--green)}.post-images.count-1{touch-action:pan-y}.image-open:focus-visible{outline-offset:-4px}
/* Explicit dark palette covers both original and new surfaces. */
html[data-theme=dark]{--ink:#ededed;--muted:#a3a3a3;--green:#eeeeee;--green-dark:#ffffff;--line:#303030;--paper:#141414;--canvas:#000000;--soft:#242424;--surface:#141414;--surface-2:#1d1d1d;--border:#303030;--text:#ededed;--subtext:#b0b0b0;background:var(--canvas);color:var(--text)}
html[data-theme=dark] body{background:var(--canvas)}html[data-theme=dark] .sidebar,html[data-theme=dark] .panel,html[data-theme=dark] .login-panel,html[data-theme=dark] dialog,html[data-theme=dark] .modal-head,html[data-theme=dark] .search-box,html[data-theme=dark] .post-menu>div,html[data-theme=dark] .reaction-picker>div,html[data-theme=dark] .mention-suggestions{background:var(--surface);border-color:var(--border)}html[data-theme=dark] .topbar,html[data-theme=dark] .mobile-nav{background:#0b0b0bf5;border-color:var(--border)}html[data-theme=dark] input,html[data-theme=dark] textarea,html[data-theme=dark] select{background:var(--surface-2);color:var(--text);border-color:var(--border)}html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#929292}html[data-theme=dark] .primary{background:#eeeeee;border-color:#eeeeee;color:#111111}html[data-theme=dark] .primary:hover{background:#ffffff}html[data-theme=dark] .secondary,html[data-theme=dark] .chip,html[data-theme=dark] .admin-tabs a,html[data-theme=dark] .demo-user{background:var(--surface-2);color:var(--text);border-color:var(--border)}html[data-theme=dark] .avatar{border-color:var(--surface)}html[data-theme=dark] .nav-link,html[data-theme=dark] .muted,html[data-theme=dark] .fineprint,html[data-theme=dark] .post-meta,html[data-theme=dark] .person-info p,html[data-theme=dark] .circle-card-body p,html[data-theme=dark] .rail-footer{color:var(--subtext)}html[data-theme=dark] .nav-link.active,html[data-theme=dark] .conversation.selected,html[data-theme=dark] .chip.active,html[data-theme=dark] .notification-row.unread{background:#242424;color:#f1f1f1}html[data-theme=dark] .nav-link:hover,html[data-theme=dark] .menu-item:hover,html[data-theme=dark] .notification-row:hover,html[data-theme=dark] .mention-option:hover{background:#222222}html[data-theme=dark] .rail-topic,html[data-theme=dark] .inline-note,html[data-theme=dark] .active-topic{background:#191919;border-color:#343434;color:#d6d6d6}html[data-theme=dark] .rail-topic p,html[data-theme=dark] .topic-button{color:#bdbdbd}hhtml[data-theme=dark] .school-label,html[data-theme=dark] .post-kind,html[data-theme=dark] .reaction-picker summary{background:#242424;color:#c9c9c9;border-color:#383838}html[data-theme=dark] .poll-option{border-color:#3b3b3b}html[data-theme=dark] .poll-bar{background:#343434}html[data-theme=dark] .poll-option.voted{color:#eeeeee}html[data-theme=dark] .message-list{background:#0d0d0d}html[data-theme=dark] .message-bubble{background:#1e1e1e;border-color:var(--border)}html[data-theme=dark] .mine .message-bubble{background:#303030;border-color:#414141}html[data-theme=dark] .chat-safety{background:#252525;color:#dedede;border-color:#454545}html[data-theme=dark] .profile-banner{background-color:#242424;background-image:none}html[data-theme=dark] .profile-banner span{color:#b8b8b8}html[data-theme=dark] .circle-hero{background:#202020}html[data-theme=dark] .circle-hero p{color:var(--subtext)}html[data-theme=dark] .stat-grid strong{color:#e3e3e3}html[data-theme=dark] .report-card blockquote{background:var(--surface-2)}html[data-theme=dark] .divider{background:var(--border)}html[data-theme=dark] .divider span{background:var(--surface)}html[data-theme=dark] .avatar-preset{background:var(--surface-2);border-color:var(--border)}html[data-theme=dark] .avatar-preset[aria-pressed=true]{background:#343434;border-color:#bdbdbd}html[data-theme=dark] .local-chip{background:#252525;color:#c7c7c7;border-color:#404040}html[data-theme=dark] .brand{color:#eeeeee}hhhtml[data-theme=dark] .empty-state h3{color:#d7d7d7}html[data-theme=dark] .empty-state{color:var(--subtext)}

/* Neutral accents for controls inherited from the original light theme. */
html[data-theme=dark] .sidebar{background:#0b0b0b}
html[data-theme=dark] .primary,html[data-theme=dark] .message-form .primary{color:#111;background:#eee;border-color:#eee}
html[data-theme=dark] .primary:hover{background:#fff;color:#000}html[data-theme=dark] .small-label,html[data-theme=dark] .tool-button,html[data-theme=dark] .reaction-button,html[data-theme=dark] .comment-link,html[data-theme=dark] .breadcrumb strong,html[data-theme=dark] .rail-guide,html[data-theme=dark] .rail-guide p,html[data-theme=dark] .mini-circle small,html[data-theme=dark] .post-meta a,html[data-theme=dark] .topic-link,html[data-theme=dark] .date-chip,html[data-theme=dark] .feed-tabs>span,html[data-theme=dark] .profile-banner span,html[data-theme=dark] .local-note,html[data-theme=dark] .local-note>span,html[data-theme=dark] .local-note small{color:#a8a8a8}
html[data-theme=dark] .text-button,html[data-theme=dark] .inline-tag,html[data-theme=dark] .inline-mention,html[data-theme=dark] .tool-button:hover,html[data-theme=dark] .tool-button.selected,html[data-theme=dark] .admin-live-status>span:first-child,html[data-theme=dark] .mobile-nav a.active{color:#eee}
html[data-theme=dark] .nav-count,html[data-theme=dark] .notification-icon,html[data-theme=dark] .count-pill,html[data-theme=dark] .avatar-edit-badge{background:#383838;color:#eee;border-color:#141414}
html[data-theme=dark] .avatar,html[data-theme=dark] .circle-emoji,html[data-theme=dark] .circle-card-cover{background:#262626!important}
html[data-theme=dark] .status-dot,html[data-theme=dark] .local-chip i,html[data-theme=dark] .unread-dot{background:#bdbdbd}
html[data-theme=dark] .new-posts,html[data-theme=dark] .reply-context,html[data-theme=dark] .message-emoji.selected,html[data-theme=dark] .avatar-upload-button{border-color:#555}
html[data-theme=dark] .compose-selects select,html[data-theme=dark] .composer textarea,html[data-theme=dark] .message-form textarea{background:#1d1d1d;color:#e3e3e3;border-color:#333}
html[data-theme=dark] .composer-bottom,html[data-theme=dark] .mini-circle,html[data-theme=dark] .topic-button,html[data-theme=dark] .person-row,html[data-theme=dark] .rail-guide,html[data-theme=dark] .local-note{border-color:#303030}
html[data-theme=dark] .post-video{background:#000}
html[data-theme=dark] #toast{background:#303030;color:#f1f1f1}
html[data-theme=dark] button:focus-visible,html[data-theme=dark] a:focus-visible,html[data-theme=dark] input:focus,html[data-theme=dark] textarea:focus,html[data-theme=dark] select:focus{outline-color:#bdbdbd}
@media(max-width:600px){.advanced-search input,.advanced-search select{min-width:calc(50% - 8px);max-width:100%}.composer-extra{gap:12px}.composer-extra .text-button{font-size:.8125rem}.public-profile .profile-inner{padding:0 20px 20px}.public-profile h1{font-size:1.5rem}.feed-tabs{gap:10px}#extra-feed-tabs{gap:10px}.comment-reply{margin-left:10px;padding-left:9px}.dm-image{max-width:200px}.settings-panel{padding:19px}.setting-toggle{font-size:.875rem}.post-video{max-height:350px}.feature-actions>.secondary{font-size:.8125rem}.sidebar{overflow-y:auto}.dm-history-actions{padding:3px 12px}#dm-extra{padding:6px 12px}.message-list{height:300px}}

/* Conversation inbox, explicit reply targets and editable drafts. */
.pending-video{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 0}.pending-video video{max-width:180px;max-height:130px;border-radius:9px;background:#000}.pending-video>span{font-size:.8125rem;overflow-wrap:anywhere}
.comment-tools{display:flex;align-items:center;gap:15px;margin-top:4px}.comment-tools .text-button{font-size:.75rem}.comment>div{min-width:0}.comment p{overflow-wrap:anywhere}
.profile-stats .text-button{font-size:.875rem}.person-actions{flex-wrap:wrap}.report-pagination{display:flex;align-items:center;gap:12px;margin:12px 0 20px;font-size:.8125rem;color:var(--subtext)}
.onboarding-interests{display:flex;flex-wrap:wrap;gap:10px}.onboarding-interests label{display:flex!important;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--border);border-radius:30px;margin:0!important;font-weight:400}.onboarding-interests input,.onboarding-circle input{width:18px;height:18px;flex:none;accent-color:var(--green)}.onboarding-interests label:has(input:checked){background:var(--surface-2);border-color:var(--subtext)}.onboarding-circles{display:grid;gap:10px}.onboarding-circle{display:flex!important;align-items:center;gap:12px;border:1px solid var(--border);border-radius:12px;padding:14px;margin:0!important;font-weight:400}.onboarding-circle span{min-width:0}.onboarding-circle small{display:block;color:var(--subtext);font-size:.8125rem;line-height:1.7;margin-top:4px}.onboarding-circle:has(input:checked){background:var(--surface-2);border-color:var(--subtext)}
.messenger{grid-template-columns:minmax(220px,29%) minmax(0,1fr);height:max(690px,calc(100dvh - 210px))}.conversation-summary{flex:1;min-width:0}.conversation-summary strong,.conversation-summary small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-summary time{display:block;font-size:.6875rem;color:var(--subtext);margin-top:4px}.conversation .count-pill{flex-shrink:0}.inbox-search{display:flex;gap:6px;flex-wrap:wrap;margin:0 3px 15px}.inbox-search input[type=search]{width:100%;font-size:.8125rem;padding:9px 10px}.inbox-search>label{display:flex;flex-direction:row;align-items:center;gap:7px;font-size:.75rem;font-weight:400}.inbox-search input[type=checkbox]{width:17px;height:17px}.inbox-search>.secondary{font-size:.75rem;min-height:32px;padding:5px 12px}.dm-contacts{border-top:1px solid var(--border);margin-top:18px;padding-top:12px}.dm-contacts>summary{font-size:.8125rem;padding:5px;cursor:pointer}.message-search{display:flex;gap:7px;align-items:center;padding:10px 15px;flex-shrink:0;border-bottom:1px solid var(--border)}.message-search>input{min-width:0;font-size:.8125rem;padding:9px 10px}.message-search .secondary{font-size:.75rem;min-height:35px;padding:6px 11px;flex-shrink:0}.message-search .text-button{font-size:.75rem;flex-shrink:0}.chat-heading{flex-wrap:wrap;gap:8px}.chat-heading>.text-button{font-size:.75rem}.chat-heading>strong{margin-right:auto}.chat-back{display:none}.message-form{padding-bottom:12px}.message-bubble .secondary{display:block;font-size:.8125rem;margin-top:7px}.conversation-list .conversation:hover{background:var(--surface-2)}.dm-history-actions{padding-top:5px;padding-bottom:5px}
@media(max-width:850px){.messenger{grid-template-columns:210px minmax(0,1fr)}.chat-heading{padding:12px}.chat-safety{padding:10px 12px}.chat-safety strong{font-size:.8125rem}.chat-safety p{font-size:.75rem}.chat-heading .chat-report-button{margin-left:0}.chat-heading>.icon-button{margin-left:0}}
@media(max-width:600px){.messenger{display:block;height:auto;min-height:450px}.conversation-list{display:block;max-height:none;padding:14px}.conversation-list .conversation{display:flex;width:100%;border:0;padding:13px 9px}.conversation-list .conversation small{display:block}.conversation-list .conversation .avatar{width:40px;height:40px;font-size:1.2rem}.conversation-list .conversation strong{font-size:.875rem}.inbox-search input[type=search]{flex:1;width:auto;min-width:160px}.inbox-search label{width:100%;margin-top:4px}.messenger:not(.has-chat) #chat-pane{display:none}.messenger.has-chat .conversation-list{display:none}.messenger.has-chat #chat-pane{min-height:640px;height:calc(100dvh - 190px)}.messenger.has-chat .message-list{height:auto;min-height:150px;flex:1}.chat-back{display:inline-flex}.chat-heading .chat-back{margin-right:4px}.chat-safety{position:static}.message-search{padding:8px 12px}.profile-stats{display:flex;flex-wrap:wrap;gap:5px}.onboarding-circle{padding:11px}.person-actions{gap:8px}.report-pagination{flex-wrap:wrap}}

.image-crop{position:absolute;bottom:3px;right:3px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:5px;padding:3px 5px;font-size:.6875rem}.crop-preview{display:block;max-width:100%;max-height:300px;margin:auto;background:#111;border-radius:8px}#crop-image-form input[type=range]{padding:0;accent-color:var(--green)}
/* Email registration uses the existing theme and keeps the demo chooser secondary. */
.email-login-page{max-width:820px}.email-login-page .login-layout{display:block;max-width:570px;margin:38px auto 0}.email-login-panel h1{font-size:1.5rem;margin:14px 0 22px}.email-auth-tabs{display:flex;gap:24px;align-items:center;margin-bottom:8px}.email-auth-form{display:grid;gap:18px;margin:22px 0}.email-auth-form .checkbox-label{align-items:flex-start}.email-auth-form .checkbox-label input{margin-top:5px;flex-shrink:0}.email-auth-form .form-grid{gap:14px}.email-login-panel>.text-button{display:block;margin:14px 0}.email-auth-error{color:#b43d42;font-size:.875rem;overflow-wrap:anywhere}.email-auth-error[hidden]{display:none}.email-auth-notice{font-size:.875rem;background:var(--soft);padding:12px;border-radius:10px;overflow-wrap:anywhere}.email-demo{border-top:1px solid var(--line);padding-top:20px;margin-top:22px}.email-demo summary{cursor:pointer;font-size:.875rem;color:var(--muted)}.email-demo .demo-accounts{margin-top:14px}.email-demo>p{margin-top:12px}.account-email{overflow-wrap:anywhere;margin:12px 0}html[data-theme=dark] .email-auth-error{color:#ff9c9c}html[data-theme=dark] .email-auth-notice{background:#242424;color:#ededed}@media(max-width:600px){.email-login-page{padding:22px 16px}.email-login-page .login-layout{margin-top:24px}.email-login-panel{padding:22px 18px}.email-auth-form .form-grid{grid-template-columns:1fr}.email-login-page .local-chip{font-size:.65rem;padding:5px 8px}}
