:root {
  color-scheme: light;
  --bg: #0f172a;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-press: #4338ca;
  --danger: #dc2626;
  --ok: #059669;
  --warn: #d97706;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 10% -10%, #312e81, transparent),
    radial-gradient(900px 500px at 100% 0%, #0e7490, transparent), var(--bg);
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
}

.app {
  width: min(520px, 100%);
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.35);
}

h1 {
  margin: 0 0 4px;
  font-size: 1.55rem;
}

.sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
  font-size: 0.92rem;
}

select,
textarea,
button {
  width: 100%;
  font: inherit;
}

select,
textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.4;
}

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

button {
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-press);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
}

.status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.status.ok {
  color: var(--ok);
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.status.err {
  color: var(--danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
}

.badge.online {
  background: #ecfdf5;
  color: var(--ok);
}

.badge.offline {
  background: #fff7ed;
  color: var(--warn);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge.phase.idle {
  background: #f1f5f9;
  color: var(--muted);
}

.badge.phase.pending {
  background: #fff7ed;
  color: var(--warn);
}

.badge.phase.confirmed {
  background: #ecfdf5;
  color: var(--ok);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}

#clerk-sign-in {
  min-height: 320px;
}

.hint {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
