/* ─────────────────────────────────────────────────────────
   ASYN App — Shared Styles
   Extends asyn-tokens.css with application-specific patterns
───────────────────────────────────────────────────────── */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: var(--leading-normal);
  min-height: 100vh;
  position: relative;
}
/* Subtle noise texture overlay on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}
body > * { position: relative; z-index: 1; }
a { color: var(--interactive-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Entrance Animations ─────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes barGrow {
  from { width: 0%; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(29, 158, 117, 0.2); }
  50%      { box-shadow: 0 0 12px rgba(29, 158, 117, 0.4); }
}
.anim-fade-up {
  animation: fadeInUp var(--duration-normal) var(--ease-decelerate) both;
}
.anim-stagger > * {
  animation: fadeInUp var(--duration-normal) var(--ease-decelerate) both;
}
.anim-stagger > *:nth-child(1)  { animation-delay: 0ms; }
.anim-stagger > *:nth-child(2)  { animation-delay: 50ms; }
.anim-stagger > *:nth-child(3)  { animation-delay: 100ms; }
.anim-stagger > *:nth-child(4)  { animation-delay: 150ms; }
.anim-stagger > *:nth-child(5)  { animation-delay: 200ms; }
.anim-stagger > *:nth-child(6)  { animation-delay: 250ms; }
.anim-stagger > *:nth-child(7)  { animation-delay: 300ms; }
.anim-stagger > *:nth-child(8)  { animation-delay: 350ms; }
.anim-stagger > *:nth-child(9)  { animation-delay: 400ms; }
.anim-stagger > *:nth-child(10) { animation-delay: 450ms; }

/* ── App Shell ────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 48px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  grid-row: 1 / -1;
  background: var(--color-slate-dark);
  border-right: var(--border-hairline) solid var(--border-subtle);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  background-image: linear-gradient(180deg, var(--color-slate-dark) 0%, rgba(10, 15, 30, 0.95) 100%);
}
.sidebar-logo {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-8);
  padding-left: var(--space-2);
}
.sidebar-logo span { color: var(--color-signal-400); }
.sidebar-section {
  margin-bottom: var(--space-6);
}
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  padding-left: var(--space-2);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-default);
  margin-bottom: 2px;
}
.sidebar-link:hover {
  background: var(--color-slate);
  color: var(--text-primary);
  text-decoration: none;
}
.sidebar-link.active {
  background: rgba(29, 158, 117, 0.08);
  color: var(--color-signal-400);
  font-weight: var(--weight-medium);
  box-shadow: inset 2px 0 0 var(--color-signal-400);
}
.sidebar-link .icon { font-size: var(--text-lg); width: 20px; text-align: center; }
.sidebar-sub {
  padding-left: var(--space-8);
}
.sidebar-spacer { flex: 1; }

/* Top bar */
.topbar {
  background: var(--bg-surface);
  border-bottom: var(--border-hairline) solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}
.topbar-breadcrumb {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
}
.topbar-breadcrumb a { color: var(--text-muted); }
.topbar-breadcrumb a:hover { color: var(--text-primary); }
.topbar-breadcrumb .sep { margin: 0 var(--space-2); opacity: 0.5; }
.topbar-spacer { flex: 1; }
.topbar-market {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  color: var(--color-signal-400);
  background: rgba(29, 158, 117, 0.1);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  animation: glowPulse 3s ease-in-out infinite;
}
.topbar-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Main content */
.main-content {
  padding: var(--space-6);
  overflow-y: auto;
  max-height: calc(100vh - 48px);
  animation: fadeIn var(--duration-slow) var(--ease-decelerate);
}

/* ── State Tags / Pills ──────────────────────────────── */
.state-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-medium);
}
.state-tag--mandate { background: var(--color-steel-800); color: var(--color-steel-200); }
.state-tag--ipt { background: rgba(29, 158, 117, 0.15); color: var(--color-signal-400); }
.state-tag--guidance { background: rgba(29, 158, 117, 0.2); color: var(--color-signal-200); }
.state-tag--priced { background: rgba(186, 117, 23, 0.2); color: var(--color-yield-200); }
.state-tag--allocated { background: rgba(186, 117, 23, 0.3); color: var(--color-yield-200); }

/* ESG / Green tags */
.tag-green { background: rgba(29, 158, 117, 0.15); color: var(--color-signal-400); }
.tag-debut { background: rgba(186, 117, 23, 0.2); color: var(--color-yield-200); }
.tag-multi { background: rgba(138, 144, 160, 0.2); color: var(--color-muted); }

/* ── NIP Display ─────────────────────────────────────── */
.nip { font-family: var(--font-mono); font-weight: var(--weight-medium); }
.nip--yield-bold { color: var(--color-yield-200); font-weight: var(--weight-bold); }
.nip--yield { color: var(--color-yield-400); }
.nip--signal { color: var(--color-signal-400); }
.nip--steel { color: var(--color-steel-400); }
.nip--negative { color: #E05252; }
.nip--muted { color: var(--text-muted); font-style: italic; font-weight: var(--weight-regular); }
.nip-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-left: var(--space-1);
}

/* ── Confidence Dots ─────────────────────────────────── */
.confidence-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.confidence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-steel-800);
}
.confidence-dot--signal.filled { background: var(--color-signal-400); box-shadow: 0 0 6px rgba(29, 158, 117, 0.5); }
.confidence-dot--yield.filled { background: var(--color-yield-400); box-shadow: 0 0 6px rgba(186, 117, 23, 0.5); }
.confidence-dot--steel.filled { background: var(--color-steel-400); box-shadow: 0 0 4px rgba(180, 178, 169, 0.3); }

/* ── Eligibility Icons ───────────────────────────────── */
.eligibility { font-weight: var(--weight-bold); font-size: var(--text-lg); }
.eligibility--signal { color: var(--color-signal-400); }
.eligibility--yield { color: var(--color-yield-400); }
.eligibility--negative { color: #E05252; }
.eligibility--muted { color: var(--text-muted); }

/* ── Data Table ──────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-thin) solid var(--border-subtle);
  font-weight: var(--weight-regular);
  white-space: nowrap;
}
.data-table tbody td {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  padding: var(--space-3);
  border-bottom: var(--border-hairline) solid var(--border-default);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr {
  transition: background var(--duration-fast) var(--ease-default), transform var(--duration-fast) var(--ease-default);
  cursor: pointer;
}
.data-table tbody tr:hover {
  background: rgba(61, 69, 96, 0.35);
  box-shadow: inset 2px 0 0 var(--color-signal-400);
}
.data-table tbody tr.row-active {
  background: rgba(29, 158, 117, 0.08);
  border-left: 2px solid var(--color-signal-400);
}
.data-table .col-issuer {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  letter-spacing: 0;
}
.data-table .col-data { color: var(--text-data); }
.data-table .col-muted { color: var(--text-muted); }
.data-table .text-right { text-align: right; }

/* ── Metric Card ─────────────────────────────────────── */
.metric-card {
  background: var(--bg-card);
  border: var(--border-hairline) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  transition: transform var(--duration-fast) var(--ease-decelerate), box-shadow var(--duration-fast) var(--ease-decelerate), border-color var(--duration-fast) var(--ease-default);
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}
.metric-card .metric-card-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.metric-card .metric-card-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}
.metric-card .metric-card-sub {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ── Morning Brief ───────────────────────────────────── */
.morning-brief {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(29, 158, 117, 0.03) 100%);
  border: var(--border-hairline) solid var(--border-subtle);
  border-left: var(--border-accent) solid var(--color-signal-400);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  animation: fadeInUp var(--duration-slow) var(--ease-decelerate);
  position: relative;
  overflow: hidden;
}
.morning-brief::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-signal-400), var(--color-signal-600));
  box-shadow: 0 0 8px rgba(29, 158, 117, 0.3);
}
.morning-brief p {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}
.morning-brief .highlight {
  color: var(--color-signal-400);
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: var(--weight-medium);
}
.morning-brief .highlight-yield {
  color: var(--color-yield-400);
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: var(--weight-medium);
}

/* ── Section Headers ─────────────────────────────────── */
.section-header {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}
.section-sub {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* ── Avatar ──────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
}
.avatar--sc { background: rgba(29, 158, 117, 0.2); color: var(--color-signal-400); }
.avatar--jp { background: rgba(186, 117, 23, 0.2); color: var(--color-yield-400); }
.avatar--dm { background: rgba(29, 158, 117, 0.2); color: var(--color-signal-400); }

/* ── Activity Feed ───────────────────────────────────── */
.feed-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-hairline) solid var(--border-default);
  font-size: var(--text-sm);
  transition: background var(--duration-fast) var(--ease-default);
}
.feed-item:hover { background: rgba(61, 69, 96, 0.15); }
.feed-item:last-child { border-bottom: none; }
.feed-time {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  min-width: 50px;
  letter-spacing: var(--tracking-wide);
}
.feed-text {
  font-family: var(--font-body);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}
.feed-text strong { color: var(--text-primary); font-weight: var(--weight-medium); }
.feed-portfolio {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
}

/* ── Progress Bar ────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--color-slate-dark);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  animation: barGrow 800ms var(--ease-decelerate) both;
}
.progress-bar-fill--signal { background: linear-gradient(90deg, var(--color-signal-600), var(--color-signal-400)); box-shadow: 0 0 6px rgba(29, 158, 117, 0.3); }
.progress-bar-fill--yield { background: linear-gradient(90deg, var(--color-yield-600), var(--color-yield-400)); box-shadow: 0 0 6px rgba(186, 117, 23, 0.3); }
.progress-bar-fill--danger { background: linear-gradient(90deg, #B03030, #E05252); box-shadow: 0 0 6px rgba(224, 82, 82, 0.3); }
.progress-bar-limit {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--text-muted);
}

/* ── Constraint Row ──────────────────────────────────── */
.constraint-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}
.constraint-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  width: 120px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.constraint-bar { flex: 1; }
.constraint-values {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-secondary);
  width: 80px;
  text-align: right;
  letter-spacing: var(--tracking-wide);
}

/* ── Grid Layouts ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: var(--space-4); }
.grid-8-4 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-6); }
.grid-3-6-3 { display: grid; grid-template-columns: 280px 1fr 300px; gap: var(--space-4); min-height: calc(100vh - 96px); }

/* ── Flyout Backdrop ─────────────────────────────────── */
.flyout-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-default);
}
.flyout-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Flyout Panel ────────────────────────────────────── */
.flyout {
  position: fixed;
  top: 48px;
  right: 0;
  width: 480px;
  height: calc(100vh - 48px);
  background: var(--bg-surface);
  background-image: linear-gradient(180deg, var(--color-slate-dark) 0%, rgba(10, 15, 30, 0.98) 100%);
  border-left: var(--border-thin) solid var(--border-subtle);
  box-shadow: -8px 0 32px rgba(10, 15, 30, 0.4);
  overflow-y: auto;
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-decelerate);
  z-index: 100;
}
.flyout.open { transform: translateX(0); }
.flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}
.flyout-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-xl);
  cursor: pointer;
  padding: var(--space-1);
}
.flyout-close:hover { color: var(--text-primary); }

/* ── Deal Card (compact, for pipeline list) ──────────── */
.deal-card {
  background: var(--bg-card);
  border: var(--border-hairline) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}
.deal-card:hover {
  border-color: var(--color-signal-400);
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}
.deal-card.active {
  border-left: 3px solid var(--color-signal-400);
  background: rgba(29, 158, 117, 0.06);
  box-shadow: inset 0 0 16px rgba(29, 158, 117, 0.04), var(--shadow-sm);
}
.deal-card-issuer {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.deal-card-tranche {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
}
.deal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.deal-card-time {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
}

/* ── Fair Value Card ─────────────────────────────────── */
.fv-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(29, 158, 117, 0.04) 100%);
  border: var(--border-hairline) solid var(--border-subtle);
  border-left: 3px solid var(--color-signal-400);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  animation: fadeInUp var(--duration-normal) var(--ease-decelerate);
  position: relative;
}
.fv-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  box-shadow: 0 0 10px rgba(29, 158, 117, 0.3);
}
.fv-spread {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-signal-400);
  line-height: var(--leading-tight);
  text-shadow: 0 0 20px rgba(29, 158, 117, 0.15);
}
.fv-unit {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-left: var(--space-1);
}

/* ── NIP Card ────────────────────────────────────────── */
.nip-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(186, 117, 23, 0.04) 100%);
  border: var(--border-hairline) solid var(--border-subtle);
  border-left: 3px solid var(--color-yield-400);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  animation: fadeInUp var(--duration-normal) var(--ease-decelerate) 100ms both;
  position: relative;
}
.nip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  box-shadow: 0 0 10px rgba(186, 117, 23, 0.3);
}
.nip-value {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}
.nip-value.nip--yield-bold { text-shadow: 0 0 20px rgba(239, 159, 39, 0.2); }
.nip-value.nip--yield { text-shadow: 0 0 16px rgba(186, 117, 23, 0.15); }

/* ── Comparables Table ───────────────────────────────── */
.comp-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-3);
}
.comp-table th {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: var(--space-1) var(--space-2);
  border-bottom: var(--border-thin) solid var(--border-subtle);
  font-weight: var(--weight-regular);
}
.comp-table td {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  padding: var(--space-2);
  border-bottom: var(--border-hairline) solid var(--border-default);
}

/* ── Price Evolution Timeline ────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--space-3);
  position: relative;
  padding-left: 5px;
}
/* Connecting line */
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(180deg, var(--color-steel-600) 0%, var(--color-signal-400) 100%);
}
.timeline-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  position: relative;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-steel-600);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all var(--duration-fast) var(--ease-default);
}
.timeline-step:last-child .timeline-dot {
  background: var(--color-signal-400);
  box-shadow: 0 0 8px rgba(29, 158, 117, 0.5);
}
.timeline-time {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  width: 90px;
  letter-spacing: var(--tracking-wide);
}
.timeline-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  letter-spacing: var(--tracking-wide);
}
.timeline-spread {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-signal-400);
  font-weight: var(--weight-medium);
  margin-left: auto;
  letter-spacing: var(--tracking-wide);
}

/* ── Eligibility Checklist ───────────────────────────── */
.elig-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: var(--border-hairline) solid var(--border-default);
}
.elig-row:last-child { border-bottom: none; }
.elig-icon { font-size: var(--text-lg); width: 24px; text-align: center; }
.elig-icon--pass { color: var(--color-signal-400); }
.elig-icon--warn { color: var(--color-yield-400); }
.elig-icon--fail { color: #E05252; }
.elig-name {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  flex: 1;
  letter-spacing: var(--tracking-wide);
}
.elig-detail {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  text-align: right;
  letter-spacing: var(--tracking-wide);
}

/* ── Funding Table ───────────────────────────────────── */
.funding-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: var(--border-hairline) solid var(--border-default);
  align-items: flex-start;
}
.funding-row:last-child { border-bottom: none; }
.funding-issuer {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  min-width: 120px;
}
.funding-detail {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
}
.funding-rationale {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* ── Order Input ─────────────────────────────────────── */
.order-input-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.order-input {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  color: var(--text-primary);
  width: 160px;
  letter-spacing: var(--tracking-wide);
}
.order-input:focus {
  outline: none;
  border-color: var(--color-signal-400);
  box-shadow: 0 0 0 2px rgba(29, 158, 117, 0.2);
}

/* ── PM Matrix Cell ──────────────────────────────────── */
.matrix-cell {
  text-align: center;
  padding: var(--space-2) !important;
  min-width: 130px;
}
.matrix-cell--eligible { background: rgba(29, 158, 117, 0.04); }
.matrix-cell--warning { background: rgba(186, 117, 23, 0.04); }
.matrix-cell--ineligible { opacity: 0.5; }
.matrix-suggested {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: var(--tracking-wide);
}
.matrix-order {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--color-signal-400);
  margin-top: 2px;
  letter-spacing: var(--tracking-wide);
}

/* ── Utilities ───────────────────────────────────────── */
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-signal { color: var(--color-signal-400); }
.text-yield { color: var(--color-yield-400); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.bg-surface { background: var(--bg-surface); }
.scroll-y { overflow-y: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── CTA Button enhancements ─────────────────────────── */
.btn-primary {
  box-shadow: 0 0 12px rgba(29, 158, 117, 0.25);
  transition: background var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default), transform var(--duration-fast) var(--ease-default);
}
.btn-primary:hover {
  box-shadow: 0 0 20px rgba(29, 158, 117, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(29, 158, 117, 0.2);
}

/* ── Pulsing dot (for MANDATE state monitoring) ──────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-steel-400);
  animation: pulse 2s ease-in-out infinite;
  display: inline-block;
  box-shadow: 0 0 6px rgba(136, 135, 128, 0.4);
}

/* ── Agent insight badge ─────────────────────────────── */
.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  color: var(--color-signal-400);
  background: rgba(29, 158, 117, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}
.agent-badge::before { content: '\2022'; font-size: 14px; text-shadow: 0 0 4px rgba(29, 158, 117, 0.6); }

/* ── Scrollbar styling ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-slate-light);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-steel-600); }

/* ── Filter Bar ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.filter-chip {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: var(--border-hairline) solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}
.filter-chip:hover {
  background: rgba(29, 158, 117, 0.08);
  border-color: rgba(29, 158, 117, 0.4);
  color: var(--color-signal-200);
}
.filter-chip.active {
  background: rgba(29, 158, 117, 0.12);
  border-color: var(--color-signal-400);
  color: var(--color-signal-400);
  box-shadow: 0 0 8px rgba(29, 158, 117, 0.15);
}

/* ── Allocation Bar ──────────────────────────────────── */
.alloc-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.alloc-bar-track {
  flex: 1;
  height: 8px;
  background: var(--color-slate-dark);
  border-radius: var(--radius-pill);
  position: relative;
}
.alloc-bar-ordered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  background: rgba(186, 117, 23, 0.3);
  border: 1px solid var(--color-yield-400);
}
.alloc-bar-filled {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-yield-400);
}
.alloc-pct {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--color-yield-400);
  letter-spacing: var(--tracking-wide);
  min-width: 40px;
}

/* ─────────────────────────────────────────────────────────
   LIGHT MODE — Surface override
   Toggled via [data-theme="light"] on <html>
   Remaps the raw slate/midnight tokens to a warm light palette.
───────────────────────────────────────────────────────── */
[data-theme="light"] {
  /* Base surfaces */
  --color-midnight:    #F0EDE8;
  --color-slate-dark:  #FFFFFF;
  --color-slate:       #FAF9F5;
  --color-slate-light: #E5E3DC;
  --color-muted:       #6A6865;

  /* Steel ramp inverted for contrast on light bg */
  --color-steel-50:    #2C2C2A;
  --color-steel-100:   #444441;
  --color-steel-200:   #5F5E5A;  /* secondary text */
  --color-steel-400:   #8A8884;
  --color-steel-600:   #B4B2A9;
  --color-steel-800:   #D3D1C7;
  --color-steel-900:   #F1EFE8;

  /* Signal & Yield stay the same hue but slightly darker for AA contrast */
  --color-signal-200:  #1D9E75;
  --color-signal-400:  #0F6E56;
  --color-signal-600:  #085041;
  --color-yield-200:   #A35F0E;
  --color-yield-400:   #854F0B;

  /* Semantic tokens */
  --bg-primary:    #F0EDE8;
  --bg-secondary:  #FAF9F5;
  --bg-surface:    #FFFFFF;
  --bg-card:       #FFFFFF;
  --text-primary:  #1A1A18;
  --text-secondary:#444441;
  --text-muted:    #6A6865;
  --text-accent:   var(--color-signal-400);
  --text-data:     var(--color-signal-400);
  --border-subtle: #E5E3DC;
  --border-default: rgba(0, 0, 0, 0.08);
  --border-accent: var(--color-signal-400);

  --interactive-cta-bg:    var(--color-signal-400);
  --interactive-cta-text:  #FFFFFF;
  --interactive-cta-hover: var(--color-signal-600);
  --interactive-link:      var(--color-signal-400);
  --interactive-focus:     var(--color-signal-200);

  /* Shadows softer in light mode */
  --shadow-sm: 0 2px 8px rgba(26, 26, 24, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 26, 24, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 26, 24, 0.12);

  /* Danger — slightly darker red for AA contrast against light bg */
  --color-danger: #C94545;
}

/* Override the body noise texture in light mode */
[data-theme="light"] body::before {
  opacity: 0.04;
}

/* Softer modal scrim in light mode */
[data-theme="light"] .scrim {
  background: rgba(26, 26, 24, 0.35) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* Suppress glow shadows on small interactive elements in light mode
   to keep the theme calm and avoid the pink/teal halo effect */
[data-theme="light"] .pulse-dot,
[data-theme="light"] .urg-dot,
[data-theme="light"] .conf-dot.filled,
[data-theme="light"] .confidence-dot.filled,
[data-theme="light"] .market-badge,
[data-theme="light"] .s-market-badge {
  box-shadow: none !important;
  animation: none !important;
}

/* Row separator borders — rgba(255,255,255,0.04) is invisible on light bg.
   Force a dark equivalent for all known table/list/grid selectors. */
[data-theme="light"] .params-table td,
[data-theme="light"] .holdings-table td,
[data-theme="light"] .issuer-table td,
[data-theme="light"] .opt-table td,
[data-theme="light"] .gap-item,
[data-theme="light"] .pulse-item,
[data-theme="light"] .read-item,
[data-theme="light"] .cal-item,
[data-theme="light"] .order-row,
[data-theme="light"] .comp-rule,
[data-theme="light"] .conn-flow {
  border-bottom-color: rgba(0, 0, 0, 0.06) !important;
  border-top-color: rgba(0, 0, 0, 0.06) !important;
}

/* Inset surfaces — rgba(255,255,255,0.02) is invisible on light bg.
   Force a faint dark tint so nested cards/rows remain distinguishable. */
[data-theme="light"] .check,
[data-theme="light"] .rv-anchor,
[data-theme="light"] .rv-metric,
[data-theme="light"] .rv-chart,
[data-theme="light"] .nip-row,
[data-theme="light"] .rating {
  background: rgba(0, 0, 0, 0.025) !important;
}

/* Sidebar gradient — warmer in light mode */
[data-theme="light"] .sidebar,
[data-theme="light"] .s-sidebar {
  background-image: linear-gradient(180deg, #FFFFFF 0%, #FAF9F5 100%) !important;
  border-right-color: #E5E3DC;
}

/* Topbar */
[data-theme="light"] .topbar,
[data-theme="light"] .s-topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom-color: #E5E3DC;
}

/* Code/data accent backgrounds slightly stronger in light mode */
[data-theme="light"] .state-tag--ipt,
[data-theme="light"] .state-ipt {
  background: rgba(15, 110, 86, 0.12);
  color: #085041;
}
[data-theme="light"] .state-tag--guidance,
[data-theme="light"] .state-guidance {
  background: rgba(15, 110, 86, 0.18);
  color: #085041;
}
[data-theme="light"] .state-tag--priced,
[data-theme="light"] .state-priced {
  background: rgba(133, 79, 11, 0.18);
  color: #633806;
}
[data-theme="light"] .state-tag--mandate,
[data-theme="light"] .state-mandate {
  background: #F1EFE8;
  color: #5F5E5A;
}

/* Metric card hover shadow stronger in light mode */
[data-theme="light"] .metric-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-signal-400);
}

/* ── Theme Toggle Button ─────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: var(--border-hairline) solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}
.theme-toggle:hover {
  color: var(--color-signal-400);
  border-color: var(--color-signal-400);
}
.theme-toggle .glyph { font-size: var(--text-md); line-height: 1; }
