:root {
  /* Softer Perplexity-style dark palette */
  --bg-page: #020617;
  --bg-main: #020617;
  --bg-surface: #020617;
  --bg-card: #020617;
  --bg-input: #020617;

  --accent: #22d3ee;
  --accent-soft: rgba(56,189,248,0.16);

  --border-subtle: rgba(148,163,184,0.18);
  --border-strong: rgba(15,23,42,0.9);

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;

  --radius-lg: 18px;
  --radius-pill: 999px;

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Full-screen layout */
html,
body {
  height: 100%;
  background: #000;
  color: var(--text-main);
}

/* allow page scroll on small screens */
body {
  overflow: auto;
}

/* Root split: sidebar + main */
.app-root {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #000 100%);
  color: var(--text-main);
}

/* Sidebar */
.sidebar {
  background: #020617;
  border-right: 1px solid rgba(15,23,42,0.95);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 8px;
}

.sidebar-top {
  display: flex;
  justify-content: center;
}

.sidebar-logo-wrap {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, var(--accent-soft), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.sidebar-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-btn {
  border-radius: 999px;
  border: 1px solid rgba(31,41,55,1);
  background: #020617;
  color: var(--text-muted);
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
}

.sidebar-btn.primary {
  color: var(--text-main);
  border-color: rgba(55,65,81,1);
}

/* Main column */
.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 20px;
  gap: 18px;
  overflow: hidden;
}

/* Hero area */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
}

.hero-logo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, var(--accent-soft), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.hero-title {
  text-align: center;
  line-height: 1.15;
}

.hero-title-main {
  display: block;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-title-sub {
  display: block;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-tagline {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Chat surface (card) */
.chat-surface {
  margin-top: 8px;
  width: 100%;
  max-width: 960px;
  flex: 1;
  border-radius: 24px;
  background: #020617;
  border: 1px solid var(--border-strong);
  box-shadow: 0 22px 60px rgba(15,23,42,0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header inside chat card */
.chat-header {
  padding: 10px 18px;
  border-bottom: 1px solid rgba(31,41,55,0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,0.6);
  background: radial-gradient(circle at 0 0, var(--accent-soft), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chat-avatar img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.chat-id-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-id-name {
  font-size: 13px;
  font-weight: 600;
}

.chat-id-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Chat panel (messages + input) */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 2px;
  min-height: 0;
}

/* Scroll area with messages */
.chat-box {
  flex: 1;
  padding: 12px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* Scrollbar */
.chat-box::-webkit-scrollbar {
  width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
  background: rgba(51,65,85,0.9);
  border-radius: 999px;
}

/* Message rows */
.message {
  display: flex;
  width: 100%;
}

.message.ai {
  justify-content: flex-start;
}

.message.user {
  justify-content: flex-end;
}

.message .bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

/* AI bubble */
.message.ai .bubble {
  background: #020617;
  border: 1px solid rgba(30,64,175,0.6);
}

/* User bubble */
.message.user .bubble {
  background: #0f172a;
  border: 1px solid rgba(51,65,85,0.7);
}

/* Input row */
.input-row {
  border-top: 1px solid rgba(31,41,55,0.95);
  padding: 10px 14px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,1));
}

/* Input */
#userInput {
  flex: 1;
  padding: 11px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(51,65,85,0.9);
  background: #020617;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

#userInput::placeholder {
  color: rgba(148,163,184,0.9);
}

#userInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34,211,238,0.35);
}

/* Send button */
.send-btn {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(15,23,42,1);
  background: linear-gradient(to right, #0ea5e9, #22d3ee);
  color: #020617;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(8,47,73,0.9);
  transition: transform 0.08s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.send-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(8,47,73,1);
}

.send-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 8px 18px rgba(8,47,73,0.9);
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-img {
  width: 20px;
  height: 20px;
}

/* Tablet tweaks */
@media (max-width: 900px) {
  .app-root {
    grid-template-columns: 60px minmax(0, 1fr);
  }
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .app-root {
    grid-template-columns: 1fr;   /* no sidebar column */
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 12px 10px 16px;
  }

  .hero-logo-wrap {
    width: 90px;
    height: 90px;
  }

  .hero-logo {
    width: 72px;
    height: 72px;
  }

  .hero-title-main {
    font-size: 26px;
    letter-spacing: 0.12em;
  }

  .hero-title-sub {
    font-size: 16px;
    letter-spacing: 0.2em;
  }

  .chat-surface {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: none;
  }

  .chat-box {
    padding-inline: 12px;
  }

  .message .bubble {
    max-width: 90%;
    font-size: 13px;
  }
}
