/* ═══════════════════════════════════════════════════════════════════════════
   proposal.css — Proposal Design Pipeline
   Design System: Sightline Apple-inspired Liquid Glass (light theme)
   Tokens mirror Sightline base.css so the two merge cleanly at integration.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Skip link (accessibility) ── */
.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 99999;
  padding: 8px 16px; background: var(--blue); color: #fff;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 8px; }

/* ── CSS Variables — Sightline tokens ─────────────────────────────────── */
:root {
  /* Brand — Apple-inspired Ice Blue system */
  --primary:          #0EA5E9;
  --primary-dark:     #0284C7;
  --primary-light:    #F0F9FF;
  --primary-glow:     rgba(14, 165, 233, 0.12);

  /* Surface — Apple's warm whites and grays */
  --bg:               #F5F5F7;
  --surface:          #FFFFFF;
  --surface-raised:   rgba(255,255,255,.72);
  --surface-glass:    rgba(255,255,255,.45);
  --border:           rgba(0,0,0,.08);
  --border-light:     rgba(0,0,0,.04);
  --border-focus:     rgba(14, 165, 233, 0.35);
  --divider:          rgba(0,0,0,.06);

  /* Text — Apple SF color system */
  --text:             #1D1D1F;
  --text-secondary:   #6E6E73;
  --text-tertiary:    #AEAEB2;
  --text-muted:       #8E8E93;
  --text-inverse:     #FFFFFF;

  /* Accent */
  --navy:             #1D1D1F;
  --navy-light:       #48484A;
  --blue:             #007AFF;
  --blue-light:       #EBF5FF;

  /* Semantic — Apple system colors */
  --green:            #30D158;
  --green-light:      #E8FAE9;
  --red:              #FF3B30;
  --red-light:        #FFF1F1;
  --amber:            #FF9F0A;
  --amber-light:      #FFF6E5;
  --purple:           #AF52DE;
  --teal:             #5AC8FA;

  /* Apple Liquid Glass tokens */
  --glass-bg:         rgba(255,255,255,.55);
  --glass-border:     rgba(255,255,255,.25);
  --glass-shadow:     0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --glass-blur:       40px;
  --glass-inner:      inset 0 1px 0 rgba(255,255,255,.5);

  /* Radius scale */
  --radius-xs:       6px;
  --radius-sm:       8px;
  --radius:          12px;
  --radius-lg:       16px;
  --radius-xl:       20px;
  --radius-2xl:      24px;
  --radius-full:     9999px;

  /* Shadow system */
  --shadow-xs:        0 1px 2px rgba(0,0,0,.03);
  --shadow-sm:        0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.02);
  --shadow-md:        0 4px 16px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:        0 12px 40px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.03);
  --shadow-xl:        0 24px 64px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.04);
  --shadow-focus:     0 0 0 4px rgba(0,122,255,.18);
  --shadow-focus-red: 0 0 0 4px rgba(232,54,78,.15);
  --shadow-glass:     0 8px 32px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.03), inset 0 1px 0 rgba(255,255,255,.5);

  /* Spacing — 4px grid */
  --space-1:          4px;
  --space-2:          8px;
  --space-3:          12px;
  --space-4:          16px;
  --space-5:          20px;
  --space-6:          24px;
  --space-8:          32px;
  --space-10:         40px;
  --space-12:         48px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Top App Bar — glass ──────────────────────────────────────────────── */
.app-header {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
  z-index: 20;
}

.brand-group { display: flex; align-items: center; gap: var(--space-3); }

.brand-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.donor-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.header-actions { display: flex; align-items: center; gap: var(--space-3); }

.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.autosave-status.saved { color: var(--green); }
.autosave-status.saving { color: var(--amber); }
.autosave-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

/* ── Buttons — Apple style ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--surface-raised); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: #0071e3; }
.btn-primary:focus-visible { box-shadow: var(--shadow-focus); }

.btn-emerald {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn-emerald:hover { background: #28c747; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Inputs — Apple style ─────────────────────────────────────────────── */
.input-text, .input-textarea, .input-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: border-color .15s, box-shadow .15s;
}
.input-text:focus, .input-textarea:focus, .input-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--shadow-focus);
}
.input-text::placeholder, .input-textarea::placeholder { color: var(--text-tertiary); }
.input-textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.input-select { appearance: none; cursor: pointer; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group { margin-bottom: var(--space-4); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

/* ── Main Split Layout ────────────────────────────────────────────────── */
.main-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.workspace-pane {
  flex: 0 0 65%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  overflow-y: auto;
}

/* ── Step Navigation ──────────────────────────────────────────────────── */
.step-nav {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: 4px;
  background: var(--surface-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-glass);
  overflow-x: auto;
}
.step-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.step-btn:hover { background: var(--surface); color: var(--text); }
.step-btn.active {
  background: var(--surface);
  color: var(--blue);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  background: var(--border-light);
  font-size: 11px;
  font-weight: 700;
}
.step-btn.active .step-num {
  background: var(--blue);
  color: #fff;
}

/* ── Step Content ─────────────────────────────────────────────────────── */
.step-header-area {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.step-title { font-size: 17px; font-weight: 600; color: var(--text); }
.step-subtitle { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }

.step-view { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Glass card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  padding: var(--space-5);
}

/* ── ToC Visualizer ───────────────────────────────────────────────────── */
.toc-flow {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 120px;
}
.toc-node {
  flex: 1;
  min-width: 130px;
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--blue-light);
  border: 1px solid rgba(14,165,233,.15);
  text-align: center;
}
.toc-node.input     { background: var(--blue-light);   border-color: rgba(14,165,233,.2); }
.toc-node.activity  { background: var(--blue-light);   border-color: rgba(14,165,233,.2); }
.toc-node.output    { background: #F5F3FF; border-color: rgba(175,82,222,.2); }
.toc-node.outcome   { background: var(--green-light);  border-color: rgba(48,209,88,.2); }
.toc-node.impact    { background: var(--amber-light);  border-color: rgba(255,159,10,.2); }
.toc-node-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.toc-node-label { font-size: 12px; font-weight: 500; color: var(--text); }
.toc-arrow {
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 15px;
  padding: 0 2px;
}

/* ── Logframe Table ───────────────────────────────────────────────────── */
.logframe-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: auto;
  max-height: 58vh;
}
.logframe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.logframe-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.logframe-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.logframe-table tr:last-child td { border-bottom: none; }
.logframe-table tr:hover td { background: var(--primary-light); }
.level-cell {
  font-weight: 600;
  color: var(--blue);
  font-size: 12px;
}
.editable-cell {
  width: 100%;
  min-height: 48px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--font-sans);
  resize: vertical;
  line-height: 1.45;
}
.editable-cell:focus { outline: 1px solid var(--border-focus); border-radius: 4px; }

/* ── Narrative Tabs ───────────────────────────────────────────────────── */
.narrative-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-4);
  overflow-x: auto;
  padding-bottom: 2px;
}
.narrative-tab {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.narrative-tab:hover { color: var(--text); }
.narrative-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.char-counter {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  text-align: right;
  margin-top: 6px;
}
.char-counter.over { color: var(--red); font-weight: 600; }
.char-counter.limit-warn { color: var(--amber); }
.char-counter.limit-exceeded { color: var(--red); font-weight: 600; }

/* ── Advisor Patch Box ─────────────────────────────────────────────────── */
.patch-box {
  margin-top: 10px;
  padding: var(--space-3);
  background: var(--blue-light);
  border: 1px solid rgba(14,165,233,.2);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.patch-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--blue);
  margin-bottom: 6px;
}
.patch-content {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

/* ── Verifier Scorecard ───────────────────────────────────────────────── */
.verifier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}
.score-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
}
.score-banner.pass {
  background: var(--green-light);
  border: 1px solid rgba(48,209,88,.3);
}
.score-banner.fail {
  background: var(--red-light);
  border: 1px solid rgba(255,59,48,.3);
}
.score-banner.warning {
  background: var(--amber-light);
  border: 1px solid rgba(255,159,10,.3);
}
.score-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}
.score-banner.pass .score-label { color: #1e9e4f; }
.score-banner.fail .score-label { color: var(--red); }
.score-banner.warning .score-label { color: #d17d00; }
.score-text { font-size: 13px; color: var(--text); margin-top: 4px; }
.score-num {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.score-banner.pass .score-num { color: var(--green); }
.score-banner.fail .score-num { color: var(--red); }
.score-banner.warning .score-num { color: var(--amber); }

.issue-item {
  padding: var(--space-3);
  border-left: 3px solid var(--amber);
  background: var(--amber-light);
  border-radius: var(--radius-xs);
  margin-bottom: var(--space-2);
  font-size: 12.5px;
}
.issue-item.critical {
  border-left-color: var(--red);
  background: var(--red-light);
}
.issue-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.issue-item.critical .issue-tag { color: var(--red); }
.issue-item:not(.critical) .issue-tag { color: #d17d00; }
.issue-msg { color: var(--text); margin-top: 2px; font-size: 12.5px; }
.issue-rec { color: var(--text-secondary); font-size: 11.5px; margin-top: 4px; font-style: italic; }

/* ── Advisor Pane ─────────────────────────────────────────────────────── */
.advisor-pane {
  flex: 0 0 35%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface-raised);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.advisor-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.advisor-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.advisor-sub { font-size: 11px; color: var(--text-tertiary); }

.advisor-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.msg-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-xs);
}
.msg-advisor {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.msg-user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.advisor-input-area {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}
.advisor-input-area .input-text { flex: 1; }

/* ── Scrollbars — thin, theme-colored ─────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .main-layout { flex-direction: column; }
  .workspace-pane { flex: 1; }
  .advisor-pane { flex: 0 0 320px; border-left: none; border-top: 1px solid var(--border); }
}

/* ── Eligibility Banner (AUTOMATIC_REJECTION) ─────────────────────────── */
.eligibility-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  border: 1px solid #dc2626;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: #fecaca;
}
.eligibility-banner-icon { font-size: 18px; line-height: 1.3; }
.eligibility-banner-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  color: #fff; text-transform: uppercase;
}
.eligibility-banner-text { font-size: 12.5px; color: #fecaca; margin-top: 2px; }

/* ── Eligibility Gates Checklist ──────────────────────────────────────── */
.eligibility-checklist {
  background: var(--surface, rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.gate-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 12.5px;
  border-bottom: 1px dashed var(--border);
}
.gate-item:last-child { border-bottom: none; }
.gate-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px;
  padding: 2px 8px; border-radius: 10px; text-transform: uppercase;
  white-space: nowrap;
}
.gate-badge.pass { background: rgba(30,158,79,0.15); color: #1e9e4f; }
.gate-badge.hard-fail { background: rgba(220,38,38,0.15); color: #dc2626; }
.gate-badge.unverified { background: rgba(245,158,11,0.15); color: #f59e0b; }
.gate-name { font-weight: 600; color: var(--text); }
.gate-detail { color: var(--text-secondary); font-size: 11.5px; margin-left: auto; text-align: right; }
.gate-fix-btn {
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 11px; padding: 3px 8px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
}
.gate-fix-btn:hover { border-color: var(--primary, #3b82f6); color: var(--primary, #3b82f6); }

/* ── Interactive Score Breakdown Table ────────────────────────────────── */
.score-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.score-table th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  color: var(--text-secondary); text-transform: uppercase;
  padding: 6px 8px; border-bottom: 1px solid var(--border);
}
.score-table td { padding: 8px; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.score-row { cursor: pointer; transition: background 0.15s; }
.score-row:hover { background: rgba(59,130,246,0.06); }
.score-row:last-child td { border-bottom: none; }
.score-criterion { font-weight: 600; color: var(--text); }
.score-bar-track {
  height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px;
  overflow: hidden; min-width: 120px;
}
.score-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.score-bar-fill.ok { background: #1e9e4f; }
.score-bar-fill.warn { background: #f59e0b; }
.score-bar-fill.bad { background: #dc2626; }
.score-num-cell { font-weight: 700; color: var(--text); white-space: nowrap; }
.score-jump-hint { color: var(--text-tertiary); font-size: 10.5px; }

/* ── Step 4: Risk Matrix severity badges ─────────────────────────────────── */
.risk-sev {
  display: inline-block; min-width: 26px; text-align: center;
  padding: 2px 6px; border-radius: 4px; font-weight: 700; font-size: 12px;
}
.risk-red { background: #fecaca; color: #b91c1c; }
.risk-amber { background: #fde68a; color: #b45309; }
.risk-green { background: #bbf7d0; color: #15803d; }
.budget-overhead-banner.limit-exceeded { font-weight: 600; }

/* ── New Proposal Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-card {
  background: var(--bg-card, #0f172a); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; width: 560px; max-width: 92vw;
  max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* ── Floating AI Advisor Chat ───────────────────────────────────────────── */
.advisor-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 90;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 6px 20px rgba(2,132,199,0.45);
  transition: transform 0.15s ease;
}
.advisor-fab:hover { transform: scale(1.08); }
.advisor-fab-icon { font-size: 24px; line-height: 1; }
.advisor-popup {
  position: fixed; bottom: 84px; right: 22px; z-index: 95;
  width: 360px; max-width: 92vw; height: 460px; max-height: 70vh;
  background: var(--bg-card, #0f172a); border: 1px solid var(--border);
  border-radius: 12px; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45); overflow: hidden;
}
.advisor-popup .advisor-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: rgba(2,132,199,0.12); border-bottom: 1px solid var(--border);
}
.advisor-popup .advisor-messages { flex: 1; overflow-y: auto; padding: 12px; }
.advisor-popup .advisor-input-area {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border);
}
.advisor-popup .advisor-input-area .input-text { flex: 1; }

/* ── Auth overlay ─────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(2, 6, 23, 0.92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.auth-overlay.hidden { display: none; }
.auth-card {
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border, #1e293b);
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.auth-card-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.auth-logo { width: 56px; height: 56px; border-radius: 12px; margin-bottom: 4px; }
.auth-card h1 { font-size: 24px; font-weight: 700; color: #f1f5f9; margin: 0; }
.auth-subtitle { font-size: 14px; color: #94a3b8; margin: 0; }
.auth-signin-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #3c4043;
  border: none; border-radius: 8px;
  padding: 12px 24px; font-size: 15px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.auth-signin-btn:hover { background: #f8f9fa; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.auth-note { font-size: 12px; color: #64748b; margin: 8px 0 0; }
