:root {
  color-scheme: light;
  --bg: #f2f5f3;
  --surface: #ffffff;
  --surface-muted: #e9eeeb;
  --surface-strong: #dfe6e2;
  --text: #1b211e;
  --text-muted: #64706a;
  --border: #d7dfda;
  --border-strong: #becac3;
  --green: #267a54;
  --green-strong: #1d6343;
  --green-soft: #e0f1e7;
  --cyan: #17798a;
  --cyan-soft: #dceff2;
  --amber: #a76516;
  --amber-soft: #f8ead5;
  --red: #b13b3b;
  --red-soft: #f7e1e1;
  --gray-soft: #e7ebe9;
  --shadow: 0 1px 2px rgba(25, 37, 31, 0.06), 0 8px 24px rgba(25, 37, 31, 0.04);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151816;
  --surface: #1d211f;
  --surface-muted: #242a27;
  --surface-strong: #2d3430;
  --text: #eef3f0;
  --text-muted: #9aa7a0;
  --border: #313a35;
  --border-strong: #46524b;
  --green: #52bd85;
  --green-strong: #72d49e;
  --green-soft: #1b3929;
  --cyan: #55bac8;
  --cyan-soft: #19363a;
  --amber: #e0a04d;
  --amber-soft: #3e301d;
  --red: #ee7777;
  --red-soft: #402525;
  --gray-soft: #2b302e;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-inner {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(1440px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 6px;
  background: var(--green);
  color: #ffffff;
  font-size: 19px;
  font-weight: 760;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #83e1a9;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 730;
}

.brand-copy span {
  color: var(--text-muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 86px;
  color: var(--text-muted);
  font-size: 12px;
}

.live-dot,
.overview-dot,
.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-muted);
}

.live-dot {
  width: 7px;
  height: 7px;
}

.live-state.is-live .live-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent);
}

.live-state.is-error .live-dot {
  background: var(--red);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.icon-button:focus-visible,
.segment:focus-visible,
th button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.icon-button.is-spinning span {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-band {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.status-band-inner {
  min-height: 142px;
  padding: 30px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 10px;
  font-weight: 760;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 730;
}

.status-copy {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.status-overview {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 220px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.overview-dot {
  width: 10px;
  height: 10px;
}

.overview-dot.is-good { background: var(--green); }
.overview-dot.is-warning { background: var(--amber); }
.overview-dot.is-error { background: var(--red); }
.overview-dot.is-loading { animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse {
  50% { opacity: 0.35; }
}

.status-overview div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.status-overview strong {
  font-size: 13px;
  font-weight: 700;
}

.status-overview span:last-child {
  color: var(--text-muted);
  font-size: 11px;
}

.section {
  padding: 34px 0 40px;
}

.section-alt {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.section-heading {
  min-height: 48px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 710;
}

.host-meta,
.section-count {
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.napcat-card,
.trend-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-width: 0;
  min-height: 126px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.metric-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.metric-value {
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.metric-detail {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: normal;
}

.meter {
  width: 100%;
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-strong);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.meter.is-warning span { background: var(--amber); }
.meter.is-danger span { background: var(--red); }

.trend-panel,
.network-panel {
  margin-top: 12px;
  padding: 16px 18px 14px;
}

.network-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.network-rate {
  min-height: 88px;
  padding: 13px 16px 12px 0;
}

.network-rate + .network-rate {
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.network-rate > span,
.network-rate small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
}

.network-rate strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.network-rate small {
  margin-top: 5px;
}

.network-rate small b {
  color: var(--text);
  font-weight: 620;
}

.network-chart-wrap {
  position: relative;
  width: 100%;
  height: 132px;
  margin-top: 10px;
}

#network-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.network-inbound strong { color: var(--cyan); }
.network-outbound strong { color: var(--green); }

.interface-list {
  margin-top: 2px;
}

.interface-row {
  min-height: 37px;
  display: grid;
  grid-template-columns: minmax(90px, 1.3fr) 1fr 1fr 1fr 1fr;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.interface-row:last-child { border-bottom: 0; }
.interface-row strong { color: var(--text); font-size: 11px; font-weight: 650; }
.interface-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.interface-row .interface-label { color: var(--text); }
.interface-row .interface-rx { color: var(--cyan); }
.interface-row .interface-tx { color: var(--green); }
.interface-empty { padding: 14px 0; color: var(--text-muted); font-size: 11px; }

.trend-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.trend-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 690;
}

.trend-header > div > span {
  color: var(--text-muted);
  font-size: 10px;
}

.trend-legend {
  display: flex;
  gap: 14px;
  color: var(--text-muted);
  font-size: 10px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trend-legend i {
  width: 14px;
  height: 2px;
}

.legend-cpu { background: var(--green); }
.legend-memory { background: var(--cyan); }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 164px;
  margin-top: 8px;
}

#trend-chart {
  display: block;
  width: 100%;
  height: 100%;
}

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

.napcat-card {
  min-width: 0;
  min-height: 132px;
  padding: 14px;
}

.napcat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.napcat-name {
  min-width: 0;
}

.napcat-name strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.napcat-name span {
  color: var(--text-muted);
  font-size: 10px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
}

.state-pill .status-dot {
  width: 6px;
  height: 6px;
}

.state-pill.is-online,
.state-pill.is-running {
  background: var(--green-soft);
  color: var(--green-strong);
}

.state-pill.is-offline,
.state-pill.is-unhealthy,
.state-pill.is-exited,
.state-pill.is-dead {
  background: var(--red-soft);
  color: var(--red);
}

.state-pill.is-unreachable,
.state-pill.is-restarting,
.state-pill.is-starting {
  background: var(--amber-soft);
  color: var(--amber);
}

.state-pill.is-stopped,
.state-pill.is-created,
.state-pill.is-paused,
.state-pill.is-none {
  background: var(--gray-soft);
  color: var(--text-muted);
}

.state-pill .status-dot { background: currentColor; }

.napcat-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.napcat-stat span {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
}

.napcat-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
}

.napcat-error {
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--red);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.containers-heading {
  margin-bottom: 14px;
}

.container-toolbar {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.segmented {
  display: inline-flex;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.segment {
  min-width: 86px;
  padding: 3px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
}

.segment span {
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}

.segment.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 30, 25, 0.1);
  font-weight: 670;
}

.search-box {
  position: relative;
  width: min(320px, 100%);
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 1;
  color: var(--text-muted);
  font-size: 15px;
  transform: translateY(-50%) rotate(-20deg);
  pointer-events: none;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  height: 42px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 650;
}

th:nth-child(1) { width: 31%; }
th:nth-child(2) { width: 13%; }
th:nth-child(3) { width: 12%; }
th:nth-child(4) { width: 18%; }
th:nth-child(5) { width: 14%; }
th:nth-child(6) { width: 12%; }

th button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
}

th button span {
  min-width: 8px;
  color: var(--green);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-muted) 55%, transparent);
}

.container-primary {
  min-width: 0;
}

.container-primary strong,
.container-primary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-primary strong {
  font-size: 12px;
  font-weight: 680;
}

.container-primary span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

.resource-cell {
  font-variant-numeric: tabular-nums;
}

.resource-cell strong {
  font-size: 11px;
  font-weight: 650;
}

.resource-cell span {
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 9px;
}

.resource-bar {
  width: 100%;
  max-width: 96px;
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-strong);
}

.resource-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.network-cell,
.uptime-cell {
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.network-cell strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 620;
}

.action-cell,
.napcat-actions {
  white-space: nowrap;
}

.action-cell {
  display: flex;
  align-items: center;
  gap: 5px;
}

.napcat-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.action-button {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.action-button:hover {
  border-color: var(--green);
  color: var(--green-strong);
  background: var(--green-soft);
}

.action-button.is-stop:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.action-button.is-start:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.action-button.is-link:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-soft); }
.actions-heading { width: 94px; }

.admin-button.is-authenticated {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-strong);
}

.admin-dialog {
  width: min(410px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 60px rgba(10, 18, 13, 0.26);
}

.admin-dialog::backdrop {
  background: rgba(10, 16, 12, 0.48);
  backdrop-filter: blur(3px);
}

.admin-dialog form { padding: 22px; }
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.dialog-heading h2 { margin: 0; font-size: 19px; line-height: 1.25; }
.dialog-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.dialog-close:hover { background: var(--surface-muted); color: var(--text); }
.token-label {
  display: block;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 11px;
}
.token-input {
  width: 100%;
  height: 40px;
  margin-top: 7px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}
.token-input:focus { border-color: var(--green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 20%, transparent); }
.auth-status { min-height: 18px; margin: 8px 0 0; color: var(--text-muted); font-size: 11px; }
.auth-status.is-error { color: var(--red); }
.auth-status.is-success { color: var(--green-strong); }
.dialog-actions { margin-top: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.text-button,
.primary-button {
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}
.text-button { border: 1px solid transparent; background: transparent; color: var(--text-muted); }
.text-button:hover { color: var(--text); background: var(--surface-muted); }
.primary-button { border: 1px solid var(--green); background: var(--green); color: #fff; font-weight: 680; }
.primary-button:hover { background: var(--green-strong); border-color: var(--green-strong); }
.primary-button:disabled { opacity: 0.55; cursor: wait; }

.empty-state {
  height: 120px;
  color: var(--text-muted);
  text-align: center;
  font-size: 12px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  background: var(--surface-muted);
  box-shadow: none;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 72%, transparent), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--text-muted);
  font-size: 10px;
}

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .napcat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .section-inner,
  .topbar-inner { width: min(100% - 28px, 1440px); }

  .topbar { height: 58px; }
  .brand-copy span { display: none; }
  .live-state { min-width: 0; }
  #live-label { display: none; }

  .status-band-inner {
    min-height: 0;
    padding: 24px 0;
    display: block;
  }

  h1 { font-size: 24px; }
  .status-overview {
    width: 100%;
    min-width: 0;
    margin-top: 20px;
  }

  .section { padding: 28px 0 32px; }
  .section-heading { margin-bottom: 14px; }
  .host-meta { max-width: 50%; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 116px; padding: 14px; }
  .metric-value { font-size: 21px; }
  .chart-wrap { height: 148px; }
  .network-rate { padding-right: 10px; }
  .network-rate + .network-rate { padding-left: 10px; }
  .interface-row { grid-template-columns: minmax(70px, 1fr) 1fr 1fr; gap: 8px; }
  .interface-row .interface-rx-rate,
  .interface-row .interface-tx-rate { display: none; }
  .napcat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .container-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented { width: 100%; }
  .segment { min-width: 0; flex: 1; }
  .search-box { width: 100%; }
  .table-shell { margin-right: -14px; border-radius: 6px 0 0 6px; }
  .napcat-actions { margin-top: 12px; }
  .admin-dialog form { padding: 18px; }
}

@media (max-width: 430px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 104px; }
  .napcat-grid { grid-template-columns: 1fr; }
  .napcat-card { min-height: 116px; }
  .status-copy { max-width: 300px; }
  .host-meta { max-width: 52%; }
  .section-heading h2 { font-size: 18px; }
}

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

/* QuakeWood-BOT visual language */
:root {
  --bg: #f4efe8;
  --surface: #fffaf4;
  --surface-muted: #eee6dd;
  --surface-strong: #e2d6c9;
  --text: #312b27;
  --text-muted: #746a61;
  --border: #ded2c6;
  --border-strong: #bbaa99;
  --green: #6f7f75;
  --green-strong: #40534c;
  --green-soft: #e1e8e2;
  --cyan: #718c88;
  --cyan-soft: #e0e9e7;
  --amber: #a9824e;
  --amber-soft: #f1e7d4;
  --red: #b96c4a;
  --red-soft: #f4e1d7;
  --gray-soft: #ece4dc;
  --chart-bg: #332b25;
  --chart-grid: rgba(255, 255, 255, 0.10);
  --chart-label: #cdbdac;
  --chart-cpu: #c3a36b;
  --chart-memory: #879b91;
  --chart-inbound: #d9c3ad;
  --chart-outbound: #91aa9c;
  --shadow: 0 12px 34px rgba(49, 43, 39, 0.055);
}

html[data-theme="dark"] {
  --bg: #211c19;
  --surface: #2c2622;
  --surface-muted: #352e29;
  --surface-strong: #493f37;
  --text: #f3e7d9;
  --text-muted: #b9aa9b;
  --border: #51463e;
  --border-strong: #75665a;
  --green: #91aa9c;
  --green-strong: #b6cbbf;
  --green-soft: #35463e;
  --cyan: #9ab7b2;
  --cyan-soft: #314744;
  --amber: #d0ad73;
  --amber-soft: #493b29;
  --red: #d88967;
  --red-soft: #503127;
  --gray-soft: #3b342f;
  --chart-bg: #171411;
  --chart-grid: rgba(255, 255, 255, 0.11);
  --chart-label: #b9aa9b;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

body {
  background:
    linear-gradient(90deg, rgba(160, 144, 126, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(160, 144, 126, 0.10) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

html[data-theme="dark"] body {
  background:
    linear-gradient(90deg, rgba(200, 185, 169, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(200, 185, 169, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
}

.section-inner,
.topbar-inner {
  width: min(1180px, calc(100% - 40px));
}

.topbar {
  height: 72px;
  border-color: rgba(222, 210, 198, 0.92);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 8px 24px rgba(49, 43, 39, 0.035);
}

.brand { gap: 12px; }

.brand-mark {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(49, 43, 39, 0.07);
}

.brand-mark::after { display: none; }

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy { display: block; }
.brand-copy strong { display: block; font-size: 15px; line-height: 1.15; }
.brand-copy span { display: block; margin-top: 3px; font-size: 12px; }

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 5px 16px rgba(49, 43, 39, 0.035);
}

.icon-button:hover {
  border-color: rgba(160, 144, 126, 0.76);
  background: var(--surface);
}

.status-band {
  border-bottom: 0;
  background: transparent;
}

.status-band-inner {
  min-height: 190px;
  padding: 46px 0 34px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #8c7a68;
  font-size: 11px;
  font-weight: 760;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
}

h1 {
  font-size: 44px;
  line-height: 1;
  font-weight: 780;
}

.status-copy {
  max-width: 680px;
  margin-top: 12px;
  font-size: 14px;
}

.status-overview {
  min-width: 246px;
  padding: 16px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 8px 24px rgba(49, 43, 39, 0.055);
}

.section {
  padding: 42px 0 50px;
  border-top: 1px solid rgba(222, 210, 198, 0.85);
}

.section-alt {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
}

.section-heading {
  margin-bottom: 20px;
  align-items: flex-end;
}

.section-heading h2 {
  font-size: 28px;
  line-height: 1;
  font-weight: 760;
}

.host-meta,
.section-count { margin-top: 17px; }

.metric-card,
.napcat-card {
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 130px;
  padding: 16px;
}

.metric-card:hover,
.napcat-card:hover {
  border-color: rgba(160, 144, 126, 0.72);
  transform: translateY(-1px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.metric-value { color: var(--text); font-size: 25px; font-weight: 780; }
.metric-label i { background: var(--green); }
.meter { background: var(--surface-strong); }

.trend-panel,
.network-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(49, 43, 39, 0.14);
  border-radius: 8px;
  background: var(--chart-bg);
  color: #f3e7d9;
  box-shadow: 0 18px 55px rgba(49, 43, 39, 0.09);
}

.trend-panel::before,
.network-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.38;
  pointer-events: none;
}

.trend-panel > *,
.network-panel > * { position: relative; }

.trend-header h3 { color: #f3e7d9; font-size: 14px; }
.trend-header > div > span,
.trend-legend,
.network-rate > span,
.network-rate small,
.interface-row { color: var(--chart-label); }

.network-rates,
.interface-row { border-color: var(--chart-grid); }
.network-rate + .network-rate { border-color: var(--chart-grid); }
.network-rate small b,
.interface-row strong,
.interface-row .interface-label { color: #f3e7d9; }
.network-inbound strong,
.interface-row .interface-rx { color: var(--chart-inbound); }
.network-outbound strong,
.interface-row .interface-tx { color: var(--chart-outbound); }
.legend-cpu { background: var(--chart-cpu); }
.legend-memory { background: var(--chart-memory); }

.napcat-card { min-height: 148px; }
.napcat-actions { border-top: 1px solid var(--border); padding-top: 10px; }

.state-pill.is-online,
.state-pill.is-running { color: var(--green-strong); }
.state-pill.is-offline,
.state-pill.is-unhealthy,
.state-pill.is-exited,
.state-pill.is-dead { color: var(--red); }

.segmented {
  border-radius: 7px;
  background: var(--surface-strong);
}

.segment { border-radius: 5px; }
.segment.is-active { background: var(--text); color: #fff; box-shadow: none; }

.search-box input {
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 8px 24px rgba(49, 43, 39, 0.045);
}

.table-shell {
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

th { background: var(--surface-strong); color: #655b52; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-muted) 58%, transparent); }

.action-button {
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.admin-dialog {
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(49, 43, 39, 0.18);
}

.admin-dialog::backdrop { background: rgba(49, 43, 39, 0.48); }
.token-input { background: #fffdf9; }
html[data-theme="dark"] .token-input { background: var(--bg); }
.primary-button { border-color: var(--text); background: var(--text); }
.primary-button:hover { border-color: #4a4039; background: #4a4039; }

footer { border-color: var(--border); background: color-mix(in srgb, var(--surface) 82%, transparent); }

@media (max-width: 760px) {
  .section-inner,
  .topbar-inner { width: min(100% - 28px, 1180px); }
  .topbar { height: 64px; }
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; }
  .status-band-inner { padding: 34px 0 30px; }
  h1 { font-size: 32px; }
  .section-heading h2 { font-size: 24px; }
  .section { padding: 34px 0 40px; }
  .trend-panel,
  .network-panel { padding: 15px; }
}

@media (max-width: 430px) {
  h1 { font-size: 29px; }
  .status-overview { margin-top: 22px; }
}