/* Shared Artis palettes. Dark preserves the house look; X uses its black/blue palette. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151714; --bg-glow: #1e211c; --surface: #1e211c; --surface-2: #2a2d26;
  --surface-3: #34382e; --panel: #1e211c; --panel-2: #2a2d26;
  --line: #373c32; --line-strong: #505748;
  --text: #f3eee5; --text-2: #e1ddcf; --dim: #b7b8aa; --muted: #959b8b;
  --accent: #c6d3aa; --accent-bright: #e0e8ce; --accent-wash: rgba(198,211,170,.13);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f9f9; --bg-glow: #eef3f4; --surface: #ffffff; --surface-2: #eff3f4;
  --surface-3: #e4eaec; --panel: #ffffff; --panel-2: #eff3f4;
  --line: #d9e0e3; --line-strong: #aab7bd;
  --text: #0f1419; --text-2: #27313a; --dim: #536471; --muted: #657786;
  --accent: #1685ce; --accent-bright: #1d9bf0; --accent-wash: rgba(29,155,240,.12);
}
html[data-theme="x"] {
  color-scheme: dark;
  --bg: #000000; --bg-glow: #0b0d0e; --surface: #000000; --surface-2: #16181c;
  --surface-3: #202327; --panel: #0b0d0e; --panel-2: #16181c;
  --line: #2f3336; --line-strong: #53616b;
  --text: #f7f9f9; --text-2: #e7e9ea; --dim: #b0b3b8; --muted: #71767b;
  --accent: #1d9bf0; --accent-bright: #8ecdf8; --accent-wash: rgba(29,155,240,.13);
}

html[data-theme="light"] body, html[data-theme="x"] body {
  background: var(--bg) !important;
  color: var(--text) !important;
}
html[data-theme="light"] header,
html[data-theme="x"] header,
html[data-theme="light"] .pageBar,
html[data-theme="x"] .pageBar,
html[data-theme="light"] .topbar,
html[data-theme="x"] .topbar {
  background: color-mix(in srgb, var(--bg) 94%, transparent) !important;
  border-color: var(--line) !important;
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] button,
html[data-theme="x"] input,
html[data-theme="x"] select,
html[data-theme="x"] textarea,
html[data-theme="x"] button {
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="light"] .item,
html[data-theme="light"] .card,
html[data-theme="light"] .empty,
html[data-theme="light"] .chunk,
html[data-theme="light"] .overall,
html[data-theme="light"] .ttsBar,
html[data-theme="light"] .tile,
html[data-theme="light"] .theme-chip,
html[data-theme="light"] .tab,
html[data-theme="x"] .item,
html[data-theme="x"] .card,
html[data-theme="x"] .empty,
html[data-theme="x"] .chunk,
html[data-theme="x"] .overall,
html[data-theme="x"] .ttsBar,
html[data-theme="x"] .tile,
html[data-theme="x"] .theme-chip,
html[data-theme="x"] .tab {
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
}
html[data-theme="light"] .tile-archive,
html[data-theme="x"] .tile-archive,
html[data-theme="light"] .tab.is-active,
html[data-theme="x"] .tab.is-active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
}
html[data-theme="x"] .viewTabs button.active { color: #ffffff !important; }
html[data-theme="light"] .tile-archive,
html[data-theme="light"] .tab.is-active,
html[data-theme="light"] body #songPage #viewTabs > button.active,
html[data-theme="light"] .artis-settings-panel button[aria-pressed="true"] {
  background: #8ecdf8 !important;
  border-color: #1685ce !important;
  color: #0f1419 !important;
}
html[data-theme="light"] body #songPage #viewTabs > button.active {
  box-shadow: inset 0 0 0 999px #8ecdf8, inset 0 -2px #1685ce, 0 0 0 1px rgba(22,133,206,.28) !important;
}
html[data-theme="light"] body #songPage .lrow.tts-row-active {
  background-color: #dcefff !important;
  box-shadow: inset 0 0 0 999px #dcefff, inset 3px 0 #1685ce;
}

.artis-site-settings {
  position: relative;
  z-index: 100;
  flex: none;
  margin-left: auto;
  color: var(--text);
  font-family: system-ui, sans-serif;
}
.pageBar .artis-site-settings { margin-left: auto; }
.artis-site-settings > summary {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  cursor: pointer;
}
.artis-site-settings > summary::-webkit-details-marker { display: none; }
.artis-site-settings > summary:hover,
.artis-site-settings[open] > summary { color: var(--accent-bright); border-color: var(--line-strong); }
.artis-site-settings > summary:focus-visible,
.artis-settings-panel button:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.artis-settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  display: grid;
  gap: 12px;
  width: 224px;
  max-width: calc(100vw - 24px);
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,.32);
}
.artis-settings-panel fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.artis-settings-panel legend { margin: 0 0 7px; color: var(--dim); font-size: 11px; font-weight: 650; }
.artis-settings-size, .artis-settings-themes { display: flex; gap: 6px; }
.artis-settings-panel button {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  background: var(--surface-2) !important;
  color: var(--text) !important;
  font: 600 12px/1 system-ui, sans-serif;
  cursor: pointer;
}
.artis-settings-panel button:hover:not(:disabled) { border-color: var(--line-strong) !important; }
.artis-settings-panel button[aria-pressed="true"] {
  border-color: var(--accent) !important;
  background: var(--accent-wash) !important;
  color: var(--accent-bright) !important;
}
.artis-settings-panel button:disabled { opacity: .55; cursor: default; }

@media (max-width: 420px) {
  .artis-site-settings > summary { width: 30px; min-width: 30px; height: 30px; min-height: 30px; }
}
