:root {
  color-scheme: light dark;
  --bg: #121212;
  --bg-2: #1e1e1e;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --accent: #f2c94c;
}

.links { display: flex; flex-direction: column; gap: 12px; }
a.link {
  display: block;
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
}
a.link:hover { border-color: var(--accent); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.brand {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 12px;
}

p.subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 24px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.retry-btn {
  display: none;
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #0b1d34;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 8px;
}

.retry-btn:hover { filter: brightness(1.05); }

.state-error .spinner { display: none; }
.state-error .retry-btn { display: inline-block; }

.state-embedded { max-width: 100%; }
.state-embedded .brand,
.state-embedded .spinner,
.state-embedded h1,
.state-embedded p.subtitle,
.state-embedded .retry-btn { display: none; }
.state-embedded #chat-root iframe {
  display: block;
  width: 100%;
  min-height: 800px;
  border: 0;
  border-radius: 8px;
}

#chat-root {
  width: 100%;
  min-height: 0;
}

#chat-root:not(:empty) ~ .placeholder { display: none; }

footer.tiny {
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
}
