* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f172a;
  color: #f8fafc;
  max-width: 640px;
  margin: 40px auto;
  padding: 0 16px;
}

h2, h3 {
  margin: 0;
}

p {
  color: #cbd5e1;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

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

.card p {
  color: #94a3b8;
  font-size: 14px;
  margin: 6px 0 0 0;
}

.top-bar, .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #0f172a;
  border: 1px solid #334155;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
}

.online .dot { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.offline .dot { background: #ef4444; }
.warn .dot { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

.phase-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: #0f172a;
  color: #94a3b8;
  border: 1px solid #334155;
  white-space: nowrap;
}

.phase-pill.active { color: #38bdf8; border-color: #0284c7; background: #0c4a6e; }
.phase-pill.live { color: #4ade80; border-color: #16a34a; background: #14532d; }
.phase-pill.stopping { color: #fbbf24; border-color: #d97706; background: #451a03; }
.phase-pill.error { color: #fca5a5; border-color: #dc2626; background: #450a0a; }

.progress-section {
  margin-top: 16px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 6px;
}

.progress-label {
  color: #e2e8f0;
  font-weight: 500;
}

.progress-pct {
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 600;
}

progress.task-progress {
  width: 100%;
  height: 12px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background-color: #0f172a;
}

progress.task-progress::-webkit-progress-bar {
  background-color: #0f172a;
  border-radius: 999px;
}

progress.task-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: 999px;
  transition: width 0.35s ease;
}

progress.task-progress.is-live::-webkit-progress-value {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

progress.task-progress.is-error::-webkit-progress-value {
  background: #dc2626;
}

progress.task-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: 999px;
}

.quota-note {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.login-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 20px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

button, .link-btn {
  flex: 1;
  min-width: 130px;
  padding: 11px 14px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  text-align: center;
  text-decoration: none;
}

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

.start { background: #16a34a; }
.stop { background: #dc2626; }
.force { background: #475569; border: 1px solid #64748b; }
.link-btn { background: #2563eb; }

.logout {
  padding: 6px 12px;
  background: #334155;
  color: #f8fafc;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
}

details.log-drawer {
  margin-top: 14px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
}

details.log-drawer summary {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

pre.log-output {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid #1e293b;
  max-height: 220px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.banner {
  background: #7c2d12;
  border: 1px solid #ea580c;
  color: #ffedd5;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.banner-btn {
  flex: 0 0 auto;
  min-width: auto;
  background: #ea580c;
  padding: 7px 12px;
  font-size: 13px;
}
