* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --text: #e8eaf0;
  --muted: #8b90a0;
  --accent: #6c8cff;
  --hot: #ff5c7a;
  --ok: #4cd97b;
}

html, body { height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }

button { font: inherit; cursor: pointer; border: none; border-radius: 8px; }
.error { color: var(--hot); font-size: 0.9rem; min-height: 1.2em; margin-top: 0.75rem; }

/* ---- welcome ---- */
#welcome { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.welcome-card { width: 100%; max-width: 26rem; background: var(--surface); border: 1px solid #262a38;
  border-radius: 16px; padding: 2.25rem 2rem; text-align: center; }
.brand-lg { font-size: 1.9rem; font-weight: 700; }
.brand .dot, .brand-lg .dot { color: var(--accent); }
.tagline { color: var(--muted); margin: 0.5rem 0 1.75rem; }
.welcome-card h2 { font-size: 1.05rem; margin-bottom: 0.9rem; text-align: left; }
.welcome-card input { width: 100%; padding: 0.7rem 0.9rem; border-radius: 8px; border: 1px solid #333849;
  background: #12141c; color: var(--text); font-size: 1rem; margin-bottom: 0.7rem; }
.welcome-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.name-row { display: flex; align-items: center; gap: 0.5rem; }
.name-row input { flex: 1; margin-bottom: 0; }
.suffix { color: var(--muted); white-space: nowrap; }
#claimForm button { width: 100%; margin-top: 0.9rem; padding: 0.75rem; background: var(--accent);
  color: #fff; font-weight: 600; font-size: 1rem; }
#claimForm button:hover { filter: brightness(1.1); }
.fine-print { color: var(--muted); font-size: 0.82rem; margin-top: 0.8rem; line-height: 1.5; text-align: left; }
.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.85rem;
  margin: 1.5rem 0 1rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #2a2f3f; }
.secondary { width: 100%; padding: 0.7rem; background: transparent;
  border: 1px solid #3a4056; color: var(--text); }
.secondary:hover { background: #232734; }

/* ---- editor ---- */
#editor { height: 100vh; display: flex; flex-direction: column; }
#editorBar { display: flex; align-items: center; gap: 1rem; padding: 0.55rem 1rem;
  background: var(--surface); border-bottom: 1px solid #262a38; }
.brand { font-weight: 700; }
#siteLink { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
#siteLink:hover { color: var(--accent); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
#muteBtn { background: transparent; font-size: 1.1rem; padding: 0.2rem 0.4rem; }
#muteBtn.muted { filter: grayscale(1) opacity(0.5); }
.linkish { background: transparent; color: var(--muted); font-size: 0.85rem; }
.linkish:hover { color: var(--text); }

#siteFrame { flex: 1; width: 100%; border: none; background: #fff; }

#voiceBar { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem;
  background: var(--surface); border-top: 1px solid #262a38; min-height: 2.8rem; }
#voiceDot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-idle { background: #555b6e; }
.dot-listening { background: var(--ok); animation: pulse 1.6s ease-in-out infinite; }
.dot-thinking { background: var(--accent); animation: pulse 0.8s ease-in-out infinite; }
.dot-speaking { background: var(--hot); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
#voiceText { color: var(--muted); font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#voiceText.active { color: var(--text); }

/* ---- mic overlay ---- */
#micOverlay { position: fixed; inset: 0; background: rgba(10, 12, 18, 0.82); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 1.5rem; z-index: 10; }
.overlay-card { max-width: 28rem; background: var(--surface); border: 1px solid #2a2f3f;
  border-radius: 16px; padding: 2rem; text-align: center; }
.overlay-card h2 { margin-bottom: 0.9rem; }
.overlay-card p { color: var(--muted); line-height: 1.6; margin-bottom: 0.9rem; text-align: left; }
#micEnableBtn { padding: 0.75rem 1.5rem; background: var(--accent); color: #fff; font-weight: 600; font-size: 1rem; }
#micEnableBtn:hover { filter: brightness(1.1); }
