/* Theme control: a sliding illuminated thumb with sun / moon icons. */
.nav-item.active { box-shadow:none; }
.format-hint > .format-toolbar { gap:3px; margin-left:-6px; }
.format-button { display:inline-flex; align-items:center; justify-content:center; width:29px; height:28px; padding:0; border:1px solid transparent; border-radius:5px; background:transparent; color:inherit; font-size:12px; }
.format-button:hover { color:#eee; border-color:#444; background:#ffffff0a; }
.format-button:active { background:#ffffff16; }
html[data-theme="light"] .format-button:hover { color:#2867b5; border-color:#bed3ee; background:#e8f1ff; }
html[data-theme="light"] .format-button:active { background:#d7e8ff; }
html[data-theme="dark"] { --bg:#121212; --panel:#1c1c1c; --panel2:#242424; --border:#333; --text:#eee; --muted:#999; --accent:#d0d0d0; }
html[data-theme="dark"] body { background:#121212; }
html[data-theme="dark"] :is(.sidebar,.topbar) { background:#161616; border-color:#2b2b2b; }
html[data-theme="dark"] .button.primary { background:#d2d2d2; border-color:#e0e0e0; color:#202020; }
html[data-theme="dark"] .button.primary:hover { background:#ededed; border-color:#fff; color:#151515; box-shadow:0 0 0 3px #ffffff08,0 4px 18px #0003; }
html[data-theme="dark"] .button.danger { background:#80364b; border-color:#a34c64; color:#fff1f5; }
html[data-theme="dark"] .button.danger:hover { background:#a0465f; border-color:#cc7089; }
html[data-theme="dark"] .validation-error { color:#f4a7b7; background:#2d1e27; border-color:#63384a; }
html[data-theme="dark"] .admin-delete:hover { color:#ffadbc; background:#783a4833; border-color:#834659; }
html[data-theme="dark"] .discord-markdown a,html[data-theme="dark"] .embed-title a { color:#88c1fd; }
html[data-theme="dark"] .embed-tools .danger-text:hover { color:#ee9da9; }
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; padding:4px; border:1px solid #424242; border-radius:24px; background:#202020; min-height:38px; cursor:pointer; }
.theme-toggle:hover { background:#303030; border-color:#808080; box-shadow:0 0 0 3px #9494940b; }
.theme-toggle-track { position:relative; display:grid; grid-template-columns:29px 29px; place-items:center; height:28px; }
.theme-toggle-track > i { position:relative; z-index:1; font-size:12px; transition:color .3s,transform .4s; pointer-events:none; }
.theme-toggle .fa-moon { color:#efefef; transform:rotate(-15deg); }
.theme-toggle .fa-sun { color:#8d8d8d; }
.theme-toggle-thumb { position:absolute; left:0; top:0; width:29px; height:28px; background:#575757; border:1px solid #7e7e7e; border-radius:50%; box-shadow:0 2px 7px #00000033; transition:transform .38s cubic-bezier(.34,1.35,.55,1),background-color .3s,border-color .3s; pointer-events:none; }
html[data-theme="light"] .theme-toggle-thumb { transform:translateX(29px); background:#fff; border-color:#dce6f4; box-shadow:0 2px 8px #204b7f24; }
html[data-theme="light"] .theme-toggle .fa-sun { color:#b67a19; transform:rotate(90deg); }
html[data-theme="light"] .theme-toggle .fa-moon { color:#7991ad; transform:rotate(-40deg); }
.theme-changing body { animation:theme-reveal .4s ease-out; }
.theme-changing :where(.sidebar,.topbar,.panel,.button,.notice,input,textarea,select,summary,.mode-switch,.discord-window,.discord-channel,.discord-embed,dialog) { transition:background-color .35s ease,color .3s ease,border-color .35s ease,box-shadow .3s ease; }
@keyframes theme-reveal { from { opacity:.72; } to { opacity:1; } }

/* Light studio is the default for visitors without a saved preference. */
html[data-theme="light"] {
  color-scheme:light;
  --bg:#f3f6fb;
  --panel:#ffffff;
  --panel2:#edf3fa;
  --border:#d9e3ef;
  --text:#1d304b;
  --muted:#697e9a;
  --accent:#2469c5;
}
html[data-theme="light"] body { background:radial-gradient(ellipse at 75% 0%,#dceaff66,transparent 55%),var(--bg); }
html[data-theme="light"] ::selection { color:#153d70; background:#b7d8ff; }
html[data-theme="light"] :is(.sidebar,.topbar) { background:#fbfcff; border-color:#dce5f1; }
html[data-theme="light"] .brand { color:#1b365c; }
html[data-theme="light"] .brand small { color:#6b83a2; }
html[data-theme="light"] :is(.nav-caption,.sidebar-footer) { color:#758aa6; }
html[data-theme="light"] .sidebar-footer > span:last-child { color:#899ab1; }
html[data-theme="light"] .nav-item { color:#5d7698; }
html[data-theme="light"] .nav-item > span:first-child { color:#7693b6; }
html[data-theme="light"] .nav-item:hover { background:#edf3fc; color:#244f84; }
html[data-theme="light"] .nav-item:hover > span:first-child { color:#397ac8; }
html[data-theme="light"] .nav-item.active { background:#e5effd; border-color:#c4d9f3; color:#225b9d; box-shadow:none; }
html[data-theme="light"] .nav-item.active > span:first-child { color:#367bc9; }
html[data-theme="light"] .nav-count { color:#7087a8; }
html[data-theme="light"] .studio-note { background:linear-gradient(145deg,#e8f1fe,#f8faff); border-color:#d2e1f5; }
html[data-theme="light"] :is(.studio-note strong,.tip-card strong) { color:#294b79; }
html[data-theme="light"] :is(.studio-note p,.tip-card p) { color:#6984a6; }
html[data-theme="light"] :is(.spark,.studio-note button,.tip-card > span:first-child) { color:#5082c1; }
html[data-theme="light"] .studio-note button:hover { color:#1a5db0; }
html[data-theme="light"] .breadcrumb { color:#7c91ad; }
html[data-theme="light"] .slash { color:#b1c1d5; }
html[data-theme="light"] #breadcrumb-current { color:#42638c; }
html[data-theme="light"] .eyebrow { color:#6888b2; }
html[data-theme="light"] .page-heading p { color:#7186a2; }
html[data-theme="light"] .button { background:#edf3fc; border-color:#cbdcf1; color:#3f608b; box-shadow:inset 0 1px 0 #fff9,0 1px 2px #234d7c09; }
html[data-theme="light"] .button:hover { background:#e1ecfb; border-color:#9dbde5; color:#224e87; box-shadow:0 3px 10px #4675a510; }
html[data-theme="light"] .button.primary { background:#347ee1; border-color:#2f74d3; color:#fff; box-shadow:inset 0 1px 0 #ffffff30,0 3px 9px #347ee120; }
html[data-theme="light"] .button.primary:hover { background:#226acb; border-color:#1e61bd; color:#fff; box-shadow:0 0 0 3px #347ee10e,0 4px 15px #347ee124; }
html[data-theme="light"] .button.subtle { background:#f7faff; border-color:#d4e0ef; color:#4e6d96; }
html[data-theme="light"] .button.subtle:hover { background:#e9f1fc; border-color:#a5c2e7; color:#235386; }
html[data-theme="light"] .discord-button { background:#eaf2fd; border-color:#cbdcf3; color:#3765a1; }
html[data-theme="light"] .discord-button:hover { background:#dceafb; border-color:#97b8e2; }
html[data-theme="light"] .theme-toggle { background:#eaf1fa; border-color:#ceddf0; }
html[data-theme="light"] .theme-toggle:hover { background:#dfebfa; border-color:#a2bfe4; }
html[data-theme="light"] .icon-button { color:#7690b0; }
html[data-theme="light"] .icon-button:hover { background:#e6effb; border-color:#c3d7f0; color:#2c68b3; }
html[data-theme="light"] :is(.text-button,.notice > button) { color:#3873bd; }
html[data-theme="light"] :is(.text-button,.notice > button):hover { color:#174f98; }
html[data-theme="light"] .notice { background:#edf4ff; border-color:#d0e1f6; color:#6884a7; }
html[data-theme="light"] .notice strong { color:#375f90; }
html[data-theme="light"] .notice-icon { color:#5689ca; }
html[data-theme="light"] .mode-switch { background:#eaf0f8; border-color:#d4dfef; }
html[data-theme="light"] .mode-switch button { color:#7590b0; }
html[data-theme="light"] .mode-switch button:hover { background:#dfeafb; color:#3165a5; }
html[data-theme="light"] .mode-switch button.selected { background:#fff; border-color:#cfddf0; color:#3466a6; box-shadow:0 2px 5px #3d639a10; }
html[data-theme="light"] .save-state { color:#8295af; }
html[data-theme="light"] .panel { box-shadow:0 4px 20px #335a8405; }
html[data-theme="light"] label { color:#526e93; }
html[data-theme="light"] :is(input:not([type=color],[type=checkbox]),textarea,select) { background:#f7f9fd; border-color:#d5e0ee; color:#254468; }
html[data-theme="light"] :is(input::placeholder,textarea::placeholder) { color:#93a5be; }
html[data-theme="light"] :is(input:not([type=color],[type=checkbox]),textarea,select):hover { border-color:#acc4e3; }
html[data-theme="light"] :is(input,textarea,select):focus { background:#fff; border-color:#5792df; box-shadow:0 0 0 3px #4f91e510; }
html[data-theme="light"] :is(.optional,.input-count) { color:#8a9db8; }
html[data-theme="light"] .embed-tabs button { color:#6b86aa; }
html[data-theme="light"] .embed-tabs button:hover { color:#245e9f; background:#e9f1fd; }
html[data-theme="light"] .embed-tabs button.active { color:#2d65a7; background:#eaf2ff; border-color:#cbdff8; }
html[data-theme="light"] .embed-tools .text-button { color:#7890af; }
html[data-theme="light"] .embed-tools .text-button:hover { color:#2468bb; }
html[data-theme="light"] .embed-tools .danger-text:hover { color:#c44965; }
html[data-theme="light"] .section-label { color:#365b87; }
html[data-theme="light"] .section-label > span { color:#6c98cb; }
html[data-theme="light"] .format-hint { color:#879bb6; }
html[data-theme="light"] .format-hint > span { color:#7791b2; }
html[data-theme="light"] .color-input { background:#f7f9fd; border-color:#d5e0ee; }
html[data-theme="light"] .color-input:focus-within { border-color:#5792df; box-shadow:0 0 0 3px #4f91e510; }
html[data-theme="light"] .color-input input:not([type=color]) { background:none; }
html[data-theme="light"] summary { color:#4e6d94; }
html[data-theme="light"] summary > span { color:#7d9dc5; }
html[data-theme="light"] summary small { color:#8a9fba; }
html[data-theme="light"] summary:hover { background:#edf4fd88; color:#2e5f99; }
html[data-theme="light"] summary:hover > span { color:#4485d2; }
html[data-theme="light"] details[open] summary { color:#2a5f9d; }
html[data-theme="light"] .summary-chevron { color:#82a2cc; }
html[data-theme="light"] .field-help { color:#7189a8; }
html[data-theme="light"] :is(.field-row,.button-row) { background:#f6f9fe; border-color:#d4e1f1; }
html[data-theme="light"] :is(.field-row,.button-row) .row-heading { color:#7c99bd; }
html[data-theme="light"] .preview-heading h2 { color:#4f6e93; }
html[data-theme="light"] .preview-sizes { background:#edf3fb; border-color:#d3e0f0; }
html[data-theme="light"] .preview-sizes button { color:#8a9fbc; }
html[data-theme="light"] :is(.preview-sizes .selected,.preview-sizes button:hover) { background:#dceafb; color:#4579bd; }
html[data-theme="light"] .discord-window { background:#fff; border-color:#d7dee9; box-shadow:0 12px 35px #264b7b0c; }
html[data-theme="light"] .discord-channel { background:#f7f8fa; border-color:#e2e5ea; }
html[data-theme="light"] .discord-channel > strong { color:#414b5c; }
html[data-theme="light"] .discord-channel > span:first-child { color:#929aa8; }
html[data-theme="light"] .discord-channel > span:last-child { color:#8b94a3; }
html[data-theme="light"] .channel-separator { background:#dce1e9; }
html[data-theme="light"] .bot-meta > strong { color:#29394e; }
html[data-theme="light"] .bot-meta time { color:#8d96a5; }
html[data-theme="light"] .discord-content { color:#3a4558; }
html[data-theme="light"] .discord-embed { background:#f2f3f5; }
html[data-theme="light"] :is(.embed-title,.embed-author,.embed-field strong) { color:#303b4e; }
html[data-theme="light"] :is(.embed-description,.embed-field) { color:#586272; }
html[data-theme="light"] .embed-footer { color:#808998; }
html[data-theme="light"] .discord-markdown a { color:#286eb9; }
html[data-theme="light"] :is(.discord-markdown pre,.discord-markdown code) { background:#e6e9ef; border-color:#d9dfe8; }
html[data-theme="light"] .discord-markdown blockquote { border-color:#c3cad6; }
html[data-theme="light"] .discord-markdown .spoiler { background:#d9dfe8; }
html[data-theme="light"] .discord-markdown .spoiler:hover { color:#38485d; }
html[data-theme="light"] .discord-link-button { background:#e5e9ef; color:#48556b; }
html[data-theme="light"] .discord-link-button:hover { background:#d7e1ee; }
html[data-theme="light"] :is(.preview-meta,.preview-footer) { color:#8196b1; }
html[data-theme="light"] #total-count { color:#6a88ae; }
html[data-theme="light"] .tip-card { background:linear-gradient(135deg,#edf4ff,#f8fbff); border-color:#d4e3f8; }
html[data-theme="light"] .tip-decoration { color:#4384d10c; }
html[data-theme="light"] .template-card { background:linear-gradient(145deg,#fff,#edf4ff); border-color:#d2e1f5; }
html[data-theme="light"] .template-card:hover { border-color:#8bb2e1; box-shadow:0 14px 34px #355f9210; }
html[data-theme="light"] .template-art { color:#6394d0; border-color:#cbdff7; background:radial-gradient(ellipse at 50% 90%,#bedaff66,transparent); }
html[data-theme="light"] :is(.template-card p,.guide-card p,.library-card p) { color:#718aae; }
html[data-theme="light"] .library-card:hover { background:#f8fbff; border-color:#9cbde8; }
html[data-theme="light"] .empty-state { border-color:#c3d6ef; }
html[data-theme="light"] .empty-state > span { color:#729bd1; }
html[data-theme="light"] .empty-state p { color:#7c92b1; }
html[data-theme="light"] :is(.guide-card pre,#json-source,#admin-record-json) { background:#f5f8fd; border-color:#d4e1f1; color:#3f6392; }
html[data-theme="light"] #json-source:focus { box-shadow:inset 2px 0 0 #6ba1e5; }
html[data-theme="light"] .main-footer { color:#7f95b1; border-color:#dce5f1; }
html[data-theme="light"] .main-footer > span:last-child { color:#8da3bf; }
html[data-theme="light"] dialog { background:#fff; border-color:#c5d8f1; box-shadow:0 30px 100px #254f8033; }
html[data-theme="light"] dialog::backdrop { background:#1d345c66; }
html[data-theme="light"] :is(dialog p,.setup-steps) { color:#6985a9; }
html[data-theme="light"] dialog code { color:#3776c3; }
html[data-theme="light"] .validation-error { color:#ad3c57; background:#fff1f3; border-color:#efc7d1; }
html[data-theme="light"] .button.danger { color:#fff; background:#ba4865; border-color:#a73a56; }
html[data-theme="light"] .button.danger:hover { color:#fff; background:#a83351; border-color:#972b47; }
html[data-theme="light"] .toast { background:#fff; color:#3d638e; border-color:#bdd5f3; box-shadow:0 8px 35px #294f7d22; }
html[data-theme="light"] .toast a { color:#276cc1; }
html[data-theme="light"] :is(.admin-stat > div,.admin-gate p,.admin-empty p) { color:#6d88ab; }
html[data-theme="light"] :is(.admin-stat > div > i,.admin-integrations .panel-top > i,.admin-lock,.admin-empty > i) { color:#6a98d1; }
html[data-theme="light"] #admin-integration-list > div { border-color:#dce6f3; }
html[data-theme="light"] #admin-integration-list > div > span { color:#7793b5; }
html[data-theme="light"] #admin-integration-list > div > strong { color:#4a6c96; }
html[data-theme="light"] .admin-search > i { color:#829dbc; }
html[data-theme="light"] .admin-table th { color:#7290b5; background:#f2f7fe; border-color:#d7e4f5; }
html[data-theme="light"] .admin-table td { color:#5f7da3; border-color:#e0e9f5; }
html[data-theme="light"] .admin-table td strong { color:#34577f; }
html[data-theme="light"] .admin-table td small { color:#8aa0bc; }
html[data-theme="light"] .admin-table tbody tr:hover { background:#eff6ff; }
html[data-theme="light"] :is(.admin-pagination,.admin-loading) { color:#7f98b9; }
html[data-theme="light"] .admin-footnote { color:#8ba1bd; }
html[data-theme="light"] .admin-delete:hover { color:#bb4a67; background:#fff0f3; border-color:#efcad5; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background:#c3d1e3; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background:#9cb3d2; }
@media(max-width:680px) {
  .topbar { gap:10px; }
  .topbar > div:first-child { display:none; }
  .account { width:100%; justify-content:flex-end; }
  .theme-toggle { margin-right:auto; }
  .theme-toggle-track { grid-template-columns:27px 27px; height:26px; }
  .theme-toggle-thumb { width:27px; height:26px; }
  html[data-theme="light"] .theme-toggle-thumb { transform:translateX(27px); }
}
@media(prefers-reduced-motion:reduce) {
  .theme-changing body { animation:none; }
  .theme-toggle-thumb,.theme-toggle-track > i { transition:none; }
}
