:root {
  --bg: #f2f4f5;
  --surface-1: rgba(255, 255, 255, 0.88);
  --surface-2: rgba(246, 250, 252, 0.9);
  --surface-3: rgba(239, 245, 248, 0.8);
  --ink: #101a23;
  --muted: #4e6071;
  --line: rgba(30, 52, 70, 0.18);
  --line-strong: rgba(14, 42, 63, 0.28);
  --brand: #0d6c84;
  --brand-soft: rgba(13, 108, 132, 0.16);
  --accent: #f06c2d;
  --bull: #087d5f;
  --neutral: #8a6618;
  --bear: #b63f35;
  --shadow-card: 0 16px 34px rgba(11, 31, 44, 0.1);
  --shadow-hard: 0 10px 24px rgba(13, 45, 66, 0.2);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  line-height: 1.38;
  background: linear-gradient(165deg, #f8fcff 0%, #ecf2f6 42%, #e8eef3 100%);
}

body.auth-locked {
  overflow: hidden;
}

body.drawer-open {
  overflow: hidden;
}

body.auth-locked .shell {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.backdrop-layer,
.orb {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.backdrop-grid {
  inset: 0;
  background-image: linear-gradient(rgba(6, 41, 60, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 41, 60, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 80%);
}

.backdrop-noise {
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(circle at 2px 2px, rgba(10, 40, 60, 0.08) 1px, transparent 0);
  background-size: 8px 8px;
}

.orb {
  width: 320px;
  height: 320px;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.4;
}

.orb-left {
  left: -110px;
  top: 8vh;
  background: #77d3d1;
}

.orb-right {
  right: -120px;
  bottom: 4vh;
  background: #ffc272;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1340px, calc(100vw - 26px));
  margin: 12px auto 32px;
  display: grid;
  gap: 13px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: linear-gradient(140deg, rgba(9, 22, 31, 0.7), rgba(9, 23, 32, 0.62));
  backdrop-filter: blur(7px);
}

.auth-gate.hidden {
  display: none;
}

.auth-shell {
  width: min(760px, 100%);
  border: 1px solid rgba(188, 216, 232, 0.26);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(12, 30, 42, 0.92), rgba(12, 26, 36, 0.94));
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.42);
  padding: 18px;
  color: #edf4fa;
}

.auth-shell h2 {
  margin: 8px 0 6px;
  font-family: "Sora", sans-serif;
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0 0 6px;
  color: #d0dfeb;
}

.subtle {
  color: #9cb1c2;
  font-size: 13px;
}

.terms-card {
  margin-top: 10px;
  border: 1px solid rgba(149, 181, 199, 0.26);
  border-radius: 12px;
  padding: 12px;
  background: rgba(21, 41, 56, 0.62);
}

.terms-card h3 {
  margin: 0 0 4px;
  font-family: "Sora", sans-serif;
}

.terms-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  max-height: 185px;
  overflow: auto;
}

.auth-toggle {
  margin-top: 10px;
}

.auth-status {
  margin: 10px 2px 0;
  color: #b8ccdc;
  font: 600 12px/1.4 "IBM Plex Mono", monospace;
}

.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--surface-1), var(--surface-2));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.panel {
  padding: 20px;
}

.hero {
  padding: 22px;
}

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

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font: 600 12px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 8px;
  max-width: 14.5ch;
  font-family: "Sora", sans-serif;
  font-size: clamp(30px, 4.6vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-sub {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  font-size: clamp(14px, 1.55vw, 20px);
  line-height: 1.34;
}

.hero-cta {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 13px;
  text-decoration: none;
  font: 700 12px/1.2 "Sora", sans-serif;
  letter-spacing: 0;
}

.cta-btn.primary {
  border: 1px solid rgba(6, 83, 106, 0.65);
  color: #eaf8ff;
  background: linear-gradient(120deg, #0a6f88, #065d73);
}

.cta-btn.secondary {
  border: 1px solid var(--line-strong);
  color: #143a50;
  background: rgba(255, 255, 255, 0.84);
}

.hero-proof {
  margin: 10px 0 0;
  color: #2f5369;
  font: 600 12px/1.3 "IBM Plex Mono", monospace;
}

.hero-badges {
  min-width: 230px;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.hero-strip {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.hero-strip .hero-badges {
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-pill,
.provider-pill {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  color: #05465a;
  background: linear-gradient(120deg, rgba(13, 108, 132, 0.2), rgba(13, 108, 132, 0.06));
  font: 600 12px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
  text-align: center;
  overflow-wrap: anywhere;
}

.provider-pill {
  background: linear-gradient(120deg, rgba(240, 108, 45, 0.2), rgba(240, 108, 45, 0.07));
  color: #6e3c1f;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-stats article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.78), rgba(240, 247, 252, 0.84));
  display: grid;
  gap: 4px;
  min-width: 0;
}

.hero-stats span {
  color: var(--muted);
  font: 600 11px/1.25 "IBM Plex Mono", monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-stats strong {
  font-size: 14px;
  line-height: 1.34;
  overflow-wrap: anywhere;
}

.macro-strip {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(130deg, rgba(231, 243, 248, 0.62), rgba(241, 248, 252, 0.8));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.macro-strip article {
  border: 1px solid rgba(31, 69, 92, 0.2);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 4px;
}

.macro-strip span {
  color: var(--muted);
  font: 600 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.macro-strip strong {
  color: #123a4d;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mode-switch {
  padding: 7px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mode-switch button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 14px;
  color: #1f384b;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.76), rgba(236, 247, 251, 0.7));
  cursor: pointer;
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.mode-switch button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(10, 40, 59, 0.13);
}

.mode-switch button.active {
  border-color: rgba(14, 91, 117, 0.5);
  color: #064e66;
  background: linear-gradient(120deg, rgba(13, 108, 132, 0.22), rgba(13, 108, 132, 0.06));
}

.workspace {
  display: grid;
  grid-template-columns: 1.26fr 0.74fr;
  gap: 13px;
}

.narrative {
  display: grid;
  gap: 12px;
}

.narrative-points,
.pillar-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pillar-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.narrative-points article,
.pillar-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(238, 248, 252, 0.86));
  padding: 10px;
  min-width: 0;
}

.narrative-points h3,
.pillar-card h3 {
  margin: 0 0 4px;
  font: 700 13px/1.2 "Sora", sans-serif;
}

.narrative-points p,
.pillar-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.hidden {
  display: none;
}

header h2 {
  margin: 0 0 4px;
  font-family: "Sora", sans-serif;
  font-size: clamp(22px, 2.2vw, 29px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.controls label {
  margin-bottom: 10px;
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 10px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
}

input::placeholder {
  color: #718697;
}

input:focus,
select:focus {
  outline: 2px solid rgba(10, 102, 127, 0.28);
  border-color: #0a667f;
}

.segment {
  margin: 14px 0 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.segment label {
  position: relative;
  margin: 0;
}

.segment input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segment span {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #1d3a4e;
  font: 700 12.5px/1.2 "Sora", sans-serif;
}

.segment input:checked + span {
  border-color: rgba(14, 91, 117, 0.55);
  background: linear-gradient(125deg, rgba(13, 108, 132, 0.23), rgba(13, 108, 132, 0.07));
  color: #064d63;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 9px 0 10px;
}

.toggle {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.76), rgba(241, 248, 251, 0.9));
  padding: 9px 10px;
}

.toggle input {
  margin: 0;
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.toggle span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  font-weight: 700;
}

details {
  margin: 8px 0 14px;
  border-top: 1px dashed rgba(30, 52, 70, 0.23);
  padding-top: 10px;
}

summary {
  cursor: pointer;
  color: var(--accent);
  font: 600 12px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subnote {
  margin: 4px 2px 0;
  color: #5f6f7f;
  font-size: 12px;
}

.control-subpanel {
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.68), rgba(236, 246, 251, 0.74));
}

.control-subpanel h3 {
  margin: 0;
  font: 700 14px/1.2 "Sora", sans-serif;
}

.control-subpanel p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

#scan-btn,
#crypto-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px;
  color: #ecfaff;
  background: linear-gradient(118deg, #0a6f88 0%, #085f77 55%, #047090 100%);
  box-shadow: 0 8px 20px rgba(8, 74, 94, 0.28);
  font-family: "Sora", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

#scan-btn + .inline-actions,
#crypto-btn + .inline-actions {
  margin-top: 8px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px;
}

.inline-actions button {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.84);
  color: #1b3f54;
  font-weight: 700;
  cursor: pointer;
}

.inline-actions button:hover {
  border-color: rgba(13, 108, 132, 0.45);
  background: rgba(226, 243, 248, 0.84);
}

.inline-actions button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

#scan-btn:hover,
#crypto-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hard);
}

#scan-btn:disabled,
#crypto-btn:disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none;
}

.stack {
  display: grid;
  gap: 13px;
}

.comparison-wrap {
  margin-top: 10px;
  width: 100%;
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 13px;
}

.comparison-table th,
.comparison-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
}

.comparison-table th {
  color: #355064;
  font: 700 12px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comparison-table td:last-child {
  color: #0b6e49;
  font-weight: 700;
}

.signal-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.signal-card {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px;
}

.signal-card span {
  font: 600 10.5px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.signal-card strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(25px, 2.5vw, 33px);
  line-height: 1.06;
}

.signal-card.bull {
  border-color: rgba(8, 125, 95, 0.34);
  background: rgba(8, 125, 95, 0.12);
  color: var(--bull);
}

.signal-card.neutral {
  border-color: rgba(138, 102, 24, 0.35);
  background: rgba(138, 102, 24, 0.12);
  color: var(--neutral);
}

.signal-card.bear {
  border-color: rgba(182, 63, 53, 0.34);
  background: rgba(182, 63, 53, 0.12);
  color: var(--bear);
}

#run-message,
#crypto-message {
  margin: 12px 0 0;
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px;
  color: #2f4356;
  background: linear-gradient(145deg, rgba(245, 251, 254, 0.92), rgba(234, 243, 248, 0.85));
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.45 "IBM Plex Mono", monospace;
}

.run-meta {
  margin: 8px 0 0;
  color: #4f6374;
  font: 600 11px/1.35 "IBM Plex Mono", monospace;
}

.movers-list {
  margin-top: 12px;
  display: grid;
  gap: 7px;
  max-height: 350px;
  overflow: auto;
  padding-right: 3px;
}

.mover-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.84), rgba(238, 246, 250, 0.86));
}

.mover-item > div {
  min-width: 0;
}

.mover-item strong {
  display: block;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.mover-item span {
  color: var(--muted);
  font-size: 12px;
}

.results {
  overflow: hidden;
}

#equities-results-panel,
#crypto-results-panel {
  display: grid;
  gap: 0;
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.results-head h2 {
  margin: 0;
  font-size: clamp(23px, 2.5vw, 31px);
}

.results-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.results-tools {
  width: min(520px, 100%);
  display: flex;
  gap: 8px;
}

.results-tools select,
.results-tools input {
  width: 100%;
}

.filter-chips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chips button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 11px;
  color: #1f3b4d;
  background: rgba(255, 255, 255, 0.78);
  font: 600 12px/1.2 "IBM Plex Mono", monospace;
  cursor: pointer;
}

.filter-chips button.active {
  border-color: rgba(14, 91, 117, 0.5);
  color: #064e65;
  background: linear-gradient(120deg, rgba(13, 108, 132, 0.18), rgba(13, 108, 132, 0.06));
}

.results-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.company-card,
.asset-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(241, 248, 252, 0.86));
  padding: 12px;
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.company-top,
.asset-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.company-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.company-title strong,
.asset-top strong {
  overflow-wrap: anywhere;
}

.pill {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 4px 9px;
  font: 600 11px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.pill.bullish {
  border-color: rgba(8, 125, 95, 0.3);
  background: rgba(8, 125, 95, 0.12);
  color: var(--bull);
}

.pill.neutral {
  border-color: rgba(138, 102, 24, 0.3);
  background: rgba(138, 102, 24, 0.12);
  color: var(--neutral);
}

.pill.bearish {
  border-color: rgba(182, 63, 53, 0.3);
  background: rgba(182, 63, 53, 0.12);
  color: var(--bear);
}

.score-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.explain-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.explain-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(240, 248, 252, 0.72);
  padding: 4px 9px;
  color: #214154;
  font: 600 11px/1.2 "IBM Plex Mono", monospace;
}

.explain-factors {
  display: grid;
  gap: 6px;
}

.explain-factor {
  display: grid;
  gap: 5px;
}

.explain-factor-meta {
  color: #2f4658;
  font: 600 11px/1.3 "IBM Plex Mono", monospace;
  overflow-wrap: anywhere;
}

.confidence-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  border: 1px solid rgba(24, 54, 74, 0.24);
  background: rgba(227, 237, 244, 0.8);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 999px;
}

.confidence-fill.positive {
  background: linear-gradient(120deg, rgba(8, 125, 95, 0.94), rgba(52, 179, 142, 0.9));
}

.confidence-fill.negative {
  background: linear-gradient(120deg, rgba(182, 63, 53, 0.94), rgba(223, 110, 102, 0.9));
}

.run-audit {
  border: 1px solid rgba(32, 61, 83, 0.2);
  border-radius: 10px;
  padding: 8px;
  background: rgba(245, 251, 255, 0.68);
}

.run-audit > summary {
  color: #155772;
  font: 700 12px/1.2 "Sora", sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.run-audit-grid {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.run-audit-grid p {
  margin: 0;
  color: #355166;
  font: 500 11px/1.35 "IBM Plex Mono", monospace;
}

.audit-open-btn {
  justify-self: start;
  border: 1px solid rgba(10, 98, 124, 0.35);
  border-radius: 999px;
  padding: 6px 11px;
  color: #0d5872;
  background: rgba(13, 108, 132, 0.08);
  font: 700 12px/1.2 "Sora", sans-serif;
  cursor: pointer;
}

.audit-open-btn:hover {
  border-color: rgba(10, 98, 124, 0.54);
  background: rgba(13, 108, 132, 0.16);
}

.factor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.factor {
  border: 1px solid rgba(27, 56, 77, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.75);
  padding: 8px;
  min-width: 0;
}

.factor span {
  color: #5c6f80;
  font: 600 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.factor strong {
  display: block;
  margin-top: 4px;
  line-height: 1.23;
  overflow-wrap: anywhere;
}

.metric-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.metric-label {
  color: #5c6f80;
  font: 600 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-tooltip-trigger {
  border: 1px solid rgba(14, 94, 117, 0.35);
  border-radius: 999px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0d5972;
  background: rgba(13, 108, 132, 0.1);
  font: 700 10px/1 "IBM Plex Mono", monospace;
  cursor: pointer;
}

.metric-tooltip-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  max-width: 300px;
  border: 1px solid rgba(26, 71, 95, 0.25);
  border-radius: 10px;
  padding: 8px;
  color: #173c50;
  background: rgba(250, 254, 255, 0.98);
  box-shadow: 0 12px 24px rgba(8, 30, 44, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 130ms ease, transform 130ms ease;
  z-index: 5;
}

.metric-tooltip-pop strong {
  display: block;
  margin: 0 0 4px;
  font: 700 12px/1.2 "Sora", sans-serif;
}

.metric-tooltip-pop p {
  margin: 0;
  color: #35566a;
  font-size: 12px;
}

.metric-tooltip-pop code {
  display: block;
  margin-top: 5px;
  color: #0b4f67;
  font: 600 10px/1.25 "IBM Plex Mono", monospace;
}

.metric-tooltip:hover .metric-tooltip-pop,
.metric-tooltip:focus-within .metric-tooltip-pop,
.metric-tooltip.open .metric-tooltip-pop {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.metric-definitions {
  border: 1px solid rgba(25, 70, 91, 0.18);
  border-radius: 10px;
  background: rgba(243, 250, 254, 0.75);
  padding: 8px;
}

.metric-definitions > summary {
  color: #0f5d79;
  font: 700 12px/1.2 "Sora", sans-serif;
  cursor: pointer;
}

.metric-definitions-list {
  margin: 8px 0 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
}

.metric-definitions-list li {
  color: #35566a;
  font-size: 12px;
}

.metric-definitions-list code {
  display: block;
  margin-top: 3px;
  font: 600 10px/1.25 "IBM Plex Mono", monospace;
  color: #0e5872;
}

.signal-contribution {
  border: 1px solid rgba(26, 72, 95, 0.2);
  border-radius: 10px;
  background: rgba(244, 251, 254, 0.75);
  padding: 8px;
}

.signal-contribution h4,
.risk-flags h4,
.signal-intelligence h4,
.asset-chat h4 {
  margin: 0 0 6px;
  color: #16445b;
  font: 700 12px/1.2 "Sora", sans-serif;
}

.contribution-stack {
  display: grid;
  gap: 6px;
}

.contribution-row {
  display: grid;
  gap: 5px;
}

.contribution-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #35566a;
  font: 600 11px/1.2 "IBM Plex Mono", monospace;
}

.contribution-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(29, 67, 89, 0.24);
  background: rgba(224, 235, 242, 0.85);
  overflow: hidden;
}

.contribution-fill {
  height: 100%;
  border-radius: 999px;
}

.contribution-fill.positive {
  background: linear-gradient(120deg, rgba(8, 125, 95, 0.94), rgba(52, 179, 142, 0.9));
}

.contribution-fill.negative {
  background: linear-gradient(120deg, rgba(182, 63, 53, 0.94), rgba(223, 110, 102, 0.9));
}

.risk-flags {
  border: 1px solid rgba(26, 72, 95, 0.2);
  border-radius: 10px;
  background: rgba(244, 251, 254, 0.75);
  padding: 8px;
}

.risk-flags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.risk-flag {
  border-radius: 999px;
  border: 1px solid rgba(24, 64, 84, 0.25);
  padding: 4px 9px;
  font: 600 10px/1.2 "IBM Plex Mono", monospace;
}

.risk-flag.high {
  border-color: rgba(182, 63, 53, 0.35);
  color: #9c3028;
  background: rgba(182, 63, 53, 0.11);
}

.risk-flag.moderate {
  border-color: rgba(138, 102, 24, 0.35);
  color: #7a5410;
  background: rgba(138, 102, 24, 0.11);
}

.risk-flag.low {
  border-color: rgba(8, 125, 95, 0.3);
  color: #0f6b53;
  background: rgba(8, 125, 95, 0.1);
}

.signal-intelligence {
  border: 1px solid rgba(29, 69, 90, 0.2);
  border-radius: 10px;
  background: rgba(247, 252, 255, 0.7);
  padding: 8px;
}

.signal-intelligence > summary {
  color: #0f5d79;
  font: 700 12px/1.2 "Sora", sans-serif;
  cursor: pointer;
}

.signal-intelligence-body {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.intel-section {
  border: 1px solid rgba(29, 69, 90, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.intel-status {
  margin: 0;
  color: #4c6372;
  font: 600 11px/1.25 "IBM Plex Mono", monospace;
}

.intel-why,
.intel-macro,
.intel-risk {
  margin: 0;
  color: #24495c;
  font-size: 12px;
}

.intel-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
  color: #2b4f63;
  font-size: 12px;
}

.asset-chat {
  border: 1px solid rgba(29, 69, 90, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.asset-chat-list {
  border: 1px solid rgba(29, 69, 90, 0.15);
  border-radius: 8px;
  background: rgba(246, 252, 255, 0.72);
  min-height: 90px;
  max-height: 220px;
  overflow: auto;
  padding: 7px;
  display: grid;
  gap: 6px;
}

.chat-empty {
  margin: 0;
  color: #5a6d7b;
  font-size: 12px;
}

.chat-msg {
  border: 1px solid rgba(29, 69, 90, 0.14);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.78);
}

.chat-msg.user {
  border-color: rgba(10, 97, 151, 0.3);
  background: rgba(232, 246, 255, 0.84);
}

.chat-role {
  color: #0f5d79;
  font: 700 10px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-msg p {
  margin: 4px 0 0;
  color: #22495d;
  font-size: 12px;
  white-space: pre-wrap;
}

.asset-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.asset-chat-input {
  width: 100%;
}

.asset-chat-send {
  border: 1px solid rgba(10, 98, 124, 0.35);
  border-radius: 8px;
  padding: 7px 10px;
  color: #0d5872;
  background: rgba(13, 108, 132, 0.08);
  font: 700 12px/1.2 "Sora", sans-serif;
}

.feed-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feed-chip {
  border: 1px solid rgba(12, 88, 112, 0.28);
  border-radius: 999px;
  padding: 4px 8px;
  color: #0a5670;
  background: rgba(12, 88, 112, 0.09);
  font: 600 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
}

.reason-list {
  margin: 0;
  padding-left: 17px;
  display: grid;
  gap: 4px;
}

.filings-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filing-link {
  border: 1px solid rgba(10, 97, 151, 0.28);
  border-radius: 999px;
  padding: 5px 10px;
  color: #08558b;
  background: rgba(10, 97, 151, 0.08);
  text-decoration: none;
  font-size: 12px;
}

.empty-state,
.loading-state {
  border: 1px dashed rgba(35, 60, 77, 0.27);
  border-radius: 11px;
  padding: 18px;
  text-align: center;
  color: #4d6272;
}

.loading-state {
  background: rgba(248, 252, 255, 0.74);
}

.provenance-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(7, 20, 30, 0.46);
  backdrop-filter: blur(3px);
}

.provenance-drawer {
  position: fixed;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(620px, calc(100vw - 20px));
  z-index: 21;
}

.provenance-shell {
  height: 100%;
  border: 1px solid rgba(169, 205, 224, 0.35);
  border-radius: 17px;
  background: linear-gradient(160deg, rgba(15, 33, 46, 0.95), rgba(10, 25, 35, 0.94));
  box-shadow: 0 20px 50px rgba(3, 11, 17, 0.45);
  display: grid;
  grid-template-rows: auto 1fr;
}

.provenance-head {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid rgba(149, 182, 200, 0.22);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.provenance-head h2 {
  margin: 8px 0 0;
  color: #ecf3f9;
  font-size: clamp(20px, 2.4vw, 28px);
}

.provenance-close {
  border: 1px solid rgba(170, 199, 216, 0.32);
  border-radius: 999px;
  padding: 7px 11px;
  color: #deecf7;
  background: rgba(223, 243, 255, 0.08);
  font: 700 12px/1.2 "Sora", sans-serif;
  cursor: pointer;
}

.provenance-content {
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.prov-section {
  border: 1px solid rgba(157, 188, 205, 0.24);
  border-radius: 12px;
  background: rgba(235, 247, 255, 0.06);
  padding: 10px;
}

.prov-section h3 {
  margin: 0 0 8px;
  color: #edf5fb;
  font: 700 13px/1.2 "Sora", sans-serif;
}

.prov-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.prov-summary-top strong {
  color: #edf6fd;
  font-size: 16px;
}

.prov-section .score-meta,
.prov-section .explain-factor-meta,
.prov-section .run-audit-grid p {
  color: #c7d9e7;
}

.prov-evidence-list {
  display: grid;
  gap: 8px;
}

.prov-evidence-item {
  border: 1px solid rgba(160, 190, 207, 0.2);
  border-radius: 10px;
  padding: 8px;
  background: rgba(223, 242, 255, 0.05);
  display: grid;
  gap: 4px;
}

.prov-evidence-item strong {
  color: #eff7fd;
  line-height: 1.28;
}

.prov-json {
  margin: 8px 0 0;
  border: 1px solid rgba(160, 190, 207, 0.22);
  border-radius: 10px;
  padding: 10px;
  color: #bdd3e3;
  background: rgba(7, 18, 25, 0.52);
  font: 500 11px/1.35 "IBM Plex Mono", monospace;
  overflow: auto;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.stagger-1 {
  animation-delay: 90ms;
}

.stagger-2 {
  animation-delay: 150ms;
}

.stagger-3 {
  animation-delay: 210ms;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .stack {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .hero-top {
    flex-direction: column;
  }

  .hero-badges {
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .macro-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toggle-grid,
  .segment,
  .row-2,
  .signal-grid,
  .factor-grid,
  .stack,
  .narrative-points,
  .pillar-grid {
    grid-template-columns: 1fr;
  }

  .results-tools {
    flex-direction: column;
  }

  .asset-chat-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .shell {
    width: calc(100vw - 14px);
    margin: 7px auto 20px;
    gap: 9px;
  }

  .hero,
  .panel {
    padding: 14px;
  }

  h1 {
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.1;
  }

  .hero-sub {
    font-size: 14px;
  }

  .hero-badges {
    grid-template-columns: 1fr;
  }

  .macro-strip {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .provenance-drawer {
    top: auto;
    right: 7px;
    left: 7px;
    bottom: 7px;
    width: auto;
  }

  #scan-btn,
  #crypto-btn {
    position: sticky;
    bottom: 8px;
    z-index: 3;
  }
}
