/* ===== Design tokens ===== */
:root {
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text: #111;
  --text-muted: #666;
  --text-soft: #999;
  --border: #e8e8e8;
  --border-light: #f2f2f2;
  --bg: #fff;
  --bg-subtle: #fafafa;
  --bg-page: #fff;
  --primary: #111;
  --primary-hover: #333;
  --primary-light: #f5f5f5;
  --on-primary: #fff;
  --accent: #304f52;
  --danger: #c0392b;
  --danger-bg: #fff0f0;
  --danger-border: #e8b4b4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --max-w: 680px;
  --header-h: 56px;
  --dot-color: rgba(0,0,0,0.055);
  color-scheme: light;
}

html[data-theme="dark"] {
  --text: #f2f2f3;
  --text-muted: #9a9aa2;
  --text-soft: #6b6b73;
  --border: #26262b;
  --border-light: #1d1d22;
  --bg: #111114;
  --bg-subtle: #17171b;
  --bg-page: #0b0b0d;
  --primary: #f2f2f3;
  --primary-hover: #dcdce0;
  --primary-light: #1d1d22;
  --on-primary: #0b0b0d;
  --accent: #9ec4c8;
  --danger: #ff7a6b;
  --danger-bg: #2a1515;
  --danger-border: #5a2222;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --dot-color: rgba(255,255,255,0.06);
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary);
  font-weight: 500; font-size: 15px;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: 999px;
  background: var(--bg); color: var(--danger); border: 1.5px solid var(--danger-border);
  font-weight: 500; font-size: 14px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-lg { padding: 16px 40px; font-size: 17px; }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text);
  font-weight: 500; font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
}
.btn-outline:hover { border-color: var(--text-soft); background: var(--bg-subtle); }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.auth-banner {
  width: 100%; padding: 10px 20px; font-size: 14px; text-align: center;
  background: #fffbeb; color: #92400e; border-bottom: 1px solid #fde68a; line-height: 1.45;
}
.auth-banner[hidden] { display: none !important; }
.header-inner {
  height: var(--header-h); padding: 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.site-logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  line-height: 0;
  background: transparent;
}
.site-logo img {
  display: block;
  height: 24px;
  width: 24px;
  object-fit: contain;
  border-radius: 7px;
}
html[data-theme="dark"] .site-logo img {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}
.header-right { position: relative; }
.avatar-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  font-weight: 500; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.avatar-btn--anon { background: var(--text-soft); }
.header-nav { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--primary-light); }
.nav-link.active { color: var(--text); background: var(--primary-light); }

/* ===== Dropdown ===== */
.dropdown {
  position: absolute; left: 0; top: calc(100% + 6px);
  min-width: 160px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 4px 0; z-index: 200;
}
.dropdown[hidden] { display: none; }
.dropdown-item {
  display: block; width: 100%; padding: 9px 14px; text-align: left;
  font-size: 14px; color: var(--text); transition: background 0.1s;
}
.dropdown-item:hover { background: var(--primary-light); }

/* ===== Pages ===== */
.page { display: none; }
.page.active { display: block; }
.page-content {
  max-width: var(--max-w); margin: 0 auto; padding: 48px 24px 80px;
}
.page-content--narrow { max-width: 480px; }
.page-content--wide { max-width: 1180px; }

/* ===== Admin ===== */
.admin-stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.admin-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start;
}
.admin-col { min-width: 0; }
.admin-arrow { color: var(--text-muted); font-weight: 400; margin: 0 4px; }
.admin-delete-btn {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--text-soft); padding: 2px 4px; border-radius: 4px;
  transition: color 0.15s, background 0.15s; line-height: 1;
}
.admin-delete-btn:hover { color: var(--danger); background: var(--danger-bg); }

/* Admin "Bin" card styles (formerly inline) */
.bin-card {
  border-color: var(--danger-border) !important;
  background: var(--danger-bg) !important;
}
.bin-card-type {
  font-size: 11px; color: var(--text-soft); font-weight: 400; margin-left: 6px;
}
.bin-card-meta {
  font-size: 11px; color: var(--text-soft); margin-top: 2px;
}
.bin-actions { display: flex; gap: 8px; margin-top: 10px; }
.bin-btn {
  font-size: 12px; padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.bin-btn:hover { background: var(--bg-subtle); }
.bin-btn--danger { border-color: var(--danger-border); color: var(--danger); }
.bin-btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.project-card-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; margin-bottom: 6px; }
.project-card-meta-item { font-size: 12px; color: var(--text-muted); }
@media (max-width: 960px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.page-title { font-size: 28px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.02em; }
.page-lead { font-size: 15px; color: var(--text-muted); margin-bottom: 32px; }
.section-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.section-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }

/* ===== Onboarding ===== */
.onboard {
  max-width: 480px; margin: 0 auto;
  min-height: calc(100dvh - var(--header-h));
  display: flex; flex-direction: column;
  padding: 0 24px;
}
.onboard-progress {
  height: 2px; background: var(--border); margin-top: 32px; border-radius: 2px;
  overflow: hidden;
}
.onboard-progress-bar {
  height: 100%; background: var(--primary);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); width: 0%;
}
.onboard-stage {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 40px 0 60px;
}
.onboard-question {
  animation: onboardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes onboardIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.onboard-title {
  font-size: clamp(26px, 5vw, 34px); font-weight: 600;
  line-height: 1.2; letter-spacing: -0.025em;
  margin-bottom: 10px;
}
.onboard-sub {
  font-size: 16px; color: var(--text-muted); line-height: 1.55;
  margin-bottom: 36px; max-width: 420px;
}
.onboard-choices { display: flex; flex-direction: column; gap: 10px; }
.onboard-choice {
  display: flex; align-items: center; padding: 16px 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 16px; font-weight: 500; text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.onboard-choice:hover { border-color: var(--text-soft); background: var(--primary-light); }
.onboard-choice:active { transform: scale(0.99); }
.onboard-choice.selected { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.onboard-form { display: flex; flex-direction: column; gap: 20px; }
.onboard-field { display: flex; flex-direction: column; gap: 6px; }
.onboard-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.onboard-label { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.onboard-input, .onboard-textarea {
  width: 100%; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 16px; color: var(--text);
  background: var(--bg); transition: border-color 0.15s;
}
.onboard-input:focus, .onboard-textarea:focus { outline: none; border-color: var(--primary); }
.onboard-input::placeholder, .onboard-textarea::placeholder { color: var(--text-soft); }
.onboard-textarea { resize: vertical; min-height: 80px; line-height: 1.5; font-family: inherit; }
.onboard-actions { display: flex; gap: 12px; margin-top: 12px; }
.onboard-skip {
  font-size: 14px; color: var(--text-muted); padding: 12px 0;
  transition: color 0.15s;
}
.onboard-skip:hover { color: var(--text); }

/* ===== Chat ===== */
.chat-container {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--header-h));
  max-width: var(--max-w); margin: 0 auto;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 32px 24px 16px;
  display: flex; flex-direction: column; gap: 20px;
}
.chat-welcome {
  text-align: center; padding: 80px 24px; color: var(--text-muted);
}
.chat-welcome h2 {
  font-size: 24px; font-weight: 600; color: var(--text);
  margin-bottom: 8px; letter-spacing: -0.02em;
}
.chat-welcome p { font-size: 16px; max-width: 380px; margin: 0 auto; line-height: 1.55; }

.chat-status {
  text-align: center; padding: 8px 16px;
  font-size: 13px; color: var(--text-soft);
  animation: onboardIn 0.3s ease both;
}

.chat-bubble {
  max-width: 72%; padding: 14px 18px;
  border-radius: 20px; font-size: 15px; line-height: 1.6;
  word-break: break-word;
}
.chat-bubble--user {
  align-self: flex-end;
  background: var(--primary); color: var(--on-primary);
  border-bottom-right-radius: 6px;
}
.chat-bubble--assistant {
  align-self: flex-start;
  background: var(--primary-light);
  border-bottom-left-radius: 6px;
}
.chat-bubble--assistant p { margin-bottom: 8px; }
.chat-bubble--assistant p:last-child { margin-bottom: 0; }
.chat-bubble--assistant strong { font-weight: 600; }
.chat-bubble--assistant ul,
.chat-bubble--assistant ol { padding-left: 20px; margin-bottom: 8px; }
.chat-bubble--assistant code {
  background: var(--bg-subtle); padding: 2px 5px; border-radius: 4px; font-size: 13px;
}
.chat-typing {
  align-self: flex-start;
  display: flex; gap: 5px; padding: 16px 20px;
  background: var(--primary-light);
  border-radius: 20px; border-bottom-left-radius: 6px;
}
.chat-typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-soft);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-3px); }
}

.chat-composer {
  padding: 12px 24px 28px;
  max-width: 540px; margin: 0 auto; width: 100%;
}
.composer-inner {
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 24px; padding: 4px 4px 4px 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer-inner:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.composer-attach {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; color: var(--text-soft);
  transition: color 0.15s, background 0.15s;
}
.composer-attach:hover { color: var(--text); background: var(--primary-light); }
.composer-input {
  flex: 1; border: none; outline: none; resize: none;
  font-size: 15px; line-height: 1.5; max-height: 150px;
  padding: 6px 0; background: transparent; color: var(--text);
}
.composer-input::placeholder { color: var(--text-soft); }
.composer-send {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity 0.15s;
}
.composer-send:disabled { opacity: 0.25; cursor: default; }
.composer-send:not(:disabled):hover { background: var(--primary-hover); }
.composer-files {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0;
}
.composer-files[hidden] { display: none; }
.composer-file-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--primary-light); font-size: 12px; color: var(--text-muted);
}
.composer-file-remove {
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-soft); line-height: 1;
}
.composer-file-remove:hover { color: var(--text); }

/* ===== Chat options & actions ===== */
.chat-options {
  align-self: flex-start;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 4px;
  animation: onboardIn 0.3s ease both;
}
.chat-option-btn {
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 14px; font-weight: 500; color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  cursor: pointer;
}
.chat-option-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.chat-option-btn:active { transform: scale(0.97); }
.chat-option-btn--selected {
  background: var(--primary); color: var(--on-primary); border-color: var(--primary);
}
.chat-option-btn--used:not(.chat-option-btn--selected) {
  opacity: 0.4; cursor: default;
}
.chat-action-wrap {
  align-self: flex-start; padding: 4px 0;
  animation: onboardIn 0.3s ease both;
}
.chat-action-btn { font-size: 14px; padding: 10px 24px; }

/* ===== Connection chat ===== */
.conn-chat-wrap[hidden] { display: none !important; }
.conn-chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - var(--header-h) - 120px); min-height: 400px; }
.conn-chat-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.conn-chat-back { padding: 6px 12px; font-size: 14px; }
.conn-chat-title { font-size: 18px; font-weight: 600; }
.conn-chat-files { padding: 8px 0 12px; border-bottom: 1px solid var(--border-light); margin-bottom: 8px; font-size: 13px; }
.conn-chat-files[hidden] { display: none !important; }
.conn-chat-files-label { font-weight: 600; margin-bottom: 6px; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.conn-chat-files-list { list-style: none; margin: 0; padding: 0; }
.conn-chat-files-list li { margin-bottom: 4px; }
.conn-chat-file-meta { color: var(--text-muted); font-size: 12px; }
.conn-chat-messages {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding: 8px 0;
}
.conn-chat-composer { padding: 12px 0 0; }
.conn-chat-composer .composer-inner { max-width: 100%; }

/* ===== Projects ===== */
.projects-grid { display: flex; flex-direction: column; gap: 12px; }
.project-card {
  padding: 20px 24px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s; cursor: pointer;
}
.project-card:hover { border-color: var(--text-soft); box-shadow: var(--shadow-sm); }
.project-card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.project-card-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }
.project-card-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.project-card-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.badge--intake { background: #f0f0f0; color: #555; }
.badge--searching { background: #fef3c7; color: #92400e; }
.badge--negotiating { background: #dbeafe; color: #1e40af; }
.badge--matched { background: #d1fae5; color: #065f46; }
.badge--in_progress { background: #ede9fe; color: #5b21b6; }
.badge--completed { background: #d1fae5; color: #065f46; }
.badge--cancelled { background: #fee2e2; color: #991b1b; }
.badge--pending { background: #fef3c7; color: #92400e; }
.badge--intro_sent { background: #dbeafe; color: #1e40af; }
.badge--quoted { background: #dbeafe; color: #1e40af; }
.badge--briefed { background: #fef3c7; color: #92400e; }
.badge--await_supplier { background: #fef3c7; color: #92400e; }
.badge--accepted { background: #d1fae5; color: #065f46; }
.badge--rejected { background: #fee2e2; color: #991b1b; }
.supplier-brief-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.project-card-reqs { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.project-files-block { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.project-files-heading { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.project-files-list { list-style: none; margin: 0; padding: 0; }
.project-files-list li { margin-bottom: 6px; font-size: 14px; }
.project-file-meta { color: var(--text-muted); font-size: 12px; }
.projects-empty {
  text-align: center; padding: 80px 24px;
  color: var(--text-muted); font-size: 15px;
}

/* ===== Connections ===== */
.connections-list { display: flex; flex-direction: column; gap: 12px; }
.connection-card {
  border-radius: var(--radius); background: var(--bg);
  border: 1px solid var(--border); overflow: hidden;
}
.connection-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.connection-header-left { display: flex; align-items: baseline; gap: 8px; }
.connection-factory { font-size: 16px; font-weight: 600; }
.connection-location { font-size: 13px; color: var(--text-muted); }
.connection-summary-bar {
  padding: 12px 20px; background: var(--bg-subtle);
  font-size: 14px; line-height: 1.55; border-bottom: 1px solid var(--border-light);
}
.connection-body { padding: 14px 20px; }
.connection-project-line { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.connection-quote { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.connection-next { font-size: 14px; color: var(--text-muted); }
.connection-actions { display: flex; gap: 8px; padding: 0 20px 16px; }
.connections-empty {
  text-align: center; padding: 80px 24px;
  color: var(--text-muted); font-size: 15px;
}

/* ===== Supplier stats ===== */
.supplier-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 32px;
}
.stat-card {
  padding: 20px; border-radius: var(--radius); border: 1px solid var(--border);
  text-align: center;
}
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ===== Settings ===== */
.settings-hint { color: var(--text-muted); font-size: 15px; }
.settings-saved { font-size: 14px; color: var(--accent); margin: 12px 0 0; font-weight: 500; }
.settings-section { margin-bottom: 32px; }
.settings-field { margin-bottom: 18px; }
.settings-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.settings-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 15px; color: var(--text); background: var(--bg);
  transition: border-color 0.15s;
}
.settings-input:focus { outline: none; border-color: var(--primary); }

/* ===== Theme toggle ===== */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted);
  cursor: pointer; border: none; padding: 0;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: var(--text); background: var(--primary-light); }
.theme-toggle svg { display: block; }
/* Push the header toggle to the right edge */
.header-inner .theme-toggle { margin-left: auto; }

/* Theme choice pills (used inside Settings) */
.theme-pills { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.theme-pill {
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.theme-pill:hover { border-color: var(--text-soft); }
.theme-pill--active {
  background: var(--primary); color: var(--on-primary); border-color: var(--primary);
}

/* Dark-mode specific badge tweaks so legacy colored pill badges stay readable */
html[data-theme="dark"] .badge--intake { background: #2b2b30; color: #c9c9cf; }
html[data-theme="dark"] .badge--searching { background: #3a2f0e; color: #f3d27a; }
html[data-theme="dark"] .badge--negotiating { background: #102e52; color: #90baef; }
html[data-theme="dark"] .badge--matched { background: #0f3327; color: #86e0b4; }
html[data-theme="dark"] .badge--in_progress { background: #2a1e4a; color: #bfaaf2; }
html[data-theme="dark"] .badge--completed { background: #0f3327; color: #86e0b4; }
html[data-theme="dark"] .badge--cancelled { background: #3d1212; color: #f19898; }
html[data-theme="dark"] .badge--pending { background: #3a2f0e; color: #f3d27a; }
html[data-theme="dark"] .badge--intro_sent { background: #102e52; color: #90baef; }
html[data-theme="dark"] .badge--quoted { background: #102e52; color: #90baef; }
html[data-theme="dark"] .badge--briefed { background: #3a2f0e; color: #f3d27a; }
html[data-theme="dark"] .badge--await_supplier { background: #3a2f0e; color: #f3d27a; }
html[data-theme="dark"] .badge--accepted { background: #0f3327; color: #86e0b4; }
html[data-theme="dark"] .badge--rejected { background: #3d1212; color: #f19898; }

/* Dark-mode auth banner (yellow warning) tweak */
html[data-theme="dark"] .auth-banner {
  background: #2a210c; color: #f3d27a; border-bottom-color: #3a2f0e;
}

/* Dark focus ring for composer */
html[data-theme="dark"] .composer-inner:focus-within {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header-nav { gap: 0; margin-left: 12px; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
  .onboard-title { font-size: 26px; }
  .onboard-field-row { grid-template-columns: 1fr; }
  .chat-bubble { max-width: 88%; }
  .supplier-stats { grid-template-columns: 1fr; }
}
