/* NOVO 20261012.04. Only the light theme; geometry and the dark theme stay in existing modules. */
html.light,body.light{--bg:#f4f6fb;--panel:#fff;--card:#edf1f7;--input:#edf1f7;--text:#172033;--muted:#566277;--line:#d8deea;--border:#d8deea;--blue:#0b63ce;--incoming:#fff;color:var(--text)}
body.light :is(.rail,.sidebar,.sidehead,.chathead,.panehead,.composer,.composer-area,.mobile-nav,.modal,.modal-head,.choose-footer,.selection-bar,.call-select-bar,.channel-readonly,.folder-bottom,.channel-create-bottom,.password-change-actions){background:var(--panel)!important;color:var(--text)}
body.light .page-scroll{background:var(--bg)!important;color:var(--text)}
body.light :is(.card,.security-card,.sessions-card,.font-card,.language-list,.identity-card,.phonebook-stat,.attachment-draft-file,.at-item){background:var(--card)!important;color:var(--text);border-color:var(--line)!important}
body.light :is(.settings-separator,.security-line,.folder-divider,.rail-divider){background:var(--line)}
body.light :is(.settings-list .setting-row,.privacy-row,.notification-check,.language-row,.session-row){border-color:var(--line)}
body.light :is(.settings-list .setting-row:hover,.contact-row:hover,.chat-item:hover,.call-row.selected,.call-row:active,.channel-choice.active,.ring-choice.active){background:#e8edf6!important;color:var(--text)}
body.light .chat-item.active{background:#e0eafa!important;color:var(--text)}
body.light .rail :is(.navbtn.active,.admin-control-nav.active,.admin-control-nav:hover){color:var(--blue)!important;background:#e7effb}
body.light .mobile-nav .navbtn.active{color:var(--blue)!important}
body.light :is(.chat-item .preview,.chat-item .time,.chat-preview-sender,.contact-main p,.settings-profile p,.settings-profile .chevron,.settings-list .right,.settings-section-label,.privacy-row span,.session-row p,.session-row small,.folder-hero>p,.folder-name-card>label,.folder-name-wrap span,.folder-rules-card>small,.folder-explicit>small,.appearance-title button,.appearance-note,.shortcut-row kbd,.business-card p,.invite-subtitle,.edit-call-ref>small,.permission-intro>p,.permission-row small,.call-sub,.call-stamp,.blocked-profile-card p,.phonebook-stat span,.phonebook-found small,.attachment-draft-meta){color:var(--muted)!important}
body.light .typing-preview,body.light .typing-preview::first-letter{color:var(--blue)!important}
body.light :is(.permission-list svg,.device-circle svg,.folder-hero-icon,.folder-drag){color:var(--muted)}
body.light :is(.secondary,.profile-logout,.profile-more,.device-circle,.folder-hero-icon,.folder-type-icon,.group-avatar-pick,.ring-choice>span:first-child,.ring-preview,.ringtone-card>.row button,.ringtone-actions button,.copy-line,.location-card,.phonebook-stat,.saved-locked){background:#e8edf6!important;color:var(--text)!important}
body.light .profile-header .actions button,body.light .actions button{background:#e8edf6!important;color:var(--blue)!important}
body.light :is(.primary,.round-btn,.record-send){background:var(--blue)!important;color:#fff!important}
body.light .primary:hover{background:#0957b7!important}
body.light :is(.danger,.error,.availability.busy,.sessions-end-all){color:#b42348!important}
body.light .red{background:#bd254d!important;color:#fff!important}
body.light .availability.free,body.light .online-dot{color:#187445!important}
body.light :is(.call-row.missed b,.call-row.missed .call-main b){color:#b42348!important}
body.light :is(.chat-preview-kind,.chat-preview-kind.self){background:#e1eafa;color:#23599d;border-color:var(--line)}
body.light :is(.switch,.auth-steps span){background:#aab4c4}
body.light .switch:after{background:#fff}
body.light :is(.switch.on,.auth-steps span.on){background:var(--blue)}
body.light :is(.radio,.choice-ring,.check-circle,.call-select){border-color:#738198}
body.light :is(.radio.on,.choice-ring.on,.check-circle.on,.call-select.on){border-color:var(--blue)}
body.light :is(.check-circle.on,.call-select.on){background:var(--blue);color:#fff}
body.light :is(.profile-camera,.avatar.online::after){border-color:var(--panel)}
body.light :is(.theme-segment,.preview-themes){background:#e7edf6!important;color:var(--text)}
body.light .theme-segment button{color:var(--muted)!important}
body.light .theme-segment button.active{background:#fff!important;color:var(--blue)!important;box-shadow:0 1px 5px #17203314}
body.light .preview-themes button{color:var(--muted)}
body.light .preview-themes button.selected span{border-color:var(--blue)}
body.light .preview-bubble.in{background:#fff;color:var(--text)}
body.light .preview-bubble.in span{color:var(--muted)}
body.light .preview-bubble.out{background:var(--out);color:#fff}
body.light .preview-bubble.out span{color:#fff}
body.light :is(.appearance-preview,.blocked-profile-card){border-color:var(--line);background:var(--card)}
body.light :is(input,textarea,select){background:var(--input)!important;color:var(--text)!important;caret-color:var(--text)}
body.light :is(input,textarea)::placeholder{color:#657187!important;opacity:1}
body.light :is(.ref-input>span,.ref-textarea>span,.field>span,.switch-label){color:var(--muted)}
body.light :is(.phone-field,.prefix-input,.channel-slug-wrap){background:var(--input);color:var(--text)}
body.light :is(.composer textarea,.prefix-input input,.phone-field input,.channel-slug-wrap input){background:transparent!important}
body.light .composer button{color:var(--muted)}
body.light .composer .send{color:var(--blue)}
body.light :is(.menu-item,.action-popover .menu-item){color:var(--text)}
body.light :is(.menu-item:hover,.menu-item:focus,.menu-item:active,.action-popover .menu-item:hover,.action-popover .menu-item:focus){background:#e5edf9!important;color:var(--text)}
body.light .menu-item.danger{color:#b42348!important}
body.light :is(.day,.pinbar,.replybar){background:var(--panel)!important;color:var(--muted)!important;border-color:var(--line)}
body.light .bubble{background:var(--incoming)!important;color:var(--text)!important}
body.light .bubble :is(.sender,a){color:var(--blue)!important}
body.light .bubble .meta{color:var(--muted);opacity:1}
body.light .reply{background:#e9eef7!important;color:var(--text);border-left-color:var(--blue)!important}
body.light .reply small{color:var(--muted)}
body.light .reaction{background:#e5ebf6!important;color:var(--text)}
body.light .reaction.mine{background:#d9e8fc!important;color:#164b8e}
body.light .mine .bubble{background:var(--out)!important;color:#fff!important}
body.light .mine .bubble :is(.sender,a,.meta){color:#fff!important;opacity:1}
body.light .mine .bubble a{text-decoration:underline}
body.light .mine .reply{background:#ffffff1f!important;color:#fff;border-left-color:#fff!important}
body.light .mine .reply :is(small,.sender){color:#fff!important}
body.light .mine .reaction{background:#ffffff24!important;color:#fff}
body.light .mine .reaction.mine{background:#ffffff38!important;color:#fff}
body.light .message:is(.media-only,.round-message) .bubble{background:transparent!important}
body.light .message:is(.media-only,.round-message) .meta{background:#000b;color:#fff!important}
body.light .message:is(.media-only,.round-message) .reactions:not(:empty){background:var(--panel)}
body.light .message:is(.media-only,.round-message) .reaction{background:#e5ebf6!important;color:var(--text)}
body.light .voice-toggle{background:#e0e9fa;color:#244b91}
body.light .voice-text-toggle{background:#e4eafa;color:#304e8e}
body.light .voice-text-toggle.active{background:var(--blue);color:#fff}
body.light .voice-transcript{background:#e9eef7;color:var(--text)}
body.light .mine .voice-toggle{background:#fff;color:#30466b}
body.light .mine .voice-text-toggle{background:#ffffff24;color:#fff}
body.light .mine .voice-transcript{background:#00000018;color:#fff}
body.light .poll-option{background:#e9eef7;border-color:#b5c1d6;color:var(--text)}
body.light .poll-bar{background:#bdcdec}
body.light .mine .poll-option{background:#ffffff1f;border-color:#ffffff88;color:#fff}
body.light .call-row .call-info{color:var(--text)}
body.light .call-event-message:not(.mine) .call-event-copy b{color:var(--text)!important}
body.light .call-event-message:not(.mine) :is(.call-event-copy small,.call-event-time){color:var(--muted)!important;opacity:1}
body.light .call-event-message:not(.mine) .call-event-icon{background:#e5edfa;color:var(--blue)}
body.light .call-event-message:is(.missed,.cancelled):not(.mine) :is(.call-event-copy small,.call-event-icon){color:#b42348!important}
body.light .call-event-message.mine :is(.call-event-copy b,.call-event-copy small,.call-event-time,.call-event-icon){color:#fff!important;opacity:1}
body.light :is(.encryption-banner,.status-pill){background:#e1eee7;color:#245f40}
body.light .ai-bot-thread .chathead{background:linear-gradient(90deg,#fff,#eff0fb,#fff)!important}
body.light .ai-answer-label{background:#e9e4fa;color:#59439d}
body.light .ai-safety-list p{background:#e7edf6;color:var(--muted)}
body.light :is(.admin-head,.admin-tabs,.admin-toolbar,.admin-toolbar.sticky,.admin-user-head,.admin-flags,.admin-kv,.audit-row pre,.sticker-admin-grid>div){background:var(--panel)!important;color:var(--text);border-color:var(--line)}
body.light :is(.admin-hero,.ai-admin-hero){background:linear-gradient(125deg,#e8eefb,#f7f8fc 56%,#e4effc)!important;color:var(--text);border-color:var(--line)}
body.light .admin-hero h2{color:var(--text)}
body.light .admin-hero small{color:#245d9f}
body.light :is(.admin-hero p,.admin-head small,.admin-list-caption,.admin-row pre){color:var(--muted)}
body.light .admin-settings-entry{color:#245d9f}
body.light .admin-tabs button.active{background:#e0eafb!important;color:#164f99!important}
body.light :is(.admin-row,.admin-kv span,.admin-quick button,.admin-danger-zone button){background:var(--card)!important;color:var(--text);border-color:var(--line)}
body.light .admin-row:hover,body.light .admin-grid button.metric:hover{background:#e5edf9!important;border-color:#a9bddb}
body.light .admin-kv b{color:var(--text)}
body.light .admin-live{background:#dceee3;color:#205b39}
body.light .admin-live.ai-offline{background:#f7e3e8;color:#922543}
body.light .admin-live.charity-hidden{background:#e4e8f0;color:#566277}
body.light .admin-chip{background:#e0e5ee;color:#4c586e}
body.light .admin-chip.blue{background:#dce9fc;color:#235994}
body.light .admin-chip.amber{background:#f9edce;color:#77500a}
body.light .admin-chip.red,body.light .admin-danger-zone .danger{background:#f8e3e8!important;color:#a12543!important}
body.light .audit-row summary{color:var(--blue)}
body.light .support-msg.admin{background:#dce9fc;color:#172033}
body.light .skeleton-card,body.light .skeleton-message,body.light .skeleton-composer{background:linear-gradient(90deg,#e5eaf3 25%,#f1f4f9 38%,#e5eaf3 63%)}
body.light .shortcut-list kbd{background:#e4eaf3;color:var(--muted);border-color:var(--line)}
body.light .auth,body.light .auth-phone,body.light .auth-v3{background:var(--bg)}
body.light .auth-v3 .auth-pattern{background:radial-gradient(circle at 50% 8%,#dce8f7,transparent 40%)}
body.light .auth-v3 .auth-card{background:var(--panel)}
body.light .dev-code strong{color:var(--text)}
body.light .ringtone-actions button.active{background:#dce9fc!important;color:#245994!important}
body.light .novo-picker{background:var(--panel);color:var(--text);border:1px solid var(--line);box-shadow:0 6px 24px #17203326}
body.light .novo-picker .np-tabs{background:var(--panel)}
body.light .novo-picker :is(h3,.np-empty,.np-pack-title span,.np-top button){color:var(--muted)}
body.light .novo-picker .np-top button.selected{background:#e2eafb;color:#245994}
body.light .novo-picker .np-tabs button.selected{background:#dfeafa;color:#194f95}
body.light .novo-picker .np-add{background:var(--blue);color:#fff}
body.light .novo-picker .np-add.installed{background:#e4eaf4;color:#35435a}
body.light .novo-picker :is(.np-empty button,.np-browse){color:var(--blue)}
body.light .novo-picker .np-scroll{scrollbar-color:#9faec4 transparent}
body.light .novo-picker .np-scroll::-webkit-scrollbar-thumb{background:#9faec4}
body.light :is(.reel-card,.reel-side,.reel-sheet,.reel-comments-sheet,.reel-comment-compose,.rc-compose){background:var(--panel)!important;color:var(--text);border-color:var(--line)}
body.light :is(.reel-card:hover,.reel-comment,.reel-side-stats div,.reel-side-tags span,.reel-tags span,.reel-side-actions button,.reel-share-tools button,.reel-share-search,.reel-sheet-close,.rc-input-wrap){background:var(--card)!important;color:var(--text);border-color:var(--line)}
body.light :is(.reel-caption,.reel-side-body p,.reel-comment p,.reel-side-stats b,.rc-sort select){color:var(--text)!important}
body.light :is(.reel-comment-head small,.reel-sheet-note,.reel-share-row small,.reel-inline-hint,.rc-stats,.rc-name>span,.rc-meta,.rc-meta button,.rc-show-replies,.rc-inline,.rc-like,.rc-empty){color:var(--muted)}
body.light .reel-sheet-handle{background:#a7b2c3}
body.light .reel-share-row:hover{background:#e5edf9}
body.light .reel-comments-sheet .reel-sheet-close{background:var(--card);color:var(--muted)}
body.light .rc-people .avatar{border-color:var(--panel)}
body.light .rc-inline>span:last-child{border-color:var(--line)}
body.light .rc-compose button{color:var(--muted)}
body.light :is(.rc-mention,.rc-load,.rc-reply){color:var(--blue)}
body.light .rc-like.active{color:#bc3157}
body.light .rc-send{background:var(--blue)!important;color:#fff!important}
body.light .rc-input-wrap textarea,body.light .rc-sort select,body.light .reel-share-search input{background:transparent!important}
body.light .reel-side-actions button.like.active{background:#dce9fc!important;color:#205994}
/* Media canvases intentionally remain dark. Their text must not inherit light foreground tokens. */
body.light :is(.viewer,.media-viewer,.story-view,.call-screen,.reels-main,.reel-stage){--text:#f4f5fa;--muted:#bec5d4;color:#f4f5fa}
body.light :is(.viewer-controls,.viewer-speed-menu,.viewer-download,.call-controls,.call-top,.reel-close,.reel-nav-arrow,.reel-camera-flip){color:#fff}
body.light :is(.viewer,.media-viewer,.story-view) :is(input,textarea,select){background:#252934!important;color:#fff!important;caret-color:#fff}
body.light :is(.viewer,.media-viewer,.story-view) :is(input,textarea)::placeholder{color:#bcc5d4!important}
body.light .call-screen.active-call-screen #call-status{color:#bec5d4!important}
body.light .incoming-center p,body.light .peer-placeholder small{color:#bec5d4}
body.light .call-side-panel{--text:#172033;--muted:#566277;--panel:#fff;--card:#edf1f7;background:#fff!important;color:var(--text)!important;border-color:#d8deea}
body.light .call-side-panel :is(.call-chat-msg,.call-person:hover){background:#edf1f7;color:#172033}
body.light .call-side-panel :is(.call-chat-msg b,.call-person small,.call-panel-loading){color:#566277}
body.light .call-side-panel .call-chat-msg.mine{background:#0b63ce;color:#fff}
body.light .call-side-panel .call-chat-msg.mine b{color:#fff}
body.light .call-side-panel .call-chat-form input{background:#edf1f7!important;color:#172033!important}
@media(hover:hover){body.light .novo-picker :is(.np-top button,.np-emoji-grid button,.np-sticker-grid button):hover{background:#e5edf9}}
/* Channel/group administration, drafts, search and diagnostics share the same foreground scale. */
body.light :is(.channel-access-card,.channel-share-card,.channel-management-card,.channel-media-card,.channel-business-row,.channel-ready-card,.draft-attachment-restore,.phone-user,.call-diag-row){background:var(--card)!important;color:var(--text);border-color:var(--line)}
body.light :is(.channel-invite-box button,.channel-setting-icon,.channel-avatar-pick,.channel-picker-search,.channel-page-search,.chat-reaction-badge){background:#e4eaf4!important;color:var(--muted);border-color:var(--line)}
body.light .channel-avatar-pick>span{background:#dce8fa;color:#235994}
body.light .channel-picker-footer{background:var(--panel)}
body.light :is(.channel-head-edit,.channel-confirm-copy,.call-diag-row span){color:var(--text)}
body.light :is(.channel-section-label,.channel-hint,.channel-setting-help,.channel-invite-card>button,.channel-member-row .i,.channel-qr p,.channel-stat-grid span,.channel-ready-card p,.channel-created-line,.range-labels,.call-diag-row small,.contact-section-title,.phonebook-caption,.search-section h4){color:var(--muted)}
body.light .channel-settings-avatar>span{border-color:var(--panel)}
body.light .channel-delete-row{background:#f8e3e8;color:#b42348}
body.light :is(.channel-user-choice:hover,.channel-member-row:hover){background:#e5edf9}
body.light .unread-divider{color:var(--muted)}
body.light :is(.unread-divider::before,.unread-divider::after){background:#ccd6e6}
body.light .unread-divider span{background:#e2eaf7;color:#3f536f}
body.light .chat-scroll-bottom{background:#fff;color:var(--blue);border-color:var(--line)}
body.light .chat-scroll-bottom:hover{background:#e8effa}
body.light .chat-scroll-count{background:var(--blue);color:#fff}
body.light #upload-progress{background:#fff;color:var(--text);box-shadow:0 3px 16px #17203324}
body.light #upload-progress>div{background:#d8e1f0}
body.light #upload-progress .upload-actions button{background:#e4eaf4;color:#172033}
body.light #upload-progress .upload-actions button:hover{background:#dbe5f5}
body.light .auth-card .muted{color:var(--muted)!important}
body.light .call-screen .modal,body.light .call-screen .action-popover .modal{--text:#172033;--muted:#566277;--card:#edf1f7;--input:#edf1f7;color:#172033!important}
body.light :is(.reel-sheet,.reel-comments-sheet,.reel-side){--text:#172033;--muted:#566277;--card:#edf1f7;--input:#edf1f7;color:#172033!important}
/* Native form controls, including the system sort popup, follow the surrounding surface. */
body.light :is(.reel-sheet,.reel-side,.call-side-panel){color-scheme:light}
body.light :is(.viewer,.media-viewer,.story-view){color-scheme:dark}
