/* Premium depth sections ("living deck" pages): dense card grid, KPI strip, scorecard table.
   Every colour is var(--lt-<token>, <dark literal>) so the light theme (dashboard-theme.css) and dark both work. */

.depth-page .dash-page__header { margin-bottom: 10px; }

.depth-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}
.depth-kpi {
  background: var(--lt-sheet, #0F1318);
  border: 1px solid var(--lt-hair, rgba(82, 92, 112, 0.45));
  box-shadow: var(--lt-lift, none);
  border-radius: 6px;
  padding: 8px 10px;
  min-width: 0;
  cursor: pointer;
  text-align: left;
  color: var(--lt-ink, #F0F2F5);
  font: inherit;
}
.depth-kpi[aria-pressed="true"] { outline: 2px solid var(--lt-gold, #FFB800); outline-offset: -2px; }
.depth-kpi__label { font-size: 12px; color: var(--lt-ink-3, #8FA4BF); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.depth-kpi__value { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.depth-kpi__meta { font-size: 12px; color: var(--lt-ink-2, #B6C5D6); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.depth-grid { display: grid; gap: 10px; margin-bottom: 10px; }
.depth-grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.depth-card {
  background: var(--lt-sheet, #0F1318);
  border: 1px solid var(--lt-hair, rgba(82, 92, 112, 0.45));
  box-shadow: var(--lt-lift, none);
  border-radius: 6px;
  padding: 8px 10px 6px;
  min-width: 0;
  margin-bottom: 10px;
}
.depth-grid .depth-card { margin-bottom: 0; }
.depth-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.depth-card__title { font-size: 14px; font-weight: 600; margin: 0; color: var(--lt-ink, #F0F2F5); flex: 1 1 auto; }
.depth-explain, .depth-link-button {
  font-size: 12px;
  color: var(--lt-blue, #7DB4FF);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.depth-chart { min-width: 0; }
.depth-chart > .depth-empty { margin: 0.5rem 0.15rem; }   /* the shared note's negative top margin runs into the card head */

/* chart toggles (.depth-tabs > .depth-tab) are the shared segmented control (dashboard.css .lt-seg) */

.depth-scorecard { overflow-x: auto; }
.depth-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.depth-table th, .depth-table td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--lt-hair, rgba(82, 92, 112, 0.35)); white-space: nowrap; }
.depth-table th { font-weight: 600; color: var(--lt-ink-3, #8FA4BF); font-size: 12px; }
.depth-table th:first-child, .depth-table td:first-child { text-align: left; }
.depth-table td:first-child { color: var(--lt-ink, #F0F2F5); font-weight: 600; }
.depth-spark { vertical-align: middle; color: var(--lt-ink-2, #B6C5D6); }
.depth-spark--worse { color: var(--lt-red, #FF6B5A); }
.depth-table th.depth-th--group { text-align: center; }
.depth-table td.depth-td--wrap { white-space: normal; min-width: 120px; }
.depth-table tr[data-key] { cursor: pointer; }
.depth-table td.depth-td--muted { font-weight: 400; color: var(--lt-ink-2, #B6C5D6); }
.depth-table tr.depth-row--selected { outline: 1px solid var(--lt-gold, #FFB800); outline-offset: -1px; }
.depth-chip { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.depth-chip--worse { color: var(--lt-red, #FF6B5A); background: rgba(var(--lt-red-rgb, 255, 77, 42), 0.14); }
.depth-chip--better { color: var(--lt-green, #34D399); background: rgba(var(--lt-green-rgb, 52, 211, 153), 0.14); }
.depth-chip--neutral { color: var(--lt-ink-2, #B6C5D6); background: rgba(var(--lt-ink-rgb, 182, 197, 214), 0.08); }
.depth-chip--notable { color: var(--lt-blue, #7DB4FF); background: rgba(var(--lt-blue-rgb, 125, 180, 255), 0.14); }
.depth-status:empty { display: none; }
.depth-tone--worse { color: var(--lt-red, #FF6B5A); }
.depth-tone--better { color: var(--lt-green, #34D399); }
.depth-tone--notable { color: var(--lt-blue, #7DB4FF); }
.depth-tone--neutral { color: var(--lt-ink-3, #8FA4BF); }

/* Charts sit on the card itself: no inner frame or padding, so the y-axis labels start about 10 px in from the card's
   edge (depth-common.js starts margin.l small and lets automargin size it). */
.depth-page .depth-card .depth-chart { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; margin-left: -3px; }
.depth-card__sub { margin: 0 0 4px; font-size: 12px; line-height: 1.35; color: var(--lt-ink-2, #B6C5D6); text-align: left; }
.depth-card__sub[hidden] { display: none; }
.depth-page > .dash-chart-note, .depth-quiet-notes { text-align: left; }
.depth-page input[type="range"] { accent-color: var(--lt-gold, #FFB800); }
.depth-grid { align-items: start; }
/* the stage band scrolls away on a depth page (depth-common.js syncChrome) */
.dash-stage__chrome.depth-chrome-static { position: static; }

/* ── Section sub-tabs (depth-common.js initTabs): one screen per tab ── */
/* the bar and its tabs are the shared tab component (dashboard.css .lt-tabs); here only where it sits */
.depth-tabpanel[hidden], .depth-card[hidden], .depth-sectiontab[hidden] { display: none !important; }
.depth-tabset:not(.depth-tabset--ready) > .depth-tabpanel ~ .depth-tabpanel { display: none; }
.depth-tabpanel > .depth-card { margin-bottom: 10px; }

@media (min-width: 901px) {
  /* the bar sticks under the dashboard header; each panel fills the viewport below it (--depth-panel-h) */
  .depth-sectiontabs {
    position: sticky;
    top: var(--depth-sticky-top, 0px);
    z-index: 15;
  }
  .depth-tabpanel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
    gap: 10px;
    height: var(--depth-panel-h, auto);
    margin-bottom: 10px;
  }
  .depth-tabpanel--one { grid-template-columns: minmax(0, 1fr); }
  .depth-tabpanel--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .depth-tabpanel > .depth-card { margin: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .depth-card--wide, .depth-card--fill { grid-column: 1 / -1; }
  .depth-card--tall { grid-row: span 2; }
  .depth-tabpanel .depth-card__head, .depth-tabpanel .depth-card__sub, .depth-tabpanel .dash-chart-note,
  .depth-tabpanel .depth-tabs { flex: 0 0 auto; }
  .depth-tabpanel .depth-chart { flex: 1 1 0; min-height: 0 !important; overflow: hidden; }
  .depth-tabpanel .depth-chart.depth-chart--scroll { overflow-y: auto; }
  .depth-tabpanel .depth-chart[style*="display:none"], .depth-tabpanel .depth-chart[style*="display: none"] { flex: 0 0 0; }
  .depth-tabpanel .depth-scorecard { flex: 1 1 0; min-height: 0; max-height: none !important; overflow: auto; }
  /* sized to content (depth-common.js contentFit): no stretched cards, tables and charts at their own height */
  .depth-tabpanel.depth-tabpanel--content { height: auto; grid-auto-rows: auto; align-items: start; }
  .depth-tabpanel > .depth-card.depth-card--fit .depth-chart { flex: none; }
  .depth-tabpanel--content .depth-scorecard { flex: none; overflow: visible; }
  .depth-tabpanel--content .depth-chart { flex: none; overflow: visible; }
  .depth-tabpanel .depth-scorecard thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--lt-sheet, #0F1318);
  }
}

/* wide tables (11+ columns) wrap their headers so the last column fits without a scrollbar */
.depth-table:has(th:nth-child(11)) th { white-space: normal; vertical-align: bottom; }
.depth-table:has(th:nth-child(11)) td, .depth-table:has(th:nth-child(11)) th { padding-left: 5px; padding-right: 5px; }
/* the page footnote stays clear of the dashboard's floating pane buttons (bottom right) */
@media (min-width: 901px) { .depth-page > .dash-chart-note { padding-right: 200px; } }

@media (max-width: 900px) {
  .depth-tabpanel { display: block; }
  .depth-kpi__label { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .depth-kpi__meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .depth-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .depth-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .depth-kpi__value { font-size: 19px; }
}

/* ── Trust picker (depth-common.js trustPicker): multi-select with search ── */
.depth-tp { position: relative; min-width: 220px; }
.depth-tp__bar { display: flex; gap: 4px; align-items: center; }
.depth-tp__toggle { flex: 1 1 auto; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.depth-tp__clear { border: 1px solid var(--lt-hair, rgba(82, 92, 112, 0.45)); background: transparent; color: var(--lt-ink-2, #B6C5D6);
  border-radius: 999px; width: 26px; height: 26px; cursor: pointer; font-size: 15px; line-height: 1; }
.depth-tp__panel { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 380px; max-width: 92vw;
  background: var(--lt-sheet, #0F1318); border: 1px solid var(--lt-hair, rgba(82, 92, 112, 0.45)); border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28); padding: 8px; }
.depth-tp__panel[hidden] { display: none; }
.depth-tp__search { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 7px 9px; border-radius: 6px;
  border: 1px solid var(--lt-hair, rgba(82, 92, 112, 0.45)); background: var(--lt-paper, #06080D); color: var(--lt-ink, #F0F2F5); }
.depth-tp__list { max-height: 340px; overflow-y: auto; margin-top: 6px; outline: none; }
.depth-tp__group { display: flex; gap: 8px; align-items: baseline; padding: 6px 4px 2px; font-size: 12px; font-weight: 600;
  color: var(--lt-ink-3, #8FA4BF); position: sticky; top: 0; background: var(--lt-sheet, #0F1318); }
.depth-tp__group span { flex: 1 1 auto; }
.depth-tp__option { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 4px 6px;
  border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--lt-ink, #F0F2F5); }
.depth-tp__option:hover, .depth-tp__option--active { background: rgba(var(--lt-blue-rgb, 125, 180, 255), 0.14); }
.depth-tp__box { width: 14px; height: 14px; border: 1px solid var(--lt-ink-3, #8FA4BF); border-radius: 3px; font-size: 11px;
  line-height: 13px; text-align: center; color: var(--lt-blue, #7DB4FF); }
.depth-tp__option[aria-selected="true"] .depth-tp__box { border-color: var(--lt-blue, #7DB4FF); }
.depth-tp__span { font-size: 11px; color: var(--lt-ink-3, #8FA4BF); white-space: nowrap; }
.depth-tp__hint:empty, .depth-tp__empty:empty { display: none; }
.depth-tp__hint, .depth-tp__empty { font-size: 12px; color: var(--lt-ink-3, #8FA4BF); margin: 6px 4px 0; }
.depth-tp__foot { display: flex; justify-content: flex-end; padding-top: 6px; }
@media (max-width: 600px) {
  .depth-tp--open .depth-tp__panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none;
    border-radius: 12px 12px 0 0; max-height: 80vh; display: flex; flex-direction: column; }
  .depth-tp--open .depth-tp__list { max-height: none; flex: 1 1 auto; }
}

/* wide monitors: the depth pages stop growing at about 1660 px, centred like the rest of the dashboard */
.depth-page { max-width: 1660px; margin-left: auto; margin-right: auto; }
.depth-kpis__note { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--lt-ink-2, #B6C5D6); }
/* the standard chart menu ("...") opens over the chart, never clipped by the fitted card */
.depth-page .depth-chart.dash-chart--with-actions { overflow: visible; }

/* the standard chart menu in the card's header row (depth-common.js chartMenu): top right, beside the title */
.depth-card__head .dash-chart-actions { position: relative; top: auto; right: auto; margin-left: auto; pointer-events: auto; order: 99; }
.depth-card__head .dash-chart-actions__toggle { width: 1.9rem; min-width: 1.9rem; height: 1.6rem; min-height: 1.6rem; opacity: 1; }
.depth-card__head .dash-chart-actions__menu { right: 0; left: auto; }

/* Issuer Scorecard: nine KPI tiles in one row on a desktop (two meta lines each), the page's two links under the title */
.depth-scorecard__titlerow { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.depth-scorecard__titlerow .dash-page__title { margin: 0; }
.depth-scorecard__picker { display: inline-flex; align-items: center; gap: 6px; }
.depth-scorecard__picker .dash-select { min-width: 170px; padding-top: 4px; padding-bottom: 4px; }
.depth-scorecard__header .dash-page__subtitle { margin-top: 4px; }
@media (min-width: 1200px) {
  .depth-kpis--scorecard { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
  .depth-kpis--scorecard .depth-kpi { padding: 6px 8px; cursor: default; }
  .depth-kpis--scorecard .depth-kpi__value { font-size: 18px; }
  .depth-kpis--scorecard .depth-chip { padding: 0 4px; font-size: 11px; }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .depth-kpis--scorecard { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.depth-scorecard__trusts .dash-field { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.depth-scorecard__trusts .depth-tp__toggle { min-width: 150px; padding-top: 4px; padding-bottom: 4px; }
.depth-scorecard__chip {
  font: inherit; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(var(--lt-blue-rgb, 125, 180, 255), 0.35); background: rgba(var(--lt-blue-rgb, 125, 180, 255), 0.10);
  color: var(--lt-blue, #7DB4FF);
}
.depth-scorecard__chip[hidden] { display: none; }
.depth-tp__modes { margin: 0 0 8px; }
#depth-issuer_scorecard-title a { color: var(--lt-blue, #7DB4FF); text-decoration: none; }
.depth-kpis--scorecard.depth-kpis--trust { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 900px) { .depth-kpis--scorecard.depth-kpis--trust { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.depth-kpis--scorecard .depth-kpi__meta { letter-spacing: -0.1px; }
.depth-scorecard__subrow { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-top: 4px; }
.depth-scorecard__subrow .dash-page__subtitle { margin: 0; flex: 1 1 420px; }
.depth-scorecard__compare { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }

/* no issuer in scope: only the "choose an issuer" line shows, never the last scope's numbers */
.depth-page--no-issuers .depth-kpis, .depth-page--no-issuers .depth-tabset, .depth-page--no-issuers .depth-note { display: none !important; }

/* Issuer Scorecard Trusts tab: sortable headers, a table capped so the compare view sits under it, the compare picker */
.depth-table--sortable th { cursor: pointer; user-select: none; }
.depth-table--sortable th:hover { color: var(--lt-ink, #F0F2F5); }
.depth-table--sortable th[aria-sort="descending"]::after { content: " \25BE"; }
.depth-table--sortable th[aria-sort="ascending"]::after { content: " \25B4"; }
.depth-scorecard--compare .depth-table td { white-space: normal; }
.depth-scorecard--compare .depth-table td:first-child { white-space: nowrap; }
.depth-cmp-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 6px; }
.depth-cmp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
  color: var(--lt-ink, #F0F2F5); background: rgba(var(--lt-ink-rgb, 182, 197, 214), 0.08); border: 1px solid var(--lt-hair, rgba(82, 92, 112, 0.35)); cursor: pointer; }
.depth-cmp-chip:hover { border-color: var(--lt-ink-3, #8FA4BF); }
.depth-cmp-chip__dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.depth-cmp-chip .depth-cmp-chip__dot { margin-right: 0; }
.depth-cmp-add { max-width: 320px; }
