  :root {
    --primary: #1a1a2e;
    --accent: #4f8ef7;
    --accent-light: #e8f0fe;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --user-bubble: #4f8ef7;
    --ai-bubble: #f0f4ff;
    --shadow: 0 4px 24px rgba(79,142,247,0.10);
    --radius: 18px;
  }

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

  body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 60%, #e8f0fe 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .container {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    height: 92vh;
    max-height: 860px;
  }

  /* ヘッダー */
  .header {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
  z-index: 0;
}

.avatar-in {
  width: 44px;
  height: 44px;
  background: url(../img/rayd_secondary_logo.svg) center/contain no-repeat #fff;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

  .header-info h1 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
  }

  .header-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 300;
  }

  .status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #22c55e;
    font-weight: 500;
  }

  .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  /* チャットエリア */
  .chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
  }

  .chat-area::-webkit-scrollbar { width: 4px; }
  .chat-area::-webkit-scrollbar-track { background: transparent; }
  .chat-area::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

  /* メッセージ */
  .message {
    display: flex;
    gap: 10px;
    animation: fadeUp 0.3s ease;
  }

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

  .message.user {
    flex-direction: row-reverse;
  }

  .msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
  }

  .message.ai .msg-avatar {
/*    background: linear-gradient(135deg, #4f8ef7, #7c3aed); */
    border: 1px solid var(--border);
    background: url(./../img/rayd_secondary_logo.svg);
    color: white;
  }

  .message.user .msg-avatar {
    background: var(--accent-light);
    color: var(--accent);
  }

  .bubble {
    max-width: 78%;
    padding: 13px 17px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
  }

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

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

  /* タイピングインジケーター */
  .typing {
    display: flex;
    gap: 10px;
    align-items: flex-end;
  }

  .typing-dots {
    background: var(--ai-bubble);
    padding: 13px 18px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 5px;
    align-items: center;
  }

  .typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    animation: bounce 1.2s infinite;
  }

  .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
  .typing-dots span:nth-child(3) { animation-delay: 0.4s; }

  @keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
  }

  /* 入力エリア */
  .input-area {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
  }

  .input-wrap {
    flex: 1;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 10px 16px;
    transition: border-color 0.2s;
  }

  .input-wrap:focus-within {
    border-color: var(--accent);
    background: white;
  }

  textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    color: var(--text);
    resize: none;
    outline: none;
    line-height: 1.6;
    max-height: 120px;
    min-height: 24px;
  }

  textarea::placeholder { color: #9ca3af; }

  .send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
  }

  .send-btn:hover { background: #3b78f0; transform: translateY(-1px); }
  .send-btn:active { transform: translateY(0); }
  .send-btn:disabled { background: #d1d5db; cursor: not-allowed; transform: none; }

  .send-btn svg { width: 18px; height: 18px; fill: white; }

  /* フッター */
  .footer {
    text-align: center;
    padding: 10px;
    font-size: 11px;
    color: #9ca3af;
    font-weight: 300;
  }

  /* エラー */
  .error-bubble {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
  }

  @media (max-width: 480px) {
    .container { height: 100vh; border-radius: 0; }
    .header { border-radius: 0; }
    .input-area { border-radius: 0; }
    .bubble { max-width: 88%; }
  }