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

  :root {
    --bg: #0b0c0f;
    --surface: #13151a;
    --surface2: #1a1d24;
    --border: #252830;
    --accent: #4f8ef7;
    --text: #e4e7f0;
    --text-muted: #6b7280;
    --user-bg: #162038;
    --bot-bg: #1a1d24;
    --radius: 18px;
  }

  body {
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image:
      radial-gradient(ellipse at 15% 15%, rgba(79,142,247,0.07) 0%, transparent 55%),
      radial-gradient(ellipse at 85% 85%, rgba(79,142,247,0.04) 0%, transparent 55%);
  }

  .wrapper {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .top-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 2px;
  }

  .logo-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(79,142,247,0.9);
    animation: glow 2s ease-in-out infinite;
  }

  @keyframes glow {
    0%,100% { box-shadow: 0 0 10px rgba(79,142,247,0.9); }
    50% { box-shadow: 0 0 18px rgba(79,142,247,0.3); }
  }

  .logo-text { font-family: 'DM Serif Display', serif; font-size: 17px; }
  .logo-sub { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }

  .chat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: 560px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  }

  .chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .bot-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8ef7, #1d4ed8);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(79,142,247,0.2);
    flex-shrink: 0;
  }

  .chat-header-info { flex: 1; }
  .chat-header-name { font-size: 13.5px; font-weight: 600; }
  .chat-header-status { font-size: 11px; color: #4ade80; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
  .status-dot { width: 5px; height: 5px; border-radius: 50%; background: #4ade80; animation: glow 2s infinite; }

  .reset-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .reset-btn:hover { border-color: var(--accent); color: var(--accent); }

  .messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
  }
  .messages::-webkit-scrollbar { width: 3px; }
  .messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

  .msg { display: flex; gap: 9px; align-items: flex-end; animation: fadeUp 0.22s ease; }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .msg.user { flex-direction: row-reverse; }

  .msg-av {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
  }
  .msg.bot .msg-av { background: linear-gradient(135deg, #4f8ef7, #1d4ed8); }
  .msg.user .msg-av { background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); }

  .bubble { max-width: 80%; padding: 10px 14px; font-size: 13.5px; line-height: 1.6; border-radius: 14px; }
  .msg.bot .bubble { background: var(--bot-bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
  .msg.user .bubble { background: var(--user-bg); border: 1px solid rgba(79,142,247,0.2); border-bottom-right-radius: 4px; }
   .bubble a {
  color: #4f8ef7;
  text-decoration: underline;
}

  .typing-dots { display: flex; gap: 4px; padding: 3px 0; }
  .typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: bounce 1.1s ease-in-out infinite; }
  .typing-dots span:nth-child(2) { animation-delay: 0.18s; }
  .typing-dots span:nth-child(3) { animation-delay: 0.36s; }
  @keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

  .input-row {
    display: flex;
    gap: 9px;
    align-items: flex-end;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface2);
    flex-shrink: 0;
  }

  #userInput {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    padding: 10px 13px;
    resize: none;
    outline: none;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.5;
    transition: border-color 0.2s;
  }
  #userInput:focus { border-color: var(--accent); }
  #userInput::placeholder { color: var(--text-muted); }

  #sendBtn {
    width: 38px; height: 38px;
    flex-shrink: 0;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    transition: opacity 0.2s, transform 0.1s;
  }
  #sendBtn:hover { opacity: 0.85; }
  #sendBtn:active { transform: scale(0.92); }
  #sendBtn:disabled { opacity: 0.3; cursor: not-allowed; }

  .powered { text-align: center; font-size: 11px; color: var(--text-muted); letter-spacing: 0.05em; }
  .powered b { color: var(--accent); font-weight: 500; }
