/* ============================================================================
   NIVUDA v3 — Clean design system (mockup, not deployed)
   Centered chat + slim top bar. No heavy sidebar.
   ============================================================================ */

:root {
  --accent: #76b900;
  --accent-hover: #8ad900;
  --accent-dim: rgba(118, 185, 0, 0.12);
  --bg: #0a0e14;
  --surface: #11161f;
  --surface-2: #161c27;
  --border: #232b38;
  --border-light: #2d3645;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --blue: #58a6ff;
  --red: #f85149;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, monospace;
}

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

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Slim top bar ---- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
}
.topbar-logo {
  font-weight: 700;
  font-size: 1.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-logo .dot { color: var(--accent); font-size: 1.2em; }
.topbar-nav {
  display: flex;
  gap: 4px;
  margin-left: 32px;
}
.topbar-nav a {
  padding: 7px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.88em;
  font-weight: 500;
}
.topbar-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar-nav a.active { color: var(--text); background: var(--surface-2); }
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.credits-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.82em;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82em;
  color: var(--text-muted);
  cursor: pointer;
}
.user-menu .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8em;
  border: 1px solid var(--border);
}

/* ---- Centered page ---- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 88px 24px 140px;
}

.page-title {
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 24px;
}

/* ---- Chat ---- */
.chat {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.msg { font-size: 0.95em; }
.msg .role {
  font-size: 0.78em;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.msg.user .role { color: var(--accent); }
.msg-body { color: var(--text); }
.msg-body p { margin-bottom: 10px; }
.msg-body code {
  font-family: var(--mono);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}
.msg-body pre {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.86em;
  margin: 12px 0;
}
.msg-body pre code { background: none; padding: 0; }

/* ---- Input bar (bottom, centered) ---- */
.composer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  padding: 24px 24px 20px;
}
.composer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.composer-box:focus-within { border-color: var(--accent); }
.composer-box textarea {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95em;
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 200px;
}
.send-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #000;
  font-size: 1.1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.composer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.74em;
  color: var(--text-dim);
  padding: 0 4px;
}
.composer-meta .cost { color: var(--accent); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92em;
  cursor: pointer;
  font-family: var(--font);
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---- Empty / welcome state ---- */
.welcome { text-align: center; padding: 60px 20px; }
.welcome h2 { font-size: 1.5em; margin-bottom: 10px; font-weight: 700; }
.welcome p { color: var(--text-muted); margin-bottom: 28px; }
.suggestions { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 0 auto; }
.suggestion {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  font-size: 0.9em;
  color: var(--text-muted);
}
.suggestion:hover { border-color: var(--border-light); background: var(--surface-2); }
.suggestion strong { color: var(--text); display: block; margin-bottom: 3px; }

/* ---- Loader ---- */
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim);
  animation: blink 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
