:root {
  --navy: #0F172A;
  --blue: #0369A1;
  --bg: #F8FAFC;
  --text: #020617;
  --muted: #64748B;
  --border: #E2E8F0;
  --surface: #FFFFFF;
  --green: #16A34A;
  --gray: #94A3B8;
  --red: #DC2626;
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 24px;
  height: 56px;
  background: var(--navy);
  color: #fff;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.tabs { display: flex; gap: 4px; }

.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: #CBD5E1;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.tab.is-active { color: #fff; background: var(--blue); }

.content { padding: 24px; max-width: 1200px; margin: 0 auto; }

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

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

.error {
  padding: 12px 16px;
  border-radius: 8px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--red);
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

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

th {
  background: #F1F5F9;
  color: var(--navy);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #F8FAFC; }

.version-cell { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.badge-built { background: #DCFCE7; color: var(--green); }
.badge-available { background: #F1F5F9; color: var(--muted); }
.badge-failed { background: #FEE2E2; color: var(--red); }
.badge-building {
  background: #E0F2FE;
  color: var(--blue);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.cell-stack { display: flex; align-items: center; gap: 8px; }

.btn {
  appearance: none;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: #075985; }
.btn:disabled { opacity: 0.5; cursor: default; }

.ext-list { color: var(--muted); font-size: 13px; }

/* Wizard */
.wizard { display: grid; gap: 12px; max-width: 520px; margin-top: 16px; }
.wizard label { display: grid; gap: 4px; font-size: 14px; color: #334155; }
.wizard input, .wizard select {
  padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; background: #fff;
}
.wizard input:focus, .wizard select:focus { outline: 2px solid #0284c7; border-color: #0369a1; }
.ok { padding: 12px 14px; background: #ecfdf5; border: 1px solid #6ee7b7; border-radius: 8px; color: #065f46; margin-top: 12px; }

.rollout { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.rollout-head { display: flex; gap: 10px; align-items: center; }
.rollout-results { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #f1f5f9; border: 1px solid #e2e8f0; }
.chip-done { background: #dcfce7; border-color: #86efac; }
.chip-updating, .chip-verifying { background: #fef9c3; border-color: #fde047; }
.chip-failed { background: #fee2e2; border-color: #fca5a5; }
