    * { box-sizing: border-box; }
    body {
      font-family: Arial, sans-serif;
      margin: 0;
      background: #f4f4f4;
      display: flex;
      height: 100vh;
      overflow: hidden;
    }

    /* SIDEBAR */
    #sidebar {
      width: 260px;
      background: #202123;
      color: #ececf1;
      display: flex;
      flex-direction: column;
      border-right: 1px solid #444;
    }
    #sidebar-header {
      padding: 20px 15px;
      border-bottom: 1px solid #444;
    }
    #new-chat-btn {
      width: 100%;
      padding: 12px;
      background: #343541;
      color: white;
      border: 1px solid #565869;
      border-radius: 6px;
      cursor: pointer;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    #new-chat-btn:hover {
      background: #40414f;
    }
    #history-list {
      flex: 1;
      overflow-y: auto;
      padding: 10px;
    }
    .history-item {
      padding: 12px;
      margin-bottom: 6px;
      background: #343541;
      border-radius: 6px;
      cursor: pointer;
      font-size: 14px;
      transition: background 0.2s;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .history-item:hover {
      background: #40414f;
    }
    .history-item.active {
      background: #565869;
    }
    .history-title {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .delete-history-btn {
      background: transparent;
      border: none;
      color: #ef4444;
      cursor: pointer;
      padding: 4px 8px;
      font-size: 16px;
      opacity: 0;
      transition: opacity 0.2s;
    }
    .history-item:hover .delete-history-btn {
      opacity: 1;
    }
    .delete-history-btn:hover {
      color: #dc2626;
    }

    /* MAIN CONTENT */
    #main-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      padding: 20px;
    }

    #header-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      gap: 16px;
    }
    #header-bar h1 {
      margin: 0;
      font-size: 24px;
      font-weight: bold;
    }

    #chat-box {
      background: #fff;
      border: 1px solid #ccc;
      padding: 15px;
      flex: 1;
      overflow-y: auto;
      border-radius: 8px;
      margin-bottom: 10px;
    }
    .message { margin: 10px 0; }
    .user      { text-align: right; color: #0066cc; font-size: 16px; }
    .assistant { text-align: left;  color: #333;    font-size: 16px; }
    .assistant-thought {
      text-align: left;
      color: #555;
      font-size: 14px;
      background: rgba(255,255,255,0.6);
      border: 1px dashed #ccc;
      padding: 10px;
      border-radius: 8px;
      margin-bottom: 8px;
    }
    pre {
      background: #2d2d2d;
      color: #f8f8f2;
      padding: 14px;
      border-radius: 6px;
      overflow-x: auto;
      margin: 12px 0;
      line-height: 1.4;
    }

    #input-box {
      display: flex;
      gap: 10px;
      align-items: flex-end;
    }
    #user-input {
      flex: 1;
      padding: 12px;
      font-size: 16px;
      resize: none;
      min-height: 100px;
      max-height: 50vh;
      border: 2px solid #ccc;
      border-radius: 8px;
      overflow-y: auto;
    }
    #user-input:focus {
      outline: none;
      border-color: #0066cc;
    }
    
    .button-group {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    
    #emoji-btn {
      padding: 12px 18px;
      font-size: 22px;
      background-color: #fbbf24;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      min-width: 70px;
      height: 55px;
    }
    #emoji-btn:hover {
      background-color: #f59e0b;
    }
    
    #send-btn {
      padding: 12px 24px;
      font-size: 18px;
      background-color: #0066cc;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      min-width: 70px;
      height: 55px;
    }
    #send-btn:hover {
      background-color: #004999;
    }

    button {
      padding: 12px 24px;
      font-size: 16px;
      background-color: #0066cc;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }
    button:hover { background-color: #004999; }

    #clear-btn {
      background-color: #ccc;
      color: #222;
      padding: 10px 20px;
      border-radius: 6px;
    }
    #clear-btn:hover {
      background-color: #e65555;
      color: #fff;
    }

    #profile-select, #model-select {
      padding: 10px 20px;
      font-size: 15px;
      border: 2px solid #0066cc;
      border-radius: 6px;
      background: white;
      cursor: pointer;
      min-width: 180px;
    }
    #model-select {
      border-color: #00aa66;
    }
    #profile-select:hover, #model-select:hover {
      background-color: #f0f8ff;
    }

    /* EMOJI PICKER */
    #emoji-picker {
      display: none;
      position: absolute;
      bottom: 110px;
      right: 30px;
      background: white;
      border: 2px solid #ccc;
      border-radius: 12px;
      padding: 15px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      width: 350px;
      z-index: 1000;
    }
    #emoji-picker.show {
      display: block;
    }
    .emoji-grid {
      display: grid;
      grid-template-columns: repeat(8, 40px);
      gap: 8px;
      max-height: 250px;
      overflow-y: auto;
      overflow-x: hidden;
    }
    .emoji-item {
      font-size: 24px;
      cursor: pointer;
      padding: 8px;
      text-align: center;
      border-radius: 6px;
      transition: background 0.2s;
    }
    .emoji-item:hover {
      background: #f0f0f0;
    }
