/* Dashboard-only design system; shared reader and owner styles remain independent. */
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #101318; --surface: #191e26; --soft: #222a35;
  --line: #323c49; --ink: #f1f5f9; --muted: #a8b5c5;
  --accent: #6ee7b7; --accent-soft: #18372d;
}
html[data-theme="light"] {
  color-scheme: light;
  --page: #f3f6f9; --surface: #fff; --soft: #edf2f7;
  --line: #d6dfe9; --ink: #172535; --muted: #526477;
  --accent: #047857; --accent-soft: #e5f5ee;
}
body.dashboard-shell { background: var(--page); color: var(--ink); font-size: 16px; line-height: 1.6; }
.dashboard-shell #main-header { background: var(--surface); border-color: var(--line); padding: 18px 32px 0; backdrop-filter: none; }
.dashboard-shell #main-header > div { max-width: 1480px; gap: 18px; }
.dashboard-shell #main-header > div > div:first-child { flex-wrap: wrap; row-gap: 16px; }
.dashboard-shell #main-header > div > div:last-child { border: 0; padding: 0; }
.dashboard-shell #bot-name { font-size: 18px; }
.dashboard-shell #main-nav-tabs { background: transparent; border: 0; border-radius: 0; padding: 0; gap: 6px; width: 100%; }
.dashboard-shell #main-nav-tabs > :is(button, a) { padding: 14px 16px; border-radius: 0; border-bottom: 3px solid transparent; font-size: 14px; color: var(--muted); }
.dashboard-shell .nav-tab.active-tab { background: transparent !important; color: var(--accent) !important; border-color: var(--accent) !important; box-shadow: none !important; }
.dashboard-shell .nav-tab.active-tab :is(span, svg) { color: var(--accent) !important; }
.dashboard-shell .nav-tab:not(.active-tab):hover { background: var(--soft); color: var(--ink) !important; }
.dashboard-shell .nav-tab:not(.active-tab):hover :is(span, svg) { color: var(--ink) !important; }
.dashboard-shell main { max-width: 1544px; padding: 32px; }
.dashboard-shell #dashboard-content { display: flex; flex-direction: column; gap: 24px; }
.dashboard-shell #dashboard-content.hidden { display: none; }
.dashboard-shell #dashboard-content > * { margin: 0; }
.dashboard-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dashboard-intro h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.04em; line-height: 1.3; margin: 4px 0 8px; }
.dashboard-intro p:not(.dashboard-eyebrow) { color: var(--muted); font-size: 15px; }
.dashboard-eyebrow { font-size: 12px; letter-spacing: .15em; color: var(--accent); font-weight: 700; }
.dashboard-reader-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.dashboard-reader-link svg { width: 17px; height: 17px; }
.dashboard-shell #server-banner { background: var(--surface); padding: 20px 24px; border-radius: 14px; }
.dashboard-shell #server-name { font-size: 20px; }
.dashboard-shell #dashboard-metrics { gap: 16px; }
.dashboard-shell #dashboard-metrics > div { padding: 20px; border-radius: 14px; min-width: 0; background: var(--surface); }
.dashboard-shell #dashboard-metrics [id^="metric-"][class~="text-2xl"] { font-size: clamp(26px, 2.3vw, 34px); font-family: inherit; font-variant-numeric: tabular-nums; }
.dashboard-shell #dashboard-metrics .uppercase { text-transform: none; letter-spacing: 0; font-size: 14px; }
.dashboard-shell #dashboard-metrics .font-mono { font-family: inherit; font-variant-numeric: tabular-nums; }
.dashboard-shell #dashboard-metrics .justify-between { flex-wrap: wrap; gap: 6px; }
.dashboard-workspace { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(0, 1.65fr); gap: 24px; align-items: start; }
.dashboard-workspace > * { min-width: 0; }
.dashboard-session > div, .dashboard-activity > section { padding: 24px; background: var(--surface); border-radius: 14px; }
.dashboard-activity > section { min-height: 440px; }
.dashboard-shell :is(h3, h4) { font-size: 17px; line-height: 1.4; }
.dashboard-shell :is(.text-xs, .text-sm) { font-size: 14px; line-height: 1.6; }
.dashboard-shell :is(.text-\[9px\], .text-\[10px\], .text-\[11px\]) { font-size: 12px; line-height: 1.5; }
.dashboard-shell :is(button, select, input:not([type="range"]):not([type="checkbox"]), textarea) { min-height: 40px; }
.dashboard-shell :is(select, input:not([type="range"]):not([type="checkbox"]), textarea) { font-size: 14px; }
.dashboard-shell :is(button, a, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.dashboard-shell input[type="range"] { accent-color: var(--accent); }
.dashboard-shell #btn-join-voice { background: var(--accent); color: var(--page); padding: 12px; }
.dashboard-shell #events-table-body td { padding: 14px 12px; vertical-align: top; }
.dashboard-shell table { font-size: 13px; }
.dashboard-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dashboard-disclosure { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; min-width: 0; overflow: hidden; }
.dashboard-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; cursor: pointer; padding: 20px 24px; font-size: 15px; font-weight: 700; }
.dashboard-disclosure > summary::-webkit-details-marker { display: none; }
.dashboard-disclosure > summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.dashboard-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.dashboard-disclosure[open] > summary svg { transform: rotate(180deg); }
.disclosure-body { padding: 20px 24px; }
.disclosure-body > div { border: 0; padding: 0; box-shadow: none; background: transparent; }
.dashboard-shell #saas-billing-widget { background: transparent; flex-direction: column; align-items: stretch; }
.dashboard-shell #saas-billing-widget > div:last-child { flex-wrap: wrap; width: 100%; }
.dashboard-shell #runtime-options .disclosure-body > div > div:first-child,
.dashboard-shell #budget-options .disclosure-body > div > div:first-child,
.dashboard-shell #role-options .disclosure-body > div > div:first-child { display: none; }
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.theme-toggle svg { width: 18px; height: 18px; }
.dashboard-shell #sse-status-box { border: 0; background: transparent; }
.dashboard-shell #sse-status-text { font-family: inherit; }
.dashboard-shell #main-header .font-mono { font-family: inherit; }
.dashboard-shell #main-header :is(.animate-pulse, .animate-ping) { animation: none; }
.dashboard-shell ::-webkit-scrollbar-track { background: var(--page); }
.dashboard-shell ::-webkit-scrollbar-thumb { background: var(--line); }
.dashboard-shell ::selection { background: var(--accent-soft); color: var(--ink); }
/* Dark utility classes emitted by existing dynamic renderers inherit the palette. */
.dashboard-shell [class~="bg-dark-bg"], .dashboard-shell [class~="bg-dark-bg/60"], .dashboard-shell [class~="bg-dark-bg/80"] { background-color: var(--page); }
.dashboard-shell [class~="bg-dark-card"] { background-color: var(--surface); }
.dashboard-shell [class*="border-dark-border"] { border-color: var(--line); }
@media (max-width: 1100px) {
  .dashboard-workspace { grid-template-columns: minmax(0, 1fr); }
  .dashboard-secondary { grid-template-columns: minmax(0, 1fr); }
  .dashboard-shell #dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dashboard-shell #main-header { position: static; padding: 16px 16px 0; }
  .dashboard-shell main { padding: 24px 16px; }
  .dashboard-shell #main-header > div > div:first-child > div:last-child { width: 100%; }
  .dashboard-intro { align-items: flex-start; flex-direction: column; gap: 14px; }
  .dashboard-shell #server-banner { padding: 18px; }
  .dashboard-shell #server-banner > div:last-child { width: 100%; }
  .dashboard-shell #select-server-switcher { max-width: 100%; min-width: 0; flex: 1; }
  .dashboard-shell #dashboard-metrics > div { padding: 16px; }
  .dashboard-session > div, .dashboard-activity > section, .disclosure-body { padding: 18px; }
  .dashboard-disclosure > summary { padding: 18px; }
  .dashboard-shell #btn-open-feed-modal { display: none; }
}
@media (max-width: 380px) {
  .dashboard-shell #dashboard-metrics { grid-template-columns: minmax(0, 1fr); }
}

/* Light palette for server-rendered utility markup and runtime updates. */
html[data-theme="light"] .dashboard-shell [class~="bg-amber-500/20"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-amber-800/60"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-amber-900/60"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-amber-900/80"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-amber-950"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-amber-950/30"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-amber-950/60"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-amber-950/90"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-amber-950/95"] { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="bg-blue-500/20"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-blue-900/80"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-blue-950/70"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-bg"] { background-color: var(--page); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-bg/50"] { background-color: var(--page); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-bg/60"] { background-color: var(--page); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-bg/70"] { background-color: var(--page); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-bg/80"] { background-color: var(--page); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-bg/90"] { background-color: var(--page); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-bg/95"] { background-color: var(--page); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-border"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-card"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-card/40"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-card/50"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-card/90"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-emerald-500/20"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-emerald-900/60"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-emerald-950"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-emerald-950/20"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-emerald-950/40"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-emerald-950/50"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-emerald-950/60"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-emerald-950/80"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-indigo-900/60"] { background-color: #eef2ff; }
html[data-theme="light"] .dashboard-shell [class~="bg-indigo-950"] { background-color: #eef2ff; }
html[data-theme="light"] .dashboard-shell [class~="bg-indigo-950/60"] { background-color: #eef2ff; }
html[data-theme="light"] .dashboard-shell [class~="bg-indigo-950/80"] { background-color: #eef2ff; }
html[data-theme="light"] .dashboard-shell [class~="bg-purple-950/20"] { background-color: #faf0ff; }
html[data-theme="light"] .dashboard-shell [class~="bg-purple-950/60"] { background-color: #faf0ff; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-500/20"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-900/60"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-900/80"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-950"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-950/30"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-950/40"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-950/60"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-950/70"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-950/80"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-950/90"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-red-950/95"] { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="bg-rose-950/40"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-rose-950/50"] { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-slate-500"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-slate-600"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-slate-800"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-100"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-300"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-400"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-600"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-800"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-800/80"] { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-900"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-900/60"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-900/80"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-900/95"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-zinc-950"] { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="border-dark-bg"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-dark-border"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-dark-border/40"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-dark-border/50"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-dark-border/60"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-dark-border/70"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-dark-border/80"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-slate-700"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-zinc-200"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-zinc-500/60"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-zinc-600"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-zinc-700"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-zinc-700/60"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-zinc-700/80"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-zinc-800"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="border-zinc-800/80"] { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-amber-500/10"]:hover { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-amber-700/80"]:hover { background-color: #fff7e6; }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-dark-card"]:hover { background-color: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-dark-cardHover"]:hover { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-indigo-900/60"]:hover { background-color: #eef2ff; }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-red-900/50"]:hover { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-red-950/50"]:hover { background-color: #fff0f0; }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-rose-900/40"]:hover { background-color: var(--accent-soft); }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-zinc-700"]:hover { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-zinc-800"]:hover { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-zinc-800/40"]:hover { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="hover:bg-zinc-800/80"]:hover { background-color: var(--soft); }
html[data-theme="light"] .dashboard-shell [class~="hover:border-zinc-500"]:hover { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="hover:border-zinc-600"]:hover { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="hover:border-zinc-700"]:hover { border-color: var(--line); }
html[data-theme="light"] .dashboard-shell [class~="hover:text-amber-300"]:hover { color: #92400e; }
html[data-theme="light"] .dashboard-shell [class~="hover:text-red-200"]:hover { color: #b91c1c; }
html[data-theme="light"] .dashboard-shell [class~="hover:text-red-300"]:hover { color: #b91c1c; }
html[data-theme="light"] .dashboard-shell [class~="hover:text-red-400"]:hover { color: #b91c1c; }
html[data-theme="light"] .dashboard-shell [class~="hover:text-rose-300"]:hover { color: #be123c; }
html[data-theme="light"] .dashboard-shell [class~="hover:text-white"]:hover { color: var(--ink); }
html[data-theme="light"] .dashboard-shell [class~="hover:text-zinc-300"]:hover { color: var(--ink); }
html[data-theme="light"] .dashboard-shell [class~="hover:text-zinc-400"]:hover { color: var(--muted); }
html[data-theme="light"] .dashboard-shell [class~="text-amber-100"] { color: #92400e; }
html[data-theme="light"] .dashboard-shell [class~="text-amber-200"] { color: #92400e; }
html[data-theme="light"] .dashboard-shell [class~="text-amber-300"] { color: #92400e; }
html[data-theme="light"] .dashboard-shell [class~="text-amber-300/80"] { color: #92400e; }
html[data-theme="light"] .dashboard-shell [class~="text-amber-300/90"] { color: #92400e; }
html[data-theme="light"] .dashboard-shell [class~="text-amber-400"] { color: #92400e; }
html[data-theme="light"] .dashboard-shell [class~="text-blue-200"] { color: #1d4ed8; }
html[data-theme="light"] .dashboard-shell [class~="text-blue-300"] { color: #1d4ed8; }
html[data-theme="light"] .dashboard-shell [class~="text-blue-400"] { color: #1d4ed8; }
html[data-theme="light"] .dashboard-shell [class~="text-cyan-400"] { color: #0e7490; }
html[data-theme="light"] .dashboard-shell [class~="text-emerald-200"] { color: #047857; }
html[data-theme="light"] .dashboard-shell [class~="text-emerald-300"] { color: #047857; }
html[data-theme="light"] .dashboard-shell [class~="text-emerald-400"] { color: #047857; }
html[data-theme="light"] .dashboard-shell [class~="text-emerald-500"] { color: #047857; }
html[data-theme="light"] .dashboard-shell [class~="text-indigo-300"] { color: #4338ca; }
html[data-theme="light"] .dashboard-shell [class~="text-indigo-400"] { color: #4338ca; }
html[data-theme="light"] .dashboard-shell [class~="text-indigo-600"] { color: #4338ca; }
html[data-theme="light"] .dashboard-shell [class~="text-purple-300"] { color: #7e22ce; }
html[data-theme="light"] .dashboard-shell [class~="text-purple-400"] { color: #7e22ce; }
html[data-theme="light"] .dashboard-shell [class~="text-red-200"] { color: #b91c1c; }
html[data-theme="light"] .dashboard-shell [class~="text-red-300"] { color: #b91c1c; }
html[data-theme="light"] .dashboard-shell [class~="text-red-400"] { color: #b91c1c; }
html[data-theme="light"] .dashboard-shell [class~="text-rose-300"] { color: #be123c; }
html[data-theme="light"] .dashboard-shell [class~="text-slate-200"] { color: var(--ink); }
html[data-theme="light"] .dashboard-shell [class~="text-slate-300"] { color: var(--ink); }
html[data-theme="light"] .dashboard-shell [class~="text-slate-400"] { color: var(--muted); }
html[data-theme="light"] .dashboard-shell [class~="text-slate-500"] { color: var(--muted); }
html[data-theme="light"] .dashboard-shell [class~="text-slate-600"] { color: var(--muted); }
html[data-theme="light"] .dashboard-shell [class~="text-white"] { color: var(--ink); }
html[data-theme="light"] .dashboard-shell [class~="text-zinc-100"] { color: var(--ink); }
html[data-theme="light"] .dashboard-shell [class~="text-zinc-200"] { color: var(--ink); }
html[data-theme="light"] .dashboard-shell [class~="text-zinc-300"] { color: var(--ink); }
html[data-theme="light"] .dashboard-shell [class~="text-zinc-400"] { color: var(--muted); }
html[data-theme="light"] .dashboard-shell [class~="text-zinc-500"] { color: var(--muted); }
html[data-theme="light"] .dashboard-shell [class~="text-zinc-600"] { color: var(--muted); }
html[data-theme="light"] .dashboard-shell [class~="text-zinc-950"] { color: var(--ink); }
html[data-theme="light"] .dashboard-shell :is(.bg-zinc-100, .bg-white) { background: var(--ink); color: #fff; }
html[data-theme="light"] .dashboard-shell :is(.bg-zinc-100, .bg-white) :is(span, svg) { color: #fff; }
html[data-theme="light"] .dashboard-shell :is(.bg-indigo-600, .bg-red-600, a[href="/api/auth/login"]) { color: #fff; }
html[data-theme="light"] .dashboard-shell :is(.bg-indigo-600, .bg-red-600, a[href="/api/auth/login"]) span { color: #fff; }
html[data-theme="light"] .dashboard-shell .active-btn { background: var(--accent-soft) !important; border-color: var(--accent) !important; color: var(--accent) !important; }
html[data-theme="light"] .dashboard-shell .active-btn :is(span, svg) { color: var(--accent) !important; }
html[data-theme="light"] .dashboard-shell [class~="bg-dark-bg/95"] { background: var(--surface); }
html[data-theme="light"] .dashboard-shell [class~="bg-black/60"], html[data-theme="light"] .dashboard-shell [class~="bg-black/80"] { background: rgba(15, 23, 42, .5); }
html[data-theme="light"] .dashboard-shell #saas-billing-widget { background-image: none; }
.dashboard-shell #main-header > div > div:first-child > div:last-child { min-width: 0; max-width: 100%; flex-shrink: 1; }
.dashboard-session { display: flex; flex-direction: column; gap: 20px; }
.dashboard-shell #voice-members-card { padding: 20px; }
html[data-theme="light"] .dashboard-shell .btn-lang-choice.bg-zinc-800 { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 1200px) {
  .dashboard-shell #main-header > div > div:first-child > div:last-child { width: 100%; }
}
@media (max-width: 640px) {
  .dashboard-shell #user-profile-box { max-width: 100%; }
  .dashboard-shell #server-banner > div:first-child { min-width: 0; }
  .dashboard-shell #server-banner > div:first-child p { flex-wrap: wrap; }
}

/* Language changes must not change the header's rows or control dimensions. */
.dashboard-shell #main-header > div { gap: 10px; }
.dashboard-shell #main-header .header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 48px 48px;
  gap: 10px;
  width: 100%;
}
.dashboard-shell #main-header .header-brand { height: 48px; min-width: 0; overflow: hidden; }
.dashboard-shell #main-header .header-brand > div:last-child { min-width: 0; }
.dashboard-shell #bot-name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.dashboard-shell #main-header .header-actions {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  height: 48px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 10px;
  scrollbar-width: none;
}
.dashboard-shell #main-header .header-actions::-webkit-scrollbar { display: none; }
.dashboard-shell .header-actions > * { flex: 0 0 auto; height: 42px; }
.dashboard-shell #btn-toggle-theme { width: 166px; justify-content: center; }
.dashboard-shell #sse-status-box { width: 166px; }
.dashboard-shell #btn-open-feed-modal { width: 170px; justify-content: center; }
.dashboard-shell #lang-switcher { width: 164px; justify-content: center; }
.dashboard-shell #lang-switcher button { width: 50px; min-height: 38px; justify-content: center; }
.dashboard-shell #lang-switcher button span { display: inline; }
.dashboard-shell #header-refresh-controls { width: 166px; justify-content: space-between; }
.dashboard-shell #header-refresh-controls > div:first-child { padding: 4px 8px; }
.dashboard-shell #header-refresh-controls > div:first-child > span:last-of-type,
.dashboard-shell #btn-refresh > span { display: none; }
.dashboard-shell #toggle-auto-refresh { width: 78px; text-align: center; }
.dashboard-shell #btn-refresh { width: 40px; justify-content: center; }
.dashboard-shell #auth-header-container { width: 292px; }
.dashboard-shell #user-profile-box { height: 42px; width: 292px; }
.dashboard-shell #user-name { width: 90px; min-width: 0; }
.dashboard-shell #user-role-badge { width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-shell #btn-discord-login { width: 292px; height: 42px; justify-content: center; overflow: hidden; }
.dashboard-shell #main-nav-tabs { height: 56px; align-items: stretch; }
.dashboard-shell #main-nav-tabs > :is(button, a) {
  flex: 0 0 176px;
  width: 176px;
  height: 56px;
  min-width: 0;
  justify-content: center;
  padding: 12px;
}
.dashboard-shell #main-nav-tabs > :is(button, a) > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-shell #main-nav-tabs svg { flex-shrink: 0; }
@media (min-width: 1800px) {
  .dashboard-shell #main-header .header-top { grid-template-columns: 330px minmax(0, 1fr); grid-template-rows: 48px; }
  .dashboard-shell #main-header > div { max-width: none; }
}
@media (max-width: 640px) {
  .dashboard-shell #btn-open-feed-modal { display: flex; }
  .dashboard-shell #btn-toggle-theme { width: 132px; }
  .dashboard-shell #sse-status-box { width: 166px; }
  .dashboard-shell #main-nav-tabs > :is(button, a) { flex-basis: 160px; width: 160px; }
}
html[data-theme="light"] .dashboard-shell .btn-lang-choice.bg-brand-600 { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 640px) {
  .dashboard-shell #lang-switcher { order: -1; }
}
