:root {
  color-scheme: dark;
  --bg: #0c0c0c;
  --bg-soft: #111111;
  --surface: #151515;
  --surface-2: #1c1c1c;
  --surface-3: #272727;
  --border: #393939;
  --border-soft: #2a2a2a;
  --text: #f2f2f2;
  --muted: #b0b0b0;
  --muted-2: #858585;
  --accent: #f2f2f2;
  --accent-strong: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --blue: #bdbdbd;
  --blue-soft: rgba(255, 255, 255, 0.08);
  --success: #d8ded8;
  --success-soft: rgba(255, 255, 255, 0.08);
  --warn: #c4c4c4;
  --warn-soft: rgba(255, 255, 255, 0.08);
  --danger: #dedede;
  --danger-soft: rgba(255, 255, 255, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --sidebar-width: 268px;
  --font: "Avenir Next", "Segoe UI Variable", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
}

::selection { background: rgba(255, 255, 255, 0.18); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffffff; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.9em; background: var(--surface-3); border: 1px solid var(--border-soft); border-radius: 6px; padding: 1px 6px; color: #eeeeee; }
hr { border: 0; border-top: 1px solid var(--border); }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[hidden] { display: none !important; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-200%);
  background: var(--accent);
  color: #111111;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  background: #101010;
  border-right: 1px solid var(--border-soft);
  overflow-y: auto;
  z-index: 30;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #111111;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: none;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 16px; letter-spacing: 0.01em; }
.brand-copy small { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); }
.sidebar-close { display: none; }
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  width: fit-content;
}
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.mode-chip.public .mode-dot { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }

.field-label, .server-select-label {
  display: block;
  margin-bottom: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.server-picker { position: relative; }
.server-picker-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 140ms ease, background 140ms ease;
}
.server-picker-button:hover { border-color: #4a584f; background: var(--surface-2); }
.server-picker-empty { color: var(--muted); }
.picker-chevron { margin-left: auto; color: var(--muted-2); }
.server-avatar-wrap { position: relative; width: 34px; height: 34px; flex: none; }
.picker-avatar { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.picker-avatar-fallback, .server-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--accent);
  font-weight: 800;
}
.server-picker-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.server-picker-copy strong, .server-picker-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-picker-copy strong { font-size: 13.5px; }
.server-picker-copy small { color: var(--muted-2); font-size: 11.5px; }
.server-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 40;
}
.server-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
}
.server-option:hover { background: var(--surface-2); }
.server-option-check { margin-left: auto; color: var(--accent); font-weight: 800; }
.server-picker-menu .server-picker-empty { padding: 12px; font-size: 13px; }

.main-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  margin: 14px 10px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 550;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.nav-button .icon { width: 17px; height: 17px; color: var(--muted-2); }
.nav-button:hover { color: var(--text); background: var(--surface); }
.nav-button.active { color: var(--accent-strong); background: var(--accent-soft); border-color: rgba(255, 255, 255, 0.18); }
.nav-button.active .icon { color: var(--accent); }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.sidebar-status { display: flex; flex-direction: column; gap: 5px; padding: 2px 2px 8px; }
.sidebar-status small { color: var(--muted-2); font-size: 11.5px; line-height: 1.4; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-align: left;
  font-size: 12.5px;
}
.sidebar-link:hover { color: var(--text); background: var(--surface); }
.sidebar-link .icon { width: 16px; height: 16px; }
.external-icon { width: 13px !important; height: 13px !important; margin-left: auto; }

.local-badge, .status-badge, .badge, .count-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}
.status-connected { color: var(--success); border-color: rgba(52, 211, 153, 0.25); background: var(--success-soft); }
.status-disconnected { color: var(--danger); border-color: rgba(248, 113, 113, 0.25); background: var(--danger-soft); }
.status-unavailable { color: var(--warn); border-color: rgba(251, 191, 36, 0.25); background: var(--warn-soft); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-connected .live-dot { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }

.main { min-width: 0; display: flex; flex-direction: column; padding: 26px 32px 20px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.topbar-left { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.page-heading { min-width: 0; }
.page-heading h1 { margin: 4px 0 3px; font-size: 30px; line-height: 1.15; letter-spacing: 0; }
.page-subtitle { margin: 0; max-width: 680px; color: var(--muted); font-size: 13.5px; }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.menu-toggle { display: none; }
.viewer-badge { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--text);
  background: var(--surface-2);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.button:hover { background: var(--surface-3); }
.button:active { transform: translateY(1px); }
.button .icon { width: 15px; height: 15px; }
.button-primary { color: #111111; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button-quiet { color: var(--muted); background: transparent; border-color: var(--border); }
.button-quiet:hover { color: var(--text); background: var(--surface); border-color: #555555; }
.button-danger { color: #111111; background: #bdbdbd; border-color: #bdbdbd; }
.button-danger:hover { background: #e0e0e0; }
.button.small { min-height: 31px; padding: 5px 9px; font-size: 11.5px; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.back-button .icon { transform: rotate(180deg); }

.notice {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.notice.visible { opacity: 1; transform: translateY(0); }
.notice.error { border-color: rgba(248, 113, 113, 0.35); background: #241214; color: #ffd4d4; }

.state-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
}
.state-icon .icon { width: 23px; height: 23px; }
.state-copy h2 { margin: 5px 0 6px; font-size: 21px; }
.state-copy p { margin: 0; color: var(--muted); max-width: 720px; }
.state-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-grid[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid[data-count="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 16px 17px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface);
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -50px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: transparent;
}
.stat-label { display: block; margin-bottom: 8px; color: var(--muted-2); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.stat-value { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -0.03em; }
.stat-detail { display: block; margin-top: 4px; color: var(--muted-2); font-size: 11.5px; }

.panel-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.panel-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel-highlight { border-color: rgba(255, 255, 255, 0.22); background: var(--surface); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.panel-heading h2, .panel-heading h3 { margin: 4px 0 3px; font-size: 17px; letter-spacing: -0.01em; }
.panel-heading p { margin: 0; color: var(--muted-2); font-size: 12.5px; }
.panel-heading .button { flex: none; }
.count-pill { color: var(--muted); background: var(--surface-2); }
.panel-actions-row { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.server-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  transition: border-color 140ms ease, transform 140ms ease;
}
.server-card:hover { border-color: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.server-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.server-card-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.server-card-copy strong, .server-card-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card-copy strong { font-size: 13.5px; }
.server-card-copy small { color: var(--muted-2); font-size: 11.5px; }
.server-card .button { width: 100%; }
.server-card-icon { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; flex: none; }
.server-card-fallback { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; flex: none; background: var(--surface-3); color: var(--accent); font-weight: 800; }

.health-list { display: flex; flex-direction: column; gap: 2px; }
.health-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.health-row:last-child { border-bottom: 0; }
.health-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.health-row-main .icon { color: var(--muted-2); }
.health-row-copy { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.health-row-copy strong { font-size: 12.5px; }
.health-row-copy small { color: var(--muted-2); font-size: 11px; }
.health-row-value { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; }
.health-row-value.ok { color: var(--success); }
.health-row-value.warn { color: var(--warn); }
.health-row-value.bad { color: var(--danger); }

.global-member-panel { margin-bottom: 14px; }
.member-distribution { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.member-distribution-row { min-width: 0; }
.member-distribution-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 11px; }
.member-distribution-heading strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.member-distribution-heading span { flex: none; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.member-distribution-track { height: 7px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.member-distribution-track i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--accent); }
.member-distribution-note { grid-column: 1 / -1; margin: 0; color: var(--muted-2); font-size: 10px; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: border-color 140ms ease, background 140ms ease;
}
.quick-card:hover { border-color: rgba(255, 255, 255, 0.3); background: var(--surface-3); }
.quick-card > .icon:first-child { color: var(--accent); }
.quick-card > .icon:last-child { margin-left: auto; color: var(--muted-2); width: 15px; height: 15px; }
.quick-card span { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.quick-card strong { font-size: 12.8px; }
.quick-card small { color: var(--muted-2); font-size: 11.2px; }

.server-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.server-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.server-icon { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; flex: none; background: var(--surface-2); }
.server-icon-fallback { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 8px; flex: none; background: var(--accent-soft); color: var(--accent-strong); font-size: 20px; font-weight: 800; }
.server-copy { min-width: 0; }
.server-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.server-title-row h2 { margin: 0; font-size: 23px; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-copy p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.server-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.view-panel { display: none; }
.view-panel.active { display: block; }

.analytics-block { display: flex; flex-direction: column; gap: 13px; }
.analytics-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.metric-tile { padding: 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.metric-tile span { display: block; color: var(--muted-2); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.metric-tile strong { display: block; margin-top: 4px; font-size: 19px; letter-spacing: -0.02em; }
.bar-chart { display: flex; flex-direction: column; gap: 7px; }
.chart-section { padding-top: 12px; border-top: 1px solid var(--border-soft); }
.chart-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--text); font-size: 11px; }
.chart-heading span { color: var(--muted-2); font-size: 10px; }
.activity-chart, .growth-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; height: 128px; padding: 10px 8px 0; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent 30px, var(--border-soft) 31px); }
.activity-day, .growth-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; }
.activity-value { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.activity-track, .growth-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 76px; }
.activity-track { border-radius: 3px 3px 0 0; background: var(--surface-2); }
.activity-track i, .growth-bars i { display: block; width: min(22px, 62%); border-radius: 3px 3px 0 0; background: var(--accent); }
.growth-bars .growth-join { background: #e7e7e7; }
.growth-bars .growth-leave { background: #7d7d7d; }
.activity-day small, .growth-day small { overflow: hidden; width: 100%; color: var(--muted-2); font-size: 8px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend { display: flex; gap: 14px; margin-top: 8px; color: var(--muted-2); font-size: 9px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; background: #e7e7e7; }
.chart-legend .growth-leave { background: #7d7d7d; }
.analytics-updated { margin: 0; color: var(--muted-2); font-size: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(76px, 132px) minmax(52px, 1fr) auto; align-items: center; gap: 10px; min-width: 0; }
.bar-row span { overflow: hidden; color: var(--muted-2); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bar-row b { min-width: 46px; color: var(--muted); font-size: 11px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-3); appearance: none; }
.bar-row progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.bar-row progress::-webkit-progress-value { background: var(--bar-color, linear-gradient(90deg, var(--accent-strong), var(--accent))); border-radius: 999px; }
.bar-row progress::-moz-progress-bar { background: var(--bar-color, linear-gradient(90deg, var(--accent-strong), var(--accent))); border-radius: 999px; }
.heatmap { display: flex; flex-direction: column; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.heatmap-grid { display: grid; grid-template-columns: 30px repeat(24, minmax(10px, 1fr)); align-items: center; gap: 3px; min-width: 540px; }
.heatmap-hour { color: var(--muted-2); font-size: 8px; font-variant-numeric: tabular-nums; text-align: center; }
.heatmap-day { color: var(--muted-2); font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.heatmap-cell { aspect-ratio: 1; min-height: 12px; border-radius: 2px; background: rgba(255, 255, 255, calc(0.045 + var(--heat, 0) * 0.78)); }
.heatmap-cell.empty { background: var(--surface-2); }
.heatmap-legend { align-items: center; }
.heat-legend-scale { width: 84px; height: 6px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.9)); }
.hourly-chart { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; height: 136px; padding: 10px 6px 0; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent 32px, var(--border-soft) 33px); }
.hour-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 0; }
.hour-value { min-height: 10px; color: var(--muted-2); font-size: 7.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hour-track { display: flex; align-items: flex-end; width: 100%; height: 78px; }
.hour-track i { display: block; width: 100%; max-width: 15px; margin: 0 auto; border-radius: 2px 2px 0 0; background: var(--accent); }
.hour-bar small { overflow: hidden; width: 100%; color: var(--muted-2); font-size: 7px; text-align: center; white-space: nowrap; }
.top-channel-list { display: flex; flex-direction: column; gap: 6px; }
.top-channel-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 8px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.top-channel-row strong { color: var(--text); font-weight: 600; }

.queue-list, .mini-module-list, .activity-list, .compact-list { display: flex; flex-direction: column; gap: 7px; }
.queue-item, .mini-module, .activity-item, .audit-item, .security-event, .role-row, .channel-row, .toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid transparent;
}
.activity-item, .audit-item, .security-event { align-items: flex-start; }
.activity-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.activity-item-main strong { font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.activity-item-main small, .activity-item-main span { color: var(--muted-2); font-size: 11.2px; line-height: 1.4; overflow-wrap: anywhere; }
.activity-item-main a { color: var(--accent); }
.queue-item { align-items: flex-start; }
.queue-item strong { font-size: 12.5px; }
.queue-item small { color: var(--muted-2); font-size: 11.2px; }
.queue-count { font-size: 17px; font-weight: 800; color: var(--accent); }
.mini-module { align-items: flex-start; }
.mini-module span { color: var(--muted-2); font-size: 11.2px; }
.mini-module strong { font-size: 12.5px; }
.empty-state { padding: 18px; text-align: center; color: var(--muted-2); font-size: 12.5px; border: 1px dashed var(--border); border-radius: 11px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; }
.chip.ok { color: var(--success); border-color: rgba(52, 211, 153, 0.22); background: var(--success-soft); }
.chip.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.22); background: var(--warn-soft); }
.chip.bad { color: var(--danger); border-color: rgba(248, 113, 113, 0.22); background: var(--danger-soft); }
.chip.info { color: var(--blue); border-color: rgba(124, 156, 255, 0.22); background: var(--blue-soft); }

.security-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.security-score { position: relative; width: 118px; height: 118px; flex: none; }
.score-ring { width: 118px; height: 118px; transform: rotate(-90deg); }
.score-track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.score-value { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 500ms ease, stroke 300ms ease; }
.score-value.good { stroke: var(--success); }
.score-value.warn { stroke: var(--warn); }
.score-value.bad { stroke: var(--danger); }
.score-copy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; line-height: 1.1; }
.score-copy strong { font-size: 25px; letter-spacing: -0.04em; }
.score-copy small { margin-top: 2px; color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.security-summary h2 { margin: 4px 0 5px; font-size: 20px; }
.security-summary p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; }
.security-actions { display: flex; flex-direction: column; gap: 8px; }

.finding-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 11px; border-radius: 10px; background: var(--surface-2); }
.finding-copy { min-width: 0; }
.finding-copy strong { display: block; font-size: 12.5px; }
.finding-copy small { color: var(--muted-2); font-size: 11.2px; }
.severity { flex: none; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.severity.critical { color: var(--danger); background: var(--danger-soft); }
.severity.high { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.severity.medium { color: var(--warn); background: var(--warn-soft); }
.severity.low { color: var(--blue); background: var(--blue-soft); }

.readonly-list .toggle-row { background: transparent; border: 1px solid var(--border-soft); }
.readonly-row .badge { margin-left: auto; flex: none; }
.toggle-row { cursor: default; }
.channel-setting-group { display: flex; flex-direction: column; gap: 8px; }
.channel-setting-group + .channel-setting-group { padding-top: 10px; border-top: 1px solid var(--border-soft); }
.settings-toolbar { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.settings-toolbar label { flex: none; }
.settings-toolbar select { min-width: 200px; width: auto; }
.settings-toolbar input[type="search"] { flex: 1; min-width: 180px; }
.settings-groups { display: flex; flex-direction: column; gap: 8px; }
.settings-group { border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-2); }
.settings-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; cursor: pointer; list-style: none; font-weight: 700; font-size: 12.5px; }
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary small { color: var(--muted-2); font-weight: 500; }
.settings-group[open] > summary { border-bottom: 1px solid var(--border-soft); }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.settings-fields .setting-field { display: flex; flex-direction: column; gap: 4px; }
.settings-fields .setting-field small { color: var(--muted-2); font-size: 10px; font-weight: 500; }
.settings-fields .toggle-row { grid-column: 1 / -1; }
.settings-fields textarea { min-height: 64px; }
.settings-toolbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.button-small { padding: 6px 10px; font-size: 11px; }
.setting-field-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.setting-field-label { display: flex; flex-direction: column; gap: 2px; color: var(--text); font-size: 12px; font-weight: 600; }
.setting-key { color: var(--muted-2); font-size: 10px; font-weight: 500; }
.setting-help { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.setting-default { color: var(--muted-2); font-size: 9.8px; overflow-wrap: anywhere; }
.setting-hint { color: var(--muted-2); font-size: 9.5px; }
.setting-reset { align-self: flex-start; border: 0; background: none; color: var(--muted); font: inherit; font-size: 10px; text-decoration: underline; cursor: pointer; padding: 0; }
.setting-reset:hover { color: var(--text); }
.setting-reset:disabled { opacity: 0.4; cursor: default; }
.setting-toggle-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.settings-dirty { color: var(--accent); font-weight: 600; }
.settings-save-row { position: sticky; bottom: 10px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.settings-copy-row { display: flex; align-items: center; gap: 8px; }
.settings-copy-row select { flex: 1; min-width: 0; }
select[multiple] { min-height: 96px; }
.settings-group[hidden], .settings-fields .setting-field[hidden], .settings-fields .toggle-row[hidden] { display: none; }
@media (max-width: 760px) { .settings-fields { grid-template-columns: 1fr; } }
.toggle-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toggle-row strong { font-size: 12.3px; line-height: 1.35; }
.toggle-row small { color: var(--muted-2); font-size: 11px; line-height: 1.4; }
.toggle-row input[type="checkbox"] { width: 34px; height: 18px; flex: none; appearance: none; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; transition: background 160ms ease, border-color 160ms ease; }
.toggle-row input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform 160ms ease, background 160ms ease; }
.toggle-row input[type="checkbox"]:checked { background: var(--accent-soft); border-color: rgba(255, 255, 255, 0.5); }
.toggle-row input[type="checkbox"]:checked::after { transform: translateX(16px); background: var(--accent); }
.toggle-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.module-toolbar { display: flex; gap: 9px; margin-bottom: 14px; }
.module-toolbar select { min-width: 190px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 16px; height: 16px; }
.search-field input { padding-left: 35px; }
input, select, textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus { border-color: rgba(255, 255, 255, 0.55); background: var(--surface); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted-2) 50%), linear-gradient(135deg, var(--muted-2) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { resize: vertical; min-height: 70px; }
label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
label input, label select, label textarea { margin-top: 5px; font-weight: 400; }
.stack-form { display: flex; flex-direction: column; gap: 10px; }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.inline-fields label { display: flex; flex-direction: column; gap: 0; }
.form-subheading { color: var(--text); font-size: 12.5px; padding-top: 2px; }
.helper-text { margin: 0; color: var(--muted-2); font-size: 11.5px; line-height: 1.45; }

.module-groups { display: flex; flex-direction: column; gap: 17px; }
.module-group-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.module-group-heading h3 { margin: 0; font-size: 14px; }
.module-group-heading p { margin: 2px 0 0; color: var(--muted-2); font-size: 11.5px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 9px; }
.module-card { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.module-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module-status { padding: 3px 7px; border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.module-status.status-on { color: var(--success); background: var(--success-soft); }
.module-status.status-off { color: var(--muted-2); background: var(--surface-3); }
.module-status.status-config { color: var(--warn); background: var(--warn-soft); }
.module-card h3 { margin: 0; font-size: 13px; line-height: 1.3; }
.module-card p { margin: 0; color: var(--muted-2); font-size: 11.5px; line-height: 1.4; }
.module-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: auto; padding-top: 5px; }
.module-card-bottom small { color: var(--muted-2); font-size: 10px; overflow-wrap: anywhere; }
.module-card-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.mini-switch { display: inline-flex; align-items: center; flex: none; cursor: pointer; }
.mini-switch input { width: 34px; height: 18px; appearance: none; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; margin: 0; padding: 0; transition: background 160ms ease; }
.mini-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform 160ms ease, background 160ms ease; }
.mini-switch input:checked { background: var(--accent-soft); border-color: rgba(255, 255, 255, 0.5); }
.mini-switch input:checked::after { transform: translateX(16px); background: var(--accent); }
.panel-hint { color: var(--muted-2); font-size: 10px; }

.search-row { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.search-row .search-field { flex: 1; }
.compact-search { margin-bottom: 12px; }
.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 9px; margin-top: 14px; }
.member-card { display: flex; flex-direction: column; gap: 9px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.member-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-3); }
.member-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.member-info strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-info small { color: var(--muted-2); font-size: 10.8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-roles { color: var(--muted-2); font-size: 10.8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.member-actions .button { min-height: 29px; padding: 4px 7px; font-size: 10.5px; }

.channel-list, .role-list { display: flex; flex-direction: column; gap: 6px; max-height: 620px; overflow-y: auto; padding-right: 2px; }
.channel-row { align-items: center; padding: 9px 10px; }
.channel-copy { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.channel-copy strong { font-size: 12.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-copy small { color: var(--muted-2); font-size: 10.8px; }
.channel-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.slowmode-form { display: flex; align-items: center; gap: 4px; }
.slowmode-form input { width: 64px; padding: 5px 7px; font-size: 11px; }
.role-row { padding: 8px 10px; }
.role-copy { display: flex; align-items: center; gap: 8px; min-width: 0; }
.role-swatch { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.role-copy strong { font-size: 12.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-meta { color: var(--muted-2); font-size: 10.8px; white-space: nowrap; }

.automation-groups { display: flex; flex-direction: column; gap: 18px; }
.automation-group h3 { margin: 0 0 8px; font-size: 13.5px; }
.automation-group .toggle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.automation-group .toggle-row { padding: 9px 10px; }

.settings-action-list { display: flex; flex-direction: column; gap: 7px; }
.settings-action { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px; text-align: left; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 11px; }
.settings-action:hover { background: var(--surface-3); border-color: var(--border); }
.settings-action .icon { color: var(--accent); }
.settings-action span { display: flex; flex-direction: column; line-height: 1.35; }
.settings-action strong { font-size: 12.3px; }
.settings-action small { color: var(--muted-2); font-size: 11px; }
.settings-action.danger .icon { color: var(--danger); }
.settings-action.danger:hover { border-color: rgba(248, 113, 113, 0.3); }

.footer { display: flex; justify-content: space-between; gap: 14px; margin-top: auto; padding: 22px 2px 4px; color: var(--muted-2); font-size: 10.8px; border-top: 1px solid var(--border-soft); }

.dialog { width: min(520px, calc(100vw - 30px)); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.dialog-wide { width: min(780px, calc(100vw - 30px)); }
.dialog::backdrop { background: rgba(3, 6, 10, 0.72); backdrop-filter: blur(4px); }
.dialog-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.dialog-fields { max-height: min(60vh, 560px); overflow-y: auto; padding-right: 4px; }
.dialog-card h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.dialog-card p { margin: 0; }
.dialog-close { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
.dialog-close:hover { color: var(--text); background: var(--surface-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.badge { font-size: 10.5px; padding: 4px 8px; }
.badge.ok { color: var(--success); background: var(--success-soft); border-color: rgba(52, 211, 153, 0.22); }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.22); }
.badge.bad { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.22); }
.badge.info { color: var(--blue); background: var(--blue-soft); border-color: rgba(124, 156, 255, 0.22); }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(3, 6, 10, 0.62); backdrop-filter: blur(3px); }

@media (max-width: 1180px) {
  .panel-grid.two-col { grid-template-columns: 1fr; }
  .security-hero { grid-template-columns: auto minmax(0, 1fr); }
  .security-actions { grid-column: 1 / -1; flex-direction: row; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, var(--sidebar-width));
    transform: translateX(-104%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-toggle { display: inline-flex; }
  .main { padding: 20px 18px 18px; }
  .topbar { align-items: flex-start; }
  .top-actions { justify-content: flex-start; }
  .viewer-badge { display: none; }
}

@media (max-width: 900px) {
  .stat-grid[data-count="4"], .stat-grid[data-count="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .main { padding: 16px 12px 14px; }
  .topbar { flex-direction: column; gap: 12px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .top-actions .button span { display: none; }
  .top-actions .button { min-width: 38px; padding: 8px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 21px; }
  .server-heading { align-items: flex-start; flex-direction: column; }
  .server-actions { width: 100%; }
  .panel { padding: 14px; }
  .panel-heading { flex-direction: column; align-items: flex-start; }
  .panel-heading .button { width: 100%; }
  .module-toolbar { flex-direction: column; }
  .module-toolbar select { min-width: 0; width: 100%; }
  .bar-row { grid-template-columns: minmax(64px, 96px) minmax(40px, 1fr) auto; gap: 7px; }
  .bar-row b { min-width: 38px; }
  .heatmap-grid { min-width: 520px; }
  .inline-fields { grid-template-columns: 1fr; }
  .security-hero { grid-template-columns: 1fr; justify-items: start; }
  .security-score { width: 100px; height: 100px; }
  .score-ring { width: 100px; height: 100px; }
  .score-copy strong { font-size: 22px; }
  .footer { flex-direction: column; gap: 4px; }
  .member-list { grid-template-columns: 1fr; }
  .dialog-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

::selection { background: rgba(255, 255, 255, 0.18); color: var(--text); }
html { scrollbar-color: #bdc9c0 var(--bg); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #bdc9c0; border: 3px solid var(--bg); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #9eada2; }
.sidebar, .server-picker-menu, .channel-list, .role-list { scrollbar-width: thin; scrollbar-color: #bdc9c0 transparent; }
:where(a, button, input, textarea, select, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button { transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease, color 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.button-primary { color: #111111; background: var(--accent); border-color: var(--accent); box-shadow: none; }
.button-primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); box-shadow: none; }
.button-danger { color: #111111; background: #bdbdbd; border-color: #bdbdbd; box-shadow: none; }
.button-danger:hover:not(:disabled) { background: #e0e0e0; box-shadow: none; }
.icon-button { transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease; }
.icon-button:hover { transform: translateY(-1px); }
.nav-button { position: relative; transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease; }
.nav-button:hover { transform: translateX(2px); }
.nav-button.active::before { content: ""; position: absolute; left: -1px; top: 50%; width: 3px; height: 17px; transform: translateY(-50%); border-radius: 999px; background: var(--accent); }
.server-picker-button { transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease; }
.server-picker-button:hover { box-shadow: 0 4px 12px rgba(31, 48, 37, 0.08); }
.server-picker-menu { box-shadow: 0 18px 40px rgba(31, 48, 37, 0.14); }
.server-option { transition: background 130ms ease, transform 130ms ease; }
.server-option:hover { transform: translateX(2px); }
.stat-card { transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.stat-card:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.24); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28); }
.stat-card::after { transition: transform 240ms ease, background 240ms ease; }
.stat-card:hover::after { transform: none; background: transparent; }
.panel { transition: border-color 180ms ease, box-shadow 180ms ease; }
.panel:hover { border-color: var(--border); box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22); }
.panel-highlight { box-shadow: none; }
.server-card, .quick-card, .module-card, .member-card, .settings-action { transition: border-color 150ms ease, transform 150ms ease, background 150ms ease, box-shadow 150ms ease; }
.server-card:hover, .quick-card:hover, .module-card:hover, .member-card:hover, .settings-action:hover { box-shadow: 0 8px 20px rgba(31, 48, 37, 0.08); }
.server-card:hover { transform: translateY(-2px); }
.quick-card:hover { transform: translateY(-2px); }
.module-card:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.24); }
.member-card:hover { border-color: var(--border); }
.activity-item, .queue-item, .mini-module, .audit-item, .security-event, .role-row, .channel-row, .finding-row { transition: background 140ms ease, border-color 140ms ease; }
.activity-item:hover, .queue-item:hover, .mini-module:hover, .audit-item:hover, .security-event:hover, .role-row:hover, .channel-row:hover, .finding-row:hover { background: var(--surface-3); }
.toggle-row { transition: background 140ms ease, border-color 140ms ease; }
.toggle-row:hover { background: var(--surface-3); }
.toggle-row input[type="checkbox"]:hover { border-color: rgba(255, 255, 255, 0.4); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1); }
.search-field input:focus { border-color: rgba(255, 255, 255, 0.55); }
.empty-state { background: linear-gradient(160deg, rgba(255, 255, 255, 0.012), transparent); border-color: var(--border); color: var(--muted); }
.score-value { filter: none; }
.score-value.good, .score-value.warn, .score-value.bad { filter: none; }
.live-dot { transition: box-shadow 200ms ease; }
.status-connected .live-dot { animation: none; }
.notice { transition: opacity 180ms ease, transform 180ms ease; }
.dialog { box-shadow: 0 24px 70px rgba(31, 48, 37, 0.2); }
.dialog::backdrop { background: rgba(24, 34, 28, 0.38); backdrop-filter: blur(3px); }
.dialog-card { gap: 11px; }
.view-panel.active { animation: panelIn 320ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.server-picker-menu:not(.hidden) { animation: menuIn 160ms ease both; }
.notice.visible { animation: noticeIn 220ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.button.is-loading { pointer-events: none; opacity: 0.8; }
.button.is-loading .icon { animation: spin 900ms linear infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); } 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-5px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes noticeIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 680px) {
  .panel:hover { box-shadow: none; }
  .stat-card:hover, .server-card:hover, .quick-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .status-connected .live-dot,
  .view-panel.active,
  .server-picker-menu:not(.hidden),
  .notice.visible,
  .button.is-loading .icon { animation: none !important; }
}

.module-card-top { gap: 8px; flex-wrap: wrap; }
.module-beta { padding: 3px 7px; border-radius: 999px; border: 1px solid rgba(251, 191, 36, 0.3); background: var(--warn-soft); color: var(--warn); font-size: 9.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.module-permission-badge { padding: 3px 7px; border-radius: 999px; border: 1px solid rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.12); color: var(--danger); font-size: 9.5px; font-weight: 700; }
.release-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 2px 0 22px; border-bottom: 1px solid var(--border); }
.release-header h2 { margin: 5px 0 4px; font-size: 27px; letter-spacing: 0; }
.release-header p { margin: 0; color: var(--muted); font-size: 13px; }
.release-current { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 142px; padding-left: 18px; border-left: 1px solid var(--border); }
.release-current span { color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; }
.release-current strong { color: var(--accent-strong); font-size: 21px; font-variant-numeric: tabular-nums; }
.changelog-list { display: flex; flex-direction: column; padding-top: 20px; }
.changelog-entry { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 20px; padding: 0 0 24px; }
.changelog-rail { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.changelog-version { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 4px 8px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 6px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.changelog-rail-line { width: 1px; flex: 1; background: var(--border); }
.changelog-content { min-width: 0; padding: 0 0 22px; border-bottom: 1px solid var(--border); }
.changelog-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.changelog-tag { padding: 3px 7px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.changelog-content h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: 0; }
.release-summary { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.release-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.release-group { min-width: 0; }
.release-group h4 { margin: 0 0 9px; color: var(--text); font-size: 12px; }
.release-group ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; line-height: 1.5; }
.release-group li { position: relative; padding-left: 13px; }
.release-group li::before { content: ""; position: absolute; top: 0.65em; left: 0; width: 5px; height: 5px; border-radius: 1px; background: var(--accent); }

.system-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(230px, 0.75fr);
  min-height: 218px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.06), transparent 50%), linear-gradient(145deg, #171717, #111111);
  box-shadow: var(--shadow);
}
.system-hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: 22px 24px; }
.system-hero-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 15px; }
.system-hero-heading h2 { margin: 0; font-size: 24px; font-weight: 650; line-height: 1.2; }
.system-hero-heading p { max-width: 460px; margin: 7px 0 0; color: var(--muted); font-size: 12.5px; }
.system-live { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: rgba(13, 17, 15, 0.55); font-size: 10px; font-weight: 750; white-space: nowrap; }
.system-live .live-dot { width: 6px; height: 6px; }
.system-hero[data-connection="connected"] .system-live { color: var(--success); border-color: rgba(255, 255, 255, 0.28); }
.system-hero[data-connection="disconnected"] .system-live,
.system-hero[data-connection="unavailable"] .system-live { color: var(--danger); border-color: rgba(255, 255, 255, 0.28); }
.system-telemetry { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; padding-top: 13px; border-top: 1px solid var(--border-soft); }
.system-telemetry div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.system-telemetry span { color: var(--muted-2); font-size: 9px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.system-telemetry strong { overflow: hidden; color: var(--text); font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.system-visual { position: relative; display: grid; min-height: 218px; overflow: hidden; place-items: center; border-left: 1px solid rgba(255, 255, 255, 0.12); background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.06), transparent 68%); }
.system-visual-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(90deg, transparent, #000 25%); }
.system-radar-ring, .system-radar-sweep { position: absolute; top: 50%; left: 50%; width: 142px; height: 142px; border-radius: 50%; transform: translate(-50%, -50%); }
.system-radar-ring { border: 1px solid rgba(151, 174, 158, 0.2); }
.system-radar-ring-inner { width: 88px; height: 88px; border-color: rgba(151, 174, 158, 0.16); }
.system-radar-sweep { background: conic-gradient(from 0deg, transparent 0deg 300deg, rgba(255, 255, 255, 0.28) 344deg, transparent 360deg); -webkit-mask: radial-gradient(circle, transparent 56%, #000 59%); mask: radial-gradient(circle, transparent 56%, #000 59%); animation: gatewaySweep 9s linear infinite; }
.system-hero[data-connection="disconnected"] .system-radar-sweep,
.system-hero[data-connection="unavailable"] .system-radar-sweep { animation-play-state: paused; opacity: 0.25; }
.system-core { position: relative; z-index: 1; display: grid; width: 52px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 8px; background: #1b1b1b; box-shadow: 0 0 24px rgba(255, 255, 255, 0.08); color: #ffffff; font-size: 13px; font-weight: 850; }
.system-node { position: absolute; z-index: 1; width: 7px; height: 7px; border: 1px solid #0c0c0c; border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14); }
.system-node-discord { top: calc(50% - 66px); left: calc(50% + 28px); }
.system-node-bot { top: calc(50% + 20px); left: calc(50% - 69px); }
.system-node-server { top: calc(50% + 50px); left: calc(50% + 41px); }
.system-visual-label { position: absolute; right: 14px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--muted-2); }
.system-visual-label span { font-size: 8px; font-weight: 750; letter-spacing: 0.1em; }
.system-visual-label strong { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; font-weight: 650; }
@keyframes gatewaySweep { to { transform: translate(-50%, -50%) rotate(1turn); } }

@media (max-width: 760px) {
  .release-header { align-items: flex-start; }
  .release-current { min-width: 112px; }
  .release-groups { grid-template-columns: 1fr; gap: 16px; }
  .system-hero { grid-template-columns: minmax(0, 1fr) 220px; }
}
@media (max-width: 520px) {
  .release-header { flex-direction: column; }
  .release-current { align-items: flex-start; padding: 0; border: 0; }
  .changelog-entry { grid-template-columns: 1fr; gap: 12px; }
  .changelog-rail { align-items: flex-start; }
  .changelog-rail-line { display: none; }
  .system-hero { grid-template-columns: 1fr; }
  .system-hero-copy { min-height: 202px; padding: 18px; }
  .system-visual { min-height: 170px; border-top: 1px solid rgba(151, 174, 158, 0.12); border-left: 0; }
  .system-hero-heading { flex-direction: column; gap: 11px; }
  .system-hero-heading h2 { font-size: 21px; }
  .system-telemetry { margin-top: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .system-radar-sweep { animation: none; }
}

/* --- Pilotage, tickets, contenus et outils --------------------------- */
.compact-stats { margin: 12px 0 16px; }
.compact-card { padding: 14px 16px; }
.compact-card span { color: var(--muted-2); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.compact-card strong { display: block; margin-top: 3px; font-size: 22px; letter-spacing: -0.02em; }
.compact-card small { color: var(--muted-2); font-size: 11px; }

.top-icon { position: relative; }
.notification-button { overflow: visible; }
.notification-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 10px; font-weight: 800; line-height: 18px; text-align: center; }
.freshness { padding: 5px 9px; border: 1px solid var(--border-soft); border-radius: 999px; color: var(--muted-2); font-size: 11px; white-space: nowrap; }

.notification-panel {
  position: fixed;
  top: 76px;
  right: max(18px, calc((100vw - 1480px) / 2));
  z-index: 60;
  width: min(430px, calc(100vw - 28px));
  max-height: min(70vh, 620px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.notification-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; border-bottom: 1px solid var(--border-soft); }
.notification-head strong { display: block; margin-top: 2px; font-size: 15px; }
.notification-list { display: flex; flex-direction: column; }
.notification-item { display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; color: var(--text); text-align: left; }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: var(--surface-2); }
.notification-dot { width: 8px; height: 8px; margin-top: 6px; flex: none; border-radius: 999px; background: var(--muted-2); }
.notification-dot.high { background: #f0b4b4; }
.notification-dot.medium { background: #f0d49a; }
.notification-dot.info { background: #b9c8f0; }
.notification-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notification-copy strong { font-size: 12.5px; }
.notification-copy small { color: var(--muted-2); font-size: 11px; }
.notification-item .icon { width: 14px; height: 14px; color: var(--muted-2); margin-top: 5px; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 14px; }
.filter-bar .search-field { flex: 1 1 280px; }
.filter-bar select { width: auto; min-width: 150px; }
.compact-check { gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }

.ticket-list { display: flex; flex-direction: column; gap: 9px; }
.ticket-card { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 16px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.ticket-card.is-breached { border-color: rgba(240, 180, 180, 0.42); background: linear-gradient(120deg, rgba(240, 180, 180, 0.06), transparent 60%), var(--surface); }
.ticket-main { display: flex; flex-direction: column; gap: 5px; min-width: min(100%, 420px); flex: 1; }
.ticket-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ticket-title-row strong { font-size: 13.5px; }
.ticket-main small { color: var(--muted-2); font-size: 11.2px; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted-2); font-size: 11px; }
.ticket-meta strong { color: var(--muted); }
.ticket-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ticket-actions select { width: auto; min-width: 110px; padding: 7px 9px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bug-description { margin: 2px 0 0; color: var(--muted); font-size: 12.2px; }
.bug-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 6px; }
.bug-editor select, .bug-editor input { width: auto; min-width: 140px; padding: 7px 9px; }
.bug-editor .bug-note { flex: 1 1 220px; }

.content-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; padding: 5px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); width: fit-content; }
.content-tab { padding: 8px 16px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 650; }
.content-tab:hover { color: var(--text); background: var(--surface-2); }
.content-tab.active { background: var(--surface-3); color: var(--text); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.form-row > div { display: flex; flex-direction: column; gap: 5px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.stacked-panels { display: flex; flex-direction: column; gap: 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.inline-form input { flex: 1 1 180px; width: auto; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.3px; }
.checkbox-row input { width: auto; }
.discord-preview { min-height: 140px; }
.discord-embed { padding: 14px 16px; border-left: 4px solid #1c1c1f; border-radius: 5px; background: var(--surface-2); }
.discord-embed strong { display: block; margin-bottom: 6px; font-size: 14px; color: #ffffff; }
.discord-embed p { margin: 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.discord-embed img { max-height: 220px; margin-top: 10px; border-radius: 6px; object-fit: cover; }
.discord-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.discord-buttons span { padding: 6px 12px; border-radius: 5px; background: var(--surface-3); color: var(--text); font-size: 11.5px; font-weight: 650; }
.article-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 2px; }
.article-editor { display: flex; flex-direction: column; gap: 9px; }
.rule-article { padding: 10px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface-2); }
.rule-article-head { display: flex; align-items: center; gap: 8px; }
.rule-number { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; }
.rule-title { flex: 1; width: auto; }
.rule-remove { width: 28px; height: 28px; color: var(--muted-2); font-size: 18px; line-height: 1; }
.rule-body { margin-top: 7px; }
.rolemenu-item .activity-item-main { gap: 4px; }
.onboarding-panel { margin-bottom: 12px; }
.onboarding-progress { height: 6px; margin: 4px 0 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.onboarding-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--text); transition: width 240ms ease; }
.onboarding-check { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border-radius: 999px; border: 1px solid var(--border); color: var(--muted-2); font-size: 11px; }
.onboarding-check.done { border-color: rgba(185, 230, 196, 0.4); background: rgba(185, 230, 196, 0.08); color: var(--success); }
.settings-action.is-done strong { color: var(--muted); }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 28px)); }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 12.5px; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42); animation: toast-in 160ms ease; }
.toast span { flex: 1; }
.toast.error { border-color: rgba(240, 180, 180, 0.4); }
.toast-action { padding: 4px 9px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text); font-size: 11.5px; font-weight: 700; }
.toast-action:hover { background: var(--surface-2); }
.toast-close { border: 0; background: transparent; color: var(--muted-2); font-size: 17px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.palette-dialog { width: min(620px, calc(100vw - 24px)); }
.palette-card { gap: 0; padding: 0; overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.palette-search .icon { color: var(--muted-2); }
.palette-search input { width: 100%; border: 0; background: transparent; color: var(--text); font-size: 15px; outline: none; }
.palette-results { max-height: min(56vh, 430px); overflow-y: auto; padding: 6px; }
.palette-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; }
.palette-result span { display: flex; flex-direction: column; gap: 1px; }
.palette-result strong { font-size: 13px; }
.palette-result small { color: var(--muted-2); font-size: 11px; }
.palette-result.active, .palette-result:hover { background: var(--surface-2); }
.palette-result kbd { color: var(--muted-2); font-size: 11px; }
.palette-footer { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border-soft); color: var(--muted-2); font-size: 10.5px; }
.palette-footer kbd, .dialog kbd { padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); font-size: 10px; }
.transcript-card { max-height: min(78vh, 760px); overflow: auto; }
.transcript-messages { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.transcript-message { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.transcript-message:first-child { border-top: 0; }
.transcript-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700; }
.transcript-body { min-width: 0; flex: 1; }
.transcript-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.transcript-head strong { font-size: 12.5px; }
.transcript-head small { color: var(--muted-2); font-size: 10.5px; }
.transcript-body p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.transcript-attachment { display: inline-block; margin-top: 4px; color: var(--accent); font-size: 11.5px; }

/* --- Thème clair ----------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f3f1;
  --bg-soft: #ececea;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --surface-3: #e8e8e5;
  --border: #c9c9c4;
  --border-soft: #deded9;
  --text: #161616;
  --muted: #505050;
  --muted-2: #737373;
  --accent: #161616;
  --accent-strong: #000000;
  --accent-soft: rgba(0, 0, 0, 0.08);
  --blue: #3b4f7a;
  --blue-soft: rgba(59, 79, 122, 0.09);
  --success: #2f6b43;
  --success-soft: rgba(47, 107, 67, 0.1);
  --warn: #8a6415;
  --warn-soft: rgba(138, 100, 21, 0.1);
  --danger: #9b3434;
  --danger-soft: rgba(155, 52, 52, 0.1);
  --shadow: 0 18px 48px rgba(30, 30, 30, 0.12);
}
:root[data-theme="light"] body {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
}
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .topbar,
:root[data-theme="light"] .notification-panel,
:root[data-theme="light"] .dialog,
:root[data-theme="light"] .server-picker-menu { background: var(--surface); }
:root[data-theme="light"] .toast { background: #ffffff; }
:root[data-theme="light"] .site-nav,
:root[data-theme="light"] .palette-result.active,
:root[data-theme="light"] .palette-result:hover { background: var(--surface-2); }
:root[data-theme="light"] .notification-count { background: #161616; color: #ffffff; }
:root[data-theme="light"] .dialog::backdrop { background: rgba(30, 30, 30, 0.45); }
:root[data-theme="light"] .discord-embed strong { color: #111111; }
:root[data-theme="light"] .button-danger { background: #9b3434; border-color: #9b3434; color: #ffffff; }
:root[data-theme="light"] .button-danger:hover:not(:disabled) { background: #b34444; }
:root[data-theme="light"] .button-primary { background: #161616; border-color: #161616; color: #ffffff; }
:root[data-theme="light"] .button-primary:hover:not(:disabled) { background: #333333; }

@media (max-width: 860px) {
  .notification-panel { top: 66px; right: 12px; left: 12px; width: auto; }
  .top-actions .freshness { display: none; }
  .ticket-card { flex-direction: column; }
  .ticket-actions { width: 100%; }
  .filter-bar select { flex: 1 1 140px; }
}
@media (max-width: 560px) {
  .content-tabs { width: 100%; }
  .content-tab { flex: 1; }
  .form-row { grid-template-columns: 1fr; }
  .toast-stack { right: 12px; bottom: 12px; }
}

/* ============================================================
   Graphiques animés et sparkline — noir et blanc
   ============================================================ */

.bar-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}
.bar-track i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--bar-color, var(--accent));
  transform-origin: left center;
  animation: barGrow 560ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.hour-track i { transform-origin: bottom center; animation: barRise 540ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.activity-track i, .growth-bars i { transform-origin: bottom center; animation: barRise 540ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.member-distribution-track i { transform-origin: left center; animation: barGrow 560ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }

.system-sparkline {
  --sparkline-line: #f2f2f2;
  margin-top: 14px;
  padding: 9px 11px 5px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.system-sparkline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.system-sparkline-head b { color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0; }
#system-sparkline { display: block; width: 100%; height: 44px; }
:root[data-theme="light"] .system-sparkline { --sparkline-line: #161616; background: rgba(0, 0, 0, 0.02); }

@keyframes barGrow { from { transform: scaleX(0); opacity: 0.5; } to { transform: scaleX(1); opacity: 1; } }
@keyframes barRise { from { transform: scaleY(0.05); opacity: 0.45; } to { transform: scaleY(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .bar-track i,
  .hour-track i,
  .activity-track i,
  .growth-bars i,
  .member-distribution-track i { animation: none; }
}
