/* bond-samples — one bond's row of the sample file, explained, and the file.
   Tokens fall back to the site's palette (/site.css: --primary, --accent,
   --ink, --paper); everything here is bsx-. The app owns its page, so in dark
   mode it also sets the body's ground. */
.bsx-page, .bsx {
  --bsx-ground: var(--paper, #f6f4ef);
  --bsx-card: #ffffff;
  --bsx-ink: var(--ink, #1b2330);
  --bsx-muted: #545d6b;
  --bsx-hair: rgba(27, 35, 48, 0.14);
  --bsx-band: rgba(27, 35, 48, 0.045);
  --bsx-accent: var(--primary, #12395c);
  --bsx-mark: var(--accent, #a3561f);
  --bsx-hit: rgba(163, 86, 31, 0.12);
  --bsx-focus: #2a78d6;
  --bsx-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bsx-page, :root:not([data-theme="light"]) .bsx {
    color-scheme: dark;
    --bsx-ground: #121417;
    --bsx-card: #1a1d22;
    --bsx-ink: #eceae4;
    --bsx-muted: #a9afb8;
    --bsx-hair: rgba(236, 234, 228, 0.16);
    --bsx-band: rgba(236, 234, 228, 0.05);
    --bsx-accent: #9cc0e4;
    --bsx-mark: #e0a06e;
    --bsx-hit: rgba(224, 160, 110, 0.16);
    --bsx-focus: #6aa8f0;
  }
}
:root[data-theme="dark"] .bsx-page, :root[data-theme="dark"] .bsx {
  color-scheme: dark;
  --bsx-ground: #121417;
  --bsx-card: #1a1d22;
  --bsx-ink: #eceae4;
  --bsx-muted: #a9afb8;
  --bsx-hair: rgba(236, 234, 228, 0.16);
  --bsx-band: rgba(236, 234, 228, 0.05);
  --bsx-accent: #9cc0e4;
  --bsx-mark: #e0a06e;
  --bsx-hit: rgba(224, 160, 110, 0.16);
  --bsx-focus: #6aa8f0;
}
body.bsx-page { background: var(--bsx-ground); }

.bsx {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 48px;
  color: var(--bsx-ink);
}
.bsx :focus-visible { outline: 2px solid var(--bsx-focus); outline-offset: 2px; }
.bsx h1 { color: var(--bsx-ink); font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0 0 14px; max-width: 24ch; }
.bsx h2 { color: var(--bsx-ink); font-size: 1.35rem; margin: 0 0 10px; }
.bsx p { max-width: 70ch; }

/* ---- head: what the file is, and the picker ------------------------------ */
.bsx-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bsx-mark);
}
.bsx-lede { margin: 0 0 22px; font-size: 1.05rem; color: var(--bsx-ink); }
.bsx-pick { max-width: 640px; }
.bsx-pick-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.bsx-pick-row { display: flex; gap: 8px; align-items: stretch; }
.bsx-combo { position: relative; flex: 1 1 auto; min-width: 0; }
.bsx-search {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--bsx-ink);
  background: var(--bsx-card);
  border: 1px solid var(--bsx-hair);
  border-radius: 8px;
  padding: 11px 13px;
  min-height: 44px;
}
.bsx-search::placeholder { color: var(--bsx-muted); }
.bsx-step {
  flex: 0 0 44px;
  min-height: 44px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--bsx-ink);
  background: var(--bsx-card);
  border: 1px solid var(--bsx-hair);
  border-radius: 8px;
  cursor: pointer;
}
.bsx-step:hover { border-color: var(--bsx-accent); }
.bsx-step:disabled { opacity: 0.35; cursor: default; }
.bsx-results {
  position: absolute;
  z-index: 5;
  left: 0; right: 0; top: calc(100% + 4px);
  list-style: none;
  margin: 0; padding: 4px 0;
  background: var(--bsx-card);
  border: 1px solid var(--bsx-hair);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  max-height: 340px;
  overflow-y: auto;
}
.bsx-results li { padding: 8px 12px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; }
.bsx-results li[aria-selected="true"], .bsx-results li:hover { background: var(--bsx-hit); }
.bsx-results .bsx-r-isin { font-family: var(--bsx-mono); font-size: 0.86rem; }
.bsx-results .bsx-r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsx-results .bsx-r-desc { grid-column: 1 / -1; font-size: 0.82rem; color: var(--bsx-muted); }
.bsx-results .bsx-r-none { cursor: default; color: var(--bsx-muted); }

/* ---- the chosen bond's row ---------------------------------------------- */
.bsx-bond {
  margin-top: 34px;
  background: var(--bsx-card);
  border: 1px solid var(--bsx-hair);
  border-radius: 12px;
  padding: 24px 24px 8px;
}
.bsx-loading { color: var(--bsx-muted); margin: 0 0 16px; }
.bsx-bond-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; align-items: baseline; }
.bsx-bond h2 { margin: 0; font-size: clamp(1.25rem, 3vw, 1.6rem); }
.bsx-bond-id { font-family: var(--bsx-mono); font-size: 0.95rem; color: var(--bsx-muted); }
.bsx-bond-sub { margin: 6px 0 0; color: var(--bsx-muted); }
.bsx-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; padding: 0; list-style: none; }
.bsx-facts li { border: 1px solid var(--bsx-hair); border-radius: 8px; padding: 8px 12px; min-width: 9.5rem; }
.bsx-facts b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.bsx-facts span { font-size: 0.8rem; color: var(--bsx-muted); }
.bsx-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.bsx-jump a {
  font-size: 0.82rem;
  padding: 5px 10px;
  border: 1px solid var(--bsx-hair);
  border-radius: 999px;
  color: var(--bsx-ink);
  text-decoration: none;
}
.bsx-jump a:hover { border-color: var(--bsx-accent); }
.bsx-sections { margin-top: 12px; }
.bsx-sec { border-top: 1px solid var(--bsx-hair); padding: 14px 0 10px; scroll-margin-top: 16px; }
.bsx-sec h3 { margin: 0 0 8px; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bsx-mark); }
.bsx-fields { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bsx-fields col.c-name { width: 23%; }
.bsx-fields col.c-value { width: 24%; }
.bsx-fields th, .bsx-fields td { text-align: left; vertical-align: top; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--bsx-band); }
.bsx-fields th { font-family: var(--bsx-mono); font-weight: 500; font-size: 0.86rem; overflow-wrap: anywhere; }
.bsx-fields td.v { font-family: var(--bsx-mono); font-size: 0.92rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bsx-fields td.v.blank { color: var(--bsx-muted); font-family: inherit; font-style: italic; }
.bsx-fields td.d { font-size: 0.9rem; color: var(--bsx-muted); }
.bsx-fields td.d .u { color: var(--bsx-ink); }
.bsx-fields td.d .n { display: block; margin-top: 2px; font-style: italic; }
.bsx-fields tr.key th::after { content: "key"; margin-left: 6px; font-family: inherit; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bsx-mark); }

/* ---- the file ------------------------------------------------------------ */
.bsx-file { margin-top: 44px; }
.bsx-file-note { color: var(--bsx-muted); margin: 0 0 14px; }
.bsx-downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; align-items: center; }
.bsx-dl, .bsx-request {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.bsx-dl { background: var(--bsx-accent); color: var(--bsx-card); border: 1px solid var(--bsx-accent); }
.bsx-dl small { font-weight: 400; opacity: 0.85; }
.bsx-request { background: transparent; color: var(--bsx-ink); border: 1px solid var(--bsx-hair); }
.bsx-request:hover { border-color: var(--bsx-accent); }
.bsx-table-wrap {
  overflow: auto;
  max-height: 560px;
  border: 1px solid var(--bsx-hair);
  border-radius: 10px;
  background: var(--bsx-card);
}
.bsx-table { border-collapse: separate; border-spacing: 0; font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.bsx-table th, .bsx-table td { padding: 6px 12px; white-space: nowrap; border-bottom: 1px solid var(--bsx-band); text-align: left; }
.bsx-table thead th { position: sticky; background: var(--bsx-card); z-index: 2; }
.bsx-table thead tr.sec td.first { top: 0; position: sticky; border-bottom: 0; }
.bsx-table thead tr.sec th { top: 0; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bsx-mark); border-bottom: 0; border-left: 1px solid var(--bsx-hair); }
.bsx-table thead tr.col th { top: 27px; font-family: var(--bsx-mono); font-weight: 500; border-bottom: 1px solid var(--bsx-hair); }
.bsx-table td { font-family: var(--bsx-mono); }
.bsx-table td.num { text-align: right; }
.bsx-table th.first, .bsx-table td.first { position: sticky; left: 0; background: var(--bsx-card); z-index: 1; border-right: 1px solid var(--bsx-hair); }
.bsx-table thead .first { z-index: 3; }
.bsx-table tbody tr { cursor: pointer; }
.bsx-table tbody tr:hover td { background: var(--bsx-band); }
.bsx-table tbody tr.on td { background: var(--bsx-hit); }
.bsx-table td.first button { all: unset; cursor: pointer; font-family: var(--bsx-mono); color: var(--bsx-accent); text-decoration: underline; text-underline-offset: 2px; }
.bsx-table td.first button:focus-visible { outline: 2px solid var(--bsx-focus); outline-offset: 2px; }

.bsx-method { margin-top: 40px; }
.bsx-method p { color: var(--bsx-ink); }
.bsx-noscript { max-width: 1120px; margin: 0 auto; padding: 0 24px 24px; }

/* ---- phone: each field stacks, the value under its name ------------------ */
@media (max-width: 640px) {
  .bsx { padding: 24px 16px 40px; }
  .bsx-bond { padding: 18px 14px 4px; border-radius: 10px; }
  .bsx-facts li { min-width: calc(50% - 5px); flex: 1 1 calc(50% - 5px); }
  .bsx-fields, .bsx-fields tbody { display: block; width: auto; }
  .bsx-fields colgroup { display: none; }
  .bsx-fields tr {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--bsx-band);
  }
  .bsx-fields th, .bsx-fields td { display: block; border: 0; padding: 0; }
  .bsx-fields th { overflow-wrap: normal; }
  .bsx-fields td.v { text-align: right; }
  .bsx-fields td.d { grid-column: 1 / -1; margin-top: 2px; font-size: 0.84rem; line-height: 1.45; }
  .bsx-dl, .bsx-request { flex: 1 1 100%; justify-content: center; }
  .bsx-table-wrap { max-height: 460px; }
}
