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

    :root {
      --black: #000000;
      --white: #ffffff;
      --off-white: #f0ede8;
      --grey-1: #080808;
      --grey-2: #101010;
      --grey-3: #1a1a1a;
      --grey-4: #272727;
      --grey-5: #404040;
      --grey-6: #777777;
      --grey-7: #bbbbbb;
    }

    html, body {
      height: 100%;
      background: var(--black);
      color: var(--white);
      font-family: 'Cormorant Garamond', serif;
      overflow: hidden;
    }

    /* ── NOISE TEXTURE ── */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
      pointer-events: none;
      z-index: 0;
    }

    /* ── LAYOUT ── */
    .app {
      display: flex;
      flex-direction: column;
      height: 100vh;
      position: relative;
      z-index: 1;
      max-width: 780px;
      margin: 0 auto;
    }

    /* ── HEADER ── */
    header {
      display: flex;
      align-items: center;
      gap: 20px;
      padding: 28px 36px 22px;
      border-bottom: 1px solid var(--grey-4);
      flex-shrink: 0;
    }

    .avatar {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      background: var(--grey-3);
      border: 1px solid var(--grey-5);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      flex-shrink: 0;
      position: relative;
    }

    .avatar-status {
      position: absolute;
      bottom: 2px;
      right: 2px;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--white);
      border: 2px solid var(--black);
    }

    .header-info { flex: 1; }

    .header-name {
      font-family: 'IM Fell English', serif;
      font-size: 1.4rem;
      letter-spacing: 1px;
      font-style: italic;
    }

    .header-sub {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.6rem;
      color: var(--grey-6);
      letter-spacing: 3px;
      text-transform: uppercase;
      margin-top: 3px;
    }

    .header-mood {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.6rem;
      color: var(--grey-5);
      letter-spacing: 2px;
      text-align: right;
      line-height: 1.8;
    }

    /* ── CHAT ── */
    .chat-area {
      flex: 1;
      overflow-y: auto;
      padding: 36px 36px 20px;
      display: flex;
      flex-direction: column;
      gap: 28px;
      scrollbar-width: thin;
      scrollbar-color: var(--grey-4) transparent;
    }

    .chat-area::-webkit-scrollbar { width: 3px; }
    .chat-area::-webkit-scrollbar-thumb { background: var(--grey-4); }

    /* Message bubbles */
    .msg {
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-width: 75%;
      animation: fadeUp 0.3s ease both;
    }

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

    .msg.user { align-self: flex-end; align-items: flex-end; }
    .msg.bot  { align-self: flex-start; align-items: flex-start; }

    .msg-label {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.58rem;
      color: var(--grey-5);
      letter-spacing: 2px;
      text-transform: uppercase;
      padding: 0 4px;
    }

    .msg-bubble {
      padding: 16px 20px;
      line-height: 1.75;
      font-size: 1.05rem;
      font-weight: 300;
    }

    .msg.user .msg-bubble {
      background: var(--white);
      color: var(--black);
      font-family: 'Cormorant Garamond', serif;
    }

    .msg.bot .msg-bubble {
      background: var(--grey-2);
      border: 1px solid var(--grey-4);
      color: var(--off-white);
      font-family: 'Cormorant Garamond', serif;
      font-style: italic;
    }

    /* Typing indicator */
    .typing-indicator {
      display: none;
      align-self: flex-start;
      align-items: center;
      gap: 6px;
      padding: 16px 22px;
      background: var(--grey-2);
      border: 1px solid var(--grey-4);
    }

    .typing-indicator.visible { display: flex; }

    .typing-dot {
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--grey-6);
      animation: typingBounce 1.2s infinite;
    }

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

    @keyframes typingBounce {
      0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
      30% { transform: translateY(-5px); opacity: 1; }
    }

    /* ── DIVIDER ── */
    .divider {
      display: flex;
      align-items: center;
      gap: 12px;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.58rem;
      color: var(--grey-5);
      letter-spacing: 3px;
    }

    .divider::before, .divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--grey-4);
    }

    /* ── INPUT AREA ── */
    .input-area {
      flex-shrink: 0;
      padding: 20px 36px 32px;
      border-top: 1px solid var(--grey-4);
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .input-row {
      display: flex;
      gap: 12px;
      align-items: flex-end;
    }

    textarea#chatInput {
      flex: 1;
      background: var(--grey-2);
      border: 1px solid var(--grey-4);
      color: var(--white);
      font-family: 'Cormorant Garamond', serif;
      font-size: 1rem;
      font-weight: 300;
      padding: 14px 18px;
      resize: none;
      outline: none;
      line-height: 1.6;
      min-height: 52px;
      max-height: 140px;
      transition: border-color 0.2s;
    }

    textarea#chatInput::placeholder {
      color: var(--grey-5);
      font-style: italic;
    }

    textarea#chatInput:focus { border-color: var(--grey-5); }

    .btn-send {
      width: 52px;
      height: 52px;
      background: var(--white);
      border: none;
      color: var(--black);
      cursor: pointer;
      font-size: 1.1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: background 0.15s, transform 0.1s;
    }

    .btn-send:hover { background: var(--grey-7); }
    .btn-send:active { transform: scale(0.95); }
    .btn-send:disabled { background: var(--grey-4); color: var(--grey-6); cursor: not-allowed; }

    .input-hint {
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.58rem;
      color: var(--grey-5);
      letter-spacing: 2px;
      text-align: right;
    }

    /* Error */
    .error-toast {
      display: none;
      font-family: 'Share Tech Mono', monospace;
      font-size: 0.68rem;
      color: #ff4444;
      letter-spacing: 1px;
      padding: 10px 14px;
      border: 1px solid #ff2222;
      background: rgba(255,0,0,0.05);
    }

    .error-toast.visible { display: block; }

    /* ── RESPONSIVE ── */
    @media (max-width: 600px) {
      header, .chat-area, .input-area { padding-left: 20px; padding-right: 20px; }
      .msg { max-width: 90%; }
    }
