:root {
      --primary: #ff477e;
      --secondary: #ff7096;
      --bg: #0f0c29;
      --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #ff477e);
      --glass-bg: rgba(255, 255, 255, 0.05);
      --glass-border: rgba(255, 255, 255, 0.1);
      --text: #ffffff;
    }
    html { height: 100%; }
    * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
    body {
      user-select: none;
      -webkit-user-select: none;
      background: var(--bg-gradient);
      background-attachment: fixed;
      color: var(--text);
      height: 100%;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    #app {
      width: 100%;
      max-width: 500px;
      height: 100%;
      display: flex;
      flex-direction: column;
      position: relative;
    }
    .glass-panel {
      background: var(--glass-bg);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--glass-border);
      border-radius: 24px;
      padding: 30px;
      box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
      width: 90%;
      max-width: 400px;
      margin: auto;
      text-align: center;
      transition: all 0.4s ease;
    }
    h1 { font-weight: 800; font-size: 2rem; margin-bottom: 10px; text-shadow: 0 2px 10px rgba(255,71,126,0.5); }
    h2 { font-weight: 600; font-size: 1.2rem; margin-bottom: 20px; color: var(--secondary); }
    p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 20px; opacity: 0.9; }
    .btn {
      background: linear-gradient(45deg, var(--primary), var(--secondary));
      border: none;
      color: white;
      padding: 14px 28px;
      font-size: 1.1rem;
      font-weight: 600;
      border-radius: 50px;
      cursor: pointer;
      width: 100%;
      box-shadow: 0 4px 15px rgba(255, 71, 126, 0.4);
      margin-bottom: 15px;
    }
    .btn:active { transform: scale(0.96); }
    .btn.outline { background: transparent; border: 2px solid var(--primary); }
    .input-group { margin-bottom: 20px; text-align: left; }
    .input-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; color: var(--secondary); }
    input, .msg, .msg-time, textarea {
      user-select: text;
      -webkit-user-select: text;
    }
    input[type="text"] {
      width: 100%; padding: 14px; border-radius: 12px;
      background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border);
      color: white; font-size: 1rem; outline: none;
    }
    .view { display: none; height: 100%; flex-direction: column; padding: 20px; }
    .view.active { display: flex; }
    .chat-header {
      background: rgba(0,0,0,0.3); padding: 15px 20px; border-radius: 20px;
      display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
      border: 1px solid var(--glass-border);
    }
    .messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; padding-bottom: 20px; scroll-behavior: smooth; }
    
    .msg-wrapper { display: flex; align-items: flex-end; width: 100%; }
    .msg-wrapper.me { justify-content: flex-end; }
    .msg-wrapper.other { justify-content: flex-start; }
    .msg-wrapper.system { justify-content: center; }
    .msg-time { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin: 0 8px; }
    
    .msg { max-width: 80%; padding: 12px 16px; border-radius: 20px; line-height: 1.4; word-break: break-word; white-space: pre-wrap; }
    .msg.system { margin: 0 auto; background: rgba(255,255,255,0.1); font-size: 0.85rem; padding: 6px 14px; color: #ccc; }
    .msg.me { background: linear-gradient(135deg, var(--primary), var(--secondary)); border-bottom-right-radius: 5px; }
    .msg.other { background: rgba(255,255,255,0.15); border: 1px solid var(--glass-border); border-bottom-left-radius: 5px; }
    
    .chat-input { display: flex; gap: 10px; margin-top: 10px; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 24px; border: 1px solid var(--glass-border); align-items: flex-end; }
    .chat-input input, .chat-input textarea { flex: 1; background: transparent; border: none; color: white; padding: 10px; font-size: 1rem; line-height: 1.4; outline: none; }
    .chat-input textarea { resize: none; overflow-y: auto; height: 42px; font-family: inherit; }
    .chat-input button { background: var(--primary); border: none; width: 45px; height: 45px; border-radius: 50%; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    #loading { position: fixed; top:0; left:0; width:100%; height:100%; background: var(--bg-gradient); z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .spinner { width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Custom Scrollbar */
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }
    * { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }