:root {
  --bg: #0e1116;
  --panel: #171c24;
  --line: #2a3340;
  --text: #e8edf4;
  --muted: #8b98a8;
  --ok: #3dd68c;
  --bad: #ff5c6a;
  --warn: #e6b84d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

.status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bad);
}

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

.status.stopped .dot {
  background: var(--bad);
}

h1 {
  margin: 0;
  font-size: 1.4rem;
}

.sub,
.heartbeat {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.tabs {
  display: flex;
  width: 100%;
  margin: 0;
}

.tabs button {
  flex: 1;
  text-align: center;
  background: #12171e;
  color: var(--muted);
  border: none;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 400;
  box-shadow: inset 0 3px 0 transparent;
}

.tabs button:last-child {
  border-right: none;
}

.tabs button.active {
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--panel);
  box-shadow: inset 0 3px 0 #2f6b4a;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--panel);
}

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.box.ok {
  border-color: #245c40;
}

.box.bad {
  border-color: #6b2430;
}

.box h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.box .code {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.box .when {
  color: var(--muted);
  font-size: 0.75rem;
  margin: 6px 0 8px;
}

.box .line {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  white-space: nowrap;
}

.box .line.empty {
  color: var(--bad);
}

.gate-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.gate-card h1 {
  margin-bottom: 4px;
}

.gate-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 12px 0 6px;
}

.gate-card input {
  width: 100%;
  background: #12171e;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
}

.gate-card button {
  margin-top: 16px;
  width: 100%;
  background: #2f6b4a;
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.gate-msg {
  display: none;
  color: var(--bad);
  font-size: 0.85rem;
  margin: 10px 0 0;
}

.gate-msg.show {
  display: block;
}
