:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, #1e293b 220px, #f1f5f9 220px);
  color: var(--ink);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  color: #f8fafc;
}

.brand { font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }

.temp-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--warn);
  color: #1e293b;
  padding: 3px 8px;
  border-radius: 999px;
}

.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }

/* Author `display: flex` beats UA `[hidden] { display: none }` — without this,
   Log out calls showLogin() but pilot1 stays visible on the sign-in screen. */
.who[hidden] {
  display: none;
}

.link-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.content {
  max-width: 560px;
  margin: 20px auto 60px;
  padding: 0 20px;
}

.card {
  background: var(--panel);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  padding: 32px;
}

h1 { margin-top: 0; font-size: 22px; }

.muted { color: var(--muted); font-size: 14px; }

.intro-copy { margin-top: -8px; margin-bottom: 16px; }

.lifecycle-hint {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.lifecycle-hint[hidden] {
  display: none;
}

form label {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

button, .button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

button:hover, .button:hover { background: var(--accent-dark); }

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

button.secondary:hover { background: #fef2f2; }

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

button.ghost:hover { background: #f1f5f9; }

button.ghost:disabled {
  opacity: 0.6;
  cursor: wait;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.error { color: var(--danger); font-size: 14px; margin-top: 12px; }

.readiness {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  background: #f1f5f9;
  color: var(--muted);
}

.readiness.ok { background: #ecfdf5; color: var(--ok); }
.readiness.blocked { background: #fef2f2; color: var(--danger); }

.session-fields {
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 8px;
  margin: 0 0 12px;
  font-size: 14px;
}

.session-fields dt { color: var(--muted); }
.session-fields dd { margin: 0; }

.actions { display: flex; gap: 10px; }

/* Same as .who[hidden]: author display:flex beats UA [hidden]. */
.actions[hidden],
.session-panel[hidden] {
  display: none;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 20px;
}
