  * {
      box-sizing: border-box;
  }

  body {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background: #f2f2f2;
      display: flex;
      justify-content: center;
      padding: 24px;
  }

  .app {
      width: 100%;
      max-width: 640px;
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
      display: flex;
      flex-direction: column;
      height: 90vh;
      overflow: hidden;
  }

  .header {
      padding: 14px 18px;
      border-bottom: 1px solid #e5e5e5;
      font-size: 15px;
      font-weight: 600;
  }

  .config {
      padding: 10px 18px;
      border-bottom: 1px solid #e5e5e5;
      display: flex;
      gap: 8px;
  }

  .config input {
      flex: 1;
      padding: 8px 10px;
      border: 1px solid #ddd;
      border-radius: 6px;
      font-size: 12px;
  }

  .chat {
      flex: 1;
      overflow-y: auto;
      padding: 16px 18px;
      display: flex;
      flex-direction: column;
      gap: 10px;
  }

  .msg {
      max-width: 85%;
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 14px;
      line-height: 1.4;
      white-space: pre-wrap;
      word-wrap: break-word;
  }

  .msg.user {
      align-self: flex-end;
      background: #2563eb;
      color: white;
  }

  .msg.bot {
      align-self: flex-start;
      background: #f0f0f0;
      color: #111;
      font-family: "SFMono-Regular", Consolas, Menlo, monospace;
      font-size: 12.5px;
  }

  .msg.bot.error {
      background: #fde8e8;
      color: #a10000;
  }

  .msg.thinking {
      align-self: flex-start;
      background: #f0f0f0;
      color: #888;
      font-style: italic;
  }

  .inputbar {
      border-top: 1px solid #e5e5e5;
      padding: 12px;
      display: flex;
      gap: 8px;
  }

  .inputbar textarea {
      flex: 1;
      resize: none;
      border: 1px solid #ddd;
      border-radius: 8px;
      padding: 10px;
      font-size: 14px;
      font-family: inherit;
      height: 44px;
  }

  .inputbar button {
      padding: 0 18px;
      border: none;
      border-radius: 8px;
      background: #2563eb;
      color: white;
      font-size: 14px;
      cursor: pointer;
  }

  .inputbar button:disabled {
      background: #aac0f0;
      cursor: not-allowed;
  }