:root {
  --primary: #3898EC;
  --accent: #008DFF;
  --navbar-dark: #2D3E50;
  --body-bg: #FCFFFE;
  --text-color: #525468;
  --text-light: #8b8da3;
  --bubble-user: #3898EC;
  --bubble-user-text: #fff;
  --bubble-assistant: #f0f2f5;
  --bubble-assistant-text: #525468;
  --border-color: #e8eaed;
  --input-bg: #fff;
  --radius: 16px;
  --radius-sm: 12px;
  --font-body: 'Satoshi Variable', 'Manrope', sans-serif;
  --font-heading: 'Manrope', sans-serif;
}

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

[x-cloak] { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text-color);
  background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
}

/* ── Chat Container ── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* ── Greeting View ── */
.greeting-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  gap: 1rem;
}

.logo {
  width: 64px;
  height: 64px;
  margin-bottom: 0.5rem;
}

.greeting-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navbar-dark);
  letter-spacing: -0.02em;
}

.greeting-text {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 480px;
  line-height: 1.6;
}

.greeting-input-wrap {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 540px;
  margin-top: 1.5rem;
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 6px 6px 18px;
  transition: border-color 0.2s;
}

.greeting-input-wrap:focus-within {
  border-color: var(--primary);
}

/* ── Chat Header ── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--body-bg);
}

.header-logo {
  width: 32px;
  height: 32px;
}

.header-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navbar-dark);
}

.header-status {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ── Messages ── */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  max-width: 80%;
}

.message-user {
  align-self: flex-end;
}

.message-assistant {
  align-self: flex-start;
}

.message-notice {
  align-self: center;
  max-width: 100%;
}

.notice-bubble {
  background: rgba(56, 152, 236, 0.1);
  color: var(--text-light);
  font-size: 0.82rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  text-align: center;
}

.bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  line-height: 1.55;
  font-size: 0.95rem;
  word-break: break-word;
}

.message-user .bubble {
  background: var(--bubble-user);
  color: var(--bubble-user-text);
  border-bottom-right-radius: 4px;
}

.message-assistant .bubble {
  background: var(--bubble-assistant);
  color: var(--bubble-assistant-text);
  border-bottom-left-radius: 4px;
}

.bubble p { margin: 0.5em 0; }
.bubble p:first-child { margin-top: 0; }
.bubble p:last-child { margin-bottom: 0; }
.bubble code {
  background: rgba(0,0,0,0.06);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}
.bubble pre {
  background: rgba(0,0,0,0.06);
  padding: 0.75em 1em;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.5em 0;
}
.bubble pre code {
  background: none;
  padding: 0;
}
.bubble ul, .bubble ol {
  padding-left: 1.4em;
  margin: 0.5em 0;
}
.bubble strong { font-weight: 600; }

.cursor {
  display: inline-block;
  animation: blink 0.8s step-end infinite;
  color: var(--primary);
  font-weight: 300;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ── Input Bar ── */
.input-bar {
  display: flex;
  align-items: flex-end;
  padding: 0.75rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--body-bg);
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-color);
  background: transparent;
  line-height: 1.5;
  max-height: 150px;
  overflow-y: auto;
}

.chat-input::placeholder {
  color: var(--text-light);
}

.send-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent);
  transform: scale(1.05);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── Scrollbar ── */
.messages::-webkit-scrollbar {
  width: 6px;
}
.messages::-webkit-scrollbar-track {
  background: transparent;
}
.messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .greeting-view { padding: 1.5rem 1rem; }
  .greeting-title { font-size: 1.5rem; }
  .greeting-text { font-size: 1rem; }
  .messages { padding: 1rem; }
  .message { max-width: 90%; }
  .input-bar { padding: 0.5rem 1rem 1rem; }
}
