/* =====================================================================
 * HUBAKU COMMERCE INTERNAL AI CHATBOT — Visual layer v3.1 (light/cream)
 *
 * Background: #F0EEE9 (cloud dancer) — plain, no grid
 * Dark text:  #140C00
 * Fonts:      Poppins
 * Type scale: bumped +1 step throughout for better readability
 * ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  /* surfaces */
  --bg-deep: #F0EEE9;
  --bg-sidebar: #E8E4DA;
  --bg-surface: #FFFFFF;
  --bg-input: #FAF8F3;

  /* borders */
  --border: rgba(20, 12, 0, 0.10);
  --border-hover: rgba(20, 12, 0, 0.20);

  /* text */
  --text: #140C00;
  --text-90: rgba(20, 12, 0, 0.92);
  --text-60: rgba(20, 12, 0, 0.62);
  --text-30: rgba(20, 12, 0, 0.40);
  --text-10: rgba(20, 12, 0, 0.08);
  --text-05: rgba(20, 12, 0, 0.04);

  /* brand */
  --accent: #a22314;
  --accent-light: #c62d18;
  --accent-soft: rgba(162, 35, 20, 0.10);
  --accent-soft-strong: rgba(162, 35, 20, 0.18);
  --accent-glow: rgba(162, 35, 20, 0.25);

  /* status */
  --success: #16A34A;
  --error: #DC2626;
  --error-soft: rgba(220, 38, 38, 0.08);

  /* fonts */
  --font-body: 'Google Sans', 'Google Sans Text', 'Product Sans', 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: var(--font-body);
  --font-chat: 'Google Sans', 'Google Sans Text', 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  /* HUBAKU COMMERCE wordmark keeps its original display face. */
  --font-logo: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

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

html, body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  overflow: hidden;
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

/* =====================================================================
 * LOGIN
 * ===================================================================== */
.login-shell {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg-deep);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 38px 34px 30px;
  position: relative;
  z-index: 1;
  box-shadow: 0 12px 40px rgba(20, 12, 0, 0.08);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 14px 14px 0 0;
}

.login-brand { margin-bottom: 28px; }

.login-brand-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}

.login-brand-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-30);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-60);
  font-weight: 400;
  line-height: 1.5;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-60);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-input::placeholder { color: var(--text-30); }
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  transition: transform 0.06s, box-shadow 0.15s, background 0.15s;
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  margin-top: 6px;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-light); box-shadow: 0 6px 18px var(--accent-glow); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--text-30); cursor: not-allowed; box-shadow: none; }

.error-message {
  background: var(--error-soft);
  border: 1px solid rgba(220, 38, 38, 0.20);
  color: var(--error);
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}
.error-message.visible { display: block; }

.login-footer {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-30);
  letter-spacing: 0.4px;
  text-align: center;
  font-weight: 500;
}

/* =====================================================================
 * SIDEBAR
 * ===================================================================== */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -80px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, var(--accent-soft-strong) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.6;
}

.sidebar-logo {
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.sidebar-logo-mark {
  font-family: var(--font-logo);
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.1px;
}

.sidebar-logo-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-60);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  margin-top: 6px;
}

.sidebar-section {
  padding: 16px 20px 8px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-60);
}

.sidebar-list {
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-list-scroll {
  flex: 1;
  overflow-y: auto;
}
.sidebar-list-scroll::-webkit-scrollbar { width: 0; }

.qp-btn,
.sidebar-item {
  background: none;
  border: none;
  color: var(--text-60);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 11px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
}

.qp-btn:hover,
.sidebar-item:hover {
  background: var(--bg-surface);
  color: var(--text);
}

.sidebar-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.qp-icon {
  font-size: 14.5px;
  flex-shrink: 0;
}

.sidebar-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 14px;
}

.sidebar-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--text-10);
  color: var(--text-60);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body);
}

.sidebar-badge.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  background: var(--bg-sidebar);
}

.team-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  background: var(--bg-surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 9px;
}

.team-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.team-info { flex: 1; min-width: 0; }

.team-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-role {
  font-size: 11.5px;
  color: var(--text-60);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2.5s infinite;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.5);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.sidebar-action-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sidebar-action {
  flex: 1;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-60);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.sidebar-action:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.sidebar-version {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-30);
  letter-spacing: 0.5px;
  text-align: center;
  margin-top: 9px;
}

/* =====================================================================
 * MAIN — chat area
 * ===================================================================== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-deep);
  position: relative;
}

.chat-header {
  padding: 18px 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-sidebar);
  position: relative;
  z-index: 2;
}

.chat-header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.1px;
}

.chat-subtitle {
  font-size: 12.5px;
  color: var(--text-60);
  font-weight: 400;
}

.header-pills {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pill {
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-60);
  background: var(--bg-surface);
  letter-spacing: 0.2px;
}

.pill.active {
  border-color: var(--accent-soft-strong);
  color: var(--accent);
  background: var(--accent-soft);
}

.menu-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--text-60);
  font-size: 17px;
  margin-right: 10px;
}

/* =====================================================================
 * MESSAGES
 * ===================================================================== */
.messages-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 30px 34px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-behavior: smooth;
  position: relative;
  z-index: 1;
}

.messages-wrap::-webkit-scrollbar { width: 4px; }
.messages-wrap::-webkit-scrollbar-track { background: transparent; }
.messages-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.messages-wrap::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

.welcome-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
  animation: fadeUp 0.5s ease both;
}

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

.welcome-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.welcome-title span { color: var(--accent); }

.welcome-sub {
  font-size: 14.5px;
  color: var(--text-60);
  max-width: 520px;
  line-height: 1.65;
  font-weight: 400;
}

.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 12px;
  max-width: 600px;
}

.chip {
  padding: 9px 15px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-60);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.msg-row {
  display: flex;
  gap: 12px;
  animation: fadeUp 0.3s ease both;
}

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

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
  font-family: var(--font-display);
}

.msg-avatar.ai {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.msg-avatar.user-av {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-60);
  font-size: 12px;
}

.msg-content {
  max-width: 72%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-row.user .msg-content { align-items: flex-end; }

.msg-sender {
  font-size: 11.5px;
  color: var(--text-30);
  font-weight: 500;
  padding: 0 4px;
  letter-spacing: 0.2px;
}

.msg-bubble {
  padding: 13px 17px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
  font-family: var(--font-chat);
}

.msg-row.ai .msg-bubble {
  background: none;
  border: none;
  box-shadow: none;
  padding: 4px 0 0 0;
  border-radius: 0;
  color: var(--text);
}

.msg-row.user .msg-bubble {
  background: #F5F5F5;
  color: var(--text);
  border: 1px solid var(--border);
  border-top-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(20, 12, 0, 0.04);
}

.msg-bubble strong { font-weight: 600; }
.msg-bubble em { font-style: italic; }

.msg-bubble ul,
.msg-bubble ol {
  padding-left: 22px;
  margin-top: 7px;
  margin-bottom: 4px;
}

.msg-bubble li { margin-bottom: 5px; }
.msg-bubble p { margin-bottom: 9px; }
.msg-bubble p:last-child { margin-bottom: 0; }

.msg-bubble code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--bg-deep);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  border: 1px solid var(--border);
}

.msg-row.user .msg-bubble code {
  background: var(--bg-deep);
  color: var(--accent);
  border-color: var(--border);
}

.msg-bubble pre {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 13px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 9px 0;
}

.msg-bubble pre code {
  background: none;
  padding: 0;
  color: var(--text);
  border: none;
}

.msg-time {
  font-size: 11px;
  color: var(--text-30);
  padding: 0 4px;
  font-weight: 400;
}

.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 8px 0;
  background: none;
  border: none;
  border-radius: 0;
  width: fit-content;
  box-shadow: none;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.3s infinite;
}

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

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* =====================================================================
 * INPUT AREA
 * ===================================================================== */
.input-area {
  padding: 16px 30px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  position: relative;
  z-index: 2;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(20, 12, 0, 0.04);
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-wrapper textarea {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 400;
  resize: none;
  outline: none;
  padding: 5px 6px;
  min-height: 24px;
  max-height: 130px;
}

.input-wrapper textarea::placeholder { color: var(--text-30); }

.send-btn {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.06s;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.send-btn:hover { background: var(--accent-light); }
.send-btn:active { transform: translateY(1px); }
.send-btn:disabled {
  background: var(--text-10);
  color: var(--text-30);
  box-shadow: none;
  cursor: not-allowed;
}

.send-btn svg {
  width: 17px;
  height: 17px;
}

.input-hint {
  font-size: 11.5px;
  color: var(--text-30);
  margin-top: 9px;
  text-align: center;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.input-hint .token-meter {
  color: var(--text-60);
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  margin-left: 6px;
  font-weight: 400;
}

/* =====================================================================
 * MOBILE
 * ===================================================================== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 0, 0.4);
  z-index: 9;
}
.sidebar-backdrop.visible { display: block; }

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 80%;
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform 0.22s;
    z-index: 10;
    box-shadow: 0 0 40px rgba(20, 12, 0, 0.15);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .menu-toggle {
    display: inline-flex;
  }
  .messages-wrap {
    padding: 22px 18px 18px;
  }
  .input-area {
    padding: 14px 18px 20px;
  }
  .msg-content {
    max-width: 86%;
  }
  .welcome-chips {
    max-width: 100%;
  }
}

/* =====================================================================
 * UTILITY
 * ===================================================================== */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* =============================================================
   v1.0b — Attachments + Delete-confirm modal
   ============================================================= */

/* --- Composer: attachment strip above textarea --- */
.attachment-strip {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 0;
}
.attachment-strip.has-files {
  display: flex;
}

.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-strong);
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  font-size: 12px;
  color: var(--text-90);
  max-width: 220px;
}
.att-icon {
  font-size: 13px;
  line-height: 1;
}
.att-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}
.att-remove {
  background: transparent;
  border: 0;
  color: var(--text-60);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
}
.att-remove:hover {
  background: rgba(20, 12, 0, 0.08);
  color: var(--text-90);
}

/* --- Composer: paperclip button --- */
.attach-btn {
  background: transparent;
  border: 0;
  color: var(--text-60);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
}
.attach-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.attach-btn svg {
  width: 18px;
  height: 18px;
}

/* --- Composer: drag-drop overlay --- */
.input-area {
  position: relative;
}
.dropzone-overlay {
  position: absolute;
  inset: 0;
  background: rgba(162, 35, 20, 0.06);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}
.dropzone-overlay.visible {
  display: flex;
}
.dropzone-message {
  text-align: center;
  color: var(--accent);
}
.dropzone-icon {
  font-size: 28px;
}
.dropzone-text {
  font-weight: 600;
  font-size: 14px;
  margin-top: 4px;
}
.dropzone-sub {
  font-size: 11px;
  color: var(--text-60);
  margin-top: 2px;
}

/* --- User message: attachment chips inside the bubble --- */
.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.msg-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  color: inherit;
}

/* --- Sidebar: conversation item with delete trash on hover --- */
.convo-item-wrap {
  position: relative;
}
.convo-item-wrap .convo-item {
  width: 100%;
  padding-right: 32px;  /* leave space for trash icon */
}
.convo-delete-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--text-30);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.convo-delete-btn svg {
  width: 14px;
  height: 14px;
}
.convo-item-wrap:hover .convo-delete-btn {
  opacity: 1;
}
.convo-delete-btn:hover {
  color: #B91C1C;
  background: rgba(185, 28, 28, 0.08);
}

/* --- Delete-confirm modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.visible {
  display: flex;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 12, 0, 0.45);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: 0 12px 36px rgba(20, 12, 0, 0.16);
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-90);
  margin-bottom: 6px;
}
.modal-body {
  margin-bottom: 16px;
}
.modal-sub {
  font-size: 13px;
  color: var(--text-60);
  line-height: 1.45;
  margin-bottom: 10px;
}
.modal-preview {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-90);
  font-style: italic;
  max-height: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.btn-secondary, .btn-danger {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.12s ease;
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-90);
}
.btn-secondary:hover {
  background: var(--bg-input);
  border-color: var(--border-hover);
}
.btn-danger {
  background: #B91C1C;
  color: #FFF;
  border-color: #B91C1C;
}
.btn-danger:hover {
  background: #991B1B;
  border-color: #991B1B;
}

/* =============================================================
   Model selector (CEO only)
   ============================================================= */
.model-select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-90);
  cursor: pointer;
  outline: none;
  transition: all 0.12s ease;
  margin-right: 8px;
}
.model-select:hover {
  border-color: var(--border-hover);
}
.model-select.opus-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
