/* Shared preference controls. No animation or extra assets are needed. */
.ct-theme-toggle{display:inline-grid;place-items:center;width:38px;height:38px;flex:0 0 38px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--muted);cursor:pointer}
.ct-theme-toggle svg{width:19px;height:19px}.ct-theme-toggle:hover{background:var(--oat);color:var(--ink)}
.cream-body :focus-visible{outline:2px solid var(--caramel);outline-offset:3px}
.cream-body{caret-color:var(--caramel);accent-color:var(--caramel)}.cream-body ::selection{background:var(--butter);color:var(--ink)}
.cream-body *{scrollbar-color:var(--muted) var(--oat);scrollbar-width:thin}
.ct-chat-entry{position:relative}.ct-nav-unread{position:absolute;top:-8px;right:-17px;display:grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:10px;background:#bd3446;color:#fff;font:600 11px/1 system-ui,sans-serif;font-variant-numeric:tabular-nums;box-shadow:0 0 0 2px var(--paper)}
.ct-nav-unread[hidden]{display:none}.cream-main-nav .ct-chat-entry{margin-right:10px}.mobile-dock .ct-nav-unread{top:0;right:calc(50% - 29px);display:grid}.mobile-dock .ct-nav-unread[hidden]{display:none}
.cream-main-nav .ct-nav-unread{top:calc(50% - 18px)}
.hot-runner-type{display:block;font-size:10px;line-height:1.4;font-style:normal;color:var(--muted);font-weight:400;margin-top:2px}.hot-runner-list a{min-height:44px}
.cream-body .catalog-sort{flex-wrap:wrap;row-gap:10px}.cream-body .catalog-sort a{white-space:nowrap}
@media(min-width:801px) and (max-width:1190px){.cloudtail-fresh-grid>.resource-card:nth-child(n+5){display:none}}
@media(max-width:700px){.cream-body .cream-header{grid-template-columns:minmax(0,1fr) auto auto;column-gap:10px}.cream-body .ct-theme-toggle{grid-column:2;grid-row:1;width:36px;height:36px;min-width:36px}.cream-body .account-nav{grid-column:3;grid-row:1}.cream-body .cream-channels a:last-child{grid-column:auto}.cream-body .cream-channels{grid-template-columns:repeat(4,minmax(0,1fr))}.cream-body .catalog-sort{column-gap:14px;row-gap:8px}.cream-body .catalog-sort a{min-height:32px;display:inline-flex;align-items:center}}

:root[data-color-mode=dark],:root[data-color-mode=dark] .cream-body{--cream:#151a23;--paper:#202733;--oat:#293241;--line:#394353;--ink:#e1e6ef;--muted:#aeb9ca;--caramel:#a7bce9;--butter:#354763;--sage:#a7bce9;--night-control:#53668f;--night-hover:#2c3748;--night-selected:#34445f;--surface-lift:0 4px 15px #00000022;--surface-hover:0 8px 22px #00000035;--panel-lift:0 5px 20px #0000001e;color-scheme:dark;background:#151a23;color:#e1e6ef}
:root[data-color-mode=dark] .cream-body{background:var(--cream);color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.cream-header,.mobile-dock){background:#1b222d;border-color:var(--line);backdrop-filter:none}
:root[data-color-mode=dark] .cream-body :is(.global-search,.hero .search,.ct-search,.ct-dl-search,.catalog-search){background:var(--oat);border-color:var(--line);color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(input,textarea,select){color:var(--ink);background:var(--paper);border-color:var(--line)}
:root[data-color-mode=dark] .cream-body :is(.global-search input,.ct-search input,.ct-dl-search input,.ct-composer textarea){background:transparent!important;color:var(--ink)}
:root[data-color-mode=dark] .cream-body ::placeholder{color:var(--muted);opacity:1}
:root[data-color-mode=dark] .cream-body :is(.btn-primary,.btn.primary,.account-nav .register-link,.ct-send,.ct-dl-search button,.ct-dl-settings-save,.ct-dl-primary,.ct-dl-quick-form button,.search>button){background:var(--night-control);border-color:var(--night-control);color:#fff}
:root[data-color-mode=dark] .cream-body :is(.btn-primary:hover,.btn.primary:hover,.ct-send:hover,.ct-dl-search button:hover){background:#6075a0}
:root[data-color-mode=dark] .cream-body :is(.btn-secondary,.btn.secondary,.spotlight-random,.ux-button,.favorite-btn,.localization-request-btn,.purchase-button,.ct-theme-toggle,.daily-brief-trigger){background:var(--paper);border-color:var(--line);color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.resource-card,.cloudtail-hot,.ux-community-strip,.panel,.content-panel,.download-panel,.comments,.auth-card,.member-panel,.member-card,.message-panel,.tutorial,.forum-compose,.forum-topic-stream,.forum-topic-detail,.forum-reply-panel,.ux-message-panel,.ux-message-head,.ux-message-composer,.ux-gallery,.ux-cover-glass){background:var(--paper);color:var(--ink);border-color:var(--line)}
:root[data-color-mode=dark] .cream-body :is(.cloudtail-masthead.hero,.hero.catalog-compact){background:#232d3d;background-image:none}
:root[data-color-mode=dark] .cream-body :is(.hero h1,.cloudtail-masthead h1,.detail-intro h1,.forum-topic-copy strong,.ux-community-item strong,.ct-dl-card h2 a,.ct-dl-related a,.brand-copy b){color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.cream-channels a,.cloudtail-periods button,.ux-community-switch button,.ct-dl-filters button){color:var(--muted);background:transparent}
:root[data-color-mode=dark] .cream-body :is(.cream-channels a.active,.ct-thread.is-active,.ux-contact[aria-pressed=true],.ct-dl-editions a[aria-current=true]){color:var(--ink);background:var(--night-selected)}
:root[data-color-mode=dark] .cream-body :is(.cloudtail-periods button[aria-selected=true],.ux-community-switch button[aria-selected=true],.ct-dl-filters button[aria-pressed=true]){color:var(--caramel);background:transparent;border-bottom-color:var(--caramel)}
:root[data-color-mode=dark] .cream-body :is(.cream-channels a:hover,.hot-runner-list a:hover,.ct-thread:hover,.ct-icon-link:hover,.ct-emoji-item:hover,.ct-picker-result:hover,.forum-topic-list>a:hover,.ux-inbox-tab:hover){background:var(--night-hover);color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.cover,.locked-visual,.hot-art,.hot-feature-cover,.hot-feature,.ux-cover-art,.ux-cover-art>img,.ux-gallery-viewport,.ct-dl-cover,.ct-dl-work-cover,.ct-dl-previews img,.ct-resource-placeholder,.ct-resource-card img){background:var(--oat);color:var(--muted)}
:root[data-color-mode=dark] .cream-body :is(.platform-tag,.release-tag,.detail-badges>span,.ct-dl-language-badge,.ux-random-tags>span){background:#303c50;color:#d5dfee;border-color:var(--line)}
:root[data-color-mode=dark] .cream-body :is(.hot-feature-copy,.hot-feature-copy strong,.hot-explainer p){color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.hot-art>span,.cream-card-category,.card-meta,.card-identity,.card-chips,.hot-feature-copy>span,.hot-number,.hot-runner-no,.hot-runner-list small,.ux-community-meta,.ux-community-author,.ux-community-more,.ux-community-empty,.ux-resource-sections a){color:var(--muted)}
:root[data-color-mode=dark] .cream-body .has-cover .hot-number{color:#fff}
:root[data-color-mode=dark] .cream-body :is(.ux-community-item,.catalog-toolbar,.cloudtail-periods,.cloudtail-hot-foot,.cream-channels,.ux-community-strip-head,.cream-updates,.forum-topic-stream>header,.site-footer,.ct-dl-specs,.ct-dl-filters,.ct-chat-head,.ct-composer,.ct-conversations,.ct-current-user){border-color:var(--line)}
:root[data-color-mode=dark] .cream-body :is(.ux-inbox-nav,.ux-forum-rail,.ux-contacts,.ux-conversation-head,.ux-conversation-body,.ct-conversations,.ct-member-panel){background:#1b222e;--muted:#aeb9ca;color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.ux-inbox-tab[aria-selected=true],.forum-sections>a.active,.forum-topic-stream>header,.forum-topic-list>a,.ux-contact-search,.ux-topic-search,.ux-topic-more[open]>form){background:var(--paper);color:var(--ink);border-color:var(--line)}
:root[data-color-mode=dark] .cream-body :is(.forum-topic-copy p,.forum-topic-body,.rich-prose,.ct-dl-description,.ux-random-summary){color:#c8d2e1}
:root[data-color-mode=dark] .cream-body :is(.ux-contact-avatar,.forum-topic-avatar,.ux-conversation-body>article>i,.notification-list>a>i,.ct-avatar,.ux-random-mark){background:var(--oat);color:var(--caramel)}
:root[data-color-mode=dark] .cream-body :is(.notification-list>a.unread,.ct-message.is-mentioned .ct-bubble){background:#2c3850;border-color:#7289b4}
:root[data-color-mode=dark] .cream-body :is(.ux-conversation-body>article p,.ct-bubble){background:var(--paper);color:var(--ink);border-color:var(--line)}
:root[data-color-mode=dark] .cream-body :is(.ux-conversation-body>article.outgoing p,.ct-message.is-own .ct-bubble){background:#34445f;color:var(--ink);border-color:#465979}
:root[data-color-mode=dark] .cream-body :is(.ux-version-select,.copy-line,.official-purchase-card,.catalog-view-switch,.ux-random-stage,.ux-random-placeholder,.ux-random-skeleton,.ux-random-close,.ux-random-browse>button){background:var(--oat);color:var(--muted);border-color:var(--line);--muted:#aeb9ca}
:root[data-color-mode=dark] .cream-body :is(.ux-random-dialog,.ux-random-head,.ux-random-result,.ux-random-dialog>footer,.ux-random-candidate,.daily-brief-modal>section,.random-game-dialog,.link-report-modal>section,.sticker-modal>section,.rich-image-dialog>section){background:var(--paper);color:var(--ink);border-color:var(--line)}
:root[data-color-mode=dark] .cream-body .ux-random-selection{border-color:#9eb6e3;box-shadow:none}
/* Chat media keep their real colors. Only surrounding controls are themed. */
:root[data-color-mode=dark] .cream-body :is(.ct-chat-shell,.ct-chat-head,.ct-composer,.ct-picker,.ct-picker-result,.ct-mention-menu,.ct-resource-card,.ct-new-messages,.ct-sticker-remove){background:var(--paper);color:var(--ink)!important;border-color:var(--line)}
:root[data-color-mode=dark] .cream-body .ct-conversation{background:var(--cream)}
:root[data-color-mode=dark] .cream-body :is(.ct-thread,.ct-mention-menu button){color:var(--ink)}
:root[data-color-mode=dark] .cream-body .ct-avatar.is-group{background:var(--night-control);color:#fff}
:root[data-color-mode=dark] .cream-body :is(.ct-conversations header p,.ct-icon-link,.ct-thread-copy small,.ct-current-user small,.ct-chat-head p,.ct-message-meta,.ct-message-meta button,.ct-message-actions,.ct-message-actions button,.ct-chat-empty,.ct-chat-empty h3,.ct-loading,.ct-composer-tools button,.ct-composer-tip,.ct-composer footer>span,.ct-compose-preview button,.ct-member-panel small,.ct-member-panel>p,.ct-picker-result small,.ct-chat-gate p,.ct-save-sticker,.ct-pending-media small,.ct-emoji-tabs button,.ct-emoji-help,.ct-sticker-item small,.ct-resource-card small,.ct-dl-quick header>button){color:var(--muted)}
:root[data-color-mode=dark] .cream-body :is(.ct-bubble a,.ct-bubble .ct-at,.ct-resource-card em,.ct-load-history,.ct-member-actions button,.ct-dl-quick-more,.ct-emoji-tabs [aria-selected=true],.ct-gif-label,.ct-chat-gate>a:last-child){color:var(--caramel)}
:root[data-color-mode=dark] .cream-body :is(.ct-compose-preview,.ct-pending-media,.ct-media-fallback,.ct-media-expired,.ct-video-expiry,.ct-media-gif,.ct-sticker-item,.ct-chat-empty>span){background:var(--oat);color:var(--muted);border-color:var(--line)}
:root[data-color-mode=dark] .cream-body .ct-media-gif.is-playing{background:transparent}
:root[data-color-mode=dark] .cream-body :is(.ct-mention-menu button.selected,.ct-composer-tools button:hover,.ct-chat-head button:hover){background:var(--night-hover);color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.ct-chat-head button,.ct-picker header button,.ct-member-panel header button){color:var(--muted)}
:root[data-color-mode=dark] .cream-body .ct-mention-badge{background:#4b303b;color:#ffbdc7}
:root[data-color-mode=dark] .cream-body .ct-connection{background:#473d2e;color:#f2d7a4}
:root[data-color-mode=dark] .cream-body .ct-composer footer>span.is-error{color:#ffb6c1}
/* DL browsing, language selection and settings. */
:root[data-color-mode=dark] .cream-body .ct-dl{color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.ct-dl-heading p,.ct-dl-list-note,.ct-dl-card p,.ct-dl-card footer,.ct-dl-empty p,.ct-dl-source-note,.ct-dl-maker,.ct-dl-facts,.ct-dl-work-time,.ct-dl-specs dt,.ct-dl-related>p,.ct-dl-related a span,.ct-dl-admin,.ct-dl-gate p,.ct-dl-editions>span,.ct-dl-cover-fallback){color:var(--muted)}
:root[data-color-mode=dark] .cream-body :is(.ct-dl-chat-link,.ct-dl-back,.ct-dl-available,.ct-dl-owned,.ct-dl-status a,.ct-dl-list-note button,.ct-dl-admin summary,.ct-dl-pagination a){color:var(--caramel)}
:root[data-color-mode=dark] .cream-body :is(.ct-dl-empty,.ct-dl-actions a,.ct-dl-actions button,.ct-dl-admin button,.ct-dl-admin input[type=number],.ct-dl-editions a,.ct-dl-quick-form input){background:var(--paper);color:var(--ink);border-color:var(--line)}
:root[data-color-mode=dark] .cream-body .ct-dl-status{background:var(--oat);color:var(--muted)}
:root[data-color-mode=dark] .cream-body .ct-dl-actions .ct-dl-primary{background:var(--night-control);color:#fff;border-color:var(--night-control)}
:root[data-color-mode=dark] .cream-body .ct-dl-editions a[aria-current=true]{background:var(--night-selected);border-color:#6d83ab;color:var(--ink)}
@media(max-width:700px){:root[data-color-mode=dark] .cream-body .account-nav .register-link{background:transparent;color:var(--caramel)}}
/* Legacy controls that used their accent as both ink and fill. */
:root[data-color-mode=dark] .cream-body .download-btn{background:var(--night-control)!important;color:#fff!important}
:root[data-color-mode=dark] .cream-body :is(.genre-bar a.active,.page-number.active,.catalog-view button[aria-pressed=true]){background:var(--night-selected);color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.catalog-view,.catalog-view button,.hot-explainer p){background:var(--paper);color:var(--ink);border-color:var(--line)}
:root[data-color-mode=dark] .cream-body :is(.cream-cover-label,.cream-cover-symbol){color:var(--muted)}
:root[data-color-mode=dark] .cream-body :is(.hot-type,.cover-update-tag){background:#303c50;color:#d5dfee;border-color:var(--line)}
:root[data-color-mode=dark] .cream-body .ux-unread{background:#bd3446;color:#fff}
:root[data-color-mode=dark] .cream-body :is(.auth-visual,.tutorial-hero,.member-dashboard-hero,.member-heading,.profile-hero){background:var(--paper);color:var(--ink)}
:root[data-color-mode=dark] .cream-body :is(.auth-visual h2,.tutorial-hero h1){color:var(--ink)}
:root[data-color-mode=dark]::-webkit-scrollbar,:root[data-color-mode=dark] .cream-body ::-webkit-scrollbar{background:var(--cream)}
:root[data-color-mode=dark]::-webkit-scrollbar-thumb,:root[data-color-mode=dark] .cream-body ::-webkit-scrollbar-thumb{background:#66768d;border:3px solid var(--cream);border-radius:8px}
:root[data-color-mode=dark] .cream-body .ct-dl-filters nav::-webkit-scrollbar-track{background:var(--oat)}
:root[data-color-mode=dark] .cream-body .ct-dl-filters nav::-webkit-scrollbar-thumb{background:#66768d;border:0}
:root[data-color-mode=dark],:root[data-color-mode=dark] .cream-body,:root[data-color-mode=dark] .cream-body *{scrollbar-color:#66768d #151a23}
