/* Bonds overview. Type and color come from the app tokens. */

.bnd {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 32px;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.bnd-head, .bnd-sec-row, .bnd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.bnd-head .section-title,
.bnd-sec-row .section-title { margin: 0; }
.bnd-sec { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.bnd h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.bnd-i {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  flex: 0 0 auto;
}
.bnd-i:hover,
.bnd-i:focus,
.bnd-i.is-open { z-index: 50; color: var(--text-primary); border-color: var(--text-muted); }
.bnd-i-pop {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: 280px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.bnd-i:hover .bnd-i-pop,
.bnd-i:focus .bnd-i-pop,
.bnd-i.is-open .bnd-i-pop { display: block; }
.bnd-i-end .bnd-i-pop { left: auto; right: 0; }

.bnd-gauge { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bnd-segs { display: flex; gap: 3px; }
.bnd-seg {
  display: block;
  width: 22px;
  height: 12px;
  border-radius: 3px;
  opacity: 0.28;
}
.bnd-seg.is-on { opacity: 1; }
.bnd-seg.s0, .bnd-glab.s0 { background: #e5483f; }
.bnd-seg.s1, .bnd-glab.s1 { background: #e0782f; }
.bnd-seg.s2, .bnd-glab.s2 { background: #b8921b; }
.bnd-seg.s3, .bnd-glab.s3 { background: #2f9e5e; }
.bnd-seg.s4, .bnd-glab.s4 { background: #1e7a4c; }
.bnd-glab {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: none;
}
.bnd-glab.s0 { color: #e5483f; }
.bnd-glab.s1 { color: #e0782f; }
.bnd-glab.s2 { color: #b8921b; }
.bnd-glab.s3 { color: #2f9e5e; }
.bnd-glab.s4 { color: #1e7a4c; }
.bnd-glab.s0, .bnd-glab.s1, .bnd-glab.s2, .bnd-glab.s3, .bnd-glab.s4 { background: none; }

.bnd-status { color: var(--text-secondary); padding: 28px 0; }

.bnd-split { display: flex; flex-wrap: wrap; gap: 16px; }
.bnd-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.bnd-card.main { flex: 2 1 560px; }
.bnd-card.side { flex: 1 1 460px; }
.bnd-card.half { flex: 1 1 480px; }

.bnd-signals {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.bnd-sig {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.bnd-sig b { font-size: 14px; }
.bnd-sig .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.bnd-sig .lab { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.bnd-track { display: block; height: 6px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; }
.bnd-fill { display: block; height: 100%; border-radius: 3px; background: var(--text-muted); }
.bnd-foot { font-size: 11px; color: var(--text-muted); }

.bnd-up { color: var(--gain); }
.bnd-dn { color: var(--loss); }
.bnd-muted { color: var(--text-muted); }
.bnd-stale { color: var(--text-muted); }
.bnd-na { color: var(--text-muted); cursor: help; }
.bnd-yield-tag { margin-left: 4px; font-size: 10px; color: var(--text-muted); }
.bnd-countries { overflow: visible; }
.bnd-countries .bnd-table { width: 100%; font-size: 11.5px; table-layout: auto; }
.bnd-countries th, .bnd-countries td { padding: 6px 4px; }
.bnd-countries th:first-child, .bnd-countries td:first-child { white-space: nowrap; }
.bnd-group td { font-weight: 600; text-align: left; background: var(--bg-hover); }

.bnd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bnd-table th, .bnd-table td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--border); }
.bnd-table th {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.bnd-table th:first-child, .bnd-table td:first-child { text-align: left; }
.bnd-table th:not(:first-child), .bnd-table td:not(:first-child) { white-space: nowrap; }
.bnd-card.side .bnd-table td:first-child .bnd-muted { display: block; }
.bnd-table tr:hover td { background: var(--bg-hover); }
.bnd-scroll { overflow-x: auto; }
.bnd-screen { overflow: auto; max-height: 640px; }
.bnd-screen thead th { position: sticky; background: var(--bg-card); z-index: 1; }
.bnd-screen thead tr:first-child th { top: 0; }
.bnd-screen thead tr:nth-child(2) th { top: 31px; }

.bnd-sort, .bnd-link, .bnd-date, .bnd-pill {
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
}
.bnd-sort { color: var(--text-muted); font-size: 11px; font-weight: 500; padding: 0; }
.bnd-sort.on { color: var(--text-primary); font-weight: 700; }
.bnd-link {
  font-weight: 600;
  color: var(--text-primary);
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
.bnd-link:hover { color: var(--accent-primary); }
.bnd-date, .bnd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-bottom: 2px solid transparent;
}
.bnd-date.on, .bnd-pill.on {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
  font-weight: 600;
}
.bnd-swatch { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.bnd-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.bnd-chart { position: relative; height: 320px; margin: 6px 72px 28px 48px; }
.bnd-grid {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.bnd-ylab {
  position: absolute;
  left: -48px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
}
.bnd-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bnd-end {
  position: absolute;
  left: 100%;
  transform: translateY(-50%);
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.bnd-x {
  position: absolute;
  left: 0; right: 0;
  bottom: -22px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.bnd-x span { width: 0; display: flex; justify-content: center; }

.bnd-regime {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.45;
}
.bnd-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.bnd-bars { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.bnd-bar {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr 1fr 64px;
  gap: 6px;
  align-items: center;
}
.bnd-bar.types { grid-template-columns: minmax(120px, 160px) 1fr 1fr 60px 52px; }
.bnd-barhead { font-size: 11px; color: var(--text-muted); }
.bnd-barhead span:nth-child(2), .bnd-num { text-align: right; }
.bnd-trackline { display: flex; }
.bnd-trackline.lost { justify-content: flex-end; }
.bnd-trackline i {
  display: block;
  height: 12px;
  border-radius: 2px;
  background: var(--text-muted);
}
.bnd-trackline i.up { background: var(--gain); }
.bnd-trackline i.dn { background: var(--loss); }

.bnd-read {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.bnd-read b { color: var(--text-primary); }

.bnd-yield {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  align-items: stretch;
}
.bnd-yield > .bnd-card.side {
  height: 0;
  min-height: 100%;
  overflow: hidden;
}
.bnd-ladder {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bnd-ladder::-webkit-scrollbar { width: 0; height: 0; display: none; }
.bnd-ladder thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.bnd-plot {
  position: relative;
  height: 680px;
  margin: 8px 12px 4px 48px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: visible;
}
.bnd-scatter-layer { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.bnd-scatter-layer svg { display: block; overflow: visible; }
.bnd-plot .bnd-ylab { left: -42px; }
.bnd-scatter-label {
  position: absolute;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}
.bnd-arrow {
  position: absolute;
  font-size: 9px;
  line-height: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.bnd-x.scatter { position: relative; height: 16px; margin: 2px 12px 0 48px; }
.bnd-x.scatter span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}
.bnd-key {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 12px 0 48px;
  font-size: 12px;
  color: var(--text-secondary);
}
.bnd-key span { display: inline-flex; align-items: center; gap: 6px; }
.bnd-pill .bnd-dot, .bnd-key .bnd-dot { position: static; width: 8px; height: 8px; display: inline-block; }
.bnd-plot .bnd-dot i { flex: none; }
.bnd-plot .bnd-dot i.hollow { background: transparent; border-width: 1.5px; border-style: solid; }
.bnd-cat-Treasury.hollow { border-color: #3d7ec9; }
.bnd-cat-Highgrade.hollow { border-color: #6b93e8; }
.bnd-cat-Investmentgrade.hollow { border-color: #2f8f7a; }
.bnd-cat-Highyield.hollow { border-color: #d4883a; }
.bnd-cat-Munis.hollow { border-color: #c45aa8; }
.bnd-cat-International.hollow { border-color: #8d74d6; }
.bnd-plot .empty {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.bnd-dot {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}
.bnd-dot i {
  display: block;
  border-radius: 50%;
  opacity: 0.9;
  box-sizing: border-box;
  border: 2px solid var(--bg-card);
}

.bnd-map { position: relative; height: 480px; background: var(--bg-primary); border-radius: 8px; overflow: hidden; }
.bnd-tile {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--bg-primary);
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  padding: 2px;
}
.bnd-glabel {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid var(--bg-primary);
  pointer-events: none;
  overflow: hidden;
}
.bnd-glabel span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-card);
  color: var(--text-primary);
}
.bnd-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--text-muted); }
.bnd-legend .scale { display: flex; height: 8px; width: 180px; border-radius: 4px; overflow: hidden; }
.bnd-legend .scale i { flex: 1; }

.bnd-b0 { background: #8f3d45; color: #fff; }
.bnd-b1 { background: #6a4044; color: #fff; }
.bnd-b2 { background: #2c3340; color: #e8e8e8; }
.bnd-b3 { background: #245c40; color: #fff; }
.bnd-b4 { background: #1e7a4c; color: #fff; }
.bnd-y0 { background: #243044; color: #d5deee; }
.bnd-y1 { background: #2c4068; color: #e8e8e8; }
.bnd-y2 { background: #3d5a94; color: #fff; }
.bnd-y3 { background: #2a4e96; color: #fff; }
.bnd-y4 { background: #1d3f8f; color: #fff; }
html[data-theme="light"] #bonds-overview-root .bnd-card,
html[data-theme="light"] #bonds-overview-root .bnd-sig,
html[data-theme="light"] #bonds-overview-root .index-card,
html[data-theme="light"] #bonds-overview-root .bnd-screen thead th,
html[data-theme="light"] #bonds-overview-root .bnd-ladder thead th {
  background: #e8ecf0;
}
html[data-theme="light"] #bonds-overview-root .bnd-table tr:hover td {
  background: #dde2e8;
}

html[data-theme="light"] .bnd-b0 { background: #a8464f; color: #fff; }
html[data-theme="light"] .bnd-b1 { background: #e7c5c8; color: #1f2329; }
html[data-theme="light"] .bnd-b2 { background: #e4e7eb; color: #1f2329; }
html[data-theme="light"] .bnd-b3 { background: #b7d7c4; color: #1f2329; }
html[data-theme="light"] .bnd-b4 { background: #2f7a52; color: #fff; }
html[data-theme="light"] .bnd-y0 { background: #e8eefb; color: #1f2329; }
html[data-theme="light"] .bnd-y1 { background: #c3d3f5; color: #1f2329; }
html[data-theme="light"] .bnd-y2 { background: #8eaced; color: #1f2329; }
html[data-theme="light"] .bnd-y3 { background: #4f7fe0; color: #fff; }
html[data-theme="light"] .bnd-y4 { background: #1d3f8f; color: #fff; }

.bnd-cat-Treasury { background: #3d7ec9; }
.bnd-cat-Highgrade { background: #6b93e8; }
.bnd-cat-Investmentgrade { background: #2f8f7a; }
.bnd-cat-Highyield { background: #d4883a; }
.bnd-cat-Munis { background: #c45aa8; }
.bnd-cat-International { background: #8d74d6; }

.bnd-filter, .bnd-search {
  font: inherit;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  width: 100%;
  max-width: 150px;
}
.bnd-filter.on, .bnd-search.on { border-color: var(--accent-primary); }
.bnd-filters { color: var(--accent-primary); font-size: 12px; font-weight: 600; }

.bnd-crp { background: var(--bg-hover); }

@media (max-width: 1100px) {
  .bnd-signals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .bnd-signals { grid-template-columns: 1fr 1fr; }
  .bnd-map { height: 320px; }
  .bnd-yield { grid-template-columns: 1fr; }
  .bnd-yield > .bnd-card.side {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .bnd-ladder { max-height: 480px; flex: none; }
  .bnd-plot { height: 420px; }
  .bnd-chart { margin: 6px 64px 28px 36px; height: 240px; }
  #bonds-overview-root table { min-width: 0; }
  #bonds-overview-root .bnd-table th:first-child,
  #bonds-overview-root .bnd-table td:first-child {
    width: 164px;
    max-width: 164px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #bonds-overview-root .bnd-table td:first-child:has(.bnd-link),
  #bonds-overview-root .bnd-table td:first-child:has(.bnd-muted) {
    display: flex;
    align-items: baseline;
    gap: 4px;
  }
  #bonds-overview-root .bnd-table td:first-child .bnd-link,
  #bonds-overview-root .bnd-table td:first-child:not(:has(.bnd-link)) .bnd-muted {
    min-width: 8ch;
    flex: 1 1 8ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
  }
  #bonds-overview-root .bnd-table td:first-child .bnd-tag,
  #bonds-overview-root .bnd-table td:first-child b,
  #bonds-overview-root .bnd-table td:first-child:has(.bnd-link) .bnd-muted {
    flex: none;
  }
  #bonds-overview-root .index-cards { grid-template-columns: 1fr !important; }
}

.bnd-wait {
  display: inline-block;
  width: 3.2em;
  height: 0.85em;
  vertical-align: middle;
}
.bnd-wait.is-spark { display: block; width: 100%; height: 36px; }
.bnd-wait.is-chart { display: block; width: 100%; min-height: 220px; }
.bnd-wait.is-card { display: block; width: 100%; height: 88px; }
.bnd-card-wait { pointer-events: none; cursor: default; }
