/* Self-hosted fonts (no third-party request / FOUT-on-Google-down). Both are
   variable fonts, so one file per family covers every weight via the range. */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/playfair-display.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/dm-sans.woff2') format('woff2');
}

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

:root {
  --bg: #0a0a0a;
  --card: #141414;
  --border: #262626;
  --border-hover: #3a3a3a;
  --blue: #1e4268;
  --blue-dim: rgba(30,66,104,0.15);
  --gold: #c9a961;
  --gold-dim: rgba(201,169,97,0.12);
  --green: #2f9e6e;
  --text: #f2f2f2;
  --muted: #888;
  --faint: #555;
  --radius: 16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Schibsted Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(30,66,104,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(201,169,97,0.04) 0%, transparent 60%);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }

/* ── Header ─────────────────────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  /* iPhone notch / Dynamic Island: keep the sticky bar clear of the inset
     once the internal bar has scrolled away. */
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.wordmark {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wm-ae { color: var(--blue); }

.wordmark-stack { display: flex; flex-direction: column; line-height: 1.1; }

.wordmark-name {
  color: var(--text);
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.wordmark-sub {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ── Primary nav tabs ────────────────────────────────────────────────────── */

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 16px;
}

.nav-tab {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}

.nav-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.nav-tab.active {
  color: var(--text);
  background: rgba(255,255,255,0.07);
}

[data-theme="light"] .nav-tab:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .nav-tab.active { background: rgba(0,0,0,0.06); }

.route-view[hidden] { display: none !important; }

@media (max-width: 640px) {
  .primary-nav { margin-right: 8px; gap: 0; }
  .nav-tab { padding: 6px 10px; font-size: 0.74rem; letter-spacing: 0.05em; }
}

/* ── Admin access button (fixed, bottom-right) ───────────────────────────── */

.admin-access-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 300;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.admin-access-btn:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.38);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  padding: 48px 0 36px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #a08850;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
  color: var(--text);
}

.hero h1 em {
  font-style: italic;
  color: var(--blue);
}

.hero-sub {
  font-size: 0.875rem;
  color: var(--faint);
  max-width: 400px;
  margin: 0 auto 28px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ── Chat ────────────────────────────────────────────────────────────────── */

.chat-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.chat-messages {
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-messages:not(:empty) { padding-bottom: 20px; }

.chat-hint {
  font-size: 0.72rem;
  color: var(--faint);
  text-align: right;
  margin-top: 6px;
}

.msg {
  font-size: 0.9375rem;
  line-height: 1.65;
}

.msg.user {
  font-size: 0.72rem;
  color: #3a3a3a;
  font-style: italic;
  padding: 12px 0 6px;
  text-align: left;
}

.msg.assistant {
  background: linear-gradient(180deg, rgba(30,66,104,0.04) 0%, rgba(13,13,13,0.85) 60%);
  border: 1px solid rgba(30,66,104,0.18);
  border-left: 2px solid rgba(30,66,104,0.55);
  border-radius: 0 12px 12px 4px;
  padding: 16px 20px;
  color: var(--text);
  margin-bottom: 4px;
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 20px -12px rgba(30,66,104,0.25);
}

.msg.assistant .sources {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gold-dim);
  border: 1px solid rgba(201,169,97,0.2);
  color: var(--gold);
  font-weight: 500;
}

.msg.typing {
  color: #383838;
  font-style: italic;
  font-size: 0.82rem;
  padding: 12px 0 4px;
}

.chat-form {
  position: relative;
  background: #111;
  border: 1px solid #282828;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 8px 32px rgba(0,0,0,0.5);
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 680px;
  margin: 0 auto;
}

.chat-form:focus-within {
  border-color: rgba(30,66,104,0.45);
  box-shadow: 0 0 0 4px rgba(30,66,104,0.07), 0 8px 32px rgba(0,0,0,0.5);
}

.chat-input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 1rem;
  color: var(--text);
  /* Right padding reserves room for the clear (×) + send (→) buttons so
     typed text never visually slides under them. Send: right 8 + width 40
     = 48px; clear: right 56 + width 28 = 84px; +30px cushion = 114px. */
  padding: 20px 120px 20px 28px;
  border-radius: 999px;
  text-overflow: ellipsis;
}

.chat-input::placeholder { color: #5f5f5f; }

.chat-clear {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  color: #666;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.chat-clear.visible { display: flex; }
.chat-clear:hover { background: rgba(255,255,255,0.06); color: #f2f2f2; }
[data-theme="light"] .chat-clear { color: #64748b; }
[data-theme="light"] .chat-clear:hover { background: rgba(0,0,0,0.05); color: #0f172a; }

/* Sources panel */
.sources-panel {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.sources-toggle {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.03em;
  font-family: 'Schibsted Grotesk', sans-serif;
}

.sources-toggle:hover { color: #e0c070; }

.sources-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.source-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.source-lender {
  font-weight: 600;
  color: var(--blue);
}

.source-doc {
  color: var(--muted);
  font-size: 0.73rem;
}

.source-page {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--gold-dim);
  border: 1px solid rgba(201,169,97,0.2);
  color: var(--gold);
}

.source-excerpt {
  color: var(--faint);
  font-size: 0.73rem;
  line-height: 1.4;
  font-style: italic;
}

/* Markdown rendering in chat */
.msg.assistant strong { font-weight: 700; color: var(--text); }
.msg.assistant em { font-style: italic; }
.msg.assistant code { font-family: monospace; font-size: 0.85em; background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 4px; }
.msg.assistant ul, .msg.assistant ol { padding-left: 18px; margin: 6px 0; }
.msg.assistant li { margin-bottom: 3px; }
.msg.assistant p { margin-bottom: 8px; }
.msg.assistant p:last-child { margin-bottom: 0; }

.chat-send {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  flex-shrink: 0;
}

.chat-send:not(:disabled):hover { background: #5a9de8; }
.chat-send:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Mobile chat input — keep text from running under the send button ─────── */
@media (max-width: 640px) {
  .chat-form { max-width: 100%; border-radius: 28px; }
  .chat-input {
    /* 16px font-size prevents iOS Safari zoom-on-focus */
    font-size: 16px;
    padding: 16px 100px 16px 18px;
    line-height: 1.35;
    -webkit-text-size-adjust: 100%;
  }
  /* 3.1 — match both action buttons to a consistent 40×40 tap target, evenly
     spaced, with a press-scale so they feel deliberate (was a lopsided 32 vs 42). */
  .chat-clear { right: 50px; width: 40px; height: 40px; }
  .chat-send  { right: 6px;  width: 40px; height: 40px; }
  .chat-clear:active { transform: translateY(-50%) scale(0.9); }
  .chat-send:active  { transform: translateY(-50%) scale(0.9); }
}

/* ── Follow-up mode indicator ─────────────────────────────────────────────── */
.followup-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 10px;
  max-width: 680px;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.followup-bar .followup-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201,169,97,0.6);
}
.followup-bar .followup-clear {
  background: none; border: none; padding: 0;
  color: var(--blue); cursor: pointer;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.78rem; font-weight: 600;
}
.followup-bar .followup-clear:hover { text-decoration: underline; }
.followup-bar.hidden { display: none; }

/* Breadcrumb trail of the questions in the current thread. The last crumb is
   the active turn; earlier crumbs show where the conversation has been. */
.followup-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
}
.followup-crumbs .crumb {
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.followup-crumbs .crumb.current {
  color: var(--text);
  font-weight: 600;
}
.followup-crumbs .crumb-sep {
  color: var(--faint);
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  /* On phones, collapse the trail to just the active turn to save space. */
  .followup-crumbs .crumb:not(.current),
  .followup-crumbs .crumb-sep { display: none; }
  .followup-crumbs .crumb.current { max-width: 28ch; }
}

/* ── Prompt Chips ─────────────────────────────────────────────────────────── */

.chat-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.chip {
  background: rgba(255,255,255,0.02);
  border: 1px solid #1e1e1e;
  color: #4a4a4a;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.chip:hover {
  border-color: rgba(30,66,104,0.3);
  color: #aaa;
  background: rgba(30,66,104,0.05);
}

/* ── AI Quick Filters ─────────────────────────────────────────────────────── */

.quick-filter-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.quick-filter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #333;
  text-transform: uppercase;
  margin-right: 2px;
  white-space: nowrap;
}

.quick-filter-chip {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.quick-filter-chip.product-chip {
  background: rgba(30,66,104,0.08);
  border-color: rgba(30,66,104,0.22);
  color: #1e4268;
}

.quick-filter-chip.product-chip:hover {
  background: rgba(30,66,104,0.18);
  border-color: rgba(30,66,104,0.5);
}

.quick-filter-chip.lender-chip {
  background: rgba(201,169,97,0.07);
  border-color: rgba(201,169,97,0.22);
  color: var(--gold);
}

.quick-filter-chip.lender-chip:hover {
  background: rgba(201,169,97,0.16);
  border-color: rgba(201,169,97,0.5);
}

.jump-dir-btn {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #252525;
  background: transparent;
  color: #444;
  margin-left: auto;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}

.jump-dir-btn:hover { color: #888; border-color: #333; }

/* ── Section Divider ─────────────────────────────────────────────────────── */

.section-header {
  margin-bottom: 32px;
}

.section-title {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.section-sub { color: var(--muted); font-size: 0.9rem; }

/* ── Directory Controls ───────────────────────────────────────────────────── */

.dir-search-wrap {
  position: relative;
  max-width: 600px;
  margin-bottom: 28px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 40px;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--blue); }
.search-input::placeholder { color: var(--faint); }

.logic-toggle {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.logic-btn {
  padding: 6px 14px;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.05em;
}

.logic-btn.active { background: var(--blue); color: #fff; }

/* ── Product Filter Pills (grouped) ──────────────────────────────────────── */

.product-filters-grouped {
  margin-bottom: 36px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}

.filter-col {
  display: flex;
  flex-direction: column;
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  border-radius: 14px;
  padding: 16px 14px 14px;
  border-top-width: 2px;
}

.filter-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-cat-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 6px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-cat-name {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #efefef;
  line-height: 1.2;
}

.filter-cat-desc {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #484848;
  text-transform: uppercase;
  margin-top: 3px;
}

.filter-cat-divider {
  height: 1px;
  background: #1e1e1e;
  margin-bottom: 12px;
}

.filter-tiles {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-tile {
  background: #111111;
  border: 1px solid #202020;
  border-radius: 10px;
  padding: 11px 12px;
  min-height: 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
  width: 100%;
  text-align: left;
  user-select: none;
}

.filter-tile:hover {
  border-color: #2e2e2e;
  background: #181818;
}

.filter-tile:hover .filter-tile-name {
  color: #f0f0f0;
}

.filter-tile.active {
  background: #1e4268;
  border-color: #1e4268;
  box-shadow: 0 2px 14px rgba(30,66,104,0.22), 0 0 0 1px rgba(30,66,104,0.4);
}

.filter-tile.active .filter-tile-name {
  color: #ffffff;
}

.filter-tile.active .filter-tile-count {
  background: rgba(255,255,255,0.22);
  color: #ffffff;
}

.filter-tile-name {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-weight: 500;
  color: #c8c8c8;
  line-height: 1.3;
}

.filter-tile-count {
  background: rgba(255,255,255,0.05);
  color: #666;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  font-family: 'Schibsted Grotesk', sans-serif;
}

@media (max-width: 1023px) {
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 639px) {
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 16px;
  }
  .filter-col {
    padding: 12px 14px 12px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
  }
  .filter-cat-header {
    padding: 0;
    margin-bottom: 10px;
  }
  .filter-cat-divider {
    margin: 0 0 10px;
  }
  .filter-tiles {
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 7px;
    padding: 0;
  }
  .filter-tile {
    width: auto;
    flex: 0 0 auto;
    min-height: 0;
    padding: 7px 12px;
    border-radius: 999px;
  }
  .filter-tile-name { font-size: 13px; }
  .filter-tile-count { font-size: 11px; padding: 1px 7px; }
}

/* ── Lender row entrance animation ─────────────────────────────────────── */

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

.lender-row-animated {
  animation: verchena-fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Dir empty / results bar ─────────────────────────────────────────────── */

.dir-empty-hint {
  font-size: 0.82rem;
  color: var(--faint);
  text-align: center;
  padding: 16px 0 4px;
}

.dir-results-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 14px;
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.dir-clear-btn {
  background: none;
  border: none;
  color: var(--faint);
  font-size: 0.82rem;
  font-family: 'Schibsted Grotesk', sans-serif;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.15s;
}
.dir-clear-btn:hover { color: var(--muted); }

.dir-no-results {
  text-align: center;
  padding: 48px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── (pill styles removed — replaced by filter-tile above) ──────────────── */

/* ── Lender Cards ─────────────────────────────────────────────────────────── */

.lender-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

.lender-row {
  background: #0e0e0e;
  border: 1px solid #1c1c1c;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lender-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(30,66,104,0.55), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}

.lender-row:hover {
  border-color: #272727;
  box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}

.lender-row:hover::before { opacity: 1; }

/* ── Card top: name + portal badge ───────────────────────────────────────── */

.lc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

/* Pin / favorite toggle — sits at the far right of the card header. */
.lc-pin {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 10px;
  color: #555; cursor: pointer;
  transition: color .15s ease, background .15s ease, transform .12s ease;
}
.lc-pin:hover { background: rgba(227,179,65,0.12); color: #d9b85c; }
.lc-pin:active { transform: scale(0.88); }
.lc-pin.active { color: #e3b341; }
.lc-pin.active svg { fill: #e3b341; }
[data-theme="light"] .lc-pin { color: #94a3b8; }
[data-theme="light"] .lc-pin:hover { background: rgba(79,70,229,0.12); color: #4338ca; }
[data-theme="light"] .lc-pin.active { color: #4f46e5; }
[data-theme="light"] .lc-pin.active svg { fill: #4f46e5; }

.lc-name {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  flex: 1;
}

.lc-name-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.lc-name-wrap > .lc-name { flex: 0 0 auto; }

.lc-main-website {
  align-self: flex-start;
  margin-left: 2px;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  color: #888;
  text-decoration: none;
  transition: color 150ms ease;
}
.lc-main-website:hover { text-decoration: underline; }
.lc-main-website-pending { color: #777; cursor: default; }
.lc-main-website-pending:hover { text-decoration: none; }

/* ── Specialty line ───────────────────────────────────────────────────────── */

.lc-spec {
  font-size: 0.72rem;
  color: #2e2e2e;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Thin divider ────────────────────────────────────────────────────────── */

.lc-divider {
  height: 1px;
  background: #181818;
  margin: 0 -2px;
}

/* ── Contact block ───────────────────────────────────────────────────────── */

.lc-contact-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lc-contact-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
}

.lc-contact-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: #363636;
  text-decoration: none;
  transition: color 0.15s;
  font-family: 'Schibsted Grotesk', sans-serif;
}

.lc-contact-item:hover { color: #666; }

.lc-contact-icon {
  flex-shrink: 0;
  opacity: 0.4;
}

/* ── Niche / notes ───────────────────────────────────────────────────────── */

.lc-notes {
  font-size: 0.78rem;
  color: rgba(201,169,97,0.55);
  font-style: italic;
  line-height: 1.5;
}

/* ── Comp badge ──────────────────────────────────────────────────────────── */

.lc-comp {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(47,158,110,0.08);
  border: 1px solid rgba(47,158,110,0.18);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
  align-self: flex-start;
}

/* ── Spacer ──────────────────────────────────────────────────────────────── */

.lc-spacer { flex: 1; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .lender-list { grid-template-columns: 1fr; gap: 12px; }
  .lender-row { padding: 16px; }
  .lc-name { font-size: 16px; }
}

/* ── Lender Cards (kept for admin use) ─────────────────────────────────── */

.lender-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.lender-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lender-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.lender-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lender-name {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.lender-comp {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(47,158,110,0.1);
  border: 1px solid rgba(47,158,110,0.2);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.lender-contact {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
}

.lender-niche {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 500;
  font-style: italic;
}

.lender-products {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.product-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  word-break: normal;
}

.product-tag.match {
  background: var(--blue-dim);
  border-color: rgba(30,66,104,0.3);
  color: var(--blue);
}

.lc-guidelines {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.lc-guidelines-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s ease;
}
.lc-guidelines-toggle:hover { opacity: 0.7; }
.lc-guidelines-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--muted);
}
.lc-guidelines-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.25s ease;
}
.lc-guidelines.open .lc-guidelines-chevron { transform: rotate(180deg); }
.lc-guidelines-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}
.lc-guidelines.open .lc-guidelines-collapse { grid-template-rows: 1fr; }
.lc-guidelines-collapse > .lc-guidelines-list {
  min-height: 0;
  overflow: hidden;
}
.lc-guidelines-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 6px;
}
.lc-guideline-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lc-guideline-chip:hover {
  background: var(--blue-dim);
  border-color: rgba(30,66,104,0.3);
  color: var(--blue);
}
.lc-guideline-chip svg { flex: 0 0 auto; }
.lc-guideline-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-guideline-more {
  opacity: 0.7;
  cursor: default;
}

.lender-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.action-btn.primary {
  background: var(--blue-dim);
  border-color: rgba(30,66,104,0.3);
  color: var(--blue);
}

.action-btn.primary:hover { background: rgba(30,66,104,0.2); }

.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #5a9de8; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }
.btn-danger { background: rgba(220,53,69,0.15); border: 1px solid rgba(220,53,69,0.3); color: #f06b75; }
.btn-danger:hover { background: rgba(220,53,69,0.25); }

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

th {
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: rgba(255,255,255,0.02);
}

td {
  padding: 10px 14px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1/-1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="url"],
textarea,
select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

input:focus, textarea:focus, select:focus { border-color: var(--blue); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; }
select option { background: var(--card); }

/* ── Modal ───────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Inline PDF source viewer ─────────────────────────────────────────────── */
.pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.pdf-overlay.open { opacity: 1; pointer-events: all; }
.pdf-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 1000px;
  height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.99);
  transition: transform 0.2s;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.pdf-overlay.open .pdf-modal { transform: translateY(0) scale(1); }
.pdf-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pdf-header-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.pdf-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pdf-open-tab {
  font-size: 0.76rem;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.pdf-open-tab:hover { color: var(--text); border-color: var(--muted); }
.pdf-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 8px;
  transition: color 0.15s;
}
.pdf-close:hover { color: var(--text); }
.pdf-frame { flex: 1; width: 100%; border: none; background: #525659; }
@media (max-width: 640px) {
  .pdf-overlay { padding: 0; }
  .pdf-modal { height: 100vh; max-width: none; border-radius: 0; border: none; }
}

/* ── Knowledge Base ──────────────────────────────────────────────────────── */

.kb-count {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  align-self: center;
}

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.kb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.kb-lender {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.kb-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-doc-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.kb-doc-icon { flex-shrink: 0; }

.kb-doc-name {
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-tag {
  font-size: 0.72rem;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(30,66,104,0.25);
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.kb-chunks {
  font-size: 0.7rem;
  color: var(--faint);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Upload Area ─────────────────────────────────────────────────────────── */

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.upload-icon { font-size: 2rem; margin-bottom: 12px; }
.upload-label { font-size: 0.9rem; color: var(--muted); }
.upload-label strong { color: var(--blue); }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(30,66,104,0.25);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status / Alerts ─────────────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.alert-success { background: rgba(47,158,110,0.1); border: 1px solid rgba(47,158,110,0.25); color: #4ade80; }
.alert-error { background: rgba(220,53,69,0.1); border: 1px solid rgba(220,53,69,0.25); color: #f06b75; }
.alert-info { background: var(--blue-dim); border: 1px solid rgba(30,66,104,0.25); color: var(--blue); }

/* ── Login Page ──────────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.login-logo span { color: var(--blue); }

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.login-logo-svg {
  height: 100px;
  width: auto;
  display: block;
}

.login-sub { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 32px; }

/* ── Stat Cards ───────────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--faint);
  margin-top: 4px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

/* ── Internal-use top bar ─────────────────────────────────────────────────── */

.internal-bar {
  background: rgba(212,175,55,0.08);
  border-bottom: 1px solid rgba(212,175,55,0.18);
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 5px 16px;
  /* Topmost element: absorb the notch inset so the label isn't clipped. */
  padding-top: calc(5px + env(safe-area-inset-top, 0px));
  text-transform: uppercase;
}

/* ── Header logo ──────────────────────────────────────────────────────────── */

.header-logo-svg {
  height: 44px;
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .header-logo-svg { height: 34px; }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 36px;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.footer-brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.footer-wordmark-text {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
}

.footer-gold-rule {
  width: 80px;
  height: 1px;
  background: #c9a961;
  opacity: 0.55;
}

.footer-tagline-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #888;
  text-transform: uppercase;
  margin: 0;
}

.footer-fine-print {
  font-size: 11px;
  color: #555;
  letter-spacing: 0.5px;
  line-height: 2.2;
  text-align: center;
  margin-bottom: 20px;
}

.footer-fine-print p { margin: 0; }

.footer-site-link {
  color: #555;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-site-link:hover { color: var(--blue); }

.footer-internal-note {
  color: rgba(212,175,55,0.4);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
  margin: 0;
}

/* ── Skeleton / Loading ───────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--border) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Product checkbox grid ────────────────────────────────────────────────── */

.product-checkboxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.product-check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.product-check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* ── Portal Badge ─────────────────────────────────────────────────────────── */

.lender-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #1e4268;
  background: rgba(30,66,104,0.10);
  border: 1px solid rgba(30,66,104,0.3);
  border-radius: 4px;
  padding: 3px 10px 3px 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.portal-badge:hover {
  background: rgba(30,66,104,0.18);
  border-color: rgba(30,66,104,0.5);
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.875rem; }
.hidden { display: none !important; }

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .lender-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 36px; }
  .product-checkboxes { grid-template-columns: repeat(2, 1fr); }
}

/* ── Smooth theme transitions ─────────────────────────────────────────────── */

body, header, .chat-form, .msg.assistant, .lender-row, .filter-col, .filter-tile,
.action-btn, .chip, .search-input, .internal-bar, footer {
  transition: background-color 0.28s ease, border-color 0.28s ease, color 0.28s ease, box-shadow 0.28s ease;
}

/* ── Theme Toggle Button ─────────────────────────────────────────────────── */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 999px;
  padding: 6px 13px 6px 9px;
  cursor: pointer;
  color: #666;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #aaa;
  border-color: rgba(255,255,255,0.16);
}

.toggle-icon { flex-shrink: 0; }
.toggle-label { line-height: 1; }

/* ── Logo variants ───────────────────────────────────────────────────────── */

.logo-light { display: none; }

/* ── Light Theme ─────────────────────────────────────────────────────────── */

:root[data-theme="light"] {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --blue: #0ea5e9;
  --blue-dim: rgba(14,165,233,0.10);
  --gold: #4f46e5;
  --gold-dim: rgba(79,70,229,0.10);
  --green: #059669;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
}

[data-theme="light"] body {
  background-color: #f8fafc;
  background-image:
    radial-gradient(at 0% 0%, hsla(210,100%,95%,0.6) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(190,100%,95%,0.6) 0px, transparent 50%);
}

[data-theme="light"] header {
  background: rgba(248,250,252,0.93);
}

[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block !important; }

[data-theme="light"] .theme-toggle {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.09);
  color: #94a3b8;
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(0,0,0,0.09);
  color: #555;
  border-color: rgba(0,0,0,0.15);
}

[data-theme="light"] .internal-bar {
  background: rgba(14,165,233,0.07);
  border-bottom-color: rgba(14,165,233,0.14);
  color: #0ea5e9;
}

/* ── Search ── */

[data-theme="light"] .chat-form {
  background: #ffffff;
  border-color: rgba(226,232,240,0.8);
  box-shadow: 0 12px 48px -12px rgba(14,165,233,0.15), 0 4px 12px -4px rgba(14,165,233,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
}

[data-theme="light"] .chat-form:focus-within {
  border-color: rgba(14,165,233,0.45);
  box-shadow: 0 0 0 4px rgba(14,165,233,0.12), 0 12px 48px -12px rgba(14,165,233,0.18);
}

[data-theme="light"] .chat-input::placeholder { color: #64748b; }

[data-theme="light"] .chip {
  background: rgba(0,0,0,0.03);
  border-color: #e2e8f0;
  color: #94a3b8;
}

[data-theme="light"] .chip:hover {
  border-color: rgba(14,165,233,0.3);
  color: #555;
  background: rgba(14,165,233,0.05);
}

/* ── Messages ── */

[data-theme="light"] .msg.user { color: #94a3b8; }

[data-theme="light"] .msg.typing { color: #94a3b8; }

[data-theme="light"] .msg.assistant {
  background: #ffffff;
  border-color: #e2e8f0;
  border-left-color: rgba(14,165,233,0.45);
}

[data-theme="light"] .quick-filter-row { border-top-color: #e2e8f0; }
[data-theme="light"] .quick-filter-label { color: #94a3b8; }
[data-theme="light"] .jump-dir-btn { border-color: #e2e8f0; color: #94a3b8; }
[data-theme="light"] .jump-dir-btn:hover { color: #888; border-color: #cbd5e1; }

/* ── Directory search ── */

[data-theme="light"] .search-input {
  background: #ffffff;
  border-color: #e2e8f0;
}

/* ── Filter grid ── */

[data-theme="light"] .filter-col {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .filter-cat-name { color: #0f172a; }
[data-theme="light"] .filter-cat-desc { color: #94a3b8; }
[data-theme="light"] .filter-cat-divider { background: #e2e8f0; }

[data-theme="light"] .filter-tile {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .filter-tile:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

[data-theme="light"] .filter-tile:hover .filter-tile-name { color: #0f172a; }

[data-theme="light"] .filter-tile-name { color: #64748b; }

[data-theme="light"] .filter-tile.active {
  background: #0ea5e9;
  border-color: #0ea5e9;
  box-shadow: 0 2px 14px rgba(14,165,233,0.22), 0 0 0 1px rgba(14,165,233,0.4);
}

[data-theme="light"] .filter-tile.active .filter-tile-name { color: #ffffff; }

[data-theme="light"] .filter-tile-count {
  background: rgba(0,0,0,0.05);
  color: #94a3b8;
}

[data-theme="light"] .filter-tile.active .filter-tile-count {
  background: rgba(255,255,255,0.22);
  color: #ffffff;
}

/* ── Dir results bar ── */

[data-theme="light"] .dir-results-bar { color: var(--muted); }

/* ── Lender cards ── */

[data-theme="light"] .lender-row {
  background: #ffffff;
  border-color: rgba(226,232,240,0.8);
  box-shadow: 0 8px 32px -8px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
}

[data-theme="light"] .lender-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 14px 40px -10px rgba(15,23,42,0.10), inset 0 1px 0 rgba(255,255,255,0.8);
}

[data-theme="light"] .lender-row::before {
  background: linear-gradient(90deg, rgba(14,165,233,0.4), transparent 70%);
}

[data-theme="light"] .lc-divider { background: #f1f5f9; }
[data-theme="light"] .lc-spec { color: #94a3b8; }
[data-theme="light"] .lc-main-website { color: #94a3b8; }
[data-theme="light"] .lc-contact-item { color: #94a3b8; }
[data-theme="light"] .lc-contact-item:hover { color: #888; }
[data-theme="light"] .lc-notes { color: rgba(79,70,229,0.6); }

/* ── Action buttons ── */

[data-theme="light"] .action-btn {
  border-color: #e2e8f0;
  color: #94a3b8;
}

[data-theme="light"] .action-btn:hover {
  border-color: #cbd5e1;
  color: #555;
  background: rgba(0,0,0,0.03);
}

/* ── Sources panel ── */

[data-theme="light"] .sources-toggle { color: #4f46e5; }
[data-theme="light"] .sources-toggle:hover { color: #4338ca; }
[data-theme="light"] .source-item {
  background: rgba(0,0,0,0.02);
  border-color: #e2e8f0;
}
[data-theme="light"] .source-excerpt { color: #94a3b8; }
[data-theme="light"] .source-page {
  background: rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.2);
}

/* ── Admin access ── */

[data-theme="light"] .admin-access-btn {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
  color: #94a3b8;
}

[data-theme="light"] .admin-access-btn:hover {
  color: #888;
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
}

/* ── Footer ── */

[data-theme="light"] footer { border-top-color: #e2e8f0; }
[data-theme="light"] .footer-internal-note { color: rgba(79,70,229,0.45); }
[data-theme="light"] .footer-gold-rule { opacity: 0.35; }

/* ── Skeleton ── */

[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #e2e8f0 50%, #e2e8f0 75%);
  background-size: 200% 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NEW — Answer Card, Toast, Category Headers, Lender Highlight
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Query hint ── */

.query-hint {
  text-align: center;
  font-size: 13px;
  color: var(--faint);
  font-style: italic;
  margin-top: 14px;
  letter-spacing: 0.01em;
}
.query-hint.hidden { display: none; }

/* ── Search result tile ── */

.search-result-tile {
  background: #141414;
  border: 1px solid #262626;
  border-left: 3px solid #1e4268;
  border-radius: 12px;
  margin-top: 16px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}
.search-result-tile.hidden { display: none; }

.srt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  gap: 12px;
}
.srt-header:hover { background: #1a1a1a; }

.srt-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.srt-icon { color: #1e4268; flex-shrink: 0; }

.srt-count {
  font-size: 15px;
  color: #f2f2f2;
  font-family: 'Schibsted Grotesk', sans-serif;
  white-space: nowrap;
}
.srt-label {
  font-size: 15px;
  color: #d4d4d4;
  font-family: 'Schibsted Grotesk', sans-serif;
  white-space: nowrap;
}

.srt-filter-chip {
  background: rgba(30,66,104,0.12);
  border: 1px solid rgba(30,66,104,0.3);
  color: #1e4268;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Schibsted Grotesk', sans-serif;
  white-space: nowrap;
}

.srt-chevron {
  color: #888;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: transform 0.25s ease;
}
.srt-chevron.expanded { transform: rotate(180deg); }

.srt-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease-out;
}
.srt-body.open { grid-template-rows: 1fr; }

.srt-body-inner {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.2s ease 0.1s;
}
.srt-body.open .srt-body-inner { opacity: 1; }

.srt-rows {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.srt-empty {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.srt-view-all {
  width: 100%;
  text-align: center;
  padding: 10px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #1e4268;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Schibsted Grotesk', sans-serif;
  transition: background 0.15s;
}
.srt-view-all:hover { background: rgba(30,66,104,0.07); }

[data-theme="light"] .search-result-tile {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .srt-header:hover { background: #f8f8f8; }
[data-theme="light"] .srt-count { color: #111; }
[data-theme="light"] .srt-label { color: #555; }
[data-theme="light"] .srt-chevron { color: #999; }
[data-theme="light"] .srt-view-all { border-color: #e5e5e5; }

/* ── Answer card ── */

/* ── Answer card v2 — 3-zone (header / body / footer) ──────────────────── */

.answer-card {
  background: linear-gradient(180deg, #161616 0%, #131313 100%);
  border: 1px solid #262626;
  border-left: 3px solid #1e4268;
  border-radius: 14px;
  max-width: 820px;
  margin: 20px auto 0;
  overflow: hidden;
  padding: 0;
  opacity: 0;
  transition: opacity 200ms ease;
}
.answer-card.in { opacity: 1; }
.answer-card.hidden { display: none; }

/* Zone 1: header strip */
.ans-head {
  padding: 16px 24px 12px;
  border-bottom: 1px solid #1f1f1f;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ans-head-left { display: inline-flex; gap: 10px; align-items: center; }
.ans-label   { font-size: 11px; font-weight: 600; letter-spacing: 2.5px; color: #1e4268; }
.ans-dot     { color: #555; font-size: 11px; }
.ans-subject { color: #888; font-size: 12px; }
.ans-verified {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  color: #1c7c43; background: rgba(46, 160, 92, 0.14);
  border: 1px solid rgba(46, 160, 92, 0.35);
}
[data-theme="dark"] .ans-verified { color: #6ee29f; }
.ans-dismiss {
  background: transparent;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: #555;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.ans-dismiss:hover { color: #f2f2f2; }

/* Zone 2: body */
.ans-body { padding: 16px 20px 12px; }

/* Progressive streaming: blinking caret on the prose while it types in. */
.ans-stream .ans-expl.is-streaming::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: currentColor;
  opacity: 0.7;
  animation: ans-caret-blink 1s steps(1) infinite;
}
@keyframes ans-caret-blink { 50% { opacity: 0; } }

/* Comparison table */
.ans-table-wrap {
  background: rgba(30,66,104,0.06);
  border: 1px solid rgba(30,66,104,0.15);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.ans-table-head,
.ans-table-row { display: grid; align-items: center; }
.ans-table-head {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(30,66,104,0.15);
  font-size: 11px;
  color: #1e4268;
  letter-spacing: 1.5px;
  font-weight: 600;
  text-transform: uppercase;
  gap: 12px;
  text-align: left;
}
.ans-table-head > div { text-align: left; }
.ans-table-row {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 12px;
}
.ans-table-row > div { text-align: left; }
.ans-table-row:last-child { border-bottom: 0; }
.ans-tcell-lender {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #f2f2f2;
}
.ans-tcell-lender-btn {
  display: inline-block;
  padding-bottom: 1px;
  border-bottom: 1px dotted rgba(30,66,104,0.4);
  cursor: help;
  outline: none;
}
.ans-tcell-lender-btn:focus-visible {
  border-bottom-color: #1e4268;
  border-bottom-style: solid;
}
@media (hover: none) {
  .ans-tcell-lender-btn { cursor: pointer; }
}
.ans-tcell-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 400;
  color: #f2f2f2;
}
.ans-tcell-num.is-missing { font-size: 14px; color: #666; font-weight: 400; }
.ans-tcell-notes { font-size: 12px; color: #888; text-align: left; }
.ans-tcell-scenario { color: #c4c4c4; font-size: 13px; text-align: left; }

/* Verdict banner */
.ans-verdict {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  border-left: 3px solid;
}
.ans-verdict.is-yes  { background: rgba(47,158,110,0.10); border-left-color: #2f9e6e; }
.ans-verdict.is-no   { background: rgba(212,82,82,0.10);  border-left-color: #d45252; }
.ans-verdict.is-cond { background: rgba(201,169,97,0.10); border-left-color: #c9a961; }
.ans-verdict-tag { font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.ans-verdict.is-yes  .ans-verdict-tag { color: #2f9e6e; }
.ans-verdict.is-no   .ans-verdict-tag { color: #d45252; }
.ans-verdict.is-cond .ans-verdict-tag { color: #c9a961; }
.ans-verdict-cond { margin-top: 4px; font-size: 14px; color: #f2f2f2; line-height: 1.5; }

/* List body (compact lender rows live inside) */
.ans-list-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ans-list-missing {
  font-size: 12px; color: #666; padding: 8px 12px;
  border: 1px dashed #2a2a2a; border-radius: 8px;
}

/* Explanation paragraph */
.ans-expl {
  color: #c4c4c4;
  font-size: 14px;
  line-height: 1.6;
  padding: 4px 2px 0;
  margin: 0;
  font-family: 'Schibsted Grotesk', sans-serif;
  white-space: pre-wrap;
}
.ans-expl .ans-num { color: #f2f2f2; font-weight: 600; }

/* Zone 3: action footer */
.ans-foot {
  padding: 12px 24px 14px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid #1f1f1f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.ans-foot-left,
.ans-foot-right { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ans-foot-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  color: #555; text-transform: uppercase;
}
.ans-foot-right .ans-foot-label {
  font-size: 11px; letter-spacing: 0; color: #666;
  text-transform: none; font-weight: 400;
}

/* ── Answer card: copy / export tools ──────────────────────────────────────
   A quiet utility row under the answer. Buttons are ghost-style so they never
   compete with the sources footer or follow-up chips, but light up on hover. */
.ans-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 24px 0;
}
.ans-tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: #b9b9b9; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ans-tool-btn:hover { background: rgba(30,66,104,0.10); color: #e6e6e6; border-color: rgba(30,66,104,0.30); }
.ans-tool-btn svg { opacity: 0.85; }
.ans-tool-btn.copied { color: #6ee29f; border-color: rgba(46,160,92,0.4); background: rgba(46,160,92,0.12); }
[data-theme="light"] .ans-tool-btn { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }
[data-theme="light"] .ans-tool-btn:hover { background: #f0f9ff; color: #334155; border-color: #bae6fd; }
[data-theme="light"] .ans-tool-btn.copied { color: #1c7c43; background: rgba(46,160,92,0.12); border-color: rgba(46,160,92,0.35); }

/* ── Accessible focus rings ────────────────────────────────────────────────
   Keyboard users need a visible focus indicator everywhere. :focus-visible
   keeps it keyboard-only so mouse clicks stay clean. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #1e4268;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Answer card: suggested follow-ups ─────────────────────────────────────
   Sits below the sources footer. Goal is "obvious next tap" — chips look
   distinct from source/lender chips (rounded pill, accent border) so brokers
   recognize them as conversational continuations rather than citations. */
.ans-followups {
  padding: 14px 24px 18px;
  border-top: 1px solid #1f1f1f;
  background: rgba(40,105,197,0.04);
}
.ans-followups-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  color: #6b7a8c; text-transform: uppercase;
  margin-bottom: 10px;
}
.ans-followups-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.ans-followup-chip {
  display: inline-flex; align-items: center;
  background: rgba(40,105,197,0.10);
  border: 1px solid rgba(40,105,197,0.35);
  color: #6ea8ff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.ans-followup-chip::before {
  content: '↪'; margin-right: 8px; opacity: 0.7; font-size: 12px;
}
.ans-followup-chip:hover {
  background: rgba(40,105,197,0.20);
  border-color: rgba(40,105,197,0.60);
}
.ans-followup-chip:active { transform: scale(0.97); }

/* ── Answer card: inline follow-up composer ────────────────────────────────
   Sits at the very bottom of the answer card. Read above, type below —
   keeps the conversation in one visual unit. */
.ans-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px 18px;
  border-top: 1px solid #1f1f1f;
  background: rgba(255,255,255,0.015);
}
.ans-composer-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text, #f2f2f2);
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 150ms, background 150ms;
}
.ans-composer-input::placeholder { color: rgba(255,255,255,0.40); }
.ans-composer-input:focus {
  border-color: rgba(40,105,197,0.60);
  background: rgba(255,255,255,0.06);
}
.ans-composer-send {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #2869c5;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms, transform 100ms;
}
.ans-composer-send:hover { background: #1f5aae; }
.ans-composer-send:active { transform: scale(0.92); }

[data-theme="light"] .ans-composer {
  background: rgba(0,0,0,0.015);
  border-top-color: #e2e8f0;
}
[data-theme="light"] .ans-composer-input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
[data-theme="light"] .ans-composer-input::placeholder { color: #64748b; }
[data-theme="light"] .ans-composer-input:focus {
  border-color: #0ea5e9;
  background: #ffffff;
}

.ans-src-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #d4d4d4;
  text-decoration: none;
  font-family: 'Schibsted Grotesk', sans-serif;
  transition: border-color 150ms, color 150ms;
}
.ans-src-chip svg { color: #1e4268; flex-shrink: 0; }
.ans-src-chip:hover { border-color: #1e4268; color: #1e4268; }
/* 1.6 — the source the broker most recently opened keeps a soft glow so they
   can find their place again after returning from the PDF viewer. */
.ans-src-chip.is-recent {
  border-color: #1e4268;
  color: #1e4268;
  animation: srcRecentGlow 1.8s ease-in-out infinite;
}
.ans-src-chip.is-recent svg { color: #1e4268; }
@keyframes srcRecentGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(30,66,104,0.30), 0 0 8px -2px rgba(30,66,104,0.40); }
  50%      { box-shadow: 0 0 0 1px rgba(30,66,104,0.55), 0 0 16px -2px rgba(30,66,104,0.75); }
}

/* 1.8 — consistent icon bounce on hover across EVERY answer-card chip
   (follow-up ↪, source file icon, lender arrow) so the micro-interaction
   reads the same everywhere instead of only firing on some chips. */
@keyframes chipIconBounce {
  0%, 100% { transform: translateY(0); }
  35%      { transform: translateY(-3px); }
  70%      { transform: translateY(0); }
}
@media (hover: hover) {
  .ans-followup-chip:hover::before,
  .ans-src-chip:hover svg,
  .ans-lender-chip:hover svg { animation: chipIconBounce 0.45s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .ans-src-chip.is-recent { animation: none; }
  .ans-followup-chip:hover::before,
  .ans-src-chip:hover svg,
  .ans-lender-chip:hover svg { animation: none; }
}

.ans-lender-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(30,66,104,0.10);
  border: 1px solid rgba(30,66,104,0.3);
  padding: 7px 12px;
  border-radius: 6px;
  color: #1e4268;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Schibsted Grotesk', sans-serif;
  transition: background 150ms, border-color 150ms;
}
.ans-lender-chip:hover {
  background: rgba(30,66,104,0.18);
  border-color: rgba(30,66,104,0.55);
}
.ans-lender-chip svg { color: #1e4268; flex-shrink: 0; }

/* Compact lender row (used by .ans-list-wrap) */
.lender-row.lender-row-compact {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px;
  background: #161616;
  border: 1px solid #262626;
  border-radius: 10px;
}
.lender-row-compact .lrc-left {
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 0; flex: 1 1 auto;
}
.lender-row-compact .lrc-name {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 15px; font-weight: 600; color: #f2f2f2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lender-row-compact .lrc-chips {
  display: inline-flex; gap: 6px; flex-wrap: wrap;
  flex: 0 1 auto;
}
.lender-row-compact .lrc-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: #888;
  background: rgba(255,255,255,0.04);
  border: 1px solid #262626;
  padding: 3px 8px; border-radius: 4px;
  white-space: nowrap;
}

/* Status row (pre-render search hint) */
.ans-status {
  margin: 14px auto 0;
  max-width: 820px;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #888;
  font-family: 'Schibsted Grotesk', sans-serif;
}
.ans-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #1e4268;
  animation: ansPulse 1.2s ease-in-out infinite;
}
@keyframes ansPulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* ── Thinking state ──────────────────────────────────────────────────────────
   Step-by-step animated pre-answer indicator. Sits in the same slot as
   the answer card / status row. Visual-only; backend untouched. */
.ans-thinking {
  margin: 14px auto 0;
  max-width: 820px;
  padding: 14px 18px;
  background: #141414;
  border: 1px solid #262626;
  border-radius: 10px;
  font-family: 'Schibsted Grotesk', sans-serif;
}
.ans-thinking-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  opacity: 0.35;
  transition: opacity 0.25s ease;
}
.ans-thinking-step + .ans-thinking-step {
  border-top: 1px solid #1e1e1e;
}
.ans-thinking-circle {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #3a3a3a;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ans-thinking-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ans-thinking-label {
  font-size: 13px;
  color: #f2f2f2;
  line-height: 1.2;
}
.ans-thinking-sublabel {
  font-size: 11px;
  color: #888;
  line-height: 1.2;
}

/* Active state */
.ans-thinking-step.is-active { opacity: 1; }
.ans-thinking-step.is-active .ans-thinking-circle {
  border-color: #1e4268;
}
.ans-thinking-step.is-active .ans-thinking-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e4268;
  animation: ansThinkingPulse 1s ease-in-out infinite;
}
.ans-thinking-step.is-active .ans-thinking-label    { color: #f2f2f2; }
.ans-thinking-step.is-active .ans-thinking-sublabel { color: #1e4268; }

/* Done state */
.ans-thinking-step.is-done { opacity: 1; }
.ans-thinking-step.is-done .ans-thinking-circle {
  border-color: #2f9e6e;
  background: #2f9e6e;
}
.ans-thinking-step.is-done .ans-thinking-label    { color: #888; }
.ans-thinking-step.is-done .ans-thinking-sublabel { color: #555; }
.ans-thinking-step.is-done .ans-thinking-check { display: block; }
.ans-thinking-check {
  display: none;
  width: 12px;
  height: 12px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes ansThinkingPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* Light theme variant */
[data-theme="light"] .ans-thinking {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
[data-theme="light"] .ans-thinking-step + .ans-thinking-step {
  border-top-color: #e2e8f0;
}
[data-theme="light"] .ans-thinking-circle { border-color: #cbd5e1; }
[data-theme="light"] .ans-thinking-label  { color: #0f172a; }
[data-theme="light"] .ans-thinking-sublabel { color: #64748b; }
[data-theme="light"] .ans-thinking-step.is-done .ans-thinking-label    { color: #64748b; }
[data-theme="light"] .ans-thinking-step.is-done .ans-thinking-sublabel { color: #94a3b8; }

/* Footer chip → directory scroll highlight */
.lender-row.ans-pulse { animation: ansLenderPulse 1.5s ease-out 1; }
@keyframes ansLenderPulse {
  0%   { box-shadow: 0 0 0 2px #1e4268; }
  100% { box-shadow: 0 0 0 2px rgba(30,66,104,0); }
}

/* ── Toast ── */

.verchena-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  background: #141414;
  border: 1px solid #1e4268;
  color: #f2f2f2;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Schibsted Grotesk', sans-serif;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 300px;
}
.verchena-toast.visible { opacity: 1; transform: translateY(0); }

/* ── Category header active/partial states ── */

.filter-cat-header { transition: opacity 0.15s; }

.filter-col.cat-active .filter-cat-name { color: #ffffff; }
.filter-col.cat-partial .filter-cat-name { color: #f2f2f2; }

.filter-cat-divider { transition: background 0.2s; }

/* ── Lender highlight (lender_contact route) ── */

@keyframes lender-pulse {
  0%   { border-color: #1e4268; box-shadow: 0 0 0 3px rgba(30,66,104,0.22); }
  100% { border-color: var(--border); box-shadow: none; }
}

.lender-row.lender-highlight {
  animation: lender-pulse 1.5s ease-out forwards;
}

/* ── Light theme overrides for new elements ── */

[data-theme="light"] .answer-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(226,232,240,0.8);
  border-left-color: #0ea5e9;
  box-shadow: 0 8px 32px -8px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
}
[data-theme="light"] .ans-head { border-bottom-color: #e2e8f0; }
[data-theme="light"] .ans-label { color: #0ea5e9; }
[data-theme="light"] .ans-dot { color: #94a3b8; }
[data-theme="light"] .ans-subject { color: #64748b; }
[data-theme="light"] .ans-dismiss { color: #94a3b8; }
[data-theme="light"] .ans-dismiss:hover { color: #0f172a; }
[data-theme="light"] .ans-table-wrap {
  background: rgba(14,165,233,0.05);
  border-color: rgba(14,165,233,0.18);
}
[data-theme="light"] .ans-table-head {
  color: #0ea5e9;
  border-bottom-color: rgba(14,165,233,0.18);
}
[data-theme="light"] .ans-table-row { border-bottom-color: rgba(0,0,0,0.04); }
[data-theme="light"] .ans-tcell-lender,
[data-theme="light"] .ans-tcell-num { color: #0f172a; }
[data-theme="light"] .ans-tcell-num.is-missing { color: #94a3b8; }
[data-theme="light"] .ans-tcell-scenario { color: #475569; }
[data-theme="light"] .ans-tcell-notes { color: #64748b; }
[data-theme="light"] .ans-verdict-cond { color: #0f172a; }
[data-theme="light"] .ans-expl { color: #334155; }
[data-theme="light"] .ans-expl .ans-num { color: #0f172a; }
[data-theme="light"] .ans-foot {
  background: rgba(0,0,0,0.02);
  border-top-color: #e2e8f0;
}
[data-theme="light"] .ans-followups {
  background: rgba(14,165,233,0.05);
  border-top-color: #e2e8f0;
}
[data-theme="light"] .ans-followups-label { color: #64748b; }
[data-theme="light"] .ans-followup-chip {
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.35);
  color: #0ea5e9;
}
[data-theme="light"] .ans-followup-chip:hover {
  background: rgba(14,165,233,0.16);
  border-color: rgba(14,165,233,0.55);
}
[data-theme="light"] .ans-foot-label { color: #94a3b8; }
[data-theme="light"] .ans-foot-right .ans-foot-label { color: #94a3b8; }
[data-theme="light"] .ans-src-chip {
  background: #f8fafc; border-color: #e2e8f0; color: #334155;
}
[data-theme="light"] .ans-src-chip svg { color: #0ea5e9; }
[data-theme="light"] .ans-src-chip:hover { border-color: #0ea5e9; color: #0ea5e9; }
[data-theme="light"] .ans-lender-chip {
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.35);
  color: #0ea5e9;
}
[data-theme="light"] .ans-lender-chip:hover {
  background: rgba(14,165,233,0.16);
  border-color: rgba(14,165,233,0.55);
}
[data-theme="light"] .ans-lender-chip svg { color: #0ea5e9; }
[data-theme="light"] .ans-status { color: #64748b; }
[data-theme="light"] .ans-list-missing { border-color: #e2e8f0; color: #94a3b8; }
[data-theme="light"] .lender-row.lender-row-compact {
  background: #ffffff; border-color: #e2e8f0;
}
[data-theme="light"] .lender-row-compact .lrc-name { color: #0f172a; }
[data-theme="light"] .lender-row-compact .lrc-chip {
  background: #f8fafc; border-color: #e2e8f0; color: #64748b;
}
[data-theme="light"] .query-hint { color: #94a3b8; }
[data-theme="light"] .verchena-toast { background: #ffffff; border-color: #0ea5e9; color: #0f172a; }

/* ── Admin: light-theme overrides ────────────────────────────────────────── */
/* The admin page defaults to the daytime palette. Most admin elements use
   CSS variables (--bg/--card/--border/--text) so they retheme for free, but a
   handful of rules hardcode rgba(255,255,255,X) hover/background fills meant
   for the dark scheme. These rules invert those to dark-on-light equivalents
   so the sidebar, tables, modals, and reusable widgets look correct in light
   mode without affecting the public site. */
[data-theme="light"] .admin-sidebar { background: #ffffff; }
[data-theme="light"] .admin-nav-item:hover { background: rgba(0,0,0,0.04); color: #0f172a; }
[data-theme="light"] .admin-nav-item.active { background: rgba(14,165,233,0.10); color: #0ea5e9; }
[data-theme="light"] th { background: rgba(0,0,0,0.025); color: #64748b; }
[data-theme="light"] tr:hover td { background: rgba(14,165,233,0.04); }
[data-theme="light"] .table-wrap { background: #ffffff; }
[data-theme="light"] .modal { background: #ffffff; box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 20px 60px rgba(15,23,42,0.18); }
[data-theme="light"] .modal-header, [data-theme="light"] .modal-footer { border-color: #e2e8f0; }
[data-theme="light"] .modal-overlay { background: rgba(15,23,42,0.45); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea {
  background: #f8fafc; border-color: #e2e8f0; color: #0f172a;
}
[data-theme="light"] input::placeholder, [data-theme="light"] textarea::placeholder { color: #64748b; }
[data-theme="light"] input:focus, [data-theme="light"] select:focus, [data-theme="light"] textarea:focus {
  background: #ffffff; border-color: #0ea5e9;
}
[data-theme="light"] .stat-card { background: #ffffff; }
[data-theme="light"] .btn-ghost { background: transparent; border-color: #e2e8f0; color: #64748b; }
[data-theme="light"] .btn-ghost:hover { border-color: #0ea5e9; color: #0f172a; background: rgba(14,165,233,0.04); }
[data-theme="light"] .btn-danger { background: rgba(220,53,69,0.08); border-color: rgba(220,53,69,0.30); color: #b8242e; }
[data-theme="light"] .btn-danger:hover { background: rgba(220,53,69,0.14); }
[data-theme="light"] .admin-c2-header { background: rgba(0,0,0,0.025); }
[data-theme="light"] .admin-c2-header:hover { background: rgba(14,165,233,0.06); }
[data-theme="light"] .admin-c2-header-hint { color: #64748b; }
[data-theme="light"] .admin-image-preview { background: #f8fafc; border-color: #e2e8f0; }
[data-theme="light"] .admin-image-preview.drop-zone:hover { border-color: #0ea5e9; background: rgba(14,165,233,0.04); }
[data-theme="light"] .coverage-tile { background: #ffffff; border-color: #e2e8f0; color: #0f172a; }
[data-theme="light"] .coverage-tile:hover { border-color: #0ea5e9; background: rgba(14,165,233,0.04); }
[data-theme="light"] .admin-badge { color: #4f46e5; border-color: rgba(79,70,229,0.4); }
[data-theme="light"] .all-lenders-toggle { background: #ffffff; border-color: #e2e8f0; color: #0f172a; }
[data-theme="light"] .all-lenders-toggle:hover { background: rgba(14,165,233,0.04); border-color: #0ea5e9; }

/* ── All Lenders (below directory) ───────────────────────────────────────── */
.all-lenders-section { padding: 8px 0 64px; }

.all-lenders-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.all-lenders-toggle:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.16);
}
.all-lenders-toggle-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.all-lenders-chevron {
  opacity: 0.55;
  transition: transform 200ms ease;
}
.all-lenders-toggle[aria-expanded="true"] .all-lenders-chevron {
  transform: rotate(180deg);
}
.all-lenders-toggle[aria-expanded="true"] {
  border-color: rgba(30,66,104,0.35);
  background: rgba(30,66,104,0.04);
}

.all-lenders-panel {
  margin-top: 18px;
  animation: alFadeIn 220ms ease;
}
@keyframes alFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.all-lenders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.all-lenders-list .lender-row {
  width: 100%;
  animation: alFadeIn 200ms ease;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  column-gap: 28px;
  row-gap: 8px;
  align-items: start;
}
.all-lenders-list .lender-row > * { grid-column: 1; min-width: 0; }
.all-lenders-list .lender-row > .lc-contact-row {
  grid-column: 2;
  grid-row: 1 / 100;
  align-self: start;
  margin: 0;
}
/* Collapse the 98 implicit empty rows the span creates so they don't
   compound with row-gap into hundreds of px of dead vertical space. */
.all-lenders-list .lender-row { grid-auto-rows: min-content; row-gap: 0; }
.all-lenders-list .lender-row > *:not(.lc-contact-row) { margin-bottom: 8px; }
.all-lenders-list .lender-row > *:not(.lc-contact-row):last-child { margin-bottom: 0; }
.all-lenders-list .lender-row > .lc-divider { display: none; }
@media (max-width: 720px) {
  .all-lenders-list .lender-row {
    grid-template-columns: 1fr;
  }
  .all-lenders-list .lender-row > .lc-contact-row {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }
  .all-lenders-list .lender-row > .lc-divider { display: block; }
}

/* Compact 2×2 grid of square contact tiles — icon, action label, value. */
.lc-contact-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.lc-contact-row > .lc-contact-rows { width: 100%; }
.lc-tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 13px 8px;
  min-height: 90px;
  background: #141414;
  border: 1px solid #232323;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.lc-tile:hover { background: #181818; border-color: #3a3a3a; transform: translateY(-1px); }
.lc-tile:active { transform: translateY(0); }
.lc-tile-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: #1e1e1e;
  border: 1px solid #2c2c2c;
  color: #cfcfcf;
  transition: color 150ms ease, border-color 150ms ease;
}
.lc-tile svg { width: 17px; height: 17px; flex-shrink: 0; }
.lc-tile:hover .lc-tile-icon { color: #1e4268; border-color: #1e4268; }
.lc-tile-label {
  font-size: 13px;
  font-weight: 600;
  color: #f2f2f2;
  line-height: 1.1;
}
.lc-tile-sub {
  max-width: 100%;
  font-size: 11px;
  font-weight: 400;
  color: #777;
  line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lc-tile-placeholder { cursor: default; }
.lc-tile-placeholder .lc-tile-label { color: #888; }
.lc-tile-placeholder .lc-tile-sub { font-style: italic; color: #666; }
.lc-tile-placeholder:hover { background: #141414; border-color: #232323; transform: none; }
.lc-tile-placeholder:hover .lc-tile-icon { color: #cfcfcf; border-color: #2c2c2c; }

[data-theme="light"] .lc-tile { background: #f1f5f9; border-color: #e2e8f0; }
[data-theme="light"] .lc-tile:hover { background: #e2e8f0; border-color: #cbd5e1; }
[data-theme="light"] .lc-tile-icon {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .lc-tile:hover .lc-tile-icon { color: #0ea5e9; border-color: #0ea5e9; }
[data-theme="light"] .lc-tile-label { color: #0f172a; }
[data-theme="light"] .lc-tile-sub { color: #94a3b8; }
[data-theme="light"] .lc-tile-placeholder .lc-tile-label { color: #94a3b8; }
[data-theme="light"] .lc-tile-placeholder .lc-tile-sub { color: #94a3b8; }
[data-theme="light"] .lc-tile-placeholder:hover { background: #f1f5f9; border-color: #e2e8f0; }
[data-theme="light"] .lc-tile-placeholder:hover .lc-tile-icon { color: #64748b; border-color: #e2e8f0; }

/* Gold Save-to-Phone button, visually separated from the rows above. */
.lc-save-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 7px;
  width: 100%;
  height: 36px;
  margin-top: 10px;
  padding: 0 12px;
  background: linear-gradient(135deg, rgba(201,169,97,0.15) 0%, rgba(201,169,97,0.08) 100%);
  border: 1px solid rgba(201,169,97,0.4);
  border-radius: 8px;
  color: #c9a961;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.lc-save-btn svg { width: 13px; height: 13px; }
.lc-save-btn:hover {
  background: linear-gradient(135deg, rgba(201,169,97,0.28) 0%, rgba(201,169,97,0.16) 100%);
  border-color: rgba(201,169,97,0.65);
}
.lc-save-btn svg { color: #c9a961; flex-shrink: 0; }

.all-lender-name {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.all-lender-name:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.14);
}
.all-lender-name.active {
  background: rgba(30,66,104,0.10);
  border-color: rgba(30,66,104,0.45);
  color: #82b3ec;
}

.all-lenders-card-slot {
  margin-top: 18px;
}
.all-lenders-card-slot:empty { margin-top: 0; }
.all-lenders-card-slot .lender-row {
  animation: alFadeIn 200ms ease;
}

/* Light theme */
[data-theme="light"] .all-lenders-toggle {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
[data-theme="light"] .all-lenders-toggle:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
[data-theme="light"] .all-lenders-toggle[aria-expanded="true"] {
  background: rgba(14,165,233,0.05);
  border-color: rgba(14,165,233,0.30);
}
[data-theme="light"] .all-lender-name {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
[data-theme="light"] .all-lender-name:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
[data-theme="light"] .all-lender-name.active {
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.45);
  color: #0ea5e9;
}

/* ── 2nd Contact toggle + block (lender card) ────────────────────────────── */
.c2-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  color: #888;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 140ms ease, color 140ms ease;
}
.c2-toggle:hover { border-color: #1e4268; color: #1e4268; }
.c2-toggle-chevron { transition: transform 220ms ease; opacity: 0.85; }
.c2-toggle.open .c2-toggle-chevron { transform: rotate(180deg); }
.c2-toggle.open { border-color: rgba(30,66,104,0.55); color: #1e4268; }

.c2-block {
  background: rgba(30,66,104,0.04);
  border: 1px solid #1f1f1f;
  border-left: 2px solid rgba(30,66,104,0.4);
  border-radius: 0 8px 8px 0;
  padding: 0 16px;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 250ms ease, opacity 200ms ease, padding 250ms ease, margin 250ms ease;
}
.c2-block.open {
  max-height: 320px;
  padding: 14px 16px;
  margin: 12px 0 16px;
  opacity: 1;
}
.c2-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #1e4268;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.c2-name {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #f2f2f2;
  line-height: 1.3;
}
.c2-name-pending { color: #555; font-style: italic; font-weight: 500; }
.c2-role { font-size: 12px; color: #888; margin-top: 2px; }
.c2-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.c2-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.c2-action-btn:hover:not(.disabled) {
  background: rgba(30,66,104,0.08);
  border-color: rgba(30,66,104,0.35);
  color: #82b3ec;
}
.c2-action-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Light theme overrides */
[data-theme="light"] .c2-toggle { border-color: #cbd5e1; color: #64748b; }
[data-theme="light"] .c2-toggle:hover { border-color: #0ea5e9; color: #0ea5e9; }
[data-theme="light"] .c2-toggle.open { border-color: rgba(14,165,233,0.5); color: #0ea5e9; }
[data-theme="light"] .c2-block {
  background: rgba(14,165,233,0.05);
  border-color: #e2e8f0;
  border-left-color: rgba(14,165,233,0.45);
}
[data-theme="light"] .c2-label { color: #0ea5e9; }
[data-theme="light"] .c2-name { color: #0f172a; }
[data-theme="light"] .c2-name-pending { color: #94a3b8; }
[data-theme="light"] .c2-role { color: #64748b; }
[data-theme="light"] .c2-action-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
[data-theme="light"] .c2-action-btn:hover:not(.disabled) {
  background: rgba(14,165,233,0.06);
  border-color: rgba(14,165,233,0.35);
  color: #0ea5e9;
}

/* ── Lender logo + contact headshot avatars (Pass A) ────────────────────── */
.avatar, .monogram {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.06);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.monogram {
  color: rgba(255,255,255,0.92);
  font-family: 'Schibsted Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  user-select: none;
}
.monogram-logo, .avatar-logo {
  border-radius: 8px; /* lender logos are squarer */
}
[data-theme="light"] .avatar, [data-theme="light"] .monogram {
  border-color: #e2e8f0;
  background: #e2e8f0;
}
[data-theme="light"] .monogram { color: #fff; }

/* Reposition lc-top so logo+name align horizontally with portal badge */
.lc-top { align-items: center; }
.lc-top .lc-name { margin-left: 2px; }

/* Contact name row already uses flex+gap; nothing extra needed */
.lc-contact-name > span { line-height: 1.2; }

/* 2nd-contact header row: headshot + name/role side-by-side */
.c2-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.c2-id-col { display: flex; flex-direction: column; min-width: 0; }
.c2-block.open { max-height: 380px; } /* a bit more room for the headshot row */

/* Lender contact popover (portaled to document.body) */
.lender-popover {
  position: absolute;
  min-width: 260px;
  max-width: 320px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  z-index: 100;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
  font-family: 'Schibsted Grotesk', sans-serif;
}
.lender-popover.in {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.lender-popover.flip-up { transform: translateY(4px); }
.lender-popover.flip-up.in { transform: translateY(0); }

.lp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.lp-name {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #f2f2f2;
  line-height: 1.2;
}
.lp-ae {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}
.lp-comp {
  background: rgba(201,169,97,0.10);
  border: 1px solid rgba(201,169,97,0.3);
  color: #c9a961;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.lp-dismiss {
  display: none;
  background: transparent;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: #555;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (hover: none) {
  .lp-dismiss { display: inline-flex; }
}

.lp-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.lp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #141414;
  border: 1px solid #262626;
  border-radius: 6px;
  color: #d4d4d4;
  font-size: 12px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.lp-row svg { color: #888; flex-shrink: 0; transition: color 0.15s; }
.lp-row:hover { border-color: #1e4268; color: #1e4268; }
.lp-row:hover svg { color: #1e4268; }
.lp-row.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  font-style: italic;
  color: #555;
}
.lp-row.is-disabled:hover { border-color: #262626; color: #555; }
.lp-row.is-disabled:hover svg { color: #888; }

.lp-save {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(201,169,97,0.15) 0%, rgba(201,169,97,0.08) 100%);
  border: 1px solid rgba(201,169,97,0.4);
  color: #c9a961;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Schibsted Grotesk', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lp-save:hover {
  background: linear-gradient(135deg, rgba(201,169,97,0.22) 0%, rgba(201,169,97,0.12) 100%);
  border-color: rgba(201,169,97,0.6);
}
.lp-empty { font-size: 12px; font-style: italic; color: #555; }

/* Light theme overrides */
[data-theme="light"] .lender-popover {
  background: #ffffff;
  border-color: #e5e5e5;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
[data-theme="light"] .lp-name { color: #0f172a; }
[data-theme="light"] .lp-ae { color: #64748b; }
[data-theme="light"] .lp-row {
  background: #f5f5f5;
  border-color: #e5e5e5;
  color: #444;
}
[data-theme="light"] .lp-row svg { color: #64748b; }
[data-theme="light"] .lp-row:hover { border-color: #0ea5e9; color: #0ea5e9; }
[data-theme="light"] .lp-row:hover svg { color: #0ea5e9; }
[data-theme="light"] .lp-row.is-disabled { color: #94a3b8; }
[data-theme="light"] .lp-dismiss { color: #94a3b8; }

/* ─────────────── Bottom-sheet popover + mobile answer card ─────────────── */

/* Full-screen backdrop behind the bottom sheet (mobile only — JS toggles
   .in when entering bottom-sheet mode). */
.lender-popover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
  z-index: 99;
}
.lender-popover-backdrop.in {
  opacity: 1;
  pointer-events: auto;
}

/* Bottom-sheet variant of the popover. Class is added by JS when the
   viewport is <=640px. Overrides the absolute desktop positioning. */
.lender-popover.is-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  border-radius: 16px 16px 0 0;
  padding: 20px 20px 32px;
  transform: translateY(100%);
  transition: transform 250ms ease-out, opacity 200ms ease;
  box-shadow: 0 -12px 32px rgba(0,0,0,0.6);
}
.lender-popover.is-sheet.in {
  transform: translateY(0);
}
.lender-popover.is-sheet .lp-dismiss { display: inline-flex; }
[data-theme="light"] .lender-popover.is-sheet {
  box-shadow: 0 -12px 32px rgba(0,0,0,0.18);
}

/* ─────────────── Mobile answer card layout (<= 640px) ─────────────── */
@media (max-width: 640px) {
  /* Header strip — allow subject tag to wrap to a second line */
  .ans-head {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 14px 16px 10px;
  }
  .ans-head-left { flex-wrap: wrap; }
  .ans-subject { white-space: normal; word-break: break-word; }

  /* Body — tighter side padding so the card fits a 375px viewport */
  .ans-body { padding: 14px 14px 10px; }

  /* Comparison table → stacked mini-cards */
  .ans-table-wrap {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    margin-bottom: 14px;
  }
  .ans-table-head { display: none; }
  .ans-table-row {
    display: block;
    grid-template-columns: none !important;
    background: rgba(30,66,104,0.06);
    border: 1px solid rgba(30,66,104,0.15);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    gap: 0;
  }
  .ans-table-row:last-child { border-bottom: 1px solid rgba(30,66,104,0.15); }
  .ans-tcell-lender {
    display: block;
    font-family: 'Schibsted Grotesk', sans-serif;
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(30,66,104,0.12);
  }
  /* Each value cell becomes a label-value row */
  .ans-table-row > div:not(.ans-tcell-lender) {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 4px 0;
    text-align: right;
  }
  .ans-table-row > div:not(.ans-tcell-lender)::before {
    content: attr(data-col-label);
    font-family: 'Schibsted Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #1e4268;
    text-transform: uppercase;
    flex-shrink: 0;
    text-align: left;
  }
  /* Scale down the bold numeric value so it doesn't dwarf the label */
  .ans-table-row .ans-tcell-num { font-size: 14px; }
  .ans-table-row .ans-tcell-scenario { font-size: 13px; }
  .ans-table-row .ans-tcell-notes { font-size: 12px; }

  /* Action footer — stack vertically */
  .ans-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px 14px;
  }
  .ans-foot-left,
  .ans-foot-right {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* Light-mode override for the mobile stacked-card label color */
@media (max-width: 640px) {
  [data-theme="light"] .ans-table-row {
    background: rgba(14,165,233,0.05);
    border-color: rgba(14,165,233,0.18);
  }
  [data-theme="light"] .ans-tcell-lender {
    border-bottom-color: rgba(14,165,233,0.15);
  }
  [data-theme="light"] .ans-table-row > div:not(.ans-tcell-lender)::before {
    color: #0ea5e9;
  }
}

/* Slick ChatGPT-style copy button — small icon, hover halo, "copied" pulse. */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
  flex: 0 0 auto;
  vertical-align: middle;
}
.copy-btn:hover {
  background: rgba(127,127,127,0.10);
  border-color: rgba(127,127,127,0.18);
  color: var(--fg, #111);
}
.copy-btn:active { transform: scale(0.94); }
.copy-btn svg { width: 14px; height: 14px; display: block; }
.copy-btn .copy-check { display: none; }
.copy-btn.copied { color: #2da44e; border-color: rgba(45,164,78,0.35); background: rgba(45,164,78,0.10); }
.copy-btn.copied .copy-copy  { display: none; }
.copy-btn.copied .copy-check { display: block; }
.copy-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Wave 1: Luxury polish ────────────────────────────────────────────────── */

:root {
  --gold-h: 41; --gold-s: 51%; --gold-l: 58%;
  --blue-h: 211; --blue-s: 71%; --blue-l: 59%;
  --gold-grad: linear-gradient(135deg, hsl(var(--gold-h), var(--gold-s), calc(var(--gold-l) + 6%)) 0%, hsl(var(--gold-h), var(--gold-s), calc(var(--gold-l) - 10%)) 100%);
}

/* Custom scrollbar (dark + light themes) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); background-clip: padding-box; border: 2px solid transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.10) transparent; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.10); background-clip: padding-box; border: 2px solid transparent; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); background-clip: padding-box; border: 2px solid transparent; }
[data-theme="light"] * { scrollbar-color: rgba(0,0,0,0.12) transparent; }

/* Gold-tinted gradient on primary buttons */
.btn-primary {
  background-image: var(--gold-grad);
  border: 1px solid rgba(201,169,97,0.5);
  color: #1a1a1a !important;
  font-weight: 600;
  transition: filter 0.18s, box-shadow 0.18s, transform 0.05s;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 4px 18px rgba(201,169,97,0.32); }
.btn-primary:active { transform: translateY(1px); }

/* Answer card: staggered slide-in. The .in class is already added by render. */
@keyframes ans-card-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.answer-card.in { animation: ans-card-rise 0.34s cubic-bezier(0.22,0.9,0.32,1) both; }
.answer-card.in > * { animation: ans-card-rise 0.42s cubic-bezier(0.22,0.9,0.32,1) both; }
.answer-card.in > *:nth-child(1) { animation-delay: 0.04s; }
.answer-card.in > *:nth-child(2) { animation-delay: 0.10s; }
.answer-card.in > *:nth-child(3) { animation-delay: 0.16s; }
.answer-card.in > *:nth-child(4) { animation-delay: 0.22s; }
.answer-card.in > *:nth-child(5) { animation-delay: 0.28s; }

/* Global copy toast (admin) */
.copy-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card, #141414);
  color: var(--text, #f2f2f2);
  border: 1px solid var(--border, #262626);
  border-radius: 999px;
  padding: 9px 18px 9px 14px;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.copy-toast::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: #2f9e6e;
  box-shadow: 0 0 8px rgba(47,158,110,0.65);
}

/* Phone-row copy button in lender popover */
.lp-row-copy {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #888);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lp-row-copy:hover { background: rgba(255,255,255,0.05); color: var(--text, #f2f2f2); border-color: rgba(255,255,255,0.10); }
.lp-row-copy.copied { color: #2f9e6e; }
.lp-row { position: relative; }

/* Footer fine-print version row */
.footer-version-row {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--faint, #555);
  letter-spacing: 0.04em;
}

/* Product checkbox category groups (admin) */
.product-check-group { margin-bottom: 14px; }
.product-check-group-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #888);
  margin-bottom: 6px;
}
.product-check-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

/* Lender table extra badges (admin) */
.tbl-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(30,66,104,0.12);
  color: var(--blue, #1e4268);
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(30,66,104,0.25);
  margin-left: 4px;
  vertical-align: middle;
}
.tbl-badge.zero { background: rgba(201,169,97,0.10); color: var(--gold, #c9a961); border-color: rgba(201,169,97,0.28); }

/* ── Admin lenders table polish ───────────────────────────────────────────── */
/* Top-align every cell so short cells (Contact, Updated, Actions) don't float
   in the middle of tall product rows, and give rows consistent vertical room. */
#adminLenderTable td {
  vertical-align: top;
  padding-top: 16px;
  padding-bottom: 16px;
}
#adminLenderTable td.lender-cell > div:first-child { line-height: 1.35; margin-bottom: 2px; }
#adminLenderTable td.contact-cell > div:first-child { line-height: 1.35; }
#adminLenderTable td.contact-cell > div + div { margin-top: 2px; }

/* Products rendered as compact wrapping pills instead of a comma wall. */
.products-cell { max-width: 320px; }
.lender-products { display: flex; flex-wrap: wrap; gap: 5px; }
.lp-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  background: rgba(30,66,104,0.10);
  border: 1px solid rgba(30,66,104,0.22);
  white-space: nowrap;
}
.lp-pill.more {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
  cursor: default;
}
.lp-pill.none {
  background: rgba(201,169,97,0.10);
  color: var(--gold, #c9a961);
  border-color: rgba(201,169,97,0.28);
}
[data-theme="light"] .lp-pill { background: rgba(14,165,233,0.08); border-color: rgba(14,165,233,0.20); color: #1e293b; }
[data-theme="light"] .lp-pill.more { background: transparent; color: #64748b; border-color: rgba(0,0,0,0.12); }

/* Typed-confirmation delete modal */
.confirm-delete-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.confirm-delete-box {
  background: var(--card, #141414);
  border: 1px solid var(--border, #262626);
  border-radius: 12px;
  padding: 22px 22px 18px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
.confirm-delete-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; color: #f06b75; }
.confirm-delete-body  { font-size: 0.86rem; color: var(--muted); margin-bottom: 14px; line-height: 1.55; }
.confirm-delete-body strong { color: var(--text); }
.confirm-delete-input {
  width: 100%; padding: 9px 12px; font-size: 0.9rem;
  background: var(--bg, #0a0a0a); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.confirm-delete-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.confirm-delete-actions .btn-danger {
  background: #c2454d; color: white; border: 1px solid #c2454d;
  font-size: 0.84rem; padding: 7px 14px; border-radius: 6px; cursor: pointer;
}
.confirm-delete-actions .btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Market lenders (not approved yet) ─────────────────────────────────────── */
.market-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 4px;
  margin-left: 8px;
  color: #e0a93c;
  background: rgba(224,169,60,0.12);
  border: 1px solid rgba(224,169,60,0.4);
  white-space: nowrap;
  vertical-align: middle;
}

.market-request {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(224,169,60,0.06);
  border: 1px solid rgba(224,169,60,0.22);
}
.market-request-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.market-request-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  color: #1a1408;
  background: #e0a93c;
  border: 1px solid #e0a93c;
  transition: opacity 0.15s ease;
}
.market-request-btn:hover { opacity: 0.88; }
.market-request-btn.requested,
.market-request-btn:disabled {
  background: rgba(46,160,67,0.18);
  border-color: rgba(46,160,67,0.4);
  color: #4caf50;
  cursor: default;
  opacity: 1;
}

.market-section-header {
  grid-column: 1 / -1;
  margin: 28px 0 12px;
  padding: 14px 16px;
  border: 1px solid rgba(224,169,60,0.4);
  border-left: 4px solid #e0a93c;
  border-radius: 8px;
  background: rgba(224,169,60,0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.import-na-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(224,169,60,0.45);
  border-radius: 8px;
  background: rgba(224,169,60,0.08);
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
}
.import-na-toggle input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #e0a93c;
}
.market-section-title {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #e0a93c;
}
.market-section-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

/* AI answer market callout */
.ans-market-callout {
  margin: 14px 0 4px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(224,169,60,0.07);
  border: 1px solid rgba(224,169,60,0.28);
}
.ans-market-head {
  font-size: 0.86rem;
  font-weight: 700;
  color: #e0a93c;
  margin-bottom: 5px;
}
.ans-market-sub {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text, #ddd);
  margin-bottom: 10px;
}
.ans-market-callout .market-request {
  margin-top: 8px;
  background: transparent;
  border: none;
  padding: 0;
}

/* Approval-request modal */
.req-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.req-modal {
  width: 100%; max-width: 460px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
}
[data-theme="light"] .req-modal {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
}
.req-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.req-modal-head h3 { font-size: 1.05rem; margin: 0; }
.req-modal-close {
  background: none; border: none; font-size: 1.5rem; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.req-modal-sub {
  font-size: 0.84rem; color: var(--muted); line-height: 1.5;
  margin: 0 0 12px;
}
.req-modal-input {
  width: 100%; box-sizing: border-box;
  font-size: 0.9rem; font-family: inherit;
  padding: 10px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: inherit; resize: vertical;
}
[data-theme="light"] .req-modal-input {
  background: #f8fafc; border: 1px solid rgba(0,0,0,0.12);
}
.req-modal-err {
  color: #e5736f; font-size: 0.8rem; margin-top: 6px;
}
.req-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px;
}
.req-modal-cancel {
  font-size: 0.85rem; padding: 8px 14px; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid rgba(255,255,255,0.14);
}
.req-modal-submit {
  font-size: 0.85rem; font-weight: 600; padding: 8px 16px; border-radius: 6px;
  cursor: pointer; color: #1a1408; background: #e0a93c; border: 1px solid #e0a93c;
}
.req-modal-submit:disabled { opacity: 0.5; cursor: default; }

/* Admin: approval requests tab */
.approval-requests-list { display: flex; flex-direction: column; gap: 14px; }
.approval-req-group {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card, #fff);
}
.approval-req-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(224,169,60,0.08);
  border-bottom: 1px solid rgba(224,169,60,0.2);
}
.approval-req-name { font-weight: 700; font-size: 0.95rem; }
.approval-req-count {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em;
  color: #b07d1f; background: rgba(224,169,60,0.18);
  padding: 3px 9px; border-radius: 99px;
}
.approval-req-items { padding: 6px 16px 12px; }
.approval-req-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.approval-req-item:last-child { border-bottom: none; }
.approval-req-item-body { flex: 1; min-width: 0; }
.approval-req-note { font-size: 0.88rem; line-height: 1.5; }
.approval-req-meta { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }
.approval-req-head-right { display: flex; align-items: center; gap: 10px; }
.approval-req-dismiss {
  flex-shrink: 0; margin-top: 2px;
  font-size: 0.74rem; font-weight: 600;
  padding: 4px 11px; border-radius: 6px; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid rgba(0,0,0,0.18);
}
.approval-req-dismiss:hover { color: #b3261e; border-color: rgba(179,38,30,0.5); background: rgba(179,38,30,0.05); }
.approval-req-dismiss:disabled { opacity: 0.5; cursor: default; }
.approval-req-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 0 16px 14px;
}

/* ── Profile menu (top-right) ─────────────────────────────────────────────── */
.profile-menu { position: relative; margin-left: 14px; flex-shrink: 0; }

.pm-trigger {
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  color: var(--text);
  font-family: 'Schibsted Grotesk', sans-serif;
  transition: border-color .18s, background .18s;
}
.pm-trigger:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.03); }
[data-theme="light"] .pm-trigger:hover { background: rgba(0,0,0,0.03); }

.pm-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  color: #fff; font-weight: 600; font-size: 0.8rem;
  overflow: hidden; flex-shrink: 0;
}
.pm-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.pm-avatar-initials { line-height: 1; }
.pm-avatar-lg { width: 44px; height: 44px; font-size: 1.05rem; }

.pm-name {
  font-size: 0.85rem; font-weight: 500; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-chevron { color: var(--muted); flex-shrink: 0; }

.pm-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 248px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.4);
  padding: 8px;
  z-index: 200;
  animation: pmFade .14s ease;
}
[data-theme="light"] .pm-dropdown { box-shadow: 0 18px 48px rgba(0,0,0,0.14); }
@keyframes pmFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.pm-identity { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.pm-identity-text { min-width: 0; }
.pm-identity-name { font-weight: 600; font-size: 0.95rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-identity-email { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.pm-role-badge {
  display: inline-block; margin-top: 6px;
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold); background: var(--gold-dim);
  padding: 2px 8px; border-radius: 999px;
}
.pm-divider { height: 1px; background: var(--border); margin: 6px 4px; }

.pm-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; cursor: pointer;
  text-align: left; text-decoration: none;
  color: var(--text); font-family: 'Schibsted Grotesk', sans-serif; font-size: 0.88rem;
  padding: 9px 10px; border-radius: 10px;
  transition: background .15s, color .15s;
}
.pm-item:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .pm-item:hover { background: rgba(0,0,0,0.04); }
.pm-item .pm-icon { color: var(--muted); flex-shrink: 0; }
.pm-item-danger { color: #e06b6b; }
.pm-item-danger .pm-icon { color: #e06b6b; }
.pm-item-danger:hover { background: rgba(224,107,107,0.10); }

/* Settings modal */
.pm-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  padding: 20px; animation: pmFade .14s ease;
}
.pm-modal {
  width: 100%; max-width: 460px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.pm-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.pm-modal-title { font-family: 'Schibsted Grotesk', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.pm-modal-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.6rem; line-height: 1; padding: 0 4px;
}
.pm-modal-close:hover { color: var(--text); }
.pm-modal-body { padding: 18px 22px; max-height: 60vh; overflow: auto; }
.pm-set-section { margin-bottom: 22px; }
.pm-set-section:last-child { margin-bottom: 0; }
.pm-set-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.pm-account { display: flex; align-items: center; gap: 14px; }
.pm-member-since { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
.pm-tool-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; color: var(--text);
}
.pm-tool-row:last-child { border-bottom: none; }
.pm-tool-state { font-size: 0.72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.pm-tool-state.on { color: var(--green); background: rgba(47,158,110,0.12); }
.pm-tool-state.off { color: var(--faint); background: rgba(128,128,128,0.12); }
.pm-theme-toggle { display: flex; gap: 8px; }
.pm-theme-btn {
  flex: 1; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text); font-family: 'Schibsted Grotesk', sans-serif; font-size: 0.85rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pm-theme-btn:hover { border-color: var(--border-hover); }
.pm-theme-btn.active { border-color: var(--gold); background: var(--gold-dim); color: var(--gold); }
.pm-modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.pm-btn-ghost {
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 18px; color: var(--text); font-family: 'Schibsted Grotesk', sans-serif; font-size: 0.85rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pm-btn-ghost:hover { border-color: #e06b6b; color: #e06b6b; }

@media (max-width: 640px) {
  .pm-name { display: none; }
  .profile-menu { margin-left: 8px; }
  .pm-trigger { padding: 4px; }
}

/* ── Luminous motion ──────────────────────────────────────────────────────
   Gentle, tasteful entrances for the answer card and lender rows. */
@keyframes verchena-fade-up {
  from { opacity: 0; transform: translateY(12px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

.answer-card.in {
  animation: verchena-fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .answer-card.in,
  .lender-row-animated {
    animation: none;
  }
}

/* ── Luminous light-theme overrides for base elements that hardcode the dark
   theme's warm gold/cream and would otherwise leak into light mode. ──────── */
[data-theme="light"] .hero-eyebrow { color: #0ea5e9; }
[data-theme="light"] .source-tag {
  background: rgba(79,70,229,0.10);
  border-color: rgba(79,70,229,0.20);
  color: #4f46e5;
}
[data-theme="light"] .followup-bar .followup-dot {
  background: #4f46e5;
  box-shadow: 0 0 8px rgba(79,70,229,0.5);
}
[data-theme="light"] .quick-filter-chip.lender-chip {
  background: rgba(79,70,229,0.07);
  border-color: rgba(79,70,229,0.22);
  color: #4f46e5;
}
[data-theme="light"] .quick-filter-chip.lender-chip:hover {
  background: rgba(79,70,229,0.16);
  border-color: rgba(79,70,229,0.5);
}
[data-theme="light"] .ans-verdict.is-cond {
  background: rgba(79,70,229,0.10);
  border-left-color: #4f46e5;
}
[data-theme="light"] .ans-verdict.is-cond .ans-verdict-tag { color: #4f46e5; }
[data-theme="light"] .source-page {
  background: rgba(79,70,229,0.10);
  border-color: rgba(79,70,229,0.20);
  color: #4f46e5;
}
[data-theme="light"] .footer-gold-rule { background: #0ea5e9; }
[data-theme="light"] .pm-theme-btn.active { border-color: #4f46e5; background: rgba(79,70,229,0.10); color: #4f46e5; }
[data-theme="light"] .ans-verified {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

/* ── Mobile header fit (≤480px) — appended; overrides nothing above ──────── */
@media (max-width: 480px) {
  /* stop sideways scroll */
  html, body { overflow-x: hidden; max-width: 100%; }

  /* 1. reduce header bar side padding (was 0 24px) + 3. let the row shrink */
  .header-inner { padding-left: 12px; padding-right: 12px; gap: 4px; }

  /* 2. shrink nav links + gap so HOME / ALL LENDERS fit */
  .primary-nav { gap: 0; margin-right: 6px; }
  .nav-tab { font-size: 0.68rem; padding: 6px 7px; letter-spacing: 0.03em; }

  /* 3. keep NIGHT toggle + avatar on-screen */
  .theme-toggle { padding: 6px 9px 6px 8px; font-size: 10px; gap: 4px; }
  .profile-menu { margin-left: 6px; }
}

/* ── Refinement pass: layout rhythm & mobile polish ──────────────────────── */

/* Tablet: give the hero more breathing room between 768–1023px. */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero { padding: 56px 0 44px; }
}

@media (max-width: 640px) {
  /* Reclaim horizontal space on phones without touching desktop rhythm. */
  .container { padding: 0 16px; }
  .section { padding: 40px 0; }
  .hero { padding: 32px 0 26px; }

  /* Modals: guaranteed side gutters + tighter internal padding on phones. */
  .modal-overlay { padding: 16px; }
  .modal { max-height: calc(100vh - 32px); }
  .modal-header { padding: 18px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 14px 16px; flex-wrap: wrap; }
  .modal-close { padding: 8px; margin: -4px; }
}

/* Narrow phones: re-assert the header squeeze (the ≤640px .container gutter
   rule above would otherwise out-cascade the ≤480px .header-inner fit fix). */
@media (max-width: 480px) {
  .header-inner { padding-left: 12px; padding-right: 12px; }

  /* Keep the whole profile avatar on-screen: shrink the logo, drop the
     chevron and trim the trigger so the right edge never clips. */
  .header-logo-svg { height: 28px; }
  .pm-chevron { display: none; }
  .pm-trigger { padding: 3px; }
  .pm-avatar { width: 28px; height: 28px; font-size: 0.72rem; }
  .primary-nav { margin-right: 4px; }
}

/* Hero accent: "instantly." reads navy in light mode (kept softer than true
   navy so it stays lively against the pale hero background). */
[data-theme="light"] .hero h1 em { color: #35568e; }
