/* neo-gigabot panel. Desktop-first; tokens swap for dark/light. */
:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --surface-2: #f0efec; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,.10); --accent: #2a78d6; --accent-ink: #ffffff;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b; --good-ink: #006300;
  --heat-0: #f0efec; --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #6da7ec; --heat-4: #3987e5; --heat-5: #1c5cab;
  --shadow: 0 1px 2px rgba(11,11,11,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #262624; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,.10); --accent: #3987e5;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --good-ink: #0ca30c;
    --heat-0: #262624; --heat-1: #0d366b; --heat-2: #184f95; --heat-3: #256abf; --heat-4: #3987e5; --heat-5: #86b6ef;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #262624; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,.10); --accent: #3987e5;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --good-ink: #0ca30c;
  --heat-0: #262624; --heat-1: #0d366b; --heat-2: #184f95; --heat-3: #256abf; --heat-4: #3987e5; --heat-5: #86b6ef;
  --shadow: none;
}

* { box-sizing: border-box; }
/* `hidden` must win over any component's own display rule. */
[hidden] { display: none !important; }
html { font-size: 14px; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; font-weight: 650; }
h2 { font-size: 1rem; margin: 0; font-weight: 600; }
h3 { font-size: .93rem; margin: 0 0 8px; font-weight: 600; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.dim { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand img, .brand .avatar-fallback { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); flex: none; }
.brand .name { font-weight: 650; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .state { font-size: .86rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.nav-group { margin-bottom: 14px; }
.nav-group .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 8px 4px; }
.nav-group a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--ink-2); }
.nav-group a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-group a.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.sidebar .foot { margin-top: auto; display: flex; gap: 6px; padding-top: 12px; }
.main { padding: 24px 32px 64px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-2); margin-top: 2px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ---- status dot (always paired with a text label) ---- */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.good { background: var(--good); } .dot.warning { background: var(--warning); } .dot.critical { background: var(--critical); }

/* ---- cards & grid ---- */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.span-2 { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card > .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card > .head .hint { color: var(--muted); font-size: .86rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .head { padding: 14px 16px 0; }
.section { margin-top: 24px; }
.section > h2 { margin-bottom: 10px; }
.stack > * + * { margin-top: 16px; }

.tile .label { color: var(--ink-2); font-size: .86rem; }
.tile .value { font-size: 1.7rem; font-weight: 650; line-height: 1.2; margin-top: 2px; }
.tile .value.hero { font-size: 3.5rem; white-space: nowrap; }
.tile.wide { grid-column: span 2; }
.tile .foot { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.delta.up { color: var(--good-ink); } .delta.down { color: var(--critical); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .86rem; padding: 8px 12px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid var(--grid); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--ink); }
th.sorted-asc::after { content: " ↑"; } th.sorted-desc::after { content: " ↓"; }
td.opts { min-width: 280px; max-width: 520px; color: var(--ink-2); word-break: break-word; }
.empty { color: var(--muted); padding: 24px 16px; text-align: center; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---- ranked bars ---- */
.rank { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 2px 12px; align-items: center; }
.rank .row { display: contents; }
.rank .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .n { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-2); }
.rank .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; margin-bottom: 8px; }
.rank .fill { display: block; height: 100%; min-width: 2px; background: var(--s1); border-radius: 0 3px 3px 0; }
.rank .fill.critical { background: var(--critical); }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: .82rem; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--border); }
.badge.OK, .badge.good { color: var(--good-ink); }
.badge.ERROR, .badge.critical { color: var(--critical); border-color: var(--critical); }
.badge.warning { color: var(--ink); border-color: var(--warning); }
.badge.new { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); font-family: var(--sans, inherit); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; vertical-align: 1px; }
.avatar { width: 22px; height: 22px; border-radius: 50%; vertical-align: -6px; margin-right: 6px; background: var(--surface-2); }
.avatar.lg { width: 56px; height: 56px; margin: 0; }
.avatar.sq { border-radius: 8px; }
/* Account menu: the signed-in user's chip opens the accounts on this browser. */
.acct { position: relative; min-width: 0; }
.whoami { display: inline-flex; align-items: center; max-width: 190px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--surface-2); cursor: pointer; list-style: none; user-select: none; }
.whoami::-webkit-details-marker { display: none; }
.whoami:hover, .acct[open] .whoami { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.whoami:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.whoami .avatar { margin-right: 7px; vertical-align: middle; flex: none; }
.whoami .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.whoami .caret { flex: none; width: 7px; height: 7px; margin: -3px 2px 0 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.acct[open] .whoami .caret { transform: rotate(225deg); margin-top: 3px; }
.acct .avatar.initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; color: #fff; background: var(--accent); }
.acctmenu { position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; width: max-content; min-width: 220px; max-width: min(300px, calc(100vw - 24px)); padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .22); }
.acct.up .acctmenu { top: auto; bottom: calc(100% + 8px); right: auto; left: 0; }
.acctwho { padding: 7px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acctwho strong { color: var(--ink); }
.acctmenu form { margin: 0; }
.acctitem { display: flex; align-items: center; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.acctitem:hover, .acctitem:focus-visible { background: var(--surface-2); text-decoration: none; }
.acctitem .avatar { flex: none; margin-right: 8px; vertical-align: middle; }
.acctitem .truncate { min-width: 0; }

/* ---- forms ---- */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=file], select, textarea {
  background: var(--surface); border: 1px solid var(--axis); border-radius: 6px; padding: 6px 9px; min-width: 0; max-width: 100%;
}
textarea { width: 100%; min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--axis); border-radius: 6px; padding: 6px 12px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical); border-color: var(--critical); }
.btn.small { padding: 2px 8px; font-size: .86rem; }
.btn[disabled], fieldset:disabled .btn { opacity: .5; cursor: not-allowed; box-shadow: none; }
fieldset:disabled input, fieldset:disabled textarea { opacity: .6; }
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg a { padding: 5px 11px; color: var(--ink-2); border-right: 1px solid var(--axis); }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: var(--surface-2); text-decoration: none; }
.seg a.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.inline { display: inline; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.field { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 4px 20px; padding: 12px 0; border-bottom: 1px solid var(--grid); align-items: start; }
.field:last-child { border-bottom: 0; }
.field label.name { font-weight: 550; padding-top: 5px; }
.field .help { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.field .control input[type=text], .field .control select:not([multiple]) { width: min(420px, 100%); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding-top: 5px; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); }
.checks { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 5px; }
.savebar { position: sticky; bottom: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 16px; box-shadow: 0 -2px 12px rgba(0,0,0,.08); }

/* multi-picker (enhanced <select multiple>) */
.picker { position: relative; width: min(560px, 100%); }
.picker .box { display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--axis); border-radius: 6px; padding: 4px; background: var(--surface); min-height: 34px; }
.picker .chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 4px; padding: 1px 4px 1px 8px; }
.picker .chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 3px; font-size: 1.05em; line-height: 1; }
.picker .chip button:hover { color: var(--critical); }
.picker input { border: 0; background: none; flex: 1; min-width: 120px; padding: 3px 4px; outline: none; }
.picker .menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); background: var(--surface); border: 1px solid var(--axis); border-radius: 6px; max-height: 260px; overflow-y: auto; box-shadow: 0 6px 24px rgba(0,0,0,.18); display: none; }
.picker.open .menu { display: block; }
.picker .opt { padding: 5px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.picker .opt:hover, .picker .opt.cursor { background: var(--surface-2); }
.picker .opt .grp { color: var(--muted); font-size: .86rem; }
.picker .none { padding: 8px 10px; color: var(--muted); }

/* ---- flash & banners ---- */
.flash { border: 1px solid var(--border); border-left-width: 4px; border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; background: var(--surface); overflow-wrap: anywhere; }
.flash.ok { border-left-color: var(--good); } .flash.error { border-left-color: var(--critical); } .flash.info { border-left-color: var(--accent); } .flash.warning { border-left-color: var(--warning); }

/* ---- charts ---- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .10; }
.chart .marker { stroke: var(--surface); stroke-width: 2; }
.chart .bar { transition: opacity .1s; }
.chart .bar.dim { opacity: .45; }
.chart .nodata { color: var(--muted); display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 20px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .86rem; color: var(--ink-2); margin-bottom: 6px; }
.legend .key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 6px; }
.tooltip { position: absolute; pointer-events: none; z-index: 30; background: var(--surface); border: 1px solid var(--axis); border-radius: 6px; padding: 7px 10px; font-size: .86rem; box-shadow: 0 6px 20px rgba(0,0,0,.18); white-space: nowrap; display: none; }
.tooltip .when { color: var(--muted); margin-bottom: 3px; }
.tooltip .line-row { display: flex; align-items: center; gap: 7px; }
.tooltip .line-row .key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tooltip .line-row b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tooltip .line-row span { color: var(--ink-2); }
details.chart-table { margin-top: 8px; font-size: .86rem; }
details.chart-table summary { color: var(--muted); cursor: pointer; width: max-content; }
details.chart-table .scroll { max-height: 240px; overflow: auto; margin-top: 6px; border: 1px solid var(--grid); border-radius: 6px; }
details.chart-table td, details.chart-table th { padding: 4px 10px; }

.heat { display: grid; grid-template-columns: max-content repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; font-size: 11px; color: var(--muted); }
.heat .cell { aspect-ratio: 1.5 / 1; border-radius: 2px; min-height: 14px; }
.heat .cell:hover { outline: 2px solid var(--ink); outline-offset: 0; }
.heat .hour { text-align: center; }
.heat .day { padding-right: 8px; }
.heat-0 { background: var(--heat-0); } .heat-1 { background: var(--heat-1); } .heat-2 { background: var(--heat-2); }
.heat-3 { background: var(--heat-3); } .heat-4 { background: var(--heat-4); } .heat-5 { background: var(--heat-5); }
.heat-scale { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.heat-scale i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.segbar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; }
.segbar i { display: block; height: 100%; min-width: 2px; }

/* ---- logs ---- */
.logbox { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; height: calc(100vh - 230px); min-height: 320px; overflow: auto; padding: 8px 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.logline { display: grid; grid-template-columns: 150px 74px minmax(0, 1fr); gap: 10px; padding: 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.logline:hover { background: var(--surface-2); }
.logline .t { color: var(--muted); white-space: nowrap; }
.logline .lv { color: var(--ink-2); }
.logline.ERROR .lv, .logline.CRITICAL .lv { color: var(--critical); font-weight: 700; }
.logline.WARNING .lv { color: var(--serious); font-weight: 700; }
.logline.ERROR, .logline.CRITICAL { box-shadow: inset 3px 0 0 var(--critical); }
.logline.WARNING { box-shadow: inset 3px 0 0 var(--warning); }
.logline .lg { color: var(--muted); }
.logline.hidden { display: none; }

/* ---- music ---- */
.session { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
.session img.thumb, .session .thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.session .title { font-weight: 600; }
.session ol { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); max-height: 150px; overflow-y: auto; }

/* ---- login ---- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 340px; }
.login input[type=password] { width: 100%; margin: 12px 0; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--grid); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .count { color: var(--muted); font-size: .86rem; margin-left: 4px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 12px; color: var(--ink-2); }
.diff { font-size: .86rem; margin-top: 4px; }
.diff .k { color: var(--ink-2); } .diff del { color: var(--critical); text-decoration: none; } .diff ins { color: var(--good-ink); text-decoration: none; }
.perm { display: flex; flex-wrap: wrap; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter i.warning { background: var(--warning); } .meter i.critical { background: var(--critical); }

@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 0 16px; }
  .main { padding: 16px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .field { grid-template-columns: 1fr; }
  .logline { grid-template-columns: 1fr; gap: 0; }
  /* Wide content scrolls inside its own card instead of stretching the page. */
  .card.flush { overflow-x: auto; }
  .card:has(> .heat) { overflow-x: auto; }
  .heat { min-width: 560px; }
  .seg { max-width: 100%; overflow-x: auto; }
  .page-head > input[type=search], .filters > input[type=search] { width: 100% !important; }
  .row-actions { flex-wrap: wrap; }
  td.opts { min-width: 180px; }
  .tile .value.hero { font-size: 2.6rem; }
  .logbox { height: calc(100dvh - 250px); }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .savebar { flex-wrap: wrap; }
}

/* Discord-style previews on the settings form */
.dpreview { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #313338; color: #dbdee1; font-size: .95rem; }
.dpreview .dlabel { font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: #b5bac1; margin-bottom: 8px; }
.dpreview .dlabel .muted, .dpreview .dname .muted { text-transform: none; letter-spacing: 0; font-weight: 400; color: #949ba4; }
.dpreview .dmsg { display: flex; gap: 12px; padding: 6px 0; }
.dpreview .davatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: #5865f2 url("/static/img/logo-64.png") center / cover; }
.dpreview .dname { font-weight: 600; color: #f2f3f5; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dpreview .dtag { background: #5865f2; color: #fff; font-size: .62rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.dpreview .dtext { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.3em; }
.dpreview .dmention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dpreview .dembed { margin-top: 6px; padding: 10px 14px; max-width: 420px; background: #2b2d31; border-left: 4px solid #5865f2; border-radius: 4px; }
.dpreview .dtitle { font-weight: 700; color: #f2f3f5; margin-bottom: 3px; }
.dpreview .dcard { margin-top: 6px; display: flex; gap: 16px; align-items: center; max-width: 420px; padding: 16px; border-radius: 8px; border-left: 0 solid #5865f2; background: linear-gradient(100deg, #12141f, #333a8c); }
.dpreview .dcircle { width: 62px; height: 62px; border-radius: 50%; flex: none; background: #36393f; border: 3px solid #5865f2; }
.dpreview .dcardsmall { font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: #c9cdfb; }
.dpreview .dcardname { font-size: 1.25rem; font-weight: 800; color: #fff; overflow-wrap: anywhere; }
.dpreview .dcardsub { font-size: .8rem; color: #c8cbd7; }

/* Beta panel: a tag beside the bot's name and a warm accent, so the test bot is never mistaken for the live one. */
.betatag { flex: none; margin-left: 7px; padding: 1px 6px; border-radius: 6px; background: #e8862c; color: #fff; font: 700 .64rem/1.5 system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase; vertical-align: middle; }
body.beta { --accent: #d9741a; --b1: #f0a23a; --b2: #ea7a2e; --b3: #e0524f; }
body.beta .sidebar { box-shadow: inset 0 3px 0 #e8862c; }
/* Bot switcher: the bot's name at the top of the sidebar opens the other panel. */
.brand .name { display: flex; align-items: center; }
.brand .name .truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.botswitch { margin-bottom: 14px; }
.botswitch > summary.brand { padding: 6px 8px; border-radius: 12px; cursor: pointer; list-style: none; user-select: none; }
.botswitch > summary.brand::-webkit-details-marker { display: none; }
.botswitch > summary.brand:hover, .botswitch[open] > summary.brand { background: var(--surface-2); }
.botswitch > summary.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.botswitch .caret { flex: none; width: 7px; height: 7px; margin: -3px 4px 0 auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.botswitch[open] .caret { transform: rotate(225deg); margin-top: 3px; }
.botswitch .acctmenu { left: 0; right: 0; width: auto; min-width: 0; top: calc(100% + 6px); }
.botswitch .acctitem .truncate { flex: 1; }
.botswitch .peerdot { flex: none; margin-left: 8px; }
