
/* Each theme keeps its own controls. The glossy pills, neon switches and 3D fields come from the classic themes;
   System24 stays square, flat and terminal-like, and the Apple (glass) theme gets flat Apple-style controls. */
:root:root[data-theme="system24"] { --sx: var(--accent); }
:root:root[data-theme="system24"] :where(.btn-primary, .ux-primary, .btn.primary, .auth-submit-action, .btn-success, .btn-danger) { border: 1px solid var(--sx); border-radius: 3px; background-image: none; background-color: color-mix(in srgb, var(--sx) 20%, transparent); color: var(--accent-hi, var(--accent)); text-shadow: none; box-shadow: none; overflow: visible; }
:root:root[data-theme="system24"] .btn-success { --sx: var(--green, #23a55a); color: var(--green, #23a55a); }
:root:root[data-theme="system24"] .btn-danger { --sx: var(--red, #f23f43); color: var(--red, #f23f43); }
:root:root[data-theme="system24"] :where(.btn-primary, .ux-primary, .btn.primary, .auth-submit-action, .btn-success, .btn-danger)::before,
:root:root[data-theme="system24"] :where(.btn-primary, .ux-primary, .btn.primary, .auth-submit-action, .btn-success, .btn-danger)::after { display: none; }
:root:root[data-theme="system24"] :where(.btn-primary, .ux-primary, .btn.primary, .auth-submit-action, .btn-success, .btn-danger):hover { filter: none; background-color: color-mix(in srgb, var(--sx) 34%, transparent); color: var(--bright, #fff); }
:root:root[data-theme="system24"] .switch i { background: var(--bg-3); border: 1px solid var(--border-focus); border-radius: 3px; box-shadow: none; }
:root:root[data-theme="system24"] .switch i::before { display: none; }
:root:root[data-theme="system24"] .switch i::after, :root:root[data-theme="system24"] .switch input:checked + i::after { border-radius: 2px; background: var(--muted, #8a8d99); box-shadow: none; }
:root:root[data-theme="system24"] .switch input:checked + i { background: color-mix(in srgb, var(--accent) 28%, var(--bg-1)); border-color: var(--accent); }
:root:root[data-theme="system24"] .switch input:checked + i::after { background: var(--accent); box-shadow: none; }
:root:root[data-theme="system24"] input[type="checkbox"]:not(.sr-only):not(.switch input):not([type="hidden"]) { border-radius: 3px; background: var(--bg-2); border: 1px solid var(--border-focus); animation: none; }
:root:root[data-theme="system24"] input[type="checkbox"]:not(.sr-only):not(.switch input)::before { display: none; }
:root:root[data-theme="system24"] input[type="checkbox"]:not(.sr-only):not(.switch input):checked { background: var(--accent); animation: none; border-color: var(--accent); }
:root:root[data-theme="system24"] input[type="radio"] { border-radius: 3px; background: var(--bg-2); box-shadow: none; border: 1px solid var(--border-focus); }
:root:root[data-theme="system24"] input[type="radio"]::before { border-radius: 1px; box-shadow: none; }
:root:root[data-theme="system24"] input[type="radio"]:checked { box-shadow: none; border-color: var(--accent); }
:root:root[data-theme="system24"] input[type="radio"]:checked::before { transform: none; }
:root:root[data-theme="system24"] :is(.system-input, .auth-input, #chat-search-input) { border: 1px solid var(--border-focus); border-radius: 3px; box-shadow: none; }
:root:root[data-theme="system24"] :is(.system-input, .auth-input, #chat-search-input):focus { box-shadow: none; border-color: var(--accent); }

/* an element with the hidden attribute stays hidden even when its class sets display */
.snav[hidden], .nav-tab[hidden] { display: none !important; }
@media (max-width: 560px) { .srow .btn { white-space: nowrap; flex: none; padding-inline: 12px; } }

/* voice panel tiles: six in one row when there is room */
.voice-dock-tiles:has(> :nth-child(6)) { grid-template-columns: repeat(auto-fit, minmax(30px, 1fr)); }
@media (max-width: 480px) { .srow .btn { white-space: nowrap; flex: none; } }
/* audit batch: settings polish */
.srow .btn, .savebar .btn { white-space: nowrap; flex: none; }
.savebar .btn { padding-inline: 14px; }
@media (min-width: 861px) { dialog.fullscreen .settings-body { padding-inline-end: 72px; } }
@media (min-width: 601px) { .srow select.system-input, .srow > select, .srow .sright > select { min-width: 210px; } }
@media (max-width: 560px) {
  .srow:has(> :is(#sv-emoji-name, #sv-sticker-name, #sv-sound-name)) { flex-wrap: wrap; }
  .srow:has(> :is(#sv-emoji-name, #sv-sticker-name, #sv-sound-name)) > :not(.btn) { flex: 1 1 100%; max-width: none !important; min-width: 0; }
  .srow:has(> :is(#sv-emoji-name, #sv-sticker-name, #sv-sound-name)) > .btn { white-space: nowrap; flex: none; }
}
/* bot store cards: one colour family in System24 and glass; the bot's own colour stays on the avatar ring */
[data-theme="system24"] .bot-banner:not([style]){ background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 40%, var(--bg-1)), color-mix(in srgb, var(--accent) 12%, var(--bg-1))); }
[data-theme="system24"] .bot-card .bot-title{ color: var(--accent) !important; }
[data-theme="system24"] .bot-card .bot-avwrap .bs-av{ border-color: color-mix(in srgb, var(--bc1) 75%, var(--bg-1)); }
/* channel names stay one line with an ellipsis */
.channel-item > span:first-child > [data-notr] { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* channel rows never squash when the panel below is tall: the list scrolls instead */
.channel-list > * { flex-shrink: 0; }
/* the unsaved-changes bar docks to the real bottom edge: a sticky bar is inset by the scroll box's padding, so the padding is taken back */
.settings-body .savebar.dirty-bar { bottom: -64px; }
@media (max-width: 860px) { .settings-body .savebar.dirty-bar { bottom: -74px; } }
#user-settings-dialog.pe-modal #sp-profile .savebar.dirty-bar { bottom: -54px; }
/* skip link: visible only while it has keyboard focus */
/* the skip link is cut away (not just moved off-screen) until the keyboard lands on it, and then sits inside the settings list, never over the page top or under a title bar */
.settings-nav { position: relative; }
.skip-link { position: absolute; inset-inline-start: 8px; top: 8px; z-index: 10; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border-radius: 6px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.skip-link:focus-visible { width: auto; height: auto; padding: 6px 12px; overflow: visible; clip-path: none; }
