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

:root {
  --blue:       #0062cc;
  --blue-lt:    #e8f0fb;
  --green:      #00875a;
  --purple:     #6d28d9;
  --purple-lt:  #f5f3ff;
  --bg:         #f4f6f9;
  --white:      #ffffff;
  --border:     #e1e4e8;
  --text:       #1a1a1a;
  --muted:      #6b7280;
  --radius:     12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
#header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
}
#header-brand { font-size: 18px; font-weight: 700; color: var(--blue); letter-spacing: -0.3px; }
#header-sub   { font-size: 12px; color: var(--muted); }

/* ── Scroll-to-response floating button ── */
#scroll-response-btn {
  position: fixed;
  bottom: 90px;
  right: 28px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
  z-index: 200;
  transition: background .15s, transform .15s;
}
#scroll-response-btn:hover { background: #0052aa; transform: translateY(-2px); }

/* ── Feedback floating button ── */
#feedback-btn {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--purple);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
  z-index: 200;
  transition: background .15s, transform .15s;
}
#feedback-btn:hover { background: #5b21b6; transform: translateY(-2px); }

/* ── Feedback modal ── */
#feedback-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.feedback-card {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 32px 28px 24px;
  width: 100%; max-width: 360px;
}
.feedback-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; font-size: 20px;
  line-height: 1; color: var(--muted); cursor: pointer;
}
.feedback-close:hover { color: var(--text); }
.feedback-title {
  font-size: 17px; font-weight: 600; color: var(--text);
  margin-bottom: 18px; text-align: center;
}
.feedback-stars {
  display: flex; justify-content: center; gap: 8px;
  font-size: 26px; color: #f5b400; margin-bottom: 18px;
}
.feedback-stars i { cursor: pointer; transition: transform .1s; }
.feedback-stars i:hover { transform: scale(1.15); }
.feedback-textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--white); outline: none; resize: vertical;
  margin-bottom: 10px; transition: border-color .15s;
}
.feedback-textarea:focus { border-color: var(--blue); }
.feedback-error {
  font-size: 13px; color: #dc2626;
  min-height: 18px; margin-bottom: 4px;
}
.feedback-submit {
  width: 100%; padding: 10px;
  background: var(--purple); color: #fff;
  border: none; border-radius: 7px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: opacity .15s;
}
.feedback-submit:hover:not(:disabled) { opacity: .88; }
.feedback-submit:disabled { opacity: .55; cursor: default; }
.feedback-thanks {
  text-align: center; font-size: 14px; font-weight: 600;
  color: var(--green); padding: 8px 0;
}

/* ── Chat scroll area ── */
#chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 8px;
  scroll-behavior: smooth;
}

/* ── Suggestions (shown only before first user message) ── */
#suggestions {
  max-width: 1000px;
  margin: 32px auto 24px;
  padding: 0 20px;
  text-align: center;
}
#suggestions .sug-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
#suggestions .sug-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.sug-chip {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.sug-chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-lt); }

/* ── Message list ── */
#messages {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.msg-wrap.user-wrap {
  flex-direction: row-reverse;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  /*background: var(--blue);
  color: var(--white);
  */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: calc(100% - 52px);
}
.user-wrap .msg-col { align-items: flex-end; }

.bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.user-bubble {
  background: var(--blue);
  color: var(--white);
  border-bottom-right-radius: 4px;
  max-width: 560px;
}
.ai-bubble {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  max-width: 620px;
}
.ai-bubble--md { white-space: normal; }

/* ── Typing indicator ── */
.typing-bubble { padding: 14px 16px; }
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 3px;
  animation: bounce 1.2s infinite;
}
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; margin-right: 0; }
@keyframes bounce {
  0%,80%,100% { transform: translateY(0); opacity: .4; }
  40%          { transform: translateY(-5px); opacity: 1; }
}

/* ── Intent tag ── */
.intent-tag {
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px;
}

/* ── Results block ── */
.results-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  max-width: 1000px;
  width: 100%;
}

/* ── Listing card ── */
.lc {
  display: flex; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  width: 100%; box-sizing: border-box;
}
.lc:last-child { border-bottom: none; }
.lc-img-wrap {
  flex-shrink: 0; width: 90px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; overflow: hidden; background: var(--white);
  border: 1px solid var(--border);
}
.lc-img-empty { color: var(--muted); font-size: 22px; }
.lc-img { width: 100%; height: 100%; object-fit: cover; }
.lc-body { min-width: 0;  gap: 4px; }
.lc-title {
  font-size: 13px; font-weight: 600; color: var(--blue);
  text-decoration: none; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-title:hover { text-decoration: underline; }
.lc-desc { font-size: 12px; color: var(--muted); line-height: 1.4; margin: 0; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 2px; }
.lc-price { font-size: 13px; font-weight: 700; color: var(--green); }
.lc-date  { font-size: 11px; color: var(--muted); }
.lc-pay   { font-size: 14px; display: flex; gap: 4px; }
.lc-seller {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  font-size: 11px; color: var(--muted); margin-top: 2px;
}
.lc-seller-name { font-weight: 600; color: var(--text); }
.lc-phone { white-space: nowrap; }
.lc-rating { display: flex; align-items: center; gap: 3px; }
.lc-rating-count { font-size: 11px; color: var(--muted); }
.lc-flag { height: 14px; width: auto; vertical-align: middle; border: 1px solid var(--border); flex-shrink: 0; }
.lc-bottom-imgs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.lc-bottom-img  { height: 24px; width: auto; display: block; }
.lc-auction { border-left: 3px solid var(--blue); }
.lc-ribbon {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; padding: 2px 7px; border-radius: 3px;
  background: var(--blue); color: #fff; margin-bottom: 3px;
}
.lc-auction-bid  { font-size: 13px; font-weight: 700; color: var(--blue); }
.lc-auction-time { font-size: 11px; color: #dc2626; font-weight: 600; }
.lc-auction-btn {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  padding: 5px 12px; background: var(--blue); color: #fff;
  border-radius: 5px; font-size: 12px; font-weight: 600; text-decoration: none;
}
.lc-auction-btn:hover { opacity: .88; }
@media (max-width: 600px) {
  .lc-desc { display: none; }
  .lc-title { -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; display: block; }
}

/* Stats bar */
.stats-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.stat-pill {
  flex: 1;
  min-width: 110px;
  padding: 10px 14px;
  text-align: center;
  background: var(--white);
  border-right: 1px solid var(--border);
}
.stat-pill:last-child { border-right: none; }
.stat-pill.hist-pill  { background: var(--purple-lt); }
.stat-pill.sold-pill  { background: #f0fdf4; }
.stat-pill.price-pill { background: #f0fdf4; }
.stat-n {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--blue);
}
.hist-pill .stat-n { color: var(--purple); }
.sold-pill .stat-n,
.price-pill .stat-n { color: var(--green); }
.stat-l {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 1px;
}

/* Result section */
.result-section { padding: 12px 14px; }

/* ── Tabbed results ── */
.tabs-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
}
.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover   { color: var(--blue); }
.tab-active      { color: var(--blue) !important; border-bottom-color: var(--blue) !important; font-weight: 600; }
.tab-count {
  background: var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
}
.tab-active .tab-count { background: var(--blue-lt); color: var(--blue); }

/* ── Filter panel ── */
.filter-groups-top {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.filter-group { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .filter-groups-top { flex-direction: column; }
}
.filter-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: 5px;
}
.filter-search {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  margin-bottom: 5px;
  transition: border-color .15s;
}
.filter-search:focus { border-color: var(--blue); }
.filter-list {
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.filter-list::-webkit-scrollbar { width: 4px; }
.filter-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 3px;
  user-select: none;
}
.filter-item:hover { background: var(--blue-lt); }
.filter-item input { cursor: pointer; flex-shrink: 0; }
.filter-item-name  { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-item-count {
  font-size: 10px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 8px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.filter-apply-btn {
  width: 100%;
  padding: 7px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s;
}
.filter-apply-btn:hover:not(:disabled) { background: #0052aa; }
.filter-apply-btn:disabled { opacity: .6; cursor: not-allowed; }
.result-section + .result-section { border-top: 1px solid var(--border); }
/*.hist-section { background: var(--purple-lt); }*/

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--blue);
  margin-bottom: 8px;
}
.hist-label { color: var(--purple); }

/* ── Forum cards ── */
.forum-card { align-items: flex-start; }
.forum-body { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.forum-subject {
  font-weight: 600;
  font-size: 13px;
  color: var(--blue);
  line-height: 1.3;
}
a.forum-card:hover .forum-subject { text-decoration: underline; }
.forum-excerpt {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}
.forum-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.forum-date { margin-left: auto; }
.forum-tag { background: #f0fdf4; color: #15803d; }

/* ── Person cards ── */
.person-card { align-items: flex-start; gap: 14px; }
.person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-lt);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.person-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--blue);
  line-height: 1.2;
}
a.person-card:hover .person-name { text-decoration: underline; }
.person-title   { font-size: 12px; color: var(--muted); font-style: italic; }
.person-company,
.person-address,
.person-phone   { font-size: 12px; color: var(--text); align-items: flex-start; gap: 6px; }
.person-company i,
.person-address i,
.person-phone i { color: var(--muted); margin-top: 2px; flex-shrink: 0; font-size: 11px; }
.person-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #f59e0b;
}
.person-rating-val { color: var(--text); font-weight: 600; }
.person-rcount     { color: var(--muted); font-weight: 400; }
.person-vts-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  margin-top: 2px;
}
.person-vts-link:hover { text-decoration: underline; }

/* ── Narrative card ── */
.nv-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}
.nv-header {
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.nv-stats {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.nv-stat {
  flex: 1;
  padding: 10px 14px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.nv-stat:last-child { border-right: none; }
.nv-stat-n {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}
.nv-stat-l {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 2px;
}
.nv-trend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 0;
  font-weight: 600;
  font-size: 14px;
}
.nv-trend-up   { color: var(--green); }
.nv-trend-down { color: #dc2626; }
.nv-trend-flat { color: var(--muted); }
.nv-trend-win  { font-size: 11px; font-weight: 400; color: var(--muted); }
.nv-trend-basis {
  padding: 4px 14px 10px;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  border-bottom: 1px solid var(--border);
}
.nv-narrative {
  padding: 12px 14px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  border-bottom: 1px solid var(--border);
}
.nv-section {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.nv-section:last-child { border-bottom: none; }
.nv-caveats { background: #fffbeb; }
.nv-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nv-caveats .nv-section-label { color: #b45309; }
.nv-list {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nv-list li {
  line-height: 1.5;
  color: var(--text);
  font-size: 12px;
}

/* ── Bluebook table ── */
.bb-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}
.bb-table-blur {
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
}
.bb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.bb-table thead tr {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
.bb-table th {
  padding: 7px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  white-space: nowrap;
}
.bb-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.bb-table tbody tr:last-child td { border-bottom: none; }
.bb-table tbody tr:nth-child(even) td { background: rgba(0,0,0,.02); }
.bb-row-link { cursor: pointer; }
.bb-row-link:hover td { background: var(--blue-lt) !important; }

.bb-date  { white-space: nowrap; color: var(--muted); font-size: 11px; }
.bb-title { font-weight: 500; max-width: 220px; }
.bb-cat   { color: var(--muted); font-size: 11px; max-width: 140px; }
.bb-price {
  text-align: right;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}
.bb-days-col {
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

/* Icon-only type badges (used in table rows) */
.bb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  font-size: 16px;
  line-height: 1;
  vertical-align: middle;
}
.bb-badge::before {
  display: block;
  line-height: 1;
}
.bb-icons { white-space: nowrap; }
.bb-t-dealer    { background: #dbeafe; color: #1d4ed8; }
.bb-t-cs        { background: #dcfce7; color: #15803d; }
.bb-t-auction   { background: #fef3c7; color: #b45309; }
.bb-t-listing   { background: #f1f5f9; color: #475569; }
.bb-t-wholesale { background: #f3e8ff; color: #7c3aed; }
.bb-t-retail    { background: #f0fdf4; color: #166534; }

/* ── Pricing narrative ── */
.bb-narrative-section {
  border-top: 1px solid var(--border);
}
.bb-table-outer {
  position: relative;
}
.bb-upsell-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.bb-upsell-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 22px 28px;
  text-align: center;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bb-upsell-icon {
  font-size: 28px;
  color: var(--blue);
}
.bb-upsell-headline {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.bb-upsell-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.bb-upsell-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 9px 20px;
  background: var(--blue);
  color: var(--white);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.bb-upsell-cta:hover { background: #0052aa; color: var(--white); }
.bb-narrative-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.bb-narrative-btn:hover:not(:disabled) {
  background: var(--blue);
  color: var(--white);
}
.bb-narrative-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.bb-narrative-text {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}
.bb-narrative-error {
  margin-top: 10px;
  font-size: 12px;
  color: #dc2626;
}

/* Icon key shown above the table */
.bb-key {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.bb-key-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ── Bluebook chart ── */
.bb-chart-wrap {
  padding: 16px 16px 8px;
  height: 210px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.bb-chart {
  width: 100% !important;
  height: 100% !important;
}

/* Vertical listing list */
.listings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Listing card */
.listing-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
a.listing-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,98,204,.1);
}
.listing-card.hist-card { background: #ede9fe; border-color: #c4b5fd; }

.listing-photo {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--border);
}

.listing-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.listing-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}

.listing-row2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.listing-mode {
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.mode-sale    { background: #dbeafe; color: #1d4ed8; }
.mode-auction { background: #fef3c7; color: #b45309; }
.mode-rent    { background: #dcfce7; color: #15803d; }
.mode-wanted  { background: #f3e8ff; color: #7c3aed; }

.listing-end {
  font-size: 10px;
  color: #b45309;
  font-weight: 500;
}

.listing-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}
.listing-price.poa { color: var(--muted); font-weight: 400; font-size: 12px; }

.listing-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.listing-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.trust-icon {
  height: 18px;
  width: auto;
  vertical-align: middle;
}

.payment-icons {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 20px;
}
.payment-icons .fa-paypal      { color: #003087; }
.payment-icons .fa-cc-visa     { color: #1a1f71; }
.payment-icons .fa-cc-mastercard { color: #eb001b; }
.payment-icons .fa-cc-discover { color: #e65c00; }

.webstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  align-self: flex-start;
  transition: background .15s;
}
.webstore-btn:hover { background: #0052aa; }

.listing-seller {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

.listing-meta {
  font-size: 11px;
  color: var(--muted);
}

/* ── Load more button ── */
.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 16px;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.load-more-btn:hover:not(:disabled) {
  background: var(--blue-lt);
  border-color: var(--blue);
}
.load-more-btn:disabled {
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}
.load-more-remain {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  background: var(--bg);
  border-radius: 10px;
  padding: 1px 8px;
}
.load-more-btn:hover:not(:disabled) .load-more-remain {
  background: #d0e4f7;
  color: var(--blue);
}

/* Horizontal card scroll (kept for bluebook fallback) */
.cards-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cards-row::-webkit-scrollbar { height: 4px; }
.cards-row::-webkit-scrollbar-track { background: transparent; }
.cards-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Individual doc card */
.doc-card {
  min-width: 150px;
  max-width: 190px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 12px;
}
.doc-card.hist-card { background: #ede9fe; border-color: #c4b5fd; }

.doc-model {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}
.doc-price.poa { color: var(--muted); font-weight: 400; font-size: 12px; }

.doc-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }
.tag {
  font-size: 10px;
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 500;
}
.mfg-tag      { background: var(--blue-lt); color: var(--blue); }
.cond-new     { background: #dcfce7; color: #16a34a; }
.cond-excel   { background: #dbeafe; color: #1d4ed8; }
.cond-good    { background: #fef9c3; color: #a16207; }
.cond-fair    { background: #fee2e2; color: #dc2626; }
.cond-used    { background: #f1f5f9; color: #475569; }
.stock-tag    { background: #dcfce7; color: #16a34a; }
.ship-tag     { background: #dcfce7; color: #16a34a; }
.auction-tag  { background: #fef3c7; color: #b45309; }

.doc-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ── Input bar ── */
#input-bar {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 14px 20px 18px;
  flex-shrink: 0;
}
#input-wrap {
  display: flex;
  gap: 10px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: flex-end;
}
#input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.45;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color .15s;
}
#input:focus    { border-color: var(--blue); }
#input:disabled { opacity: .6; cursor: not-allowed; }

#send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  border: none;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, opacity .15s;
  line-height: 1;
}
#send-btn:hover:not(:disabled) { background: #0052aa; }
#send-btn:disabled { opacity: .45; cursor: not-allowed; }

.send-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#input-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

/* ── Auction Posting Wizard ────────────────────────────────────────────────── */
.wizard-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  max-width: 620px;
  margin-top: 4px;
}

/* Progress dots */
.wizard-header {
  background: var(--blue);
  padding: 12px 16px 10px;
}
.wizard-step-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  margin-top: 8px;
}
.wizard-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wizard-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: rgba(255,255,255,.6);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.wizard-dot.active { background: var(--white); color: var(--blue); }
.wizard-dot.done   { background: rgba(255,255,255,.45); color: var(--white); }

/* Photo identify (step 1) */
.wizard-photo-id {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wizard-photo-id-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.wizard-photo-id-btn:hover { border-color: var(--blue); color: var(--blue); }
.wizard-photo-id-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.wizard-photo-id-error { font-size: 12px; color: #dc2626; }
.wizard-photo-id-thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.wizard-photo-id-request {
  font-size: 11px;
  color: var(--blue);
  font-style: italic;
  flex-basis: 100%;
  margin-top: 4px;
}

/* Found card (step 1 confirmed match) */
.wizard-found-card {
  margin: 14px 16px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.wizard-found-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.wizard-found-row:last-child { border-bottom: none; }
.wizard-mfg-hint-row { padding-top: 2px; padding-bottom: 6px; border-bottom: none; }
.wizard-mfg-hint { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.wizard-mfg-use-btn {
  background: none; border: none; padding: 0;
  font-size: 11px; font-family: inherit; font-weight: 600;
  color: var(--blue); cursor: pointer;
}
.wizard-mfg-use-btn:hover { text-decoration: underline; }
.wizard-found-label {
  color: var(--muted);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
  width: 110px; flex-shrink: 0;
}
.wizard-found-value { font-weight: 500; color: var(--text); }

/* Category typeahead (step 1 search) */
.wizard-category-search { padding: 14px 16px 0; }
.wizard-typeahead {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: var(--white); color: var(--text);
}
.wizard-typeahead:focus { border-color: var(--blue); }
.wizard-inline-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: none;
  font-size: 13px; font-family: inherit;
  font-weight: 500;
  background: var(--white);
  color: var(--text);
  padding: 4px 8px;
  transition: border-color .15s;
}
.wizard-inline-input:focus { border-color: var(--blue); }
.wizard-inline-input::placeholder { color: var(--muted); font-weight: 400; }
.wizard-typeahead-results {
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.wizard-typeahead-results--card {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: none;
}
.wizard-typeahead-results:empty { display: none; }
.wizard-typeahead-item {
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.wizard-typeahead-item:last-child { border-bottom: none; }
.wizard-typeahead-item:hover { background: var(--blue-lt); color: var(--blue); }
.wizard-typeahead-empty, .wizard-typeahead-selected {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.wizard-typeahead-selected { color: var(--green); font-style: normal; }

/* Form fields */
.wizard-field { padding: 12px 16px 0; }
.wizard-field-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.wizard-required { color: #dc2626; }
.wizard-field-help {
  font-size: 11px; font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}
.wizard-select,
.wizard-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px; font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color .15s;
  background: var(--white); color: var(--text);
}
.wizard-select:focus,
.wizard-textarea:focus { border-color: var(--blue); }
.wizard-field-error .wizard-price-input,
.wizard-field-error .wizard-select,
.wizard-field-error .wizard-textarea { border-color: #dc2626; }

/* Spec key-value builder */
.wizard-specs-container { display: flex; flex-direction: column; gap: 4px; }
.wizard-spec-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wizard-spec-name, .wizard-spec-value, .wizard-spec-name-select {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px; font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: var(--white); color: var(--text);
  cursor: text;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .wizard-spec-name, .wizard-spec-name-select,
  .wizard-spec-value { flex: 1 1 50%; }
}
.wizard-spec-name-select { cursor: pointer; }
.wizard-spec-name:focus, .wizard-spec-value:focus, .wizard-spec-name-select:focus { border-color: var(--blue); }
.wizard-spec-name-wrap { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; box-sizing: border-box; }
.wizard-spec-name-wrap .wizard-spec-name-select { flex: none; width: 100%; }
.wizard-spec-name-other { width: 100%; padding: 7px 10px; border: 1px solid var(--blue); border-radius: 6px; font-size: 12px; font-family: inherit; outline: none; background: var(--white); color: var(--text); box-sizing: border-box; }
.wizard-spec-name-other:focus { border-color: var(--blue); }
@media (max-width: 600px) {
  .wizard-spec-name-wrap { flex: 1 1 50%; }
}
.wizard-spec-remove {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .1s, color .1s;
}
.wizard-spec-remove:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.wizard-add-spec {
  margin-top: 6px;
  padding: 5px 10px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 6px;
  font-size: 12px; font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  align-self: flex-start;
}
.wizard-add-spec:hover { border-color: var(--blue); color: var(--blue); }

/* Pricing inputs */
.wizard-pricing-toggle { padding: 14px 16px 4px; }
.wizard-toggle-label {
  display: flex; align-items: center;
  gap: 8px; cursor: pointer; font-size: 13px;
}
.wizard-toggle-text { font-weight: 500; }
.wizard-toggle-note { font-size: 11px; color: var(--muted); font-weight: 400; }
.wizard-price-input-wrap {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
  transition: border-color .15s;
}
.wizard-price-input-wrap:focus-within { border-color: var(--blue); }
.wizard-currency {
  padding: 0 10px;
  background: var(--bg); color: var(--muted);
  font-size: 14px; font-weight: 600;
  border-right: 1px solid var(--border);
  align-self: stretch;
  display: flex; align-items: center;
}
.wizard-price-input {
  flex: 1; padding: 8px 10px;
  border: none; font-size: 14px; font-family: inherit;
  outline: none;
  background: var(--white); color: var(--text);
}

/* Fee calculator */
.wizard-fee-calc {
  margin: 14px 16px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.wizard-fee-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted);
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.wizard-fee-hint { padding: 8px 12px; font-size: 12px; color: var(--muted); font-style: italic; }
.wizard-fee-row {
  display: flex; justify-content: space-between;
  padding: 5px 12px; font-size: 12px; color: var(--text);
}
.wizard-fee-total {
  border-top: 1px solid var(--border);
  font-weight: 600; margin-top: 2px;
  padding-top: 7px;
}
.wizard-fee-takehome { font-weight: 700; color: var(--green); padding-bottom: 8px; }

/* Loading state */
.wizard-loading {
  padding: 12px 16px;
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}

/* Action buttons */
.wizard-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}
.wizard-btn-primary {
  padding: 9px 20px;
  background: var(--blue); color: var(--white);
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.wizard-btn-primary:hover:not(:disabled) { background: #0052aa; }
.wizard-btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.wizard-btn-secondary {
  padding: 9px 16px;
  background: var(--white); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.wizard-btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

/* Confirm step */
.wizard-confirm-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.wizard-confirm-section:last-of-type { border-bottom: none; }
.wizard-confirm-section-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--blue); margin-bottom: 8px;
}
.wizard-confirm-row {
  display: flex; gap: 10px;
  margin-bottom: 5px; font-size: 13px;
}
.wizard-confirm-label {
  width: 110px; flex-shrink: 0;
  color: var(--muted); font-size: 11px; padding-top: 1px;
}
.wizard-confirm-value { color: var(--text); font-weight: 500; }
.wizard-confirm-text {
  font-size: 12px; color: var(--text);
  line-height: 1.5; white-space: pre-wrap;
  margin-bottom: 4px;
}

/* Photo upload */
.wizard-photo-section { padding: 14px 16px 0; }
.wizard-photo-drop {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 24px 16px;
  border: 2px dashed var(--border);
  border-radius: 8px; cursor: pointer;
  color: var(--muted); text-align: center; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.wizard-photo-drop:hover { border-color: var(--blue); background: var(--blue-lt); color: var(--blue); }
.wizard-photo-drop--disabled { opacity: .5; cursor: default; pointer-events: none; }
.wizard-photo-hint { font-size: 11px; }
.wizard-file-input { display: none; }
.wizard-photo-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.wizard-photo-thumb-wrap { position: relative; width: 80px; height: 80px; }
.wizard-photo-thumb {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.wizard-photo-remove {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #dc2626; color: var(--white);
  border: none; font-size: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}

/* Submit area */
.wizard-submit-area {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border); margin-top: 14px;
}
.wizard-btn-post {
  padding: 10px 22px;
  background: var(--green); color: var(--white);
  border: none; border-radius: 6px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background .15s;
}
.wizard-btn-post:hover:not(:disabled) { background: #006e49; }
.wizard-btn-post:disabled { opacity: .6; cursor: not-allowed; }
.wizard-submit-error { flex: 1; font-size: 12px; color: #dc2626; }

/* Success */
.wizard-success {
  padding: 32px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.wizard-success-icon { font-size: 40px; color: var(--green); }
.wizard-success-title { font-size: 18px; font-weight: 700; color: var(--text); }
.wizard-success-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--blue); font-size: 14px; font-weight: 600; text-decoration: none;
}
.wizard-success-link:hover { text-decoration: underline; }
.wizard-terms-agree {
  padding: 12px 16px 0;
  font-size: 13px;
  color: var(--text);
}
.wizard-terms-agree label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.wizard-terms-agree a { color: var(--blue); }
.wizard-terms-agree.wizard-field-error label { color: #dc2626; }

/* ── Listing Wizard: Item Type Toggle ───────────────────────────────────────── */
.listing-type-toggle {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
}
.listing-type-btn {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.listing-type-btn.active {
  border-color: var(--blue);
  background: var(--blue-lt);
  color: var(--blue);
  font-weight: 600;
}
.listing-type-btn:hover:not(.active) {
  border-color: var(--blue);
}

/* ── Auth overlay ────────────────────────────────────────────────────────────── */
#auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;

}
.auth-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 36px 32px 28px;
  width: 100%; max-width: 380px;
}
.auth-logo {
  font-size: 20px; font-weight: 700; color: var(--blue);
  text-align: center; margin-bottom: 24px; letter-spacing: -.3px;
}
.auth-title {
  font-size: 17px; font-weight: 600; color: var(--text);
  margin-bottom: 20px;
}
.auth-field { margin-bottom: 14px; }
.auth-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px;
}
.auth-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--white); outline: none; box-sizing: border-box;
  transition: border-color .15s;
}
.auth-input:focus { border-color: var(--blue); }
.auth-input--code {
  font-size: 22px; letter-spacing: 6px; text-align: center; font-weight: 600;
}
.auth-btn {
  width: 100%; padding: 10px;
  background: var(--blue); color: #fff;
  border: none; border-radius: 7px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; margin-top: 6px;
  transition: opacity .15s;
}
.auth-btn:hover:not(:disabled) { opacity: .88; }
.auth-btn:disabled { opacity: .55; cursor: default; }
.auth-error {
  font-size: 13px; color: #dc2626;
  min-height: 18px; margin-bottom: 6px;
}
.auth-2fa-hint {
  font-size: 13px; color: var(--muted);
  margin-bottom: 16px; line-height: 1.5;
}
.auth-back {
  display: block; width: 100%; margin-top: 10px;
  background: none; border: none; color: var(--muted);
  font-size: 13px; cursor: pointer; font-family: inherit;
  text-align: center;
}
.auth-back:hover { color: var(--blue); }
.auth-pwd-wrap { position: relative; }
.auth-pwd-wrap .auth-input { padding-right: 38px; }
.auth-pwd-toggle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 36px; background: none; border: none;
  color: var(--muted); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.auth-pwd-toggle:hover { color: var(--blue); }

/* ── RAG answer ──────────────────────────────────────────────────────────────── */
.rag-answer { max-width: 640px; }
.rag-answer-body { font-size: 14px; line-height: 1.6; color: var(--text); }
.rag-answer-body a { color: var(--blue); text-decoration: underline; }
.rag-answer-body a:hover { opacity: .8; }
.rag-h { font-size: 15px; font-weight: 700; margin: 10px 0 4px; color: var(--text); }
.rag-h:first-child { margin-top: 0; }
.rag-p { margin: 0; }
.rag-gap { height: 8px; }
.rag-ul, .rag-ol { margin: 4px 0 4px 20px; padding: 0; }
.rag-ul li, .rag-ol li { margin: 2px 0; }
.rag-hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.rag-code { background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-size: 12px; font-family: monospace; }
.rag-table-wrap { overflow-x: auto; margin: 6px 0; }
.rag-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rag-table th, .rag-table td { padding: 7px 12px; border: 1px solid var(--border); text-align: left; }
.rag-table thead tr { background: var(--bg); }
.rag-table th { font-weight: 600; color: var(--text); }
.rag-table tbody tr:nth-child(even) { background: var(--bg); }
.rag-wizard-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 6px 0; padding: 8px 16px;
  background: var(--blue); color: #fff;
  border: none; border-radius: 7px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: opacity .15s;
}
.rag-wizard-btn:hover { opacity: .88; }
.rag-sources { margin-top: 12px; }
.rag-sources-toggle {
  font-size: 12px; color: var(--muted); cursor: pointer;
  list-style: none; display: flex; align-items: center; gap: 5px;
}
.rag-sources-toggle::-webkit-details-marker { display: none; }
.rag-sources-toggle:hover { color: var(--blue); }
.rag-sources-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.rag-source-item { padding: 8px 10px; background: var(--bg); border-radius: 6px; border: 1px solid var(--border); }
.rag-source-title { font-size: 12px; font-weight: 600; color: var(--blue); text-decoration: none; }
.rag-source-title:hover { text-decoration: underline; }
.rag-source-snippet { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* ── News card ── */
.news-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
a.news-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,98,204,.1);
}
.news-card-img {
  flex-shrink: 0;
  width: 88px;
  height: 66px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.news-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-card-photo-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 26px;
}
.news-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.news-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
a.news-card:hover .news-card-title { color: var(--blue); }
.news-card-date {
  font-size: 11px;
  color: var(--muted);
}
.news-card-intro {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.news-sponsored-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: #dc2626;
  color: #fff;
  border-radius: 3px;
  padding: 2px 6px;
  margin-right: 5px;
  vertical-align: middle;
}
.news-feature-tag {
  font-size: 10px;
  background: var(--blue-lt);
  color: var(--blue);
  border-radius: 3px;
  padding: 2px 6px;
  font-weight: 500;
}
@media (max-width: 600px) {
  .news-card-img { width: 64px; height: 50px; }
  .news-card-intro { -webkit-line-clamp: 3; line-clamp: 3; }
}

/* ── Company card ── */
.co-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.co-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,98,204,.1);
}
.co-logo-wrap {
  flex-shrink: 0;
  width: 88px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.co-logo {
  width: 88px;
  max-height: 76px;
  object-fit: contain;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--white);
  padding: 4px;
}
.co-logo-empty {
  width: 88px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  font-size: 26px;
  background: var(--bg);
}
.co-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.co-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  line-height: 1.3;
}
.co-name:hover { text-decoration: underline; }
.co-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.co-person { font-size: 12px; font-weight: 500; color: var(--text); }
.co-addr   { font-size: 11px; color: var(--muted); }
.co-phone  { font-size: 11px; color: var(--text); }
.co-blurb {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.co-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 100px;
}
.co-badges {
  display: flex;
  gap: 4px;
  align-items: center;
}
.co-badge { height: 24px; width: auto; display: block; }
.co-rating {
  display: flex;
  align-items: center;
  gap: 3px;
}
.co-rcount { font-size: 11px; color: var(--muted); }
.co-followers {
  font-size: 11px;
  color: var(--muted);
}
.co-booth-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  margin-top: 2px;
  white-space: nowrap;
}
.co-booth-link:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .co-card    { flex-wrap: wrap; }
  .co-right   { flex-direction: row; align-items: center; flex-wrap: wrap; min-width: 0; width: 100%; }
  .co-blurb   { -webkit-line-clamp: 3; line-clamp: 3; }
}
