/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1a1f36;
  --navy-mid: #232940;
  --navy-light: #2d3454;
  --navy-border: #3a4070;
  --gold: #D4A853;
  --gold-light: #e8c47a;
  --white: #ffffff;
  --text: #e8eaf0;
  --text-dim: #8890b0;
  --text-muted: #5a6080;

  --red: #e84040;
  --red-bg: rgba(232,64,64,0.15);
  --yellow: #f0b429;
  --yellow-bg: rgba(240,180,41,0.15);
  --blue: #4a8fe8;
  --blue-bg: rgba(74,143,232,0.15);
  --grey: #607080;
  --grey-bg: rgba(96,112,128,0.15);
  --green: #3db87a;
  --purple: #9b59d6;
  --orange: #e8843a;

  --sidebar-w: 360px;
  --topbar-h: 52px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

html, body { height: 100%; overflow: hidden; }
body {
  background: var(--navy);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Top Bar ── */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}
#topbar-left { display: flex; align-items: center; gap: 16px; }
#brand { font-size: 18px; font-weight: 700; color: var(--white); letter-spacing: 0.5px; }
#brand span { color: var(--gold); }
#last-updated { font-size: 11px; color: var(--text-muted); }
#topbar-right { display: flex; align-items: center; gap: 12px; }
#rep-selector { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
#rep-selector select {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* ── Layout ── */
#layout {
  display: flex;
  height: 100vh;
  padding-top: var(--topbar-h);
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--navy-mid);
  border-right: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Filter tabs */
#filter-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--navy-border);
  flex-wrap: wrap;
}
.ftab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s;
}
.ftab:hover { background: var(--navy-light); color: var(--text); }
.ftab.active { background: var(--navy); color: var(--white); border-bottom: 2px solid var(--gold); }
.ftab-badge {
  background: var(--navy-light);
  color: var(--text-dim);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.ftab.active .ftab-badge { background: var(--gold); color: var(--navy); }
.ftab-hot { color: #ff6b6b; }
.ftab-warm { color: var(--yellow); }
.ftab-esc { color: #ff6b6b; }
.ftab-compliance { color: var(--yellow); }
.ftab-no-response { color: var(--text-dim); }

/* Search bar */
#search-bar {
  padding: 10px 10px 6px;
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#q {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
#q:focus { border-color: var(--gold); }
#q::placeholder { color: var(--text-muted); }
#sort-filter-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
#sort-by, #rep-filter {
  flex: 1;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.my-leads-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.my-leads-toggle input { cursor: pointer; }

/* Lead list */
#lead-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
#lead-list::-webkit-scrollbar { width: 4px; }
#lead-list::-webkit-scrollbar-track { background: transparent; }
#lead-list::-webkit-scrollbar-thumb { background: var(--navy-border); border-radius: 2px; }

/* Lead card */
.lc {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  margin-bottom: 5px;
  cursor: pointer;
  display: flex;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.lc:hover { border-color: var(--gold); background: var(--navy-light); }
.lc.active { border-color: var(--gold); background: var(--navy-light); }

/* Urgency stripe */
.lc-stripe {
  width: 4px;
  min-width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
  flex-shrink: 0;
}
.stripe-red { background: var(--red); }
.stripe-yellow { background: var(--yellow); }
.stripe-blue { background: var(--blue); }
.stripe-grey { background: var(--grey); }

.lc-body {
  flex: 1;
  padding: 8px 10px;
  min-width: 0;
}
.lc-top {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 3px;
}
.lc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tb-ARB_LANDLORD { background: rgba(61,184,122,0.2); color: var(--green); border: 1px solid var(--green); }
.tb-PM_CLIENT { background: rgba(74,143,232,0.2); color: var(--blue); border: 1px solid var(--blue); }
.tb-INVESTOR { background: rgba(155,89,214,0.2); color: var(--purple); border: 1px solid var(--purple); }
.tb-VANTAGE { background: rgba(232,132,58,0.2); color: var(--orange); border: 1px solid var(--orange); }
.tb-EXISTING_CLIENT { background: rgba(96,112,128,0.2); color: #8899aa; border: 1px solid #8899aa; }
.tb-UNKNOWN { background: rgba(96,112,128,0.15); color: var(--text-muted); border: 1px solid var(--text-muted); }

.lc-brief {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.lc-brief.generating { color: var(--text-muted); font-style: italic; }

.lc-score-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.score-track {
  flex: 1;
  height: 3px;
  background: var(--navy-border);
  border-radius: 2px;
  overflow: hidden;
}
.score-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.sf-red { background: var(--red); }
.sf-yellow { background: var(--yellow); }
.sf-blue { background: var(--blue); }
.sf-grey { background: var(--grey); }
.lc-score-num { font-size: 11px; font-weight: 600; color: var(--text-dim); width: 24px; text-align: right; flex-shrink: 0; }

.lc-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.lc-claimed { color: var(--text-dim); }
.lc-waiting { color: var(--text-muted); }
.lc-next-action {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gold);
  font-size: 11px;
}

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 32px; margin-bottom: 12px; }
.empty-state-title { font-size: 15px; color: var(--text-dim); margin-bottom: 6px; }

/* ── Main panel ── */
#main {
  flex: 1;
  background: var(--navy);
  overflow-y: auto;
  position: relative;
}
#main::-webkit-scrollbar { width: 6px; }
#main::-webkit-scrollbar-track { background: transparent; }
#main::-webkit-scrollbar-thumb { background: var(--navy-border); border-radius: 3px; }

#placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.placeholder-inner { text-align: center; color: var(--text-muted); }
.placeholder-icon { font-size: 48px; margin-bottom: 16px; }
.placeholder-title { font-size: 18px; color: var(--text-dim); margin-bottom: 6px; }
.placeholder-sub { font-size: 13px; }

#mobile-back {
  display: none;
  padding: 12px 16px;
  color: var(--gold);
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--navy-border);
}

/* ── Detail panel ── */
#detail {
  padding: 0 0 80px;
}

/* Detail header */
#d-header {
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
  padding: 16px 20px 12px;
}
#d-header-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
#d-urgency-stripe {
  width: 4px;
  min-width: 4px;
  height: 48px;
  border-radius: 2px;
  flex-shrink: 0;
}
#d-name-block { flex: 1; min-width: 0; }
#d-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
#d-name { font-size: 22px; font-weight: 700; color: var(--white); }
.esc-tag {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
#d-contact-row { font-size: 13px; color: var(--text-dim); display: flex; flex-wrap: wrap; gap: 8px; }
#d-contact-row a { color: var(--gold); text-decoration: none; }
#d-contact-row a:hover { text-decoration: underline; }

.claim-btn {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.claim-btn:hover { background: var(--gold-light); }

#d-score-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}
#d-score-bar-bg {
  flex: 1;
  height: 5px;
  background: var(--navy-border);
  border-radius: 3px;
  overflow: hidden;
}
#d-score-bar { height: 100%; border-radius: 3px; transition: width 0.3s; }
#d-score-num { font-size: 13px; font-weight: 700; width: 50px; text-align: right; }

/* Controls row */
#d-controls {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
  flex-wrap: wrap;
}
#d-controls label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#d-controls select {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  min-width: 120px;
}
#d-controls select:focus { outline: none; border-color: var(--gold); }

#status-error {
  background: var(--red-bg);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 8px 20px;
  font-size: 13px;
}
#no-response-panel {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  margin: 0 20px;
  border-radius: var(--radius);
  padding: 16px;
}
#no-response-summary { font-size: 13px; margin-bottom: 12px; color: var(--text-dim); }
.nr-field { margin-bottom: 12px; }
.nr-field label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 4px; }
.nr-field input {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 13px;
}
#no-response-btns { display: flex; gap: 8px; }
#nr-confirm-btn {
  background: var(--green);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
#nr-cancel-btn {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--navy-border);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* ── Section shared styles ── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.edit-btn {
  background: transparent;
  border: 1px solid var(--navy-border);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.edit-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── Executive Brief ── */
#exec-brief-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--navy-border);
}
#exec-brief-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
#regen-btn {
  background: transparent;
  border: 1px solid var(--navy-border);
  color: var(--text-dim);
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
#regen-btn:hover { border-color: var(--gold); color: var(--gold); }
#regen-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#exec-brief-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brief-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.brief-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  width: 52px;
  min-width: 52px;
  padding-top: 2px;
}
.brief-text {
  font-size: 14px;
  color: var(--text);
  flex: 1;
  line-height: 1.5;
}
.brief-text.generating { color: var(--text-muted); font-style: italic; }
.brief-action .brief-label { color: var(--gold); }
.brief-action .brief-text { color: var(--gold); font-weight: 500; }

/* ── Key Facts ── */
#key-facts-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--navy-border);
}
#key-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.kf-item {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  padding: 8px 10px;
}
.kf-key {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.kf-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.kf-val.empty { color: var(--text-muted); }
#key-facts-edit { margin-top: 8px; }
#key-facts-edit textarea {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  resize: vertical;
  margin-bottom: 8px;
  font-family: monospace;
}
#key-facts-edit button {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Outreach Checklist ── */
#outreach-checklist {
  padding: 14px 20px;
  border-bottom: 1px solid var(--navy-border);
}
#outreach-checklist .section-title { margin-bottom: 10px; display: block; }
.oc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
.oc-label { flex: 1; color: var(--text-dim); }
.oc-done { color: var(--green); font-size: 12px; }
.oc-pending { color: var(--text-muted); font-size: 12px; }
.oc-na-tag { color: var(--text-muted); font-size: 12px; }
.oc-log-btn {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.oc-log-btn:hover { border-color: var(--gold); color: var(--gold); }
.oc-na-label { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; cursor: pointer; }

/* ── Action section ── */
#action-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--navy-border);
}
#action-section .section-title { margin-bottom: 10px; display: block; }
#action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.action-btn {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.action-btn:hover { border-color: var(--gold); color: var(--white); }
.action-btn.sel { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 700; }
.action-escalate { border-color: rgba(232,64,64,0.3); color: var(--red); }
.action-escalate:hover { background: var(--red-bg); border-color: var(--red); }
.action-more { color: var(--text-muted); }
#more-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.action-btn-sm {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}
.action-btn-sm:hover { border-color: var(--gold); color: var(--text); }
.action-btn-sm.sel { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.action-danger { color: var(--red) !important; border-color: rgba(232,64,64,0.3) !important; }

#action-note-box {
  margin-top: 8px;
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 12px;
}
#a-notes {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
}
#a-notes:focus { border-color: var(--gold); }
#action-submit-row { display: flex; gap: 8px; align-items: center; }
#a-rep {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 13px;
}
#a-submit {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 7px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
#a-submit:hover { background: var(--gold-light); }
#a-cancel {
  background: transparent;
  border: 1px solid var(--navy-border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* ── Tabs ── */
#tabs {
  display: flex;
  border-bottom: 1px solid var(--navy-border);
  padding: 0 20px;
  background: var(--navy-mid);
}
.tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--white); border-bottom-color: var(--gold); }

#tab-panes { padding: 0 20px 20px; }
.pane { padding-top: 16px; }
.pane.hidden { display: none; }

/* ── Conversation Thread ── */
#convo-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
  padding: 4px;
}
#convo-thread::-webkit-scrollbar { width: 4px; }
#convo-thread::-webkit-scrollbar-thumb { background: var(--navy-border); border-radius: 2px; }

.msg-bubble {
  max-width: 75%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.msg-us {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  color: var(--text);
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.msg-lead {
  background: var(--navy-light);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.msg-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.msg-us .msg-label { text-align: right; color: var(--gold); }
.msg-lead .msg-label { color: var(--text-muted); }
.msg-raw {
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ── Activity Log ── */
#d-log { display: flex; flex-direction: column; gap: 8px; }
.log-item {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  padding: 10px 12px;
}
.log-action { font-size: 13px; color: var(--text); font-weight: 500; }
.log-notes { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.log-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Package Guide ── */
#guide-chat {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
#guide-chat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
#guide-messages {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.gm { font-size: 13px; padding: 8px 12px; border-radius: 8px; }
.gm.user { background: var(--navy-light); color: var(--text-dim); align-self: flex-end; max-width: 80%; }
.gm.ai { background: rgba(212,168,83,0.1); border: 1px solid rgba(212,168,83,0.2); color: var(--text); max-width: 90%; }
.gm.loading { color: var(--text-muted); font-style: italic; }
#guide-input-row { display: flex; gap: 8px; }
#guide-q {
  flex: 1;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
}
#guide-q:focus { outline: none; border-color: var(--gold); }
#guide-ask-btn {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
#guide-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sug {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
}
.sug:hover { border-color: var(--gold); color: var(--text); }

.pkg {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.pkg-head {
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  color: var(--white);
}
.pkg-vantage-b { background: rgba(74,143,232,0.2); border-left: 3px solid var(--blue); }
.pkg-vantage-g { background: rgba(61,184,122,0.2); border-left: 3px solid var(--green); }
.pkg-arb { background: rgba(212,168,83,0.2); border-left: 3px solid var(--gold); }
.pkg-full { background: rgba(155,89,214,0.2); border-left: 3px solid var(--purple); }
.pkg ul { padding-left: 16px; font-size: 13px; color: var(--text-dim); line-height: 1.7; }
.pkg-cta { font-size: 12px; color: var(--gold); margin-top: 8px; }
.escalate-note { font-size: 12px; color: var(--red); font-style: italic; }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: white;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  display: none;
  z-index: 9999;
  box-shadow: var(--shadow);
}
#toast.error { background: var(--red); }

/* ── Mobile bottom tabs ── */
#mobile-tabs { display: none; }

/* ── Mobile ── */
@media (max-width: 768px) {
  #layout { flex-direction: column; }
  #sidebar {
    width: 100%;
    min-width: 100%;
    height: calc(100vh - var(--topbar-h) - 52px);
    border-right: none;
    border-bottom: 1px solid var(--navy-border);
  }
  #main {
    position: fixed;
    top: var(--topbar-h);
    left: 0; right: 0; bottom: 52px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 50;
    background: var(--navy);
    overflow-y: auto;
  }
  #main.open { transform: translateX(0); }
  #mobile-back { display: block; }
  #mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 52px;
    background: var(--navy-mid);
    border-top: 1px solid var(--navy-border);
    z-index: 100;
  }
  .mtab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 11px;
    cursor: pointer;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .mtab.active { color: var(--gold); }
  #filter-tabs { display: none; }
  #key-facts-grid { grid-template-columns: repeat(2, 1fr); }
  #action-btns { flex-direction: column; }
  .action-btn { width: 100%; text-align: center; }
  #d-controls { flex-direction: column; }
  #d-controls select { width: 100%; }
  #topbar-right .rep-label { display: none; }
}

/* ── Scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: var(--navy-border) transparent; }
