:root {
  color-scheme: light dark;
  --bg: #0b0e14;
  --surface: #131722;
  --surface-2: #1b2130;
  --border: #262d3d;
  --text: #e6e9f0;
  --text-muted: #93a0b8;
  --accent: #5b8cff;
  --ok: #3ecf8e;
  --warn: #e0a832;
  --danger: #e0554f;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5bff);
  flex-shrink: 0;
}

h1 {
  font-size: 18px;
  margin: 0;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.login-panel {
  max-width: 420px;
  margin: 48px auto;
}

.login-panel h2 {
  margin-top: 0;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 13px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

label {
  font-size: 13px;
  color: var(--text-muted);
}

input[type="password"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
}

input[type="password"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: #fff;
  margin-top: 8px;
}

.button.primary:hover {
  filter: brightness(1.08);
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.button.ghost:hover {
  background: var(--surface-2);
}

.message {
  min-height: 20px;
  font-size: 13px;
  margin: 12px 0 0;
}

.message.error {
  color: var(--danger);
}

.message.info {
  color: var(--text-muted);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
}

.dot.connected {
  background: var(--ok);
}

.dot.error {
  background: var(--danger);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card.wide {
  margin-bottom: 12px;
}

.card-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.card-value {
  font-size: 16px;
  font-weight: 600;
  word-break: break-word;
}

.fallback-card .card-value {
  color: var(--ok);
}

.pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
}

.pill-list li {
  background: rgba(91, 140, 255, 0.14);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}

footer {
  margin-top: 32px;
  text-align: center;
}

@media (max-width: 480px) {
  .topbar {
    flex-wrap: wrap;
  }

  .login-panel {
    margin: 24px auto;
  }
}
