:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f1eb;
  --surface: #faf7f2;
  --panel: #ffffff;
  --panel-soft: #faf7f2;
  --elevated: #ffffff;
  --text: #28282c;
  --muted: #6b6760;
  --muted-2: #9a9098;
  --border: #e8e2d8;
  --accent: #e8a4b5;
  --accent-hover: #d98fa3;
  --accent-text: #28282c;
  --danger: #c75a4a;
  --danger-bg: #f7e4df;
  --success: #4f7d57;
  --success-bg: #e5efe5;
  --warning: #8b6d2f;
  --warning-bg: #f7edcf;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.07);
  --soft-shadow: 0 1px 2px rgba(0, 0, 0, 0.035);
  --gauge-muted: color-mix(in srgb, var(--muted) 20%, transparent);
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1a1d;
  --surface: #242428;
  --panel: #242428;
  --panel-soft: #202024;
  --elevated: #2d2d32;
  --text: #f0ede6;
  --muted: #9a958c;
  --muted-2: #817983;
  --border: #3a3a40;
  --accent: #facdd7;
  --accent-hover: #f5b8c5;
  --accent-text: #28282c;
  --danger: #e8a09a;
  --danger-bg: #3a2525;
  --success: #a9d2af;
  --success-bg: #243127;
  --warning: #e8cf8e;
  --warning-bg: #332d1d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(0, 0, 0, 0.22);
  --soft-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  --gauge-muted: color-mix(in srgb, var(--muted) 28%, transparent);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.58;
}

body,
button,
input {
  font: inherit;
}

button,
input {
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease, opacity 150ms ease, transform 150ms ease;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

::selection {
  background: color-mix(in srgb, var(--accent) 42%, transparent);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 36%, transparent);
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.brand-logo {
  display: block;
  image-rendering: pixelated;
  flex: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(430px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
}

.login-theme-switcher {
  justify-self: end;
}

.login-panel {
  display: grid;
  gap: 18px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--elevated);
  color: var(--text);
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 4px;
  text-align: center;
}

.login-brand h1 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: 0;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 520;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login-panel input:-webkit-autofill,
.login-panel input:-webkit-autofill:hover,
.login-panel input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0 1000px var(--panel) inset;
}

.primary,
.ghost,
.theme-switcher button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
}

.primary {
  min-height: 42px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 35%, transparent);
}

.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.compact {
  width: 100%;
}

.ghost {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-soft) 74%, transparent);
  color: var(--text);
}

.ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-soft));
}

.theme-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(64px, auto));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-soft) 78%, transparent);
}

.theme-switcher button {
  min-height: 30px;
  padding: 0 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.theme-switcher button.active {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--soft-shadow);
}

.error,
.error-banner {
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  border-radius: 16px;
  background: var(--danger-bg);
  color: var(--danger);
}

.error {
  padding: 10px 12px;
  font-size: 14px;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.status-hero,
.quick-panel,
.metric-card,
.panel {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--elevated) 92%, transparent);
  box-shadow: var(--shadow);
}

.status-hero {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 28px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 650;
  line-height: 1.1;
}

h2 {
  font-size: 1.05rem;
  font-weight: 650;
}

.status-badge {
  margin-left: auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.quick-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 24px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-meta span {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-soft));
}

.error-banner {
  padding: 12px 14px;
}

.hidden {
  display: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 12px 0;
}

.metric-card {
  min-height: 142px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 16px;
  border-radius: 24px;
}

.metric-label,
.metric-extra,
.panel-heading span,
.mini-card span {
  color: var(--muted);
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.metric-card strong {
  color: var(--text);
  font-size: 2rem;
  font-weight: 650;
  line-height: 1.05;
}

.metric-extra {
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.progress-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--accent));
  transition: width 260ms ease;
}

.gauge-card {
  justify-items: center;
  text-align: center;
}

.gauge-card .metric-label,
.gauge-card .metric-card__header,
.gauge-card .metric-extra {
  justify-self: stretch;
}

.temp-gauge {
  --gauge-percent: 0;
  --gauge-color: var(--muted);
  width: min(162px, 54vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(var(--gauge-color) calc(var(--gauge-percent) * 1%), var(--gauge-muted) 0),
    var(--panel-soft);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background 220ms ease;
}

.temp-gauge::before {
  content: "";
  grid-area: 1 / 1;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--elevated);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent);
}

.temp-gauge__center {
  grid-area: 1 / 1;
  z-index: 1;
  display: grid;
  gap: 2px;
  justify-items: center;
}

.temp-gauge__center strong {
  font-size: 1.35rem;
}

.temp-gauge__center span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.temp-cool {
  --gauge-color: var(--success);
}

.temp-warm {
  --gauge-color: var(--accent);
}

.temp-hot {
  --gauge-color: var(--warning);
}

.temp-critical {
  --gauge-color: var(--danger);
}

.temp-na {
  --gauge-color: var(--muted);
}

.panel {
  margin-top: 12px;
  padding: 16px;
  border-radius: 26px;
}

.warning-panel[data-has-warnings="true"] {
  border-color: color-mix(in srgb, var(--warning) 36%, var(--border));
  background: color-mix(in srgb, var(--warning-bg) 46%, var(--elevated));
}

.secondary-grid {
  display: grid;
  gap: 12px;
}

.secondary-grid .panel {
  margin-top: 0;
}

.collapsible-panel summary {
  cursor: pointer;
  list-style: none;
}

.collapsible-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel summary::after {
  content: "Open";
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-soft) 78%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.collapsible-panel[open] summary::after {
  content: "Close";
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.container-list,
.disk-list,
.warning-list,
.sensor-list {
  display: grid;
  gap: 8px;
}

.mini-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-left-width: 5px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel-soft) 86%, transparent);
  box-shadow: var(--soft-shadow);
}

.mini-card strong,
.mini-card span {
  overflow-wrap: anywhere;
}

.mini-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.mini-card__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mini-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mini-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.good {
  border-color: color-mix(in srgb, var(--success) 34%, var(--border));
  background: var(--success-bg);
  color: var(--success);
}

.status-pill.warn {
  border-color: color-mix(in srgb, var(--warning) 34%, var(--border));
  background: var(--warning-bg);
  color: var(--warning);
}

.status-pill.bad {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--border));
  background: var(--danger-bg);
  color: var(--danger);
}

.info-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--panel-soft) 72%, transparent);
  color: var(--muted);
  cursor: help;
  font-size: 13px;
  font-weight: 750;
}

.info-button:hover,
.info-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-soft));
  color: var(--text);
}

.info-tooltip {
  position: fixed;
  z-index: 100;
  max-width: min(340px, calc(100vw - 24px));
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--elevated);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  animation: tooltipIn 120ms ease;
}

@keyframes tooltipIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.usage-line {
  display: grid;
  gap: 6px;
}

.usage-line .progress-track {
  height: 8px;
}

.temperature-strip {
  display: grid;
  gap: 6px;
}

.temperature-strip__bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
}

.temperature-strip__bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.temperature-strip.temp-warm .temperature-strip__bar i {
  background: var(--accent);
}

.temperature-strip.temp-hot .temperature-strip__bar i {
  background: var(--warning);
}

.temperature-strip.temp-critical .temperature-strip__bar i {
  background: var(--danger);
}

.temperature-strip.temp-na .temperature-strip__bar i {
  background: var(--muted);
}

.mini-card.good {
  border-left-color: var(--success);
}

.mini-card.warn {
  border-left-color: var(--warning);
}

.mini-card.bad {
  border-left-color: var(--danger);
}

.mini-card.muted {
  border-left-color: var(--muted);
}

body[data-status="ok"] .status-badge {
  border-color: color-mix(in srgb, var(--success) 34%, var(--border));
  background: var(--success-bg);
  color: var(--success);
}

body[data-status="warning"] .status-badge {
  border-color: color-mix(in srgb, var(--warning) 34%, var(--border));
  background: var(--warning-bg);
  color: var(--warning);
}

body[data-status="critical"] .status-badge {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--border));
  background: var(--danger-bg);
  color: var(--danger);
}

@media (min-width: 520px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .shell {
    padding: 24px;
  }

  .status-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .hero-actions {
    justify-content: flex-end;
  }

  .primary-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .container-list,
  .disk-list,
  .sensor-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
