/* Dirigon institutional workstation.
   Tokens from design_handoff_dirigon_workstation. No rounded corners. */
:root {
  --ink: #12161B;
  --ink-2: #43484F;
  --paper: #EFEEE9;
  --surface: #FFFFFF;
  --surface-alt: #F7F6F3;
  --surface-tint: #FBFAF7;
  --hairline: #D6D3CA;
  --hairline-2: #EBE9E2;
  --hairline-3: #E4E2DA;
  --oxblood: #8E2A22;
  --amber: #8A6210;
  --amber-2: #C2802A;
  --green: #1F6B4B;
  --muted: #6E6A61;
  --muted-2: #8B857A;
  --muted-3: #A9A398;
  --slate: #7C8794;
  --cmd-bg: #1C222A;
  --cmd-border: #2E3742;
  --font-ui: "Archivo", system-ui, Helvetica, Arial, sans-serif;
  --font-display: "Archivo Narrow", "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --rail-w: 186px;
  --bar-h: 46px;
  --series-0: #8E2A22;
  --series-1: #43484F;
  --series-2: #C2802A;
  --series-3: #1F6B4B;
  --series-4: #2C4463;
  --series-5: #8B857A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: var(--oxblood); text-decoration: none; }
a:hover { color: var(--ink); }
button { font-family: inherit; }
::selection { background: var(--oxblood); color: #fff; }
input { font-family: inherit; }

/* ── App shell ─────────────────────────────────────────────── */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Command bar */
#cmdbar {
  height: var(--bar-h);
  flex: none;
  background: var(--ink);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  border-bottom: 2px solid var(--oxblood);
  z-index: 20;
}
.rail-toggle {
  display: none;
  flex: none;
  width: 28px;
  height: 26px;
  padding: 5px 5px;
  background: transparent;
  border: 1px solid var(--cmd-border);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.rail-toggle span {
  display: block;
  height: 1.5px;
  background: #EFEEE9;
}
#rail-scrim {
  display: none;
}
.brand {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  flex: none;
  text-decoration: none;
}
a.brand:hover .brand-word { color: #fff; }
.brand-glyph { margin-bottom: 2px; display: block; }
.brand-word {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .16em;
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
}
.brand-desc {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .18em;
  color: var(--slate);
  text-transform: uppercase;
  line-height: 1;
  padding-bottom: 1px;
}
.cmd-input-wrap {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 26px;
  padding: 0 10px;
  background: var(--cmd-bg);
  border: 1px solid var(--cmd-border);
  cursor: text;
}
.cmd-input-wrap .prompt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--oxblood);
  letter-spacing: .1em;
}
.cmd-input-wrap .placeholder {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-chip {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #5C6772;
  border: 1px solid var(--cmd-border);
  padding: 1px 5px;
}
.cmd-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex: none;
}
.gate-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #A7B0BA;
  letter-spacing: .06em;
}
.gate-dot {
  width: 6px;
  height: 6px;
  background: #2E8B5F;
  display: block;
  flex: none;
}
.asof {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #A7B0BA;
  letter-spacing: .06em;
}
.user-sq {
  width: 24px;
  height: 24px;
  background: var(--cmd-border);
  color: #DDE3E9;
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Body layout */
#layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* Left rail */
#rail {
  width: var(--rail-w);
  flex: none;
  background: var(--surface-alt);
  border-right: 1px solid var(--hairline);
  padding: 10px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.nav-group-label {
  padding: 12px 12px 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.nav-item[hidden],
[data-admin-only][hidden] { display: none !important; }
/* Empty book used to hide Disagreement / Studio / funds. New users could
   not reach the product we sell. The rail is the map. Credit is the door
   when they have no sleeve; Your book moves up once they do. */
.nav-group { display: flex; flex-direction: column; }
.nav-group[data-group="book"] { order: 1; }
.nav-group[data-group="credit"] { order: 2; }
.nav-group[data-group="fund"] { order: 3; }
.nav-more { order: 4; }
#rail-foot { order: 5; }
body.book-empty .nav-group[data-group="credit"] { order: 1; }
body.book-empty .nav-group[data-group="book"] { order: 2; }
.start-book {
  max-width: 560px;
  padding: 40px 32px 56px;
}
.start-book h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 8px;
  line-height: 1.15;
}
.start-book .lead {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 22px;
}
.start-book-search {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font: 16px Archivo, sans-serif;
  border: 1px solid var(--line, var(--hairline));
  background: var(--surface);
  color: var(--ink);
}
.start-book-search:focus {
  outline: none;
  border-color: var(--ink);
}
.start-book-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.start-book-hit .cell-primary { font-size: 15px; }
.start-book-next {
  margin-top: 28px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.start-book details {
  margin-top: 20px;
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}
.start-book details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
}
.start-book details summary::-webkit-details-marker { display: none; }
.start-book-paste {
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  padding: 10px 12px;
  font: 13px "IBM Plex Mono", monospace;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  min-height: 88px;
}
.discover-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.discover-kicker {
  flex: 1 0 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.discover-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  min-width: 140px;
  flex: 1 1 140px;
  text-decoration: none;
  color: inherit;
}
.discover-hit:hover { border-color: var(--ink); }
.discover-lab { font-size: 13px; font-weight: 600; }
.discover-why { font-size: 12px; color: var(--muted); }
.book-coach {
  padding: 10px 0 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}
.book-coach a { color: var(--oxblood); }
.press-tape { padding: 10px 0 8px; }
.press-tape-k {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}
.press-tape-k span { text-transform: none; letter-spacing: 0; margin-left: 8px; }
.press-item { display: block; padding: 5px 0; text-decoration: none; color: inherit; }
.press-item-t { font-size: 13.5px; line-height: 1.4; }
.press-item-w { font-size: 12px; color: var(--muted); margin-top: 2px; }

.eightk-band {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.eightk-sum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.eightk-sum::-webkit-details-marker { display: none; }
.eightk-sum::before {
  content: "▸";
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  width: 10px;
  flex: none;
}
.eightk-band[open] > .eightk-sum::before { content: "▾"; }
.eightk-sum:hover { background: var(--surface-tint); }
.eightk-sum-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.eightk-sum-title {
  font-size: 13.5px;
  font-weight: 600;
  flex: 1;
  min-width: 140px;
}
.eightk-sum-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--muted-2);
}
.eightk-band .eightk-card { margin: 0 20px 12px; }
.eightk-band:not([open]) > .eightk-card { display: none; }
.eightk-card {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 0 14px;
  align-items: start;
  margin-top: 8px;
  padding: 12px 14px 12px 0;
  background: var(--surface-alt);
  border: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
}
.eightk-card:hover { border-color: var(--muted-2); }
.eightk-card-bar { display: block; align-self: stretch; background: var(--hairline); min-height: 48px; }
.eightk-card.material .eightk-card-bar { background: var(--oxblood); }
.eightk-card.notable .eightk-card-bar { background: var(--amber); }
.eightk-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.eightk-card-title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.eightk-card-blurb {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.eightk-card-foot {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--oxblood);
}
.eightk-card-chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--hairline);
  color: var(--muted);
  white-space: nowrap;
}
.eightk-card.material .eightk-card-chip {
  border-color: var(--oxblood);
  color: var(--oxblood);
}
.eightk-card.notable .eightk-card-chip {
  border-color: var(--amber);
  color: var(--amber);
}
@media (max-width: 640px) {
  .eightk-card { grid-template-columns: 4px minmax(0, 1fr); }
  .eightk-card-chip { grid-column: 2; margin-top: 8px; justify-self: start; }
}
details.nav-more { margin: 0; }
details.nav-more > summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--font-mono);
}
details.nav-more > summary::-webkit-details-marker { display: none; }
.page-fill.family-page { overflow: hidden; }
.page-fill.family-page > :last-child {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.more-family {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-alt);
  flex: 0 0 auto;
}
.more-family-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
  margin-right: 6px;
}
.more-family-tab {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.more-family-tab:hover { color: var(--ink); border-color: var(--ink); }
.more-family-tab.on {
  color: var(--ink);
  border-color: var(--oxblood, #8E2A22);
  background: var(--surface);
}
.fund-mn-axis-title {
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .06em;
  color: #43484F;
}
.fund-mn-y {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-3);
  white-space: nowrap;
}
.fund-mn-y-l { right: 4px; text-align: right; }
.fund-mn-y-r { left: 4px; text-align: left; color: #43484F; }
.fund-mn-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.fund-mn-hit:hover { background: rgba(142, 42, 34, 0.06); }
.fund-mn-note {
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.45;
  max-width: 260px;
}
.filer-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--muted);
}
.holder-spark {
  display: inline-block;
  position: relative;
  width: 88px;
  height: 12px;
  background: #EFEDE8;
  border-radius: 1px;
  vertical-align: middle;
}
.holder-spark-band {
  position: absolute;
  top: 3px;
  height: 6px;
  background: #C4B8A8;
  border-radius: 1px;
}
.holder-spark i.cons {
  position: absolute;
  top: 0;
  width: 2px;
  height: 12px;
  background: #12161B;
  margin-left: -1px;
}
.nav-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 12px;
  cursor: pointer;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
  background: transparent;
}
.nav-item:hover { background: var(--surface-alt); color: var(--ink); }
.nav-item.active {
  background: #EFE7E6;
  border-left-color: var(--oxblood);
  color: var(--ink);
  font-weight: 600;
}
.nav-code {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-3);
  width: 26px;
  flex: none;
}
.nav-item.active .nav-code { color: var(--oxblood); }
.nav-label { font-size: 12.5px; white-space: nowrap; }
.rail-foot {
  margin: 16px 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--muted-2);
  margin-top: auto;
}
.page-back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
}
.page-back:hover { color: var(--oxblood); }

/* Main */
#main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* page-fill / page-scroll own vertical scroll */
  background: var(--paper);
}
#main > .loading,
#main > .error {
  padding: 60px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
}
#main > .error { color: var(--oxblood); }

/* Page chrome */
.page-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.1;
}
.page-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .06em;
}
.page-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 800px) {
  .rail-toggle { display: flex; }
  #rail-scrim[hidden] { display: none !important; }
  #rail-scrim {
    display: block;
    position: fixed;
    inset: var(--bar-h) 0 0 0;
    background: rgba(18, 22, 27, .35);
    z-index: 24;
  }
  #rail {
    position: fixed;
    top: var(--bar-h);
    left: 0;
    bottom: 0;
    z-index: 25;
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 8px 0 24px rgba(18, 22, 27, .12);
  }
  body.rail-open #rail { transform: translateX(0); }
  .cmd-input-wrap .placeholder { max-width: 140px; }
  .brand-desc { display: none; }
}
.entity-head {
  flex: none;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
}
.back-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--oxblood);
  cursor: pointer;
  margin-bottom: 8px;
  display: inline-block;
  text-decoration: none;
}
.back-link:hover { color: var(--ink); }
.entity-title-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  row-gap: 8px;
  flex-wrap: wrap;
}
.entity-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: .01em;
  line-height: 1.12;
}
.entity-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .06em;
  padding-bottom: 3px;
}
.entity-flags {
  margin-left: auto;
  display: flex;
  gap: 6px;
  padding-bottom: 2px;
  flex-wrap: wrap;
  align-items: center;
}
.entity-flag-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 2px;
}

/* Buttons */
.btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  padding: 5px 10px;
  border: 1px solid #C9C5BA;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled, .btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: var(--surface);
  color: var(--muted);
  border-color: var(--hairline);
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-primary:hover { background: #1C222A; }
.btn-filter.active,
.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tags / badges */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .1em;
  padding: 1px 4px;
  border: 1px solid;
  flex: none;
  line-height: 1.4;
  text-transform: uppercase;
}
.tag-risk { background: #F3E4E2; color: var(--oxblood); border-color: #E0C6C3; }
.tag-warn { background: #F5EEDF; color: var(--amber); border-color: #E3D6B8; }
.tag-good { background: #E6EFE9; color: var(--green); border-color: #C6DCCF; }
.tag-mute { background: var(--surface-alt); color: var(--muted); border-color: #DCD9D0; }
.tag-listed { background: #E9EDF3; color: #2C4463; border-color: #CBD5E1; }
.tag-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag-est { background: #F5EEDF; color: var(--amber); border-color: #E3D6B8; }

.mix-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mix-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
  padding: 1px 6px;
  border: 1px solid var(--hairline);
  background: var(--surface-tint, #f2f1ec);
  color: var(--muted);
  cursor: pointer;
  line-height: 1.5;
}
.mix-chip:hover { color: var(--ink); border-color: var(--ink); }
.mix-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Stat strip — 1px gap grid */
.stat-strip {
  flex: none;
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.stat-strip-fixed { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .stat-strip-fixed { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
.stat-cell {
  background: var(--surface);
  padding: 11px 14px;
  min-width: 0;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -.02em;
  margin-top: 5px;
  color: var(--ink);
}
.stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.stat-value.risk, .c-risk { color: var(--oxblood) !important; }
.stat-value.warn, .c-warn { color: var(--amber) !important; }
.stat-value.good, .c-good { color: var(--green) !important; }
.stat-value.muted, .c-muted { color: var(--muted-2) !important; }

/* Panel band */
.panel-band {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  /* Default: size to content. Use .panel-band.fill when a page wants the
     band to consume remaining viewport (desk-style split panes). flex:1 was
     the default and silently ate the holdings region on fund/issuer pages. */
  flex: none;
  min-height: 0;
}
.panel-band.fill {
  flex: 1;
}
.panel {
  background: var(--surface);
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.panel-alt { background: var(--surface-alt); }
.panel-tint { background: var(--surface-tint); }
.panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px 9px;
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 2;
  flex-wrap: wrap;
}
.panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.panel-title-sm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.panel-sub { font-size: 11.5px; color: var(--muted); }
.panel-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
}
.panel-body { padding: 14px 16px; }
.panel-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--muted-2);
  margin-bottom: 8px;
}

/* Instrument / capital-structure collapsible groups (BDC + issuer detail) */
.instr-group {
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}
.instr-group > summary.instr-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 12.5px;
  background: var(--surface-alt);
}
.instr-group > summary.instr-head::-webkit-details-marker { display: none; }
.instr-group > summary.instr-head::before {
  content: "▸";
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  width: 10px;
  flex: none;
}
.instr-group[open] > summary.instr-head::before { content: "▾"; }
.instr-group > summary.instr-head:hover { background: var(--surface-tint); }
.instr-group .instr-label {
  font-weight: 600;
  text-transform: capitalize;
  min-width: 140px;
}
.instr-group .instr-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .02em;
}
.instr-group .instr-meta strong {
  color: var(--ink);
  font-weight: 600;
}
.instr-group .instr-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.instr-group .instr-actions .btn {
  font-size: 9px;
  padding: 3px 8px;
}
.instr-filter-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: .06em;
  padding: 6px 16px;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--hairline);
}
.hbar.clickable { cursor: pointer; }
.hbar.clickable:hover { background: var(--surface-tint); }
.hbar.clickable.active {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
}

/* Fund profile — full portfolio controls */
.filer-context-band {
  max-height: 280px;
}
.filer-context-band > .panel {
  max-height: 280px;
  overflow: auto;
}
.filer-holdings-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-alt);
}
.filer-holdings-controls .search-box {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink);
}
.filer-holdings-controls .search-box:focus {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: capitalize;
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.chip:hover { background: var(--surface-tint); color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.chip .chip-n {
  opacity: 0.7;
  margin-left: 4px;
}
.filer-view-toggle {
  display: flex;
  gap: 0;
  padding: 0 16px 10px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--hairline);
}
.filer-view-toggle .btn {
  border-radius: 0;
  font-size: 9.5px;
  letter-spacing: .08em;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--muted);
  cursor: pointer;
}
.filer-view-toggle .btn + .btn { border-left: 0; }
.filer-view-toggle .btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Tables */
/* Tables size to content by default so multiple tables on one page don't
   each claim flex:1 and crush to zero height (issuer capital structure). */
.table-wrap {
  overflow: auto;
  flex: none;
  background: var(--surface);
}
td.table-empty {
  text-align: left;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  cursor: default;
}
.table-empty-note {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
}
table.data thead th:focus {
  outline: 1px solid var(--text, #222);
  outline-offset: -1px;
}
tr.clickable:focus {
  outline: 1px solid var(--text, #222);
  outline-offset: -1px;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.data thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--muted-2);
  padding: 7px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-alt);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
table.data thead th.num { text-align: right; }
table.data thead th.th-help { cursor: help; }
.col-help {
  position: fixed;
  z-index: 80;
  max-width: 280px;
  padding: 8px 10px;
  background: var(--ink);
  color: #EFEEE9;
  font: 12.5px/1.45 Archivo, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(18,22,27,.28);
}
table.data thead th.sorted-asc::after { content: " ↑"; }
table.data thead th.sorted-desc::after { content: " ↓"; }
table.data tbody tr { border-bottom: 1px solid var(--hairline-2); }
table.data tbody tr:hover { background: var(--surface-alt); }
table.data tbody tr.clickable { cursor: pointer; }
table.data td {
  padding: 8px 14px;
  vertical-align: top;
}
table.data td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
table.data td.num.strong {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink);
}
.cell-primary {
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
}
.cell-secondary {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 3px;
  letter-spacing: .04em;
}
.cell-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
}

/* Method footer */
.method-foot {
  flex: none;
  padding: 8px 16px;
  border-top: 1px solid var(--hairline);
  background: var(--surface-alt);
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.4;
  max-width: 960px;
}
.desk-fund-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--hairline);
}
.desk-book-k-meta {
  letter-spacing: .04em;
  text-transform: none;
  font-weight: 500;
  color: var(--muted);
  margin-left: 8px;
}
.desk-street {
  border-top: 1px solid var(--hairline);
  background: #F7F6F3;
}
.desk-street > summary {
  cursor: pointer;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}
.desk-street > summary::-webkit-details-marker { display: none; }
.desk-street > summary::after { content: " +"; }
.desk-street[open] > summary::after { content: " −"; }
.method-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--muted-2);
  display: block;
  margin-bottom: 2px;
}

/* Legend strip */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding: 11px 16px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: .06em;
  align-items: center;
}
.legend .swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  vertical-align: middle;
}
.legend .rule {
  display: inline-block;
  width: 1px;
  height: 11px;
  background: var(--ink);
  margin-right: 5px;
  vertical-align: middle;
}

/* Dot plot (holder marks 30→105) */
.dotplot {
  position: relative;
  height: 16px;
  background: var(--surface-alt);
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  width: 180px;
}
.dotplot .band {
  position: absolute;
  top: 0; bottom: 0;
  background: #E4E2DA;
}
.dotplot .dot {
  position: absolute;
  top: 5px;
  width: 5px;
  height: 5px;
  transform: translateX(-2px);
}
.dotplot .cons {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--ink);
}

/* Holder move plot — names in a real column; ¢ live on .move-track so
   a 27¢ mark cannot land on the filer label. */
.move-plot {
  display: flex;
  align-items: stretch;
  position: relative;
  height: 154px;
  background: transparent;
}
.move-plot .axis {
  position: absolute;
  top: 0;
  bottom: 16px;
  width: 1px;
  background: var(--hairline-2);
}
.move-plot .axis-lab {
  position: absolute;
  bottom: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  transform: translateX(-50%);
}
.move-plot .cons-line {
  position: absolute;
  top: 0;
  bottom: 16px;
  width: 1px;
  background: var(--ink);
}
.move-plot .cons-lab {
  position: absolute;
  top: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  background: var(--ink);
  color: #fff;
  padding: 1px 4px;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* History chart */
.hist-wrap {
  display: flex;
  gap: 14px;
  padding: 14px 18px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.hist-chart {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.hist-yg {
  flex: none;
  width: 36px;
  position: relative;
  overflow: hidden;
}
.hist-yg-r {
  width: 44px;
  border-left: 1px solid #43484F;
}
.hist-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.hist-well {
  position: relative;
  width: 100%;
  height: 170px;
  border-left: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-tint);
  overflow: hidden;
  clip-path: inset(0);
}
.hist-well svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.hist-xg {
  position: relative;
  height: 22px;
  overflow: hidden;
}
.hist-x-lab {
  position: absolute;
  top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  transform: translateX(-50%);
  white-space: nowrap;
}
.hist-hole {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(139, 133, 122, 0.14) 3px,
    rgba(139, 133, 122, 0.14) 4px
  );
  pointer-events: none;
  z-index: 0;
}
.hist-hole-lab {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.hist-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}
.hist-dot-other {
  width: 6px;
  height: 6px;
  background: var(--surface) !important;
  box-shadow: 0 0 0 1.5px currentColor;
}
.hist-legend {
  flex: none;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}
.hist-leg-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11px;
}
.hist-leg-row .line {
  width: 14px;
  height: 2px;
  flex: none;
  margin-top: 6px;
}
.hist-leg-row .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  color: var(--ink-2);
}
.hist-leg-row .val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-2);
}
.hist-leg-row .move {
  font-family: var(--font-mono);
  font-size: 10px;
  width: 50px;
  text-align: right;
}

/* Bars */
.bar-track {
  height: 8px;
  background: var(--surface-alt);
  position: relative;
  flex: 1;
  min-width: 0;
}
.bar-fill { height: 100%; }
.bar-tick {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--ink);
}
.hbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--hairline-2);
}
.hbar-label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fund-mix .hbar-label,
.filer-context-band .hbar-label {
  flex: 0 0 176px;
  width: 176px;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.25;
}
.mvs-rank {
  max-height: 280px;
  overflow: hidden;
  min-height: 0;
}
.mvs-rank > .panel {
  min-height: 0;
  overflow: auto;
}
.mvs-page .ux-filter-bar {
  flex: none;
  position: relative;
  z-index: 2;
  background: var(--surface);
}
.fund-mix {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--hairline);
}
.fund-mix-foot {
  padding: 8px 16px 12px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
}
.td-sector {
  white-space: normal;
  line-height: 1.3;
  min-width: 132px;
  max-width: 240px;
}
.td-sector .cell-secondary {
  white-space: normal;
}

/* Stacked wall chart */
.wall-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 300px;
  border-bottom: 1px solid var(--ink);
}
.wall-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.wall-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.wall-labels {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.wall-labels > div {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.conc-wrap {
  padding: 4px 0 14px;
}
.conc-row {
  display: grid;
  grid-template-columns: minmax(10rem, 18rem) 1fr 5.8rem;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.conc-name {
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.conc-name:hover { text-decoration: underline; }
.conc-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.conc-bar {
  height: 8px;
  min-width: 2px;
}
.conc-bar.cost { background: #43484F; }
.conc-bar.fv { background: #8E2A22; }
.conc-val {
  font-size: 11px;
  text-align: right;
  color: var(--ink-2, var(--muted));
}

/* Software book */
.swb-area {
  position: relative;
  height: 220px;
  border-left: 1px solid var(--hairline);
  border-bottom: 1px solid var(--ink);
  background: var(--surface-tint);
  margin: 8px 0 22px;
}
.swb-area svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.swb-y {
  position: absolute;
  left: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  transform: translateY(-50%);
}
.swb-x {
  position: absolute;
  bottom: -16px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  transform: translateX(-50%);
  white-space: nowrap;
}
.swb-group {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 240px;
  border-bottom: 1px solid var(--ink);
}
.swb-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.swb-pair {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
.swb-bar {
  flex: 1;
  min-width: 4px;
}
.swb-bar.sw { background: #2C4463; }
.swb-bar.rest { background: #C5C0B4; }
.swb-group-labs {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.swb-group-labs > div {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.swb-compare {
  display: grid;
  grid-template-columns: 1.2fr repeat(7, 1fr);
  gap: 0;
  border: 1px solid var(--hairline);
  margin: 0 0 16px;
}
.swb-compare div {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline-2);
  border-right: 1px solid var(--hairline-2);
  font-size: 12px;
}
.swb-compare .lab {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.swb-compare .mono { font-family: var(--font-mono); font-weight: 600; }
.swb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.swb-jump {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  position: static;
}
.swb-jump-btn {
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  cursor: pointer;
}
.swb-jump-btn:hover { background: var(--surface-alt); }
.swb-credits-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  padding: 6px 0 8px;
}
.stat-cell-link { cursor: pointer; }
.stat-cell-link:hover { background: var(--surface-alt); }

/* Side list items */
.side-row {
  padding: 9px 14px;
  border-bottom: 1px solid var(--hairline-3);
  display: flex;
  gap: 10px;
  align-items: baseline;
  cursor: pointer;
}
.side-row:hover { background: var(--surface-alt); }
.side-row .name {
  font-weight: 600;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-row .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-row {
  padding: 8px 14px;
  border-bottom: 1px solid var(--hairline-3);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.cal-tone {
  flex: none;
  width: 3px;
  height: 22px;
}

/* Sector pressure cells */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--hairline);
}
.sector-cell {
  background: var(--surface);
  padding: 9px 11px;
  min-width: 0;
}
.sector-cell .name {
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sector-cell .val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--oxblood);
}
.sector-cell .bar {
  height: 4px;
  background: var(--paper);
  margin-top: 6px;
}
.sector-cell .bar > div {
  height: 4px;
  background: var(--oxblood);
}
.sector-cell .meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 5px;
}

/* Alerts */
.alert-row {
  display: flex;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--hairline-2);
  cursor: pointer;
}
.alert-row:hover { background: var(--surface-alt); }
.alert-row.unread { background: var(--surface-tint); }
.alert-tone { flex: none; width: 3px; }
.alert-kind {
  flex: none;
  width: 96px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  padding-top: 2px;
}
.alert-title {
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.3;
  display: flex;
  gap: 7px;
  align-items: center;
}

.unread-dot {
  flex: none;
  width: 5px;
  height: 5px;
  background: var(--oxblood);
}
.alert-body {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.45;
}
.alert-rule {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 4px;
  letter-spacing: .04em;
}
.toggle {
  flex: none;
  width: 26px;
  height: 14px;
  background: #C9C5BA;
  cursor: pointer;
  position: relative;
}
.toggle.on { background: var(--oxblood); }
.toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: var(--surface);
}
.toggle.on .knob { left: 14px; }

/* Studio */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
}
.stepper button {
  font-family: var(--font-mono);
  font-size: 11px;
  width: 22px;
  height: 22px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid #C9C5BA;
  cursor: pointer;
}
.stepper .pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  width: 46px;
  text-align: center;
}
.seg-bar {
  display: flex;
  height: 9px;
  background: var(--surface-alt);
  width: 100%;
}
.seg-bar > div { height: 9px; }

/* Coverage */
.gate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline-2);
}
.gate-swatch {
  flex: none;
  width: 9px;
  height: 9px;
}

/* Scroll body for full-page content */
.page-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
}
.page-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* Critical: without this, long entity pages (issuer detail, multi-table
     fund views) are clipped by #main { overflow:hidden } and appear to
     "only show the top section". Nested .page-scroll still works when used. */
  overflow-y: auto;
}
/* Table-primary pages: head + stats sticky-ish, table fills remaining height */
.page-fill.table-page {
  overflow: hidden;
}
.page-fill.table-page > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.page-fill.mvs-page {
  overflow: hidden;
}
.stat-strip-compact .stat-cell { padding: 6px 12px; }
.stat-strip-compact .stat-value { font-size: 16px; margin-top: 2px; }
.stat-strip-compact .stat-sub { font-size: 10.5px; }

/* ── Desk (#/desk): document scroll, full-width queue ─────────────────────
   Nested flex:1 panes crushed the watchlist into a ~1-row strip. Desk uses
   one page-scroll; table grows with rows; secondary cards sit below. */
.desk-page {
  overflow: hidden; /* only .desk-scroll scrolls */
}
.desk-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  padding-bottom: 32px;
}
.desk-digest {
  margin: 0 16px 10px;
  border: 1px solid var(--hairline);
  background: var(--paper);
}
.desk-digest-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}
.desk-digest-head:hover { background: var(--surface-alt); }
.desk-digest-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  flex: none;
  font-weight: 600;
}
.desk-digest-summary {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink);
}
.desk-digest-toggle {
  flex: none;
  font-size: 10px;
  color: var(--oxblood);
  letter-spacing: 0.04em;
}
.desk-digest-body {
  padding: 0 14px 12px;
  border-top: 1px solid var(--hairline);
}
.desk-digest-bullets {
  margin: 10px 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.5;
}
.desk-digest-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  margin: 10px 0 6px;
}
.desk-digest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.desk-queue {
  margin: 8px 0 0;
  border-top: 1px solid var(--hairline);
}
.desk-queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 10px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--hairline);
}
.desk-queue-titles {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
/* Table is content-height — no nested max-height / flex crush */
.desk-queue .desk-queue-table,
.desk-queue .table-wrap {
  max-height: none !important;
  overflow: visible !important;
  flex: none !important;
  min-height: 280px;
}
.desk-queue .table-wrap.sticky-col {
  overflow-x: auto !important;
  overflow-y: visible !important;
}
.desk-legend {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--hairline);
}
.desk-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hairline);
  border-top: 1px solid var(--hairline);
  margin-top: 8px;
}
.desk-card {
  background: var(--surface-alt);
  min-width: 0;
  padding-bottom: 8px;
}
.desk-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px 6px;
  flex-wrap: wrap;
}
.desk-card-link {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--oxblood);
}
.desk-card-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  padding: 0 14px 8px;
}
.desk-card-foot {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  border-top: 1px solid var(--hairline);
}
.desk-sectors {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  padding: 14px 16px 20px;
}
.desk-sectors-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
@media (max-width: 960px) {
  .desk-secondary {
    grid-template-columns: 1fr;
  }
}

/* ── Fund packs index + detail ─────────────────────────────────────────── */
.fund-packs-page {
  overflow: hidden;
}
.fund-packs-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  padding-bottom: 40px;
}
.fund-packs-table,
.fund-packs-table.table-wrap {
  max-height: none !important;
  overflow: visible !important;
  flex: none !important;
  min-height: 240px;
}
.fund-packs-table.sticky-col {
  overflow-x: auto !important;
  overflow-y: visible !important;
}
.fp-detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
  margin: 12px 16px;
}
.fp-detail-card {
  border: 1px solid var(--hairline);
  background: var(--surface);
  min-width: 0;
}
.fp-detail-card .table-wrap {
  max-height: none !important;
  overflow: visible !important;
}
.fp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px;
  padding-top: 4px;
}
.fp-actions-hint {
  font-size: 11px;
  color: var(--muted-2);
  margin-left: 4px;
}
.fp-actions .btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.fund-pack-panel .stat-strip {
  margin: 0;
}
@media (max-width: 960px) {
  .fp-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Allocator studio — mix rail · look-through pane */
.studio-page {
  overflow: hidden; /* columns own scroll */
  min-height: 0;
}
.studio-hero {
  flex: none;
  padding: 12px 14px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.studio-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.studio-hero-id { flex: 1; min-width: 0; }
.studio-hero-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 3px;
}
.studio-hero-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.studio-hero-status {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.studio-hero-check {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex: none;
  padding-top: 12px;
}
.studio-hero-check-lab {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.studio-hero-check-input {
  width: 64px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.studio-hero-check-unit { font-size: 12px; color: var(--muted); }
.studio-hero-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 8px;
}
.studio-hero-commit {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.studio-hero-commit b { color: var(--ink); font-weight: 600; }
.studio-hero .studio-comp { margin-top: 10px; }
.studio-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.studio-kpi {
  padding: 12px 16px 13px;
  background: var(--paper);
}
.studio-kpi:first-child { padding-left: 28px; }
.studio-kpi:last-child { padding-right: 28px; }
.studio-kpi.tone-warn .studio-kpi-val { color: var(--amber, #C2802A); }
.studio-kpi.tone-risk .studio-kpi-val { color: var(--oxblood, #8E2A22); }
.studio-kpi-lab {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.studio-kpi-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-top: 2px;
}
.studio-kpi-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.studio-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.studio-tools-more { display: flex; gap: 5px; }
.studio-tools-more .btn { height: 26px; padding: 0 8px; font-size: 11px; }
.studio-vs-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.studio-vs-cell {
  padding: 8px 12px;
  background: var(--surface-alt);
}
.studio-vs-cell-l {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.studio-vs-cell-v { font-size: 14px; font-weight: 700; }
.studio-vs-tog {
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.studio-vs-tog:hover { color: var(--ink); }
@media (max-width: 860px) {
  .studio-kpis, .studio-vs-strip { grid-template-columns: 1fr 1fr; }
}
.shape-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 12px 16px 4px;
}
.shape-dist-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .shape-dist-pair { grid-template-columns: 1fr; }
}
.shape-chart {
  padding: 10px 12px 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.shape-chart-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}
.shape-chart-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 8px;
}
.shape-hbar {
  display: grid;
  grid-template-columns: minmax(7em, 28%) 1fr 4.2em;
  gap: 8px;
  align-items: center;
  margin: 3px 0;
}
.shape-hbar-lab {
  font-size: 11.5px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shape-hbar-lab a { color: inherit; text-decoration: none; }
.shape-hbar-lab a:hover { color: var(--oxblood, #8E2A22); }
.shape-hbar-track {
  height: 10px;
  background: var(--surface-alt, #EFEDE8);
}
.shape-hbar-fill { height: 100%; }
.shape-hbar-val {
  font-size: 11px;
  text-align: right;
}
.shape-stack-leg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 4px 0 8px;
  font-size: 11px;
  color: var(--muted);
}
.shape-stack-item { display: inline-flex; align-items: center; gap: 5px; }
.shape-stack-row {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}
.shape-stack-lab { font-size: 12px; font-weight: 600; }
.shape-stack-track {
  display: flex;
  height: 22px;
  background: var(--surface-alt, #EFEDE8);
  overflow: hidden;
}
.shape-stack-seg {
  height: 100%;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shape-qtr {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 124px;
  margin-top: 8px;
}
.shape-qtr-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.shape-qtr-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.shape-qtr-bar {
  width: 70%;
  max-width: 16px;
  min-width: 6px;
  background: #43484F;
}
.shape-qtr-bar.down { background: #8E2A22; }
.shape-qtr-lab {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.studio-cands {
  flex: none;
  padding: 8px 12px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.studio-cands-lab,
.studio-vs-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.studio-cands-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.studio-cands-name {
  width: 200px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  font-size: 12px;
  color: var(--ink);
}
.studio-cands-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.studio-cand {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
}
.studio-cand.on { border-color: var(--ink); }
.studio-cand.vs { border-color: var(--oxblood, #8E2A22); }
.studio-cand-load,
.studio-cand-vs,
.studio-cand-x {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  padding: 4px 8px;
}
.studio-cand-vs,
.studio-cand-x {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--hairline);
}
.studio-cand-x:hover { color: var(--oxblood, #8E2A22); }
.studio-vs {
  flex: none;
  padding: 8px 16px 10px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--hairline);
}
.studio-vs-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.studio-vs-targets { display: flex; flex-wrap: wrap; gap: 5px; }
.studio-vs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.studio-vs-table th,
.studio-vs-table td {
  text-align: left;
  padding: 5px 8px;
  border-top: 1px solid var(--hairline);
  vertical-align: top;
}
.studio-vs-table thead th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 0;
}
.studio-vs-table tbody th {
  font-weight: 600;
  width: 8.5em;
  color: var(--ink);
}
.studio-vs-read {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.studio-ticket {
  flex: none;
  padding: 8px 12px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.studio-ticket-top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 28px;
}
.studio-ticket-modes {
  flex: none;
  display: flex;
  gap: 0;
  border: 1px solid var(--hairline);
}
.studio-ticket-mode {
  height: 28px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.studio-ticket-mode.on {
  color: var(--paper);
  background: var(--oxblood, #8E2A22);
}
.studio-ticket-mode:hover { color: var(--ink); }
.studio-ticket-mode.on:hover { color: var(--paper); }
.studio-ticket-status {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-ticket-body {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: flex-end;
  margin-top: 8px;
}
.studio-ticket-group {
  min-width: 0;
}
.studio-ticket-lab {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 4px;
}
.studio-ticket-chips { gap: 5px; }
.studio-ticket-actrow {
  display: flex;
  align-items: center;
  gap: 6px;
}
.studio-ticket-n {
  width: 36px;
  height: 26px;
  padding: 0 4px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
}
.studio-ticket-actrow .btn { height: 26px; padding: 0 8px; font-size: 11px; }
.studio-ticket-note {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.studio-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  background: var(--hairline);
  gap: 1px;
}
.studio-rail {
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.studio-rail-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}
.studio-rail-top {
  padding: 10px 14px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.studio-rail-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.studio-rail-meta {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .02em;
}
.studio-rail-meta b {
  color: var(--ink);
  font-weight: 600;
}
.studio-rail-meta .dot {
  margin: 0 6px;
  color: var(--muted-3);
}
.studio-comp {
  display: flex;
  height: 10px;
  margin-top: 12px;
  background: var(--hairline-3);
}
.studio-comp.empty {
  height: 28px;
  align-items: center;
  justify-content: center;
  background: var(--surface-tint);
}
.studio-comp.empty span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.studio-comp-seg {
  height: 100%;
  min-width: 2px;
}
.studio-section-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 14px 6px;
}
.studio-section-label span {
  color: var(--muted-3);
  letter-spacing: .04em;
  text-transform: none;
  margin-left: 6px;
}
.studio-active {
  flex: none;
  min-height: 0;
  overflow: visible;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.studio-hint {
  padding: 8px 14px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.studio-hint b { color: var(--ink); font-weight: 600; }
.studio-weight-list {
  padding: 0 0 8px;
}
.studio-weight-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline-2);
}
.studio-swatch {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  background: var(--hairline);
}
.studio-weight-info {
  flex: 1;
  min-width: 0;
}
.studio-weight-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.studio-weight-tick {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
}
.studio-weight-tick:hover { color: var(--oxblood, #8E2A22); }
.studio-held-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--muted-2);
}
.studio-weight-row.is-held .studio-held-tag { color: var(--ink-2); }
.studio-weight-row.is-next .studio-held-tag { color: var(--oxblood, #8E2A22); }
.studio-held-m { width: 52px; }
.sleeve-fund-m {
  width: 72px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.studio-weight-legal,
.studio-lib-legal {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.25;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-weight-sub {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
  letter-spacing: .02em;
}
.studio-weight-dol {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.studio-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--hairline);
}
.studio-mode {
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.studio-mode.on {
  color: var(--ink);
  border-bottom-color: var(--oxblood, #8E2A22);
}
.studio-mode:hover { color: var(--ink); }
.studio-goals {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--hairline-2);
}
.studio-goals-lab {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.studio-goals-row { gap: 5px; }
.studio-goals-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.studio-caps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin-top: 6px;
}
.studio-cap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.studio-cap-input {
  width: 42px;
  height: 22px;
  padding: 0 4px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
}
.studio-cap-input:focus {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
}
.studio-cap-unit {
  font-size: 9px;
  letter-spacing: .06em;
}
.studio-mandate-act {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.studio-mandate-act .btn { height: 26px; padding: 0 8px; font-size: 11px; }
.studio-weight-ctl {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
}
.studio-weight-ctl .btn {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}
.studio-weight-input {
  width: 44px;
  height: 24px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
}
.studio-weight-input:focus {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
  background: var(--surface);
}
.studio-lib {
  flex: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-alt);
}
.studio-lib.is-open {
  flex: 1 1 auto;
  min-height: 280px;
}
.studio-lib-head {
  flex: none;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--hairline-2);
}
.studio-search-kicker {
  padding: 10px 12px 2px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.studio-advanced {
  flex: none;
  border-top: 1px solid var(--hairline);
  padding: 4px 0 10px;
  background: var(--surface);
  box-shadow: 0 -8px 18px rgba(20, 19, 18, 0.06);
}
.studio-advanced-sum {
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.studio-advanced-sum::-webkit-details-marker { display: none; }
.studio-advanced-body { padding: 0 0 8px; }
.studio-lib-head .studio-section-label {
  padding-left: 0;
  padding-right: 0;
}
.studio-search {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}
.studio-search:focus {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
}
.studio-lib-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.studio-lib.is-open .studio-lib-body {
  min-height: 240px;
  max-height: min(420px, 48vh);
  background: var(--surface);
}
.studio-lib-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--hairline-2);
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--ink-2);
}
.studio-lib-row:hover { background: var(--surface); color: var(--ink); }
.studio-lib-row.on { background: var(--surface); color: var(--ink); }
.studio-lib-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.studio-lib-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-lib-sub {
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: .03em;
}
.studio-lib-w {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted-2);
  min-width: 3.6em;
  padding-left: 8px;
  text-align: right;
  white-space: nowrap;
}
.studio-lib-row.on .studio-lib-w { color: var(--oxblood); }
.studio-lib-row:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
  background: var(--surface);
}

/* Right results pane */
.studio-pane {
  background: var(--paper);
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.studio-vs-none {
  margin: 0;
  padding: 8px 16px 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  border-bottom: 1px solid var(--hairline);
}
.studio-pane-stick {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}
.studio-pane-stick .stat-strip {
  border-bottom: 0;
}
.studio-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  padding: 8px 24px 10px;
  background: var(--paper);
}
.studio-jump-a {
  height: 24px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  cursor: pointer;
}
.studio-jump-a:hover { color: var(--ink); }
.studio-pane-empty {
  margin: auto;
  max-width: 420px;
  padding: 48px 24px;
  text-align: left;
}
.studio-pane-empty-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.studio-pane-empty-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.studio-pane-empty-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 18px;
}
.studio-pane-empty-actions { display: flex; gap: 8px; }

/* Dense secondary metrics — replaces the second full stat strip */
.studio-chips {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.studio-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px 6px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  min-width: 64px;
}
.studio-chip-k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.studio-chip-v {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .02em;
}
.studio-chip.tone-warn .studio-chip-v { color: #8B6914; }
.studio-chip.tone-risk .studio-chip-v { color: #8E2A22; }

/* Collapsible panels — quality / wall / shared / pairs / method */
.studio-sec {
  flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 118px;
}
.studio-sec > summary.studio-sec-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 28px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--surface-alt);
}
.studio-sec > summary.studio-sec-sum::-webkit-details-marker { display: none; }
.studio-sec > summary.studio-sec-sum::before {
  content: "▸";
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  width: 10px;
  flex: none;
}
.studio-sec[open] > summary.studio-sec-sum::before { content: "▾"; }
.studio-sec > summary.studio-sec-sum:hover { background: var(--surface-tint); }
.studio-sec-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}
.studio-sec-meta {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: .04em;
}
.studio-sec-body {
  border-top: 1px solid var(--hairline-2);
  padding: 20px 28px 28px;
}
.studio-book {
  max-width: 760px;
  margin: 0 auto;
}

.studio-quality {
  flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.studio-qgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
}
.studio-qcell {
  background: var(--surface);
  padding: 10px 12px 12px;
  min-height: 72px;
}
.studio-qcell-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 4px;
}
.studio-qcell-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.1;
}
.studio-qcell-note {
  margin-top: 5px;
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: .03em;
  line-height: 1.35;
}

/* Maturity wall inside collapsed section */
.studio-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 14px;
  align-items: flex-end;
}
.studio-wall-col {
  flex: 1 1 48px;
  min-width: 48px;
  max-width: 72px;
  text-align: center;
}
.studio-wall-bar-wrap {
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.studio-wall-bar {
  width: 26px;
  background: #43484F;
  border-radius: 2px 2px 0 0;
  min-height: 4px;
}
.studio-wall-yr {
  font-size: 9.5px;
  margin-top: 4px;
  color: var(--ink-2);
}
.studio-wall-v {
  font-size: 9px;
  color: var(--muted-2);
}

.studio-exposure-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.studio-legend {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 16px;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--hairline-2);
}
.studio-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
}
.studio-exposure-body .table-wrap {
  max-height: min(52vh, 480px);
  overflow: auto;
}

.studio-pairs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 14px;
}
.studio-pair {
  flex: 1 1 160px;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
}
.studio-pair-names {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.studio-pair-amt {
  font-size: 13px;
  font-weight: 600;
  color: var(--oxblood);
}
.studio-pair-n {
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: .04em;
  margin-top: 2px;
}

.studio-method {
  padding: 12px 16px 16px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 720px;
}
.studio-method p { margin: 0 0 8px; }
.studio-method p:last-child { margin-bottom: 0; }
.studio-method b { color: var(--ink-2); font-weight: 600; }

.studio-memo-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 16, 14, .45);
  display: flex;
  justify-content: center;
  overflow: auto;
  padding: 32px 16px;
}
.studio-memo {
  width: min(720px, 100%);
  margin: auto;
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 28px 32px 24px;
  color: var(--ink);
}
.studio-memo-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted-2);
  margin: 16px 0 6px;
}
.studio-memo-kicker:first-child { margin-top: 0; }
.studio-memo-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.studio-memo-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.45;
}
.studio-memo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.studio-memo-table th {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-align: left;
  color: var(--muted-2);
  border-bottom: 1px solid var(--hairline);
  padding: 6px 8px 6px 0;
}
.studio-memo-table td {
  border-bottom: 1px solid var(--hairline-2);
  padding: 8px 8px 8px 0;
  vertical-align: top;
}
.studio-memo-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.studio-memo-slot, .studio-memo-vs p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 8px;
  color: var(--ink-2);
}
.studio-memo-acts {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
@media print {
  nav, header, .studio-ticket, .studio-cands, .studio-tools, .studio-rail, .studio-pane-stick,
  .studio-memo-acts, .studio-help-scrim, .page-head .page-actions { display: none !important; }
  .studio-memo-scrim {
    position: static;
    background: transparent;
    padding: 0;
  }
  .studio-memo { border: 0; width: 100%; }
}

.studio-help-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 16, 14, .45);
  display: flex;
  justify-content: center;
  overflow: auto;
  padding: 32px 16px;
}
.studio-help {
  width: min(440px, 100%);
  margin: auto;
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 24px 26px 20px;
  color: var(--ink);
}
.studio-help-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted-2);
  margin: 0 0 6px;
}
.studio-help-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.studio-help-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: help-step;
}
.studio-help-steps li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  padding-left: 28px;
  position: relative;
}
.studio-help-steps li::before {
  content: counter(help-step, decimal-leading-zero);
  counter-increment: help-step;
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted-2);
}
.studio-help-steps b { color: var(--ink); font-weight: 600; }
.studio-help-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .studio-qgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .studio-page { overflow-y: auto; }
  .studio-shell {
    flex: none;
    min-height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: max-content minmax(360px, auto);
  }
  .studio-rail {
    overflow: visible;
    min-height: 0;
  }
  .studio-rail-scroll {
    overflow: visible;
    flex: none;
  }
  .studio-advanced { box-shadow: none; }
  .studio-pane { overflow: visible; }
  .studio-qgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-lib.is-open .studio-lib-body {
    min-height: 200px;
    max-height: min(360px, 42vh);
  }
}

/* Legacy card surface (scenarios.js engines; pre-redesign pages) */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  margin-bottom: 14px;
}
.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-alt);
}
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.card-note {
  font-size: 11.5px;
  color: var(--muted);
  padding: 8px 16px 0;
  line-height: 1.45;
}
.card .disclaimer {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: .04em;
  padding: 6px 16px 10px;
  border-bottom: 1px solid var(--hairline-2);
}
.card .kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--hairline);
  margin: 0;
}
.scenario-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline-2);
}
.scenario-bar button {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.scenario-bar button.active,
.scenario-bar button:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.scenario-bar input[type="number"] {
  width: 96px;
  height: 28px;
  border: 1px solid var(--hairline);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Command palette */
#palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 22, 27, .42);
  z-index: 100;
  display: none;
}
#palette-overlay.open { display: block; }
#palette {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--ink);
  z-index: 101;
  display: none;
  box-shadow: 0 24px 60px rgba(18, 22, 27, .28);
}
#palette.open { display: block; }
.palette-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}
.palette-input-row .prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--oxblood);
}
.palette-input-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
}
.palette-hit {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--hairline-2);
}
.palette-hit:hover,
.palette-hit.sel {
  background: var(--surface-alt);
  border-left-color: var(--oxblood);
}
.palette-kind {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--muted-2);
  width: 64px;
  flex: none;
}
.palette-label {
  flex: 1 1 auto;
  font-size: 12.5px;
  font-weight: 600;
  min-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--oxblood);
  border: 1px solid color-mix(in srgb, var(--oxblood) 35%, var(--hairline));
  vertical-align: 1px;
}
.palette-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  flex: 0 1 38%;
  max-width: 38%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.palette-empty {
  padding: 14px;
  font-size: 12px;
  color: var(--muted);
}
.palette-foot {
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: .06em;
  border-top: 1px solid var(--hairline);
}

/* Utility */
.mono { font-family: var(--font-mono); }
.trunc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flex-1 { flex: 1; min-width: 0; }
.mt-auto { margin-left: auto; }
.pad-block { padding: 14px 16px; }
.risk-tone { color: var(--oxblood); }
.warn-tone { color: var(--amber); }
.good-tone { color: var(--green); }

/* Print: hide chrome */
@media print {
  #cmdbar, #rail, #palette-overlay, #palette, .page-actions, .no-print { display: none !important; }
  #layout { display: block; }
  #main { overflow: visible; }
  body { overflow: visible; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Credit-analyst UX layer (2026-08-05)
   ═══════════════════════════════════════════════════════════════════════════ */

.unit-cents {
  font-size: 9px;
  color: var(--muted-2);
  margin-left: 1px;
  font-weight: 500;
}

.mark-scale-legend {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: .04em;
  flex-wrap: wrap;
}
.mark-scale-legend .ms-lab {
  font-weight: 600;
  color: var(--ink-2);
  margin-right: 4px;
}
.mark-scale-legend .ms-bar {
  display: inline-block;
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, #8E2A22, #C2802A, #7C8794, #43484F);
  vertical-align: middle;
}

.period-strip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.period-strip-lab {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--muted-2);
  font-weight: 600;
}
.period-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  color: var(--ink-2);
  letter-spacing: .03em;
}
.period-chip.frontier {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.period-chip.lag {
  border-color: #C2802A;
  color: #8A6210;
  background: #FBF6EC;
}
.period-strip-note {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}
.period-cell {
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid transparent;
}
.period-cell.frontier { color: var(--ink); font-weight: 600; }
.period-cell.lag {
  color: #8A6210;
  background: #FBF6EC;
  border-color: #E8D9B0;
}

.entity-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Issuer workspace — mark + holders first */
.iss-page .entity-head { padding: 12px 28px 10px; }
.iss-page .entity-title { font-size: 22px; }
.iss-kpis { border-bottom: 1px solid var(--hairline); }
.iss-sec {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.iss-sec-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 28px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--surface-alt);
}
.iss-sec-sum::-webkit-details-marker { display: none; }
.iss-sec-sum::before {
  content: "▸";
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  width: 10px;
  flex: none;
}
.iss-sec[open] > .iss-sec-sum::before { content: "▾"; }
.iss-sec-sum:hover { background: var(--surface-tint); }
.iss-sec-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}
.iss-sec-meta {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: .04em;
}
.iss-sec-body { padding: 12px 28px 20px; }
.iss-page .compare-strip { padding: 12px 28px; }
.iss-page .call-card { border: 0; padding: 0; background: transparent; }
.iss-page .hist-wrap { margin: 0; }
.iss-slice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.iss-slice-lab {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
}
.iss-slice-bar .mix-chips { margin-top: 0; }
.iss-empty {
  padding: 22px 4px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 36em;
}
.iss-sec-body .table-wrap { margin: 0; }
.iss-sec-body .instr-group { border: 1px solid var(--hairline); margin-bottom: 8px; }

.ux-filter-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.ux-search {
  flex: 1;
  min-width: 200px;
  max-width: 480px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-tint);
}
.ux-search:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--surface);
}
.ux-chips { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.ux-filter-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: .06em;
}
.ux-num-lab {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: .06em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ux-num {
  width: 52px;
  height: 24px;
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 0 4px;
  text-align: right;
}
.ux-thresh-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip .chip-n { opacity: .7; margin-left: 3px; }

/* Sticky first column on data tables */
.table-wrap.sticky-col { position: relative; }
.table-wrap.sticky-col table.data thead th:first-child,
.table-wrap.sticky-col table.data tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--hairline);
}
.table-wrap.sticky-col table.data thead th:first-child {
  z-index: 3;
  background: var(--surface-alt);
}
.table-wrap.sticky-col table.data tbody tr:hover td:first-child {
  background: var(--surface-alt);
}

.compare-strip {
  flex: none;
  padding: 12px 18px;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--hairline);
}
.compare-lab {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--muted-2);
  margin-bottom: 8px;
  font-weight: 600;
}
.compare-grid {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.compare-cell {
  background: var(--surface);
  padding: 10px 12px;
}
.compare-cell .cc-name {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.compare-cell .cc-mark {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.compare-cell .cc-meta {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 3px;
}

.sector-cell-click { cursor: pointer; }
.sector-cell-click:hover { background: #F3EDEA; }

.est-banner {
  flex: none;
  padding: 7px 18px;
  background: #FBF6EC;
  border-bottom: 1px solid #E8D9B0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: #8A6210;
}

/* Nowcast: table is the product. Scatter sits in a side rail so the
   list is not crushed to a single clipped row (2026-08-14). */
.page-fill.nowcast-page {
  overflow: hidden;
  container-type: inline-size;
  container-name: nowcast;
}
.page-fill.nowcast-page > .method-foot,
.page-fill.nowcast-page > .est-banner,
.page-fill.nowcast-page > .stat-strip,
.page-fill.nowcast-page > .page-head {
  flex: none;
}
.nowcast-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.nowcast-scatter-wrap {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  overflow: hidden;
}
.nowcast-table-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.nowcast-table-col > .ux-filter-bar { flex: none; }
.nowcast-table-col > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.nowcast-scatter {
  position: relative;
  flex: 1 1 auto;
  min-height: 160px;
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  overflow: hidden; /* out-of-range dots must not leak into the filter bar */
}
/* Viewport *or* the content column (sidebar-aware). Stack so the
   table is never a 0-width / 0-height grid leftover. */
@media (max-width: 900px) {
  .page-fill.nowcast-page { overflow-y: auto; }
  .nowcast-body {
    display: block;
    flex: none;
    min-height: 0;
  }
  .nowcast-scatter-wrap {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    padding: 8px 12px;
    height: 168px;
  }
  .nowcast-scatter {
    flex: none;
    height: 140px;
    min-height: 140px;
  }
  .nowcast-table-col { min-height: 0; }
  .nowcast-table-col > .table-wrap {
    flex: none;
    overflow: visible;
    min-height: 0;
  }
}
@container nowcast (max-width: 720px) {
  .nowcast-body {
    display: block;
    flex: none;
    min-height: 0;
  }
  .nowcast-scatter-wrap {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    height: 168px;
  }
  .nowcast-scatter {
    flex: none;
    height: 140px;
    min-height: 140px;
  }
  .nowcast-table-col > .table-wrap {
    flex: none;
    overflow: visible;
  }
}
.nowcast-scatter .scatter-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.scatter-dot {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  opacity: .85;
  border: 1px solid rgba(0,0,0,.15);
  z-index: 1;
}
.scatter-dot:hover { opacity: 1; outline: 2px solid var(--ink); z-index: 2; }
.scatter-axis-x {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: .06em;
  z-index: 1;
  background: rgba(245, 244, 240, .85);
  padding: 1px 4px;
}
.scatter-axis-y {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: .06em;
  z-index: 1;
  background: rgba(245, 244, 240, .85);
  padding: 1px 4px;
}
/* Corner tick labels for the shared ¢ scale (x and y share lo–hi) */
.scatter-tick {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--muted-3);
  letter-spacing: .04em;
  pointer-events: none;
  z-index: 1;
}
.scatter-tick-lo { bottom: 6px; left: 8px; }
.scatter-tick-mid { bottom: 6px; left: 50%; transform: translateX(-50%); }
.scatter-tick-hi { top: 8px; right: 10px; }

/* Secondary rail tools (fund packs, client tape) */
.nav-group-secondary {
  opacity: 0.85;
  margin-top: 4px;
}
.nav-item-secondary .nav-label {
  color: var(--muted);
  font-size: 11px;
}
.nav-item-secondary .nav-code {
  color: var(--muted-2);
}

/* Scenarios shard-load progress */
.scen-load {
  max-width: 420px;
  margin: 48px auto;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--hairline);
}
.scen-load-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.scen-load-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.4;
}
.scen-load-bar {
  height: 6px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}
.scen-load-fill {
  height: 100%;
  background: var(--oxblood, #8E2A22);
  transition: width .15s ease-out;
  min-width: 2%;
}
.scen-load-meta {
  font-size: 11px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.scen-load-hint {
  font-size: 11px;
  color: var(--muted-2);
}

/* Screener filing-period mix banner */
.period-mix-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 16px;
  background: #FBF8F0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-2);
}
.period-mix-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  color: #8B6914;
  font-weight: 600;
}
.period-mix-body { flex: 1; min-width: 200px; line-height: 1.4; }
.period-mix-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.period-mix-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--muted);
}
.period-mix-chip.front {
  border-color: #1F6B4B;
  color: #1F6B4B;
  font-weight: 600;
}
.period-mix-chip.deep {
  border-color: #8E2A22;
  color: #8E2A22;
}
.period-mix-chip b { margin-right: 4px; }

/* Issuer early-read estimate drawer */
.estimate-drawer {
  background: var(--surface)BF5;
  border-bottom: 1px solid #E8D9B8;
}
.estimate-drawer-sum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.estimate-drawer-sum::-webkit-details-marker { display: none; }
.estimate-drawer-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.estimate-drawer-meta {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted);
}
details.estimate-drawer:not([open]) .estimate-drawer-body { display: none !important; }
.estimate-drawer-body {
  padding: 0 16px 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid #E8D9B8;
}
.estimate-drawer-body p { margin: 10px 0; max-width: 720px; }
.estimate-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.estimate-kpis > div {
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
}
.estimate-kpis .ek-l {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 4px;
}
.estimate-kpis .ek-v {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.estimate-foot {
  font-size: 11.5px;
  color: var(--muted-2);
}
@media (max-width: 720px) {
  .estimate-kpis { grid-template-columns: 1fr 1fr; }
}

/* Credit-analyst workflow strip (desk landing) */
.analyst-path {
  flex: none;
  padding: 12px 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.analyst-path-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.analyst-path-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.analyst-step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  text-decoration: none;
  color: var(--ink);
  min-height: 56px;
}
.analyst-step:hover {
  background: var(--surface-tint);
  border-color: var(--ink-2);
}
.analyst-step b {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  font-weight: 600;
}
.analyst-step span {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.35;
}
.analyst-path-legend {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.analyst-path-legend .tag { margin-right: 2px; vertical-align: middle; }
.rail-foot-frontier,
.rail-foot-lag {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: .04em;
}
.product-notes {
  padding: 12px 16px 14px;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.product-notes summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--ink-2);
  list-style: none;
}
.product-notes summary::-webkit-details-marker { display: none; }
.product-notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.product-notes li { margin-bottom: 4px; }

@media (max-width: 1100px) {
  .analyst-path-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .analyst-path-steps { grid-template-columns: 1fr 1fr; }
}

.risk-strip {
  flex: none;
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  overflow-x: auto;
}
.risk-strip-title {
  flex: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--muted-2);
  padding: 10px 6px;
  background: var(--surface-alt);
  border-right: 1px solid var(--hairline);
  font-weight: 600;
}
.risk-cell {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border-right: 1px solid var(--hairline-2);
}
.risk-cell .lab {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--muted-2);
}
.risk-cell .val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  margin-top: 3px;
  color: var(--ink);
}
.risk-cell .sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}

.ux-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  padding: 10px 16px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.ux-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.page-fill.table-page > .ux-filter-bar,
.page-fill.table-page > .mark-scale-legend {
  flex: none;
}
.page-fill.table-page > .table-wrap.sticky-col {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Instrument badge + dual-period fund portfolio */
.instr-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 0 4px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  color: var(--ink);
  vertical-align: middle;
  margin-right: 4px;
  line-height: 1.5;
}
.cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-stack .cell-secondary { font-size: 10px; }
.filer-policy-chips { flex-wrap: wrap; }
.filer-spark-host { padding: 10px 14px 4px; border-bottom: 1px solid var(--hairline); background: var(--surface-tint); }
.mark-spark-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.spark-row { display: flex; align-items: flex-end; gap: 10px; height: 64px; }
.spark-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; flex: 1; min-width: 36px; height: 100%; }
.spark-bar { width: 100%; max-width: 36px; border-radius: 2px 2px 0 0; min-height: 4px; }
.spark-lab { font-family: var(--font-mono); font-size: 8.5px; color: var(--muted-2); letter-spacing: .02em; white-space: nowrap; }
.c-muted { color: var(--muted) !important; }
.c-up { color: #1F6B4B !important; }

/* Listed BDC terminal — KPI strip, chart + movers, quotes, 8-Ks */
.desk-wave { border-bottom: 1px solid var(--hairline); }
.desk-wave .stat-strip { border-bottom: 0; }
.desk-wave .stat-cell { padding: 8px 14px; }
.desk-wave .stat-value { font-size: 17px; margin-top: 2px; }
.desk-wave .stat-sub { font-size: 10.5px; }
.desk-term { background: #FBFAF7; }
.desk-term-top {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  border-bottom: 1px solid var(--hairline);
  min-height: 0;
}
.desk-term-side {
  border-left: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}
.listed-board { min-width: 0; background: var(--paper); }
.listed-board-chart { padding: 12px 16px 14px; }
.listed-board-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.listed-board-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.listed-board-k-meta { letter-spacing: .04em; text-transform: none; font-weight: 500; }
.listed-board-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  letter-spacing: .04em;
  text-transform: none;
  font-weight: 500;
  color: var(--muted);
}
.listed-board-leg i {
  display: inline-block;
  width: 14px;
  height: 2px;
  vertical-align: middle;
}
.listed-board-leg .leg-eq { background: #8E2A22; }
.listed-board-leg .leg-cap {
  background: #43484F;
  background-image: linear-gradient(90deg, #43484F 0 7px, transparent 7px 10px);
  background-size: 10px 2px;
}
.listed-board-range { display: flex; gap: 4px; flex: none; }
.listed-board-range-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  padding: 3px 9px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.listed-board-range-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.listed-board-svg { width: 100%; height: 196px; display: block; color: var(--ink); }
.listed-board-chart-foot {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--muted);
  margin-top: 6px;
}
.desk-movers { padding: 12px 16px 14px; flex: 1; }
.desk-movers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin-top: 8px; }
.desk-movers-h {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 2px;
}
.desk-movers-split {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 8px 0 2px;
}
.desk-movers-split.up { color: #1F6B4B; }
.desk-movers-split.down { color: var(--oxblood); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hairline); }
.desk-mover {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  text-decoration: none;
  color: inherit;
}
.desk-mover:hover .desk-mover-t { text-decoration: underline; }
.desk-mover-t { font-weight: 600; }
.desk-eightk {
  border-top: 1px solid var(--hairline);
  background: var(--paper);
  padding: 12px 16px 16px;
}
.desk-eightk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 6px;
  border-top: 1px solid var(--hairline);
}
.desk-eightk-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px 10px 12px;
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  border-left: 3px solid transparent;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.desk-eightk-row:nth-child(2n) { border-right: 0; }
.desk-eightk-row.material { border-left-color: var(--oxblood); }
.desk-eightk-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.desk-eightk-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  flex: none;
}
.desk-eightk-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desk-eightk-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--oxblood);
  margin-left: auto;
  flex: none;
}
.desk-eightk-blurb {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2, #3d3a34);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}
.desk-eightk-row.material .desk-eightk-name { color: var(--oxblood); }
.listed-quotes { border-top: 1px solid var(--hairline); background: var(--surface); }
.desk-table-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 3;
}
.desk-find {
  margin-left: auto;
  width: 240px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
}
.desk-find:focus { outline: 1px solid var(--ink); outline-offset: -1px; background: var(--paper); }
.listed-board-table { max-height: min(48vh, 560px); }
.listed-quotes .table.data td { padding-top: 7px; padding-bottom: 7px; }
.listed-quotes .cell-secondary { font-size: 10.5px; letter-spacing: .02em; }
.desk-term-foot { padding: 10px 16px; font-weight: 500; }
@media (max-width: 980px) {
  .desk-term-top { grid-template-columns: 1fr; }
  .desk-term-side { border-left: 0; border-top: 1px solid var(--hairline); }
  .desk-eightk-grid { grid-template-columns: 1fr; }
  .desk-eightk-row { border-right: 0; }
  .listed-quotes .listed-board-k-meta { display: none; }
  .desk-table-bar { flex-wrap: wrap; }
  .desk-find { width: 100%; max-width: none; margin-left: 0; }
  .listed-board-leg { display: none; }
  .listed-board-svg { height: 160px; }
}

.desk-more {
  border-bottom: 1px solid var(--hairline);
  background: #FBFAF7;
}
.desk-more > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}
.desk-more > summary::-webkit-details-marker { display: none; }
.desk-more-meta { letter-spacing: .04em; text-transform: none; font-weight: 500; margin-left: 8px; }

/* Desk tape — leftover chrome if a compile still paints it */
.desk-tape-wrap { border-bottom: 1px solid var(--hairline); background: #FBFAF7; }
.desk-tape-status {
  padding: 10px 16px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink-2, #3d3a34);
  border-bottom: 1px solid var(--hairline);
}
.desk-tape-status-note {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: none;
}
.desk-tape {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.desk-tape-col {
  padding: 14px 16px 16px;
  border-left: 1px solid var(--hairline);
  min-width: 0;
}
.desk-tape-col:first-child { border-left: 0; }
.desk-tape-empty {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin: 8px 0 0;
}
.desk-filed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--hairline);
  padding: 12px 16px 16px;
}
.desk-filed .desk-book-k { grid-column: 1 / -1; }
.desk-filed-col { min-width: 0; padding-right: 16px; }
@media (max-width: 980px) {
  .desk-tape, .desk-filed { grid-template-columns: 1fr; }
  .desk-tape-col { border-left: 0; border-top: 1px solid var(--hairline); }
  .desk-tape-col:first-child { border-top: 0; }
  .desk-filed-col { padding-right: 0; }
}

/* Desk: their doubles */
.desk-book {
  border-bottom: 1px solid var(--hairline);
  background: #FBFAF7;
  padding: 14px 16px 16px;
}
.desk-book-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.desk-book-lead {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 10px;
}
.desk-double {
  display: block;
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
  color: var(--ink);
  text-decoration: none;
}
.desk-double-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.desk-double-row > a {
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.desk-double:hover { color: var(--oxblood); }
.desk-double-row > a:hover { color: var(--oxblood); }
.desk-double-name { font-weight: 600; font-size: 14px; }
.desk-double-marks {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 2px;
  color: var(--ink-2, #3d3a34);
}
.desk-double-gap { color: var(--oxblood); font-weight: 600; }
.desk-double-flags { margin-left: 8px; }
.desk-double-caveat {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--muted);
  margin-top: 3px;
}
.desk-book-more {
  display: inline-block;
  margin-top: 8px;
  margin-right: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--oxblood);
}

/* Desk book pulse + flow waterfalls */
.desk-book-pulse {
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-tint);
  padding: 12px 16px 14px;
}
.desk-book-pulse-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.desk-spark { padding: 0; border: none; background: transparent; }
.flow-waterfall { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-width: 520px; }
.fw-row { display: flex; align-items: center; gap: 10px; }
.fw-lab { width: 128px; flex: none; font-size: 11.5px; color: var(--ink-2); }
.fw-track { flex: 1; height: 10px; background: #ECEAE4; min-width: 80px; }
.fw-fill { height: 10px; min-width: 2px; }
.fw-new { background: #2F6B4F; }
.fw-draw { background: #6B8F71; }
.fw-remint { background: #8B857A; }
.fw-paydown { background: #C2802A; }
.fw-exit { background: #8E2A22; }
.fw-val { width: 72px; text-align: right; font-size: 11.5px; font-weight: 600; }
.ffs-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.ffs-col { min-width: 72px; }
.ffs-pe { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ffs-n, .ffs-x, .ffs-d { font-size: 11.5px; font-family: var(--font-mono); }
.ffs-d { color: var(--muted); }
.credit-flow { padding: 8px 0 4px; font-size: 12px; color: var(--ink-2); }
.credit-flow b { font-weight: 600; color: var(--ink); }
.credit-book { border-bottom: 1px solid var(--hairline); }
.iss-fac-k {
  padding: 10px 18px 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.credit-path { padding: 8px 18px 12px; }
.credit-path-lead {
  font-size: 14px; line-height: 1.5; color: var(--ink); max-width: 52rem;
  margin: 0 0 12px;
}
.credit-path-lead b { font-weight: 650; }
.credit-path .table-wrap { margin: 0 0 10px; }
.credit-path-funds {
  display: inline-block;
  max-width: 28rem;
  white-space: normal;
  line-height: 1.35;
  font-size: 11.5px;
}

/* Client tape */
.client-tape-drop { border-bottom: 1px solid var(--hairline); }
.client-tape-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.client-tape-paste {
  width: 100%;
  max-width: 720px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  margin-bottom: 10px;
}
.btn.primary, label.btn.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Issuer holder ladder labels — full legal name, ellipsis, not a 22-char slice */
.move-plot-labs {
  flex: 0 0 188px;
  width: 188px;
  position: relative;
}
.move-track {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  background: var(--surface-tint);
}
.move-filer-lab {
  position: absolute;
  left: 0;
  width: 176px;
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.move-prior-off {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  white-space: nowrap;
  pointer-events: none;
}
.move-prior-off.hi { transform: translate(-100%, -12px); }
.move-prior-off.lo { transform: translate(4px, -12px); }

/* Period pair pickers (SOI tape) */
.ux-select {
  font: inherit;
  font-size: 11px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  padding: 4px 8px;
  border: 1px solid var(--hairline, #ddd);
  background: var(--surface);
  color: inherit;
  border-radius: 2px;
  max-width: 140px;
}

/* ── Account page ── */
.acc-page { padding: 20px 24px 48px; overflow-y: auto; height: 100%; }
.acc-shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 28px; max-width: 1120px; align-items: start; }
.acc-side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; }
.acc-side-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; font: 600 12px var(--font-mono); letter-spacing: .06em;
  color: var(--muted); text-decoration: none; border: 1px solid transparent;
}
.acc-side-link:hover { color: var(--ink); background: var(--surface-alt); }
.acc-side-link.on { color: var(--ink); background: var(--surface); border-color: var(--hairline); }
.acc-maincol { min-width: 0; }
.acc-kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  color: var(--oxblood);
}
.acc-h1 {
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  color: var(--ink); margin: 4px 0 16px;
}
.acc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 920px;
}
.acc-list { list-style: none; margin: 0 0 12px; padding: 0; font-size: 13px; }
.acc-list li { padding: 7px 0; border-top: 1px solid var(--hairline); }
.acc-list li:first-child { border-top: 0; }
.acc-soon {
  font: 600 9px var(--font-mono); letter-spacing: .12em; color: var(--muted);
  border: 1px solid var(--hairline); padding: 1px 5px;
}
.acc-soon-row { color: var(--muted); }
.acc-locked { opacity: .72; }
@media (max-width: 760px) {
  .acc-shell { grid-template-columns: 1fr; }
  .acc-side { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .acc-grid { grid-template-columns: 1fr; }
  .acc-page { padding: 16px 14px 40px; }
}
.acc-card {
  background: var(--surface); border: 1px solid var(--hairline); padding: 16px 18px;
}
.acc-card-wide { grid-column: 1 / -1; }
.acc-h2 {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em;
  color: var(--muted); text-transform: uppercase; margin: 0 0 12px;
}
.acc-label {
  display: block; font-size: 11px; color: var(--muted); margin: 0 0 4px;
}
.acc-value { font-size: 13px; color: var(--ink); margin: 0 0 12px; }
.acc-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px;
  background: var(--surface-alt); border: 1px solid var(--hairline);
  color: var(--ink); font-size: 13px; margin: 0 0 10px;
}
.acc-btn {
  padding: 8px 14px; background: var(--oxblood); border: 0; color: #EFEEE9;
  font-weight: 600; font-size: 11px; letter-spacing: .06em; cursor: pointer;
}
.acc-btn-ghost {
  background: transparent; border: 1px solid var(--oxblood); color: var(--oxblood);
}
.acc-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acc-choice {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--ink); margin: 0 0 8px; cursor: pointer;
}
.acc-choice input { margin-top: 3px; }
.acc-hint { font-size: 12px; color: var(--muted); margin: 8px 0 10px; }
.acc-note { font-size: 12px; min-height: 16px; margin-top: 8px; }
.acc-rule { border-top: 1px solid var(--hairline); margin: 14px 0 12px; }
.acc-api-foot {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline);
}
.acc-fold { margin-top: 12px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.acc-fold summary {
  cursor: pointer; font: 600 11px var(--font-mono); letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase;
}

/* ── Account page: API keys + docs (admin only) ── */
.acc-key-create { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.acc-key-create input {
  box-sizing: border-box; padding: 9px 10px;
  background: var(--surface-alt); border: 1px solid var(--hairline);
  color: var(--ink); font-size: 13px; min-width: 200px;
}
.acc-key-create input[type=number] {
  min-width: 88px; font-family: var(--font-mono);
}
.acc-secret {
  font-size: 13px; color: var(--green); margin: 0 0 14px;
  padding: 10px 12px; border: 1px solid var(--hairline); background: var(--surface-alt);
}
.acc-keys-body { font-size: 13px; }
.acc-api-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acc-api-table th {
  text-align: left; font: 600 10px var(--font-mono); letter-spacing: .12em;
  color: var(--muted); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--hairline);
}
.acc-api-table td {
  padding: 8px 8px 8px 0; border-bottom: 1px solid var(--hairline); vertical-align: top;
}
.acc-mono { font-family: var(--font-mono); font-size: 12px; }
.acc-muted { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.acc-err { color: #C65A4E; font-size: 12px; margin: 0 0 8px; }
.acc-revoked { font: 600 10px var(--font-mono); letter-spacing: .1em; color: var(--muted); }
.acc-del {
  padding: 5px 10px; background: transparent; border: 1px solid var(--oxblood);
  color: var(--oxblood); font: 600 10px var(--font-mono); letter-spacing: .1em; cursor: pointer;
}
.acc-docs-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.acc-docs-link {
  font: 600 11px var(--font-mono); letter-spacing: .08em; color: var(--oxblood);
  text-decoration: none; padding: 8px 10px; border: 1px solid var(--hairline);
}
.acc-docs-prompt {
  font: 400 12px var(--font-mono); color: var(--ink);
  background: var(--surface-alt); border: 1px solid var(--hairline);
  padding: 10px 12px; white-space: pre-wrap; overflow: auto; margin: 0 0 8px;
}
.acc-docs-field {
  display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px;
  padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 13px;
}
.acc-docs-field .k { font: 600 11px var(--font-mono); }
.acc-docs-res {
  margin: 14px 0 6px; font: 600 10px var(--font-mono);
  letter-spacing: .14em; color: var(--muted);
}

/* ── Dark theme (My account → Appearance; persists via dirigon.prefs.v1) ── */
[data-theme="dark"] {
  --ink: #EFEEE9;
  --ink-2: #B8B4AC;
  --paper: #141312;
  --surface: #1D1C1A;
  --surface-alt: #232220;
  --surface-tint: #191816;
  --hairline: #33312D;
  --hairline-2: #292724;
  --hairline-3: #2E2C29;
  --oxblood: #B6543F;
  --amber: #D89A40;
  --amber-2: #D89A40;
  --green: #3D9A72;
  --muted: #A8A49C;
  --muted-2: #8B857A;
  --muted-3: #6E6A61;
  --slate: #93A0AE;
  --cmd-bg: #0F1215;
  --cmd-border: #2E3742;
  --series-0: #C65A4E;
  --series-1: #9AA1A9;
  --series-2: #D89A40;
  --series-3: #3D9A72;
  --series-4: #5B7BA0;
  --series-5: #8B857A;
}
[data-theme="dark"] ::selection { color: #141312; }
[data-theme="dark"] .stat-cell,
[data-theme="dark"] .panel,
[data-theme="dark"] .instr-group,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .dotplot { background: var(--surface); }
[data-theme="dark"] .dotplot .band { background: var(--surface-alt); }
[data-theme="dark"] .nav-item.active { background: var(--surface-alt); }
[data-theme="dark"] table.data tbody tr:hover { background: var(--surface-alt); }
[data-theme="dark"] .tag-listed { background: #232B36; color: #93A0AE; border-color: #2E3742; }
[data-theme="dark"] .table-wrap.sticky-col table.data tbody td:first-child { background: var(--surface); }
[data-theme="dark"] .table-wrap.sticky-col table.data thead th:first-child { background: var(--surface-alt); }
[data-theme="dark"] .estimate-drawer { background: #241F18; border-bottom-color: #4A3B22; }
[data-theme="dark"] .table-wrap.sticky-col table.data tbody tr:hover td:first-child { background: var(--surface-alt); }
[data-theme="dark"] .alert-row:hover { background: var(--surface-alt); }
[data-theme="dark"] .filer-spark-host,
[data-theme="dark"] .desk-book-pulse,
[data-theme="dark"] .desk-recap,
[data-theme="dark"] .product-notes,
[data-theme="dark"] #filer-holdings,
[data-theme="dark"] #filer-holdings .panel-head {
  background: var(--surface);
}
[data-theme="dark"] .instr-badge,
[data-theme="dark"] .tag-mute { background: var(--surface-alt); color: var(--muted); border-color: var(--hairline); }
[data-theme="dark"] .tag-risk { background: #3A241F; color: #E8A090; border-color: #5A3832; }
[data-theme="dark"] .tag-warn,
[data-theme="dark"] .tag-est { background: #3A3018; color: #D89A40; border-color: #5A4A28; }
[data-theme="dark"] .tag-good { background: #1E3228; color: #6FBF96; border-color: #2E4A3A; }
[data-theme="dark"] .fw-track { background: var(--hairline); }
[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .swb-jump-btn:hover,
[data-theme="dark"] .stat-cell-link:hover,
[data-theme="dark"] .side-row:hover,
[data-theme="dark"] .desk-digest-head:hover { background: var(--surface-alt); }

/* ════════════════════════════════════════════════════════════════════
   VISUAL REFRESH (2026-08) — appended layer; overrides earlier rules.
   Direction: calmer hierarchy, lighter paper, cooler hairlines, Archivo
   800 display type (Archivo Narrow retired), pill controls, softer
   tables. Token changes hit light theme only — [data-theme="dark"]
   redeclares its own tokens above with higher specificity.
   ════════════════════════════════════════════════════════════════════ */
:root:not([data-theme="dark"]) {
  --ink: #15181E;
  --ink-2: #454B55;
  --paper: #F5F5F3;
  --surface-alt: #F3F3F1;
  --surface-tint: #FAFAF8;
  --hairline: #E3E4E1;
  --hairline-2: #ECECEA;
  --hairline-3: #E7E7E4;
  --muted: #5C636E;
  --muted-2: #858C97;
  --muted-3: #A8AFB9;
}
:root {
  --font-display: "Archivo", system-ui, sans-serif;
}

/* ── type & titles ─────────────────────────────────────────────── */
.page-title {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.01em;
}
.entity-title { font-weight: 800; letter-spacing: -.015em; }
.panel-title, .panel-title-sm {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--ink-2);
}
.page-head { padding: 12px 20px; }
.entity-head { padding: 14px 20px; }

/* ── controls: buttons, chips, inputs ──────────────────────────── */
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .02em;
  padding: 6px 13px;
  border-color: color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 6px;
  transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--ink); background: var(--surface-alt); }
.btn-primary { background: var(--oxblood); border-color: var(--oxblood); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--oxblood) 86%, #000); border-color: transparent; }
.btn-filter.active, .chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip { border-radius: 999px; }
.tag { border-radius: 3px; font-weight: 600; }
input[type="text"], input[type="number"], input[type="email"],
input[type="password"], textarea, select { border-radius: 6px; }
.ux-search, .studio-search, .studio-weight-input,
.filer-holdings-controls .search-box { border-radius: 6px; }
.ux-search:focus, .studio-search:focus,
.filer-holdings-controls .search-box:focus {
  border-color: var(--ink);
  outline: none;
}
.studio-stack {
  display: flex; height: 22px; overflow: hidden;
  border: 1px solid var(--hairline); margin: 8px 0 6px;
}
.studio-stack-seg {
  color: #fff; font: 10px/22px var(--font-mono);
  text-align: center; overflow: hidden; white-space: nowrap;
}
.studio-secbar { display: flex; height: 8px; margin: 8px 0 6px; }
.studio-secbar-seg { height: 8px; }
.studio-book-meta { font-size: 11px; color: var(--muted); margin: 8px 0; }
.studio-markpill {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0 8px 4px 0; font-size: 12px; white-space: nowrap;
}
.studio-slot {
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--hairline);
}
.studio-slot-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.studio-slot-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.studio-slot-w { margin-left: auto; color: var(--muted); }
.studio-slot-meta { font-size: 11px; color: var(--muted); margin: 4px 0 8px; }
.studio-dbl-filters { padding: 8px 0 10px; }

.studio-lead {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.studio-lead b { color: var(--ink); font-weight: 650; }

.studio-mix { margin: 4px 0 12px; }
.studio-mix-bar {
  display: flex;
  height: 8px;
  background: var(--hairline-3);
  overflow: hidden;
}
.studio-mix-seg { height: 100%; min-width: 2px; }
.studio-mix-leg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
}
.studio-mix-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.studio-mix-k { color: var(--muted); }
.studio-mix-v { font-weight: 600; color: var(--ink); }

.studio-secs { margin: 4px 0 16px; }
.studio-budget {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.studio-budget-lab {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.studio-budget-input {
  width: 72px;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--hairline);
  background: var(--surface, #fff);
  color: var(--ink);
}
.studio-budget-unit { font-size: 11px; color: var(--muted); }
.studio-secrow {
  display: grid;
  grid-template-columns: minmax(10em, 13em) minmax(80px, 1fr) 5em 3.8em;
  gap: 10px 14px;
  align-items: center;
  padding: 6px 0;
}
.studio-secrow-lab {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-secrow-bar {
  height: 8px;
  background: var(--hairline-3);
  min-width: 0;
}
.studio-secrow-bar i {
  display: block;
  height: 100%;
  background: var(--ink);
}
.studio-secrow-dol {
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.studio-secrow-pct {
  text-align: right;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .studio-secrow {
    grid-template-columns: minmax(0, 1fr) 5em 3.8em;
  }
  .studio-secrow-bar {
    grid-column: 1 / -1;
    order: 3;
  }
}

.studio-book-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 4px 0 8px;
}
.studio-names { display: flex; flex-direction: column; }
.studio-name {
  display: block;
  padding: 8px 0 9px;
  border-bottom: 1px solid var(--hairline-2);
  text-decoration: none;
  color: inherit;
}
.studio-name:hover .studio-name-lab { color: var(--oxblood); }
.studio-name-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.6em 4.6em;
  gap: 10px;
  align-items: baseline;
}
.studio-name-lab {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-name-pct { text-align: right; font-size: 12px; color: var(--ink); }
.studio-name-dol { text-align: right; font-size: 12px; color: var(--muted); }
.studio-name-bar {
  height: 3px;
  background: var(--hairline-3);
  margin: 6px 0 4px;
}
.studio-name-bar i {
  display: block;
  height: 100%;
  background: var(--ink);
}
.studio-name-sub {
  font-size: 11px;
  color: var(--muted);
}

.studio-slot-drop {
  margin-left: 8px;
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
}
.studio-slot-w { font-size: 11px; }

.change-pack {
  margin: 0 0 14px;
  padding: 12px 16px 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.change-pack-head {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline;
  margin-bottom: 8px;
}
.change-pack-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--oxblood);
}
.change-pack-sub { font-size: 12px; color: var(--muted); }
.change-pack-rows { display: grid; gap: 4px; }
.change-pack-row {
  display: grid;
  grid-template-columns: minmax(88px, 1.1fr) 64px 64px 64px minmax(120px, 2fr);
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
}
.change-pack-label { color: var(--ink); text-decoration: none; font-weight: 600; }
a.change-pack-label:hover { color: var(--oxblood); }
.change-pack-now, .change-pack-was { color: var(--muted); text-align: right; }
.change-pack-dlt { text-align: right; font-weight: 600; }
.change-pack-dlt.risk { color: var(--oxblood); }
.change-pack-note { color: var(--muted); font-size: 12px; }
.change-pack-foot {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 720px) {
  .change-pack-row { grid-template-columns: 1fr 1fr; }
  .change-pack-note { grid-column: 1 / -1; }
}

.call-card {
  margin: 0 0 16px;
  padding: 14px 16px 16px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.call-card-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; margin-bottom: 10px; }
.call-card-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--oxblood);
}
.call-card-sub { font-size: 12px; color: var(--muted); }
.call-card-stances { margin-bottom: 10px; }
.call-card-note {
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  padding: 8px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font: 13px/1.45 var(--font-sans, inherit);
  resize: vertical;
}
.call-card-note:focus { border-color: var(--ink); outline: none; }
.call-card-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.call-card-meta { font-size: 12px; color: var(--muted); }
.chip-row-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
  align-self: center;
  margin-right: 4px;
}

.period-chip { border-radius: 999px; }
.cmd-input-wrap { border-radius: 6px; }
.cmd-chip { border-radius: 4px; }
.user-sq { border-radius: 6px; }
.stepper button { border-radius: 6px; }

/* ── stat strip ────────────────────────────────────────────────── */
.stat-cell { padding: 13px 18px; }
.stat-value {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
}
.stat-sub { font-size: 11.5px; }

/* ── tables ────────────────────────────────────────────────────── */
table.data thead th {
  background: var(--surface-alt);
  padding-top: 8px;
  padding-bottom: 8px;
}
table.data td { padding-top: 9px; padding-bottom: 9px; }
table.data td.num { font-variant-numeric: tabular-nums; }

/* ── rail ──────────────────────────────────────────────────────── */
.nav-group-label { padding: 16px 14px 5px; color: var(--muted-3); }
.nav-item { padding: 6px 14px; }
.nav-item:hover { background: var(--hairline-2); }
.nav-item.active { background: color-mix(in srgb, var(--oxblood) 9%, transparent); border-left-color: var(--oxblood); }
.rail-foot { color: var(--muted-3); }

/* ── panels & cards: keep the hairline grid, just lighter ─────── */
.panel-head { padding: 13px 18px 10px; }
.method-foot { color: var(--muted-2); }

/* ── chart chrome ──────────────────────────────────────────────── */
.hbar, .bar-track, .bar-fill { border-radius: 2px; }
.seg-bar { border-radius: 3px; overflow: hidden; }

/* ── command palette ───────────────────────────────────────────── */
#palette { border-radius: 10px; overflow: hidden; }
.palette-hit { border-radius: 6px; }

/* ── scrollbars ────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: #C9CCC9 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #C9CCC9; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] * { scrollbar-color: #3A3833 transparent; }
[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #3A3833; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }

/* ── focus ─────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 1px; }

/* cmdbar must stay dark in both themes (--ink flips light in dark mode) */
#cmdbar { background: #15181E; }

/* ── SOI tape advanced filter groups + non-breaking dates ───────── */
.adv-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 18px 10px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-tint);
}
.af-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.af-label {
  width: 92px;
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--muted-3);
}
.nb { white-space: nowrap; }

/* dates/numbers never wrap mid-value in narrow columns */
table.data td.num { white-space: nowrap; }

.desk-recap { background: var(--surface-alt); }
.desk-recap-line {
  font-size: 13px;
  line-height: 1.45;
  padding: 6px 0;
  border-top: 1px solid var(--hairline);
}
.desk-recap-line:first-of-type { border-top: 0; }

.brief-wrap { background: var(--paper, #EFEEE9); }
.brief-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  color: var(--ink);
}
.brief-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.brief-page h1 { font-size: 32px; margin: 0 0 6px; letter-spacing: -.02em; }
.brief-sub { color: var(--muted); margin: 0 0 24px; }
.brief-page h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 22px 0 8px;
}
.brief-page ul { margin: 0; padding-left: 18px; }
.brief-page li { margin: 6px 0; font-size: 14px; line-height: 1.45; }
.brief-ask {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.brief-foot { margin-top: 32px; font-size: 12px; color: var(--muted); }

/* Desk terminal density — last, beats the later polish padding reopen */
.desk-page .page-head { padding: 6px 14px; gap: 10px; }
.desk-page .page-title { font-size: 16px; }
.desk-page .desk-scroll { padding-bottom: 8px; }
.desk-page .desk-wave .stat-cell { padding: 5px 10px; }
.desk-page .desk-wave .stat-value { font-size: 15px; margin-top: 1px; line-height: 1.1; }
.desk-page .desk-wave .stat-sub { font-size: 10px; margin-top: 0; }
.desk-page .listed-board-chart { padding: 6px 12px 4px; }
.desk-page .listed-board-chart-head { margin-bottom: 2px; }
.desk-page .listed-board-svg { height: 118px; }
.desk-page .listed-board-chart-foot { display: none; }
.desk-page .desk-movers { padding: 6px 12px 6px; }
.desk-page .desk-movers-grid { margin-top: 2px; gap: 0 14px; }
.desk-page .desk-movers-split { margin: 3px 0 0; }
.desk-page .desk-movers-split.down { margin-top: 5px; padding-top: 4px; }
.desk-page .desk-mover { font-size: 12px; line-height: 1.45; }
.desk-page .desk-table-bar { padding: 5px 12px; }
.desk-page .desk-find { padding: 4px 8px; width: 200px; }
.desk-page .listed-quotes table.data thead th { padding-top: 4px; padding-bottom: 4px; }
.desk-page .listed-quotes table.data td { padding-top: 3px; padding-bottom: 3px; }
.desk-page .listed-quotes .cell-primary { font-size: 12px; line-height: 1.15; }
.desk-page .listed-quotes .cell-secondary { margin-top: 0; font-size: 9.5px; line-height: 1.15; }
.desk-page .listed-board-table { max-height: min(58vh, 680px); }
.desk-page .desk-eightk { padding: 6px 12px 8px; }
.desk-page .desk-eightk-grid { margin-top: 2px; }
.desk-page .desk-eightk-row { padding: 6px 10px 6px 8px; gap: 2px; }
.desk-page .desk-eightk-blurb { font-size: 12px; line-height: 1.3; }
.desk-page .desk-more > summary { padding: 8px 12px; }
@media (max-width: 980px) {
  .desk-page .listed-board-svg { height: 110px; }
  .desk-page .desk-find { width: 100%; }
}

@media print {
  #rail, #cmdbar, #rail-scrim, .rail-toggle, .page-head .entity-actions,
  .page-head button, .brief-wrap .page-head { display: none !important; }
  #layout { display: block; }
  #main, .brief-wrap { background: #fff; }
  .brief-page { padding: 0; max-width: none; }
}

/* Allocator Studio — Core Builder (donut + sibling tabs) */
.studio-port {
  padding: 12px 16px 18px;
  border-bottom: 1px solid var(--hairline);
}
.studio-alloc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 14px;
  overflow-x: auto;
}
.studio-alloc-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 12px 7px;
  font: 600 12px/1 var(--font);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.studio-alloc-tab:hover { color: var(--ink); }
.studio-alloc-tab.on {
  color: var(--ink);
  border-bottom-color: var(--oxblood, #8E2A22);
}
.studio-alloc-chart { margin-bottom: 14px; }
.studio-donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.studio-donut { flex: none; }
.studio-donut svg { display: block; }
.studio-donut-leg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  flex: 1;
  max-height: 280px;
  overflow-y: auto;
}
.studio-donut-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.studio-donut-k { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-donut-v { color: var(--muted); }
.studio-more { border-top: 1px solid var(--hairline); }
.studio-more-sum {
  padding: 12px 16px;
  font: 600 12px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.studio-more-sum::-webkit-details-marker { display: none; }
.studio-more-body { border-top: 1px solid var(--hairline); }
.studio-name-chips { margin: 0 0 10px; }
