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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-light: #1c1c1c;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-muted: #999;
  --text-dim: #666;
  --accent: #7c6ef0;
  --accent-hover: #6b5dd3;
  --green: #4ade80;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  -webkit-font-smoothing: antialiased;
}

.chat-container {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  background: var(--surface-light);
  border-bottom: 1px solid var(--border);
}

.chat-header-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
}

.chat-header-dot:nth-child(1) { background: #ff5f57; }
.chat-header-dot:nth-child(2) { background: #febc2e; }
.chat-header-dot:nth-child(3) { background: #28c840; }

.chat-header-title {
  margin-left: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.chat-body {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 300px;
}

.prompt-area {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.prompt-input {
  flex: 1;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 1.5em;
  color: var(--text);
  word-break: break-word;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

.cursor.hidden {
  display: none;
}

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

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.send-btn.active {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

/* Snarky message */
.snarky-message {
  text-align: center;
  padding: 1.5rem 1rem;
  animation: fadeInUp 0.6s ease;
}

.snarky-message.hidden {
  display: none;
}

.snarky-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.snarky-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Redirect notice */
.redirect-notice {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  animation: fadeIn 0.3s ease;
}

.redirect-notice.hidden {
  display: none;
}

.cancel-link {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 0.5rem;
}

/* AI buttons */
.ai-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  animation: fadeInUp 0.4s ease;
}

.ai-buttons.hidden {
  display: none;
}

.ai-btn {
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.ai-btn:hover {
  border-color: var(--text-dim);
  background: var(--surface-light);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-light);
  border: 1px solid var(--border);
  color: var(--green);
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.3s ease;
  z-index: 100;
}

.toast.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast {
  animation: fadeInUp 0.3s ease;
}

@media (max-width: 480px) {
  .chat-body {
    padding: 1.5rem 1rem;
  }

  .snarky-title {
    font-size: 1.25rem;
  }

  .ai-buttons {
    flex-direction: column;
  }
}
