/* Appearance settings: palettes, typography, spacing and the settings drawer. */

html {
  --theme-accent-light: #1682f8;
  --theme-accent-light-strong: #0769d7;
  --theme-accent-light-soft: #e8f3ff;
  --theme-accent-light-rgb: 22 130 248;
  --theme-accent-dark: #60a5fa;
  --theme-accent-dark-strong: #93c5fd;
  --theme-accent-dark-soft: #172f4a;
  --theme-accent-dark-rgb: 96 165 250;
  --theme-glow-a: rgb(63 166 255 / 0.16);
  --theme-glow-b: rgb(142 112 255 / 0.12);
  --ui-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ui-card-radius: 16px;
  --ui-control-radius: 10px;
  --ui-small-radius: 8px;
  --ui-avatar-radius: 11px;
  --ui-shell-x: 24px;
  --ui-shell-bottom: 36px;
  --ui-grid-gap: 14px;
  --ui-card-padding: 16px;
  --ui-nav-height: 44px;
  --ui-nav-gap: 10px;
}

html[data-theme-palette="ocean"] {
  --theme-accent-light: #2563eb;
  --theme-accent-light-strong: #1d4ed8;
  --theme-accent-light-soft: #e9efff;
  --theme-accent-light-rgb: 37 99 235;
  --theme-accent-dark: #74a7ff;
  --theme-accent-dark-strong: #a7c5ff;
  --theme-accent-dark-soft: #182b4f;
  --theme-accent-dark-rgb: 116 167 255;
  --theme-glow-a: rgb(37 99 235 / 0.17);
  --theme-glow-b: rgb(72 115 255 / 0.11);
}

html[data-theme-palette="mint"] {
  --theme-accent-light: #159669;
  --theme-accent-light-strong: #0f7a56;
  --theme-accent-light-soft: #e5f7ef;
  --theme-accent-light-rgb: 21 150 105;
  --theme-accent-dark: #4ad6a0;
  --theme-accent-dark-strong: #7ee9bd;
  --theme-accent-dark-soft: #17392f;
  --theme-accent-dark-rgb: 74 214 160;
  --theme-glow-a: rgb(21 150 105 / 0.15);
  --theme-glow-b: rgb(45 212 191 / 0.1);
}

html[data-theme-palette="violet"] {
  --theme-accent-light: #7357e8;
  --theme-accent-light-strong: #5b3dd0;
  --theme-accent-light-soft: #f0edff;
  --theme-accent-light-rgb: 115 87 232;
  --theme-accent-dark: #a491ff;
  --theme-accent-dark-strong: #c0b6ff;
  --theme-accent-dark-soft: #302a54;
  --theme-accent-dark-rgb: 164 145 255;
  --theme-glow-a: rgb(115 87 232 / 0.17);
  --theme-glow-b: rgb(168 85 247 / 0.13);
}

html[data-theme-palette="rose"] {
  --theme-accent-light: #e64f89;
  --theme-accent-light-strong: #c93672;
  --theme-accent-light-soft: #ffedf4;
  --theme-accent-light-rgb: 230 79 137;
  --theme-accent-dark: #ff78ac;
  --theme-accent-dark-strong: #ffa3c7;
  --theme-accent-dark-soft: #4a2233;
  --theme-accent-dark-rgb: 255 120 172;
  --theme-glow-a: rgb(230 79 137 / 0.16);
  --theme-glow-b: rgb(244 114 182 / 0.12);
}

html[data-theme-palette="sunset"] {
  --theme-accent-light: #ef6c4d;
  --theme-accent-light-strong: #d85235;
  --theme-accent-light-soft: #fff0e9;
  --theme-accent-light-rgb: 239 108 77;
  --theme-accent-dark: #ff8b6f;
  --theme-accent-dark-strong: #ffb29f;
  --theme-accent-dark-soft: #48271f;
  --theme-accent-dark-rgb: 255 139 111;
  --theme-glow-a: rgb(239 108 77 / 0.17);
  --theme-glow-b: rgb(251 191 36 / 0.1);
}

html[data-theme-palette="cyan"] {
  --theme-accent-light: #0e9fb6;
  --theme-accent-light-strong: #087a90;
  --theme-accent-light-soft: #e3f8fb;
  --theme-accent-light-rgb: 14 159 182;
  --theme-accent-dark: #45d6e8;
  --theme-accent-dark-strong: #7de5f1;
  --theme-accent-dark-soft: #16383e;
  --theme-accent-dark-rgb: 69 214 232;
  --theme-glow-a: rgb(14 159 182 / 0.16);
  --theme-glow-b: rgb(45 212 191 / 0.1);
}

html[data-theme-palette="graphite"] {
  --theme-accent-light: #5f6b7c;
  --theme-accent-light-strong: #414b59;
  --theme-accent-light-soft: #edf0f4;
  --theme-accent-light-rgb: 95 107 124;
  --theme-accent-dark: #aeb8c6;
  --theme-accent-dark-strong: #d2d8e0;
  --theme-accent-dark-soft: #2a313b;
  --theme-accent-dark-rgb: 174 184 198;
  --theme-glow-a: rgb(95 107 124 / 0.15);
  --theme-glow-b: rgb(100 116 139 / 0.1);
}

html[data-theme="light"][data-theme-palette] {
  --dash-primary: var(--theme-accent-light);
  --dash-primary-strong: var(--theme-accent-light-strong);
  --dash-primary-soft: var(--theme-accent-light-soft);
  --skin-accent: var(--theme-accent-light);
  --skin-accent-hover: var(--theme-accent-light-strong);
  --skin-accent-soft: var(--theme-accent-light-soft);
  --skin-accent-rgb: var(--theme-accent-light-rgb);
}

html[data-theme="dark"][data-theme-palette] {
  --dash-primary: var(--theme-accent-dark);
  --dash-primary-strong: var(--theme-accent-dark-strong);
  --dash-primary-soft: var(--theme-accent-dark-soft);
  --skin-accent: var(--theme-accent-dark);
  --skin-accent-hover: var(--theme-accent-dark-strong);
  --skin-accent-soft: var(--theme-accent-dark-soft);
  --skin-accent-rgb: var(--theme-accent-dark-rgb);
}

html[data-theme][data-theme-palette] body.dashboard-v2 {
  background:
    radial-gradient(circle at 48% -16%, var(--theme-glow-a), transparent 34rem),
    radial-gradient(circle at 96% 4%, var(--theme-glow-b), transparent 31rem),
    linear-gradient(135deg, var(--dash-bg), var(--dash-bg-2));
}

/* Font choices keep complete Chinese fallbacks on every platform. */
html[data-ui-font="auto"] {
  --ui-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-ui-font="sans"] {
  --ui-font-family: Inter, "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

html[data-ui-font="serif"] {
  --ui-font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
}

html[data-ui-font] body.dashboard-v2 {
  font-family: var(--ui-font-family) !important;
}

html[data-ui-font] body.dashboard-v2 button,
html[data-ui-font] body.dashboard-v2 input,
html[data-ui-font] body.dashboard-v2 select,
html[data-ui-font] body.dashboard-v2 textarea {
  font-family: inherit;
}

/* Radius presets are intentionally applied to the main visual surfaces only. */
html[data-ui-radius="none"] {
  --ui-card-radius: 2px;
  --ui-control-radius: 2px;
  --ui-small-radius: 2px;
  --ui-avatar-radius: 3px;
}

html[data-ui-radius="subtle"] {
  --ui-card-radius: 9px;
  --ui-control-radius: 7px;
  --ui-small-radius: 5px;
  --ui-avatar-radius: 7px;
}

html[data-ui-radius="balanced"] {
  --ui-card-radius: 16px;
  --ui-control-radius: 10px;
  --ui-small-radius: 8px;
  --ui-avatar-radius: 11px;
}

html[data-ui-radius="soft"] {
  --ui-card-radius: 21px;
  --ui-control-radius: 14px;
  --ui-small-radius: 11px;
  --ui-avatar-radius: 14px;
}

html[data-ui-radius="round"] {
  --ui-card-radius: 28px;
  --ui-control-radius: 19px;
  --ui-small-radius: 15px;
  --ui-avatar-radius: 18px;
}

html[data-ui-radius] body.dashboard-v2 .dashboard-card,
html[data-ui-radius] body.dashboard-v2 .dashboard-stats > article,
html[data-ui-radius] body.dashboard-v2 .server-card,
html[data-ui-radius] body.dashboard-v2 .community-publish-card,
html[data-ui-radius] body.dashboard-v2 .community-feed,
html[data-ui-radius] body.dashboard-v2 .community-post-card,
html[data-ui-radius] body.dashboard-v2 .chat-room,
html[data-ui-radius] body.dashboard-v2 .shop-item,
html[data-ui-radius] body.dashboard-v2 .content-card,
html[data-ui-radius] body.dashboard-v2 .profile-card,
html[data-ui-radius] body.dashboard-v2 .profile-binding-panel,
html[data-ui-radius] body.dashboard-v2 .profile-display-settings,
html[data-ui-radius] body.dashboard-v2 .player-activity-panel,
html[data-ui-radius] body.dashboard-v2 .server-detail-playtime,
html[data-ui-radius] body.dashboard-v2 .server-detail-drawer,
html[data-ui-radius] body.dashboard-v2 .starter-gift-panel {
  border-radius: var(--ui-card-radius) !important;
}

html[data-ui-radius] body.dashboard-v2 .site-nav button,
html[data-ui-radius] body.dashboard-v2 .sidebar-status,
html[data-ui-radius] body.dashboard-v2 .theme-button,
html[data-ui-radius] body.dashboard-v2 .sidebar-profile,
html[data-ui-radius] body.dashboard-v2 .sidebar-collapse-button,
html[data-ui-radius] body.dashboard-v2 .nav-toggle,
html[data-ui-radius] body.dashboard-v2 input,
html[data-ui-radius] body.dashboard-v2 select,
html[data-ui-radius] body.dashboard-v2 textarea,
html[data-ui-radius] body.dashboard-v2 .server-search,
html[data-ui-radius] body.dashboard-v2 .chart-range-tabs,
html[data-ui-radius] body.dashboard-v2 .chart-type-toggle,
html[data-ui-radius] body.dashboard-v2 .dashboard-heading__action,
html[data-ui-radius] body.dashboard-v2 .player-activity__refresh {
  border-radius: var(--ui-control-radius) !important;
}

html[data-ui-radius] body.dashboard-v2 .dashboard-stat__icon,
html[data-ui-radius] body.dashboard-v2 .sidebar-profile__avatar,
html[data-ui-radius] body.dashboard-v2 .top-profile-button__avatar,
html[data-ui-radius] body.dashboard-v2 .player-activity__avatar,
html[data-ui-radius] body.dashboard-v2 .server-playtime-avatar {
  border-radius: var(--ui-avatar-radius) !important;
}

/* Page density presets. */
html[data-ui-density="compact"] {
  --ui-shell-x: 16px;
  --ui-shell-bottom: 24px;
  --ui-grid-gap: 10px;
  --ui-card-padding: 12px;
  --ui-nav-height: 38px;
  --ui-nav-gap: 6px;
}

html[data-ui-density="default"] {
  --ui-shell-x: 24px;
  --ui-shell-bottom: 36px;
  --ui-grid-gap: 14px;
  --ui-card-padding: 16px;
  --ui-nav-height: 44px;
  --ui-nav-gap: 10px;
}

html[data-ui-density="relaxed"] {
  --ui-shell-x: 30px;
  --ui-shell-bottom: 42px;
  --ui-grid-gap: 18px;
  --ui-card-padding: 19px;
  --ui-nav-height: 48px;
  --ui-nav-gap: 12px;
}

html[data-ui-density="spacious"] {
  --ui-shell-x: 38px;
  --ui-shell-bottom: 52px;
  --ui-grid-gap: 22px;
  --ui-card-padding: 23px;
  --ui-nav-height: 52px;
  --ui-nav-gap: 14px;
}

html[data-ui-density] body.dashboard-v2.dashboard-v3 .shell {
  padding-right: var(--ui-shell-x);
  padding-bottom: var(--ui-shell-bottom);
  padding-left: var(--ui-shell-x);
}

html[data-ui-density] body.dashboard-v2.dashboard-v3 .dashboard-stats,
html[data-ui-density] body.dashboard-v2.dashboard-v3 .category-stack,
html[data-ui-density] body.dashboard-v2.dashboard-v3 .community-post-grid,
html[data-ui-density] body.dashboard-v2.dashboard-v3 .shop-grid {
  gap: var(--ui-grid-gap);
}

html[data-ui-density] body.dashboard-v2.dashboard-v3 .dashboard-stats > article {
  padding: var(--ui-card-padding);
}

html[data-ui-density] body.dashboard-v2.dashboard-v3 .site-nav {
  gap: var(--ui-nav-gap);
}

html[data-ui-density] body.dashboard-v2.dashboard-v3 .site-nav button {
  min-height: var(--ui-nav-height);
}

html[data-ui-density="compact"] body.dashboard-v2.dashboard-v3 .server-card__body,
html[data-ui-density="compact"] body.dashboard-v2.dashboard-v3 .community-post-card__body,
html[data-ui-density="compact"] body.dashboard-v2.dashboard-v3 .shop-item,
html[data-ui-density="compact"] body.dashboard-v2.dashboard-v3 .content-card {
  padding: 12px;
}

html[data-ui-density="relaxed"] body.dashboard-v2.dashboard-v3 .server-card__body,
html[data-ui-density="relaxed"] body.dashboard-v2.dashboard-v3 .community-post-card__body,
html[data-ui-density="relaxed"] body.dashboard-v2.dashboard-v3 .shop-item,
html[data-ui-density="relaxed"] body.dashboard-v2.dashboard-v3 .content-card {
  padding: 19px;
}

html[data-ui-density="spacious"] body.dashboard-v2.dashboard-v3 .server-card__body,
html[data-ui-density="spacious"] body.dashboard-v2.dashboard-v3 .community-post-card__body,
html[data-ui-density="spacious"] body.dashboard-v2.dashboard-v3 .shop-item,
html[data-ui-density="spacious"] body.dashboard-v2.dashboard-v3 .content-card {
  padding: 23px;
}

/* Sidebar presentation choices. */
html[data-sidebar-style="solid"] body.dashboard-v2.dashboard-v3 .site-bar,
html[data-sidebar-style="solid"] body.dashboard-v2.dashboard-v3 .app-header {
  background: var(--dash-sidebar) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-sidebar-style="solid"] body.dashboard-v2.dashboard-v3 .app-header {
  background: var(--dash-header) !important;
}

@media (min-width: 901px) {
  html[data-sidebar-style="floating"] body.dashboard-v2.dashboard-v3 .site-bar {
    top: 8px;
    right: auto;
    bottom: 8px;
    left: 8px;
    height: auto;
    border: 1px solid var(--dash-border);
    border-radius: calc(var(--ui-card-radius) + 2px);
    box-shadow: var(--dash-shadow);
  }

  html[data-sidebar-style="floating"] body.dashboard-v2.dashboard-v3 .app-header {
    left: 248px;
  }

  html[data-sidebar-style="floating"] body.dashboard-v2.dashboard-v3 .shell {
    margin-left: 240px;
  }

  html[data-sidebar-style="floating"] body.dashboard-v2.dashboard-v3.sidebar-collapsed .app-header {
    left: 84px;
  }

  html[data-sidebar-style="floating"] body.dashboard-v2.dashboard-v3.sidebar-collapsed .shell {
    margin-left: 76px;
  }
}

/* Drawer shell. */
.theme-settings-backdrop {
  position: fixed;
  z-index: 2990;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  background: rgb(15 23 42 / 0.34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

html[data-theme="dark"] .theme-settings-backdrop {
  background: rgb(0 0 0 / 0.52);
}

.theme-settings-panel {
  position: fixed;
  z-index: 3000;
  top: 0;
  right: 0;
  width: min(430px, 100vw);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  visibility: hidden;
  overflow: hidden;
  color: var(--dash-text);
  background: color-mix(in srgb, var(--dash-surface-solid) 94%, transparent);
  border-left: 1px solid var(--dash-border);
  box-shadow: -24px 0 70px -38px rgb(15 23 42 / 0.64);
  backdrop-filter: blur(28px) saturate(1.14);
  -webkit-backdrop-filter: blur(28px) saturate(1.14);
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(0.2, 0.72, 0.2, 1), visibility 220ms ease;
}

body.theme-settings-open {
  overflow: hidden !important;
}

body.theme-settings-open .theme-settings-backdrop,
body.theme-settings-open .theme-settings-panel {
  visibility: visible;
}

body.theme-settings-open .theme-settings-backdrop {
  opacity: 1;
}

body.theme-settings-open .theme-settings-panel {
  transform: translateX(0);
}

.theme-settings-header {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 11px;
  padding: 17px 18px 15px;
  border-bottom: 1px solid var(--dash-border);
}

.theme-settings-header__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--dash-primary);
  background: var(--dash-primary-soft);
  border: 1px solid color-mix(in srgb, var(--dash-primary) 18%, var(--dash-border));
  border-radius: var(--ui-control-radius);
}

.theme-settings-header__icon svg {
  width: 21px;
  height: 21px;
}

.theme-settings-header h2,
.theme-settings-header p {
  margin: 0;
}

.theme-settings-header h2 {
  color: var(--dash-heading);
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.theme-settings-header p {
  margin-top: 3px;
  color: var(--dash-muted);
  font-size: 10px;
  line-height: 1.45;
}

.theme-settings-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--dash-muted);
  background: var(--dash-surface-soft);
  border: 1px solid transparent;
  border-radius: var(--ui-control-radius);
  cursor: pointer;
}

.theme-settings-close:hover {
  color: var(--dash-heading);
  border-color: var(--dash-border);
}

.theme-settings-close svg {
  width: 18px;
  height: 18px;
}

.theme-settings-content {
  min-height: 0;
  padding: 2px 18px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border-strong) transparent;
}

.theme-settings-section {
  padding: 19px 0 20px;
  border-bottom: 1px solid var(--dash-border);
}

.theme-settings-section:last-child {
  border-bottom: 0;
}

.theme-settings-section__head {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.theme-settings-section__head h3,
.theme-settings-section__head span {
  margin: 0;
}

.theme-settings-section__head h3 {
  color: var(--dash-heading);
  font-size: 12px;
  font-weight: 760;
}

.theme-settings-section__head span {
  overflow: hidden;
  color: var(--dash-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-mode-grid,
.theme-font-grid,
.theme-sidebar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.theme-mode-grid > button,
.theme-font-grid > button,
.theme-radius-grid > button,
.theme-density-grid > button,
.theme-sidebar-grid > button,
.theme-palette-grid > button {
  min-width: 0;
  margin: 0;
  color: var(--dash-text);
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: var(--ui-control-radius);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 80ms ease;
}

.theme-mode-grid > button:hover,
.theme-font-grid > button:hover,
.theme-radius-grid > button:hover,
.theme-density-grid > button:hover,
.theme-sidebar-grid > button:hover,
.theme-palette-grid > button:hover {
  border-color: color-mix(in srgb, var(--dash-primary) 42%, var(--dash-border));
  transform: translateY(-1px);
}

.theme-mode-grid > button[aria-pressed="true"],
.theme-font-grid > button[aria-pressed="true"],
.theme-radius-grid > button[aria-pressed="true"],
.theme-density-grid > button[aria-pressed="true"],
.theme-sidebar-grid > button[aria-pressed="true"],
.theme-palette-grid > button[aria-pressed="true"] {
  color: var(--dash-primary);
  background: color-mix(in srgb, var(--dash-primary-soft) 70%, var(--dash-surface-solid));
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--dash-primary) 10%, transparent);
}

.theme-mode-grid > button {
  position: relative;
  display: grid;
  grid-template-rows: 48px auto;
  gap: 8px;
  padding: 7px;
  text-align: left;
}

.theme-mode-grid > button > span:nth-child(2) {
  min-width: 0;
  padding: 0 2px 2px;
}

.theme-mode-grid strong,
.theme-mode-grid small {
  display: block;
}

.theme-mode-grid strong {
  overflow: hidden;
  color: var(--dash-heading);
  font-size: 10px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-mode-grid small {
  margin-top: 2px;
  color: var(--dash-muted);
  font-size: 8px;
}

.theme-mode-grid > button > b {
  position: absolute;
  z-index: 2;
  top: 11px;
  right: 11px;
  width: 10px;
  height: 10px;
  border: 2px solid rgb(255 255 255 / 0.9);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 0.16);
}

.theme-mode-grid > button[aria-pressed="true"] > b {
  background: var(--dash-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--dash-primary) 22%, transparent);
}

.theme-mode-preview {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 17px 1fr;
  grid-template-rows: 12px 1fr;
  border: 1px solid rgb(100 116 139 / 0.22);
  border-radius: calc(var(--ui-small-radius) - 1px);
}

.theme-mode-preview i {
  display: block;
  border-radius: 2px;
}

.theme-mode-preview i:first-child {
  grid-row: 1 / 3;
  margin: 4px;
  background: #dce4ef;
}

.theme-mode-preview i:nth-child(2) {
  margin: 4px 5px 0 0;
  background: #d6deea;
}

.theme-mode-preview i:nth-child(3) {
  margin: 4px 5px 5px 0;
  background: #ffffff;
}

.theme-mode-preview.is-light {
  background: #f4f7fb;
}

.theme-mode-preview.is-dark {
  background: #152033;
  border-color: #2c3c58;
}

.theme-mode-preview.is-dark i:first-child,
.theme-mode-preview.is-dark i:nth-child(2) {
  background: #30405d;
}

.theme-mode-preview.is-dark i:nth-child(3) {
  background: #22314a;
}

.theme-mode-preview.is-system {
  background: linear-gradient(110deg, #f4f7fb 0 49.5%, #152033 50%);
}

.theme-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px 8px;
}

.theme-palette-grid > button {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 5px 5px 7px;
  background: transparent;
  border-color: transparent;
  text-align: center;
}

.theme-palette-grid > button > i {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 38px;
  display: block;
  border: 1px solid rgb(100 116 139 / 0.2);
  border-radius: var(--ui-small-radius);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3);
}

.theme-palette-grid > button > i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgb(255 255 255 / 0.36), transparent 50%);
}

.theme-palette-grid > button > i.is-blue { background: linear-gradient(135deg, #1682f8, #7ab9ff); }
.theme-palette-grid > button > i.is-ocean { background: linear-gradient(135deg, #1d4ed8, #55a4ff); }
.theme-palette-grid > button > i.is-mint { background: linear-gradient(135deg, #159669, #69e1b1); }
.theme-palette-grid > button > i.is-violet { background: linear-gradient(135deg, #7357e8, #bc8cff); }
.theme-palette-grid > button > i.is-rose { background: linear-gradient(135deg, #e64f89, #ff9cc2); }
.theme-palette-grid > button > i.is-sunset { background: linear-gradient(135deg, #ef6c4d, #ffc76c); }
.theme-palette-grid > button > i.is-cyan { background: linear-gradient(135deg, #0e9fb6, #77e1e7); }
.theme-palette-grid > button > i.is-graphite { background: linear-gradient(135deg, #3f4a59, #aeb8c6); }

.theme-palette-grid > button > span {
  overflow: hidden;
  color: var(--dash-text);
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-palette-grid > button > b {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 16px;
  height: 16px;
  display: none;
  place-items: center;
  color: #ffffff;
  background: rgb(15 23 42 / 0.72);
  border: 1px solid rgb(255 255 255 / 0.74);
  border-radius: 50%;
  font-size: 9px;
}

.theme-palette-grid > button[aria-pressed="true"] > b {
  display: grid;
}

.theme-font-grid > button {
  min-height: 68px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  padding: 8px 6px;
}

.theme-font-grid > button > b {
  color: var(--dash-heading);
  font-size: 19px;
  line-height: 1.15;
}

.theme-font-grid > button[data-ui-font="sans"] > b { font-family: Arial, "Microsoft YaHei", sans-serif; font-weight: 700; }
.theme-font-grid > button[data-ui-font="serif"] > b { font-family: Georgia, "Songti SC", SimSun, serif; font-weight: 700; }

.theme-font-grid > button > span {
  color: var(--dash-heading);
  font-size: 9px;
  font-weight: 680;
}

.theme-font-grid > button > small {
  color: var(--dash-muted);
  font-size: 8px;
}

.theme-radius-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.theme-radius-grid > button {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 7px 3px 6px;
}

.theme-radius-grid > button > i {
  width: 38px;
  max-width: 100%;
  height: 29px;
  display: block;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-bottom-color: transparent;
  opacity: 0.86;
}

.theme-radius-grid > button:nth-child(1) > i { border-radius: 0; }
.theme-radius-grid > button:nth-child(2) > i { border-radius: 5px 0 0; }
.theme-radius-grid > button:nth-child(3) > i { border-radius: 10px 0 0; }
.theme-radius-grid > button:nth-child(4) > i { border-radius: 15px 0 0; }
.theme-radius-grid > button:nth-child(5) > i { border-radius: 21px 0 0; }

.theme-radius-grid > button > span,
.theme-density-grid > button > span,
.theme-sidebar-grid > button > span {
  color: var(--dash-text);
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.theme-density-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.theme-density-grid > button {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 8px 5px 7px;
}

.theme-density-grid > button > i {
  width: 46px;
  max-width: 100%;
  height: 31px;
  display: grid;
  align-content: center;
}

.theme-density-grid > button > i > b {
  height: 2px;
  display: block;
  background: currentColor;
  border-radius: 2px;
}

.theme-density-grid > button:nth-child(1) > i { gap: 3px; }
.theme-density-grid > button:nth-child(2) > i { gap: 5px; }
.theme-density-grid > button:nth-child(3) > i { gap: 7px; }
.theme-density-grid > button:nth-child(4) > i { gap: 9px; }
.theme-density-grid > button > i > b:nth-child(2) { width: 76%; }
.theme-density-grid > button > i > b:nth-child(3) { width: 56%; }

.theme-sidebar-grid > button {
  display: grid;
  gap: 7px;
  padding: 7px 7px 6px;
}

.theme-sidebar-grid > button > i {
  position: relative;
  overflow: hidden;
  height: 48px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 7px 5px 7px 29px;
  background: color-mix(in srgb, var(--dash-surface-solid) 76%, var(--dash-bg));
  border: 1px solid var(--dash-border);
  border-radius: var(--ui-small-radius);
}

.theme-sidebar-grid > button > i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 23px;
  background: color-mix(in srgb, var(--dash-primary) 12%, var(--dash-sidebar));
  border-right: 1px solid var(--dash-border);
}

.theme-sidebar-grid > button > i.is-solid::before {
  background: var(--dash-sidebar);
}

.theme-sidebar-grid > button > i.is-floating::before {
  inset: 4px auto 4px 4px;
  width: 18px;
  border: 1px solid var(--dash-border);
  border-radius: 5px;
  box-shadow: 2px 2px 7px rgb(15 23 42 / 0.12);
}

.theme-sidebar-grid > button > i > b {
  height: 3px;
  display: block;
  background: var(--dash-border-strong);
  border-radius: 4px;
}

.theme-sidebar-grid > button > i > b:nth-child(2) { width: 76%; }
.theme-sidebar-grid > button > i > b:nth-child(3) { width: 56%; }

.theme-sidebar-state {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 11px;
  background: var(--dash-surface-soft);
  border: 1px solid var(--dash-border);
  border-radius: var(--ui-control-radius);
}

.theme-sidebar-state > span,
.theme-sidebar-state strong,
.theme-sidebar-state small {
  min-width: 0;
  display: block;
}

.theme-sidebar-state strong {
  color: var(--dash-heading);
  font-size: 9px;
}

.theme-sidebar-state small {
  margin-top: 2px;
  color: var(--dash-muted);
  font-size: 8px;
}

.theme-sidebar-state > div {
  flex: 0 0 auto;
  display: flex;
  gap: 3px;
  padding: 3px;
  background: color-mix(in srgb, var(--dash-border) 55%, transparent);
  border-radius: calc(var(--ui-small-radius) + 1px);
}

.theme-sidebar-state button {
  min-width: 48px;
  height: 28px;
  padding: 0 8px;
  color: var(--dash-muted);
  background: transparent;
  border: 0;
  border-radius: var(--ui-small-radius);
  cursor: pointer;
  font-size: 8px;
  font-weight: 680;
}

.theme-sidebar-state button[aria-pressed="true"] {
  color: var(--dash-primary);
  background: var(--dash-surface-solid);
  box-shadow: 0 2px 7px rgb(15 23 42 / 0.1);
}

.theme-settings-footer {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--dash-surface-solid) 92%, transparent);
  border-top: 1px solid var(--dash-border);
}

.theme-settings-status {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--dash-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-settings-footer > button {
  min-width: 96px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  color: var(--dash-primary);
  background: var(--dash-primary-soft);
  border: 1px solid color-mix(in srgb, var(--dash-primary) 24%, var(--dash-border));
  border-radius: var(--ui-control-radius);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.theme-settings-footer > button:hover {
  border-color: var(--dash-primary);
}

.theme-settings-footer > button svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 900px) {
  html[data-ui-density] body.dashboard-v2.dashboard-v3 .shell {
    padding-right: min(var(--ui-shell-x), 18px);
    padding-left: min(var(--ui-shell-x), 18px);
  }

  html[data-sidebar-style="floating"] body.dashboard-v2.dashboard-v3 .site-bar {
    top: 0;
    bottom: 0;
    left: 0;
    height: 100dvh;
    border-radius: 0;
  }
}

@media (max-width: 520px) {
  .theme-settings-panel {
    width: 100vw;
    border-left: 0;
  }

  .theme-settings-header {
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 9px;
    padding: 13px 14px 12px;
  }

  .theme-settings-header__icon {
    width: 38px;
    height: 38px;
  }

  .theme-settings-content {
    padding-right: 14px;
    padding-left: 14px;
  }

  .theme-settings-section {
    padding-block: 16px;
  }

  .theme-settings-footer {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 350px) {
  .theme-settings-header p {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .theme-mode-grid,
  .theme-font-grid,
  .theme-sidebar-grid {
    gap: 5px;
  }

  .theme-mode-grid > button,
  .theme-font-grid > button,
  .theme-sidebar-grid > button {
    padding-right: 5px;
    padding-left: 5px;
  }

  .theme-radius-grid,
  .theme-density-grid,
  .theme-palette-grid {
    gap: 5px;
  }

  .theme-sidebar-state {
    align-items: stretch;
    flex-direction: column;
  }

  .theme-sidebar-state > div {
    align-self: stretch;
  }

  .theme-sidebar-state button {
    flex: 1 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-settings-backdrop,
  .theme-settings-panel,
  .theme-mode-grid > button,
  .theme-font-grid > button,
  .theme-radius-grid > button,
  .theme-density-grid > button,
  .theme-sidebar-grid > button,
  .theme-palette-grid > button {
    transition: none !important;
  }
}
