:root {
  --ide-bg: #1e1e1e;
  --ide-panel-bg: #252526;
  --ide-sidebar-bg: #252526;
  --ide-activity-bg: #333333;
  --ide-border: #3c3c3c;
  --ide-accent: #007acc;
  --ide-accent-hover: #005a9e;
  --ide-text-main: #cccccc;
  --ide-text-muted: #808080;
  --ide-text-bright: #ffffff;

  --ide-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* PRO DESIGN THEME */
body.theme-pro {
  --ide-bg: #0a0a0a;
  --ide-panel-bg: rgba(28, 28, 30, 0.7);
  --ide-sidebar-bg: rgba(28, 28, 30, 0.5);
  --ide-activity-bg: #1c1c1e;
  --ide-border: rgba(255, 255, 255, 0.1);
  --ide-accent: #0a84ff;
  --ide-accent-hover: #409cff;
  --ide-text-main: #ebebf5;
  --ide-text-muted: rgba(235, 235, 245, 0.6);
  --ide-text-bright: #ffffff;

  background: radial-gradient(circle at top left, #1c1c1e, #000000);
}

body.theme-pro .panel {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--ide-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  overflow: hidden;
}

body.theme-pro .ide-menubar {
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  height: 44px;
}

body.theme-pro .ide-sidebar {
  border-right: 1px solid var(--ide-border);
}

body.theme-pro .ide-tab.active {
  background-color: transparent;
  border-top: none;
  border-bottom: 2px solid var(--ide-accent);
}

body.theme-pro .dashboard-content {
  padding: 32px;
}

body.theme-pro .panel-header h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

body.theme-pro .tree-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 4px 8px;
  padding: 6px 12px;
}

body.theme-pro .btn-small {
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

body {
  margin: 0;
  height: 100vh;
  width: 100vw;
  background-color: var(--ide-bg);
  color: var(--ide-text-main);
  font-family: var(--ide-font-ui);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- TOP MENU BAR --- */
.ide-menubar {
  height: 35px;
  background-color: var(--ide-activity-bg);
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--ide-border);
  justify-content: space-between;
  user-select: none;
  position: relative;
  z-index: 1000;
}
.ide-brand {
  font-weight: 600;
  color: var(--ide-text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.ide-brand span {
  font-weight: 400;
  color: var(--ide-text-muted);
  font-size: 12px;
}
.ide-menubar-actions {
  display: flex;
  gap: 8px;
}

/* --- MAIN LAYOUT --- */
.ide-main-container {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* --- LEFT SIDEBAR --- */
.ide-sidebar {
  width: 250px;
  background-color: var(--ide-sidebar-bg);
  border-right: 1px solid var(--ide-border);
  display: flex;
  flex-direction: column;
}
.ide-sidebar-title {
  height: 35px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ide-text-muted);
  letter-spacing: 0.5px;
}
.ide-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px 8px;
}

.ide-tree-header {
  font-weight: 600;
  margin: 12px 0 6px 8px;
  color: var(--ide-text-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ide-tree-header::before {
  content: "▼";
  font-size: 9px;
  color: var(--ide-text-muted);
}
.tree-item {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  margin-left: 8px;
  cursor: pointer;
  border-radius: 3px;
  color: var(--ide-text-main);
}
.tree-item:hover {
  background-color: rgba(255,255,255,0.1);
}
.tree-item.active {
  background-color: var(--ide-accent);
  color: var(--ide-text-bright);
}
.mobile-primary-tab {
  display: none;
}

/* --- EDITOR AREA (RIGHT SIDE) --- */
.ide-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.ide-tabs {
  display: flex;
  background-color: var(--ide-panel-bg);
  height: 35px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #4a5570 #1f2737;
}
.ide-tab {
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--ide-panel-bg);
  color: var(--ide-text-muted);
  border-right: 1px solid var(--ide-border);
  cursor: pointer;
  user-select: none;
  border-top: 2px solid transparent;
  white-space: nowrap;
  font-size: 12px;
}
.ide-tab.active {
  background-color: var(--ide-bg);
  color: var(--ide-text-bright);
  border-top: 2px solid var(--ide-accent);
}

/* Dashboard Content */
.dashboard-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
.panel {
  background-color: var(--ide-panel-bg);
  border: 1px solid var(--ide-border);
  border-radius: 4px;
  margin-bottom: 20px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--ide-border);
}
.panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ide-text-bright);
}
.btn {
  background: var(--ide-activity-bg);
  border: 1px solid var(--ide-border);
  color: var(--ide-text-main);
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
}
.btn:hover {
  background: var(--ide-accent);
  color: white;
  border-color: var(--ide-accent-hover);
}
.btn-small {
  background: var(--ide-activity-bg);
  border: 1px solid var(--ide-border);
  color: var(--ide-text-main);
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
}
.btn-small:hover {
  background: var(--ide-accent);
  color: white;
  border-color: var(--ide-accent-hover);
}

/* Dashboard layout primitives.
   New panels should use these instead of inline grid columns or fixed chart heights. */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  min-width: 0;
}
.chart-grid-2,
.chart-grid-3,
.compare-control-grid,
.table-card-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.chart-grid-2,
.table-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chart-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.compare-control-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
}
.chart-frame {
  position: relative;
  width: 100%;
  min-width: 0;
}
.chart-fill {
  width: 100%;
  height: 100%;
}
.chart-frame-xs { height: 300px; }
.chart-frame-sm { height: 320px; }
.chart-frame-md { height: 360px; }
.chart-frame-lg { height: 420px; }
.chart-frame-xl { height: 520px; }
.chart-frame-2xl { height: 600px; }
.chart-frame-surface { height: 640px; }
.chart-frame-map { height: 440px; }
.chart-frame-narrow { max-width: 420px; }
.chart-stack { margin-top: 10px; }
.table-scroll {
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  min-width: 640px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ide-text-main);
  font-size: 13px;
}
.servicing-card {
  border: 1px solid #1e2a52;
  border-radius: 6px;
  overflow: hidden;
  min-width: 0;
}
.servicing-card-title {
  padding: 8px 10px;
  color: #ddd;
  font-size: 12px;
  background: #0b1020;
}
.servicing-table {
  width: 100%;
  border-collapse: collapse;
  color: #ddd;
  font-size: 12px;
}

.chart-legend {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ide-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--ide-text-main);
  font-size: 11px;
}

.chart-controls-bottom .chart-legend {
  order: 2;
  border-top: 1px solid var(--ide-border);
  border-bottom: 0;
}

.chart-control-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.market-rates-body #couponLegend {
  order: 3;
}

.market-rates-body #couponRangeControls {
  order: 2;
}

.market-rates-body .coupon-chart-frame {
  order: 1;
}

.coupon-endpoint-labels {
  position: absolute;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  overflow: hidden;
}

.coupon-endpoint-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(260px, calc(100% - 12px));
  min-height: 18px;
  padding: 3px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.coupon-endpoint-label.is-left-axis {
  margin-left: 0;
}

.coupon-endpoint-label.is-right-axis {
  margin-right: 0;
}

.coupon-endpoint-value {
  flex: 0 0 auto;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.coupon-endpoint-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-header {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 4px;
}

.legend-action-btn {
  background: transparent;
  border: none;
  color: var(--ide-accent);
  cursor: pointer;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0;
  transition: color 0.15s ease;
}

.legend-action-btn:hover {
  color: var(--ide-accent-hover);
  text-decoration: underline;
}

.legend-action-btn:active {
  opacity: 0.7;
}

.legend-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.legend-group-label {
  font-weight: 700;
  color: var(--ide-text-muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  margin-right: 8px;
  min-width: 70px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.legend-item.is-hidden {
  opacity: 0.35;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.05);
}

.legend-item input[type="checkbox"] {
  display: none;
}

.legend-swatch {
  width: 10px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}
.coupon-series-toggle,
.legend-close-btn {
  display: none;
}

/* --- HEATMAP (CONTRIBUTION GRAPH) --- */
.heatmap-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: auto;
  padding: 16px;
  background: var(--ide-panel-bg);
  border-radius: 8px;
  user-select: none;
}
.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(5, 10px);
  grid-auto-flow: column;
  grid-auto-columns: 10px;
  gap: 3px;
}
.heatmap-day-labels {
  display: grid;
  grid-template-rows: repeat(5, 10px);
  gap: 3px;
  font-size: 8px;
  color: var(--ide-text-muted);
  text-align: right;
  padding-right: 4px;
}
.heatmap-year-wrapper {
  display: flex;
  flex-direction: row;
}
.heatmap-year-label {
  width: 32px;
  font-size: 11px;
  color: var(--ide-text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}
.heatmap-month-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 10px;
  gap: 3px;
  font-size: 9px;
  color: var(--ide-text-muted);
  margin-left: 64px; /* year label + day labels width */
  margin-bottom: 4px;
}
.heatmap-square {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background-color: transparent; /* Empty color */
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.heatmap-square:hover {
  transform: scale(1.3);
  z-index: 10;
  outline: 1px solid var(--ide-accent);
  background-color: rgba(255, 255, 255, 0.1);
}

/* No data */
.no-data { background-color: transparent; border: 1px solid rgba(255, 255, 255, 0.05); }

.heatmap-legend-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ide-border);
}
.heatmap-legend-label {
  font-size: 10px;
  color: var(--ide-text-muted);
  margin: 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.heatmap-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
  z-index: 1000;
  display: none;
  border: 1px solid var(--ide-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  white-space: nowrap;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ide-bg); }
::-webkit-scrollbar-thumb { background: #464646; }
::-webkit-scrollbar-thumb:hover { background: #555; }
::-webkit-scrollbar-corner { background: var(--ide-bg); }

/* --- TEMP VIEWS --- */

/* Slim Sidebar View */
body.view-slim-sidebar .ide-tabs {
  display: none !important;
}

body.view-slim-sidebar .ide-sidebar {
  width: 72px;
  overflow-x: hidden;
  position: relative;
  z-index: 100;
  padding-top: 8px;
}

body.view-slim-sidebar .ide-sidebar-content {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 4px 8px 4px;
}

body.view-slim-sidebar .ide-sidebar-title {
  display: none;
}

body.view-slim-sidebar .ide-tree-header {
  display: block;
  font-size: 0;
  color: transparent;
  height: 1px;
  background-color: var(--ide-border);
  margin: 8px 16px 12px 16px;
  padding: 0;
}

body.view-slim-sidebar .ide-tree-header::before {
  content: none;
}

body.view-slim-sidebar .tree-item {
  justify-content: center;
  flex-direction: column;
  margin-left: 0;
  margin-bottom: 6px;
  padding: 8px 4px;
  position: relative;
  text-align: center;
  gap: 4px;
  border-radius: 6px;
}

body.view-slim-sidebar .tree-item svg {
  margin-right: 0 !important;
  width: 18px;
  height: 18px;
}

body.view-slim-sidebar .tree-item span {
  display: block;
  font-size: 9px;
  line-height: 1.1;
  white-space: normal;
  color: var(--ide-text-muted);
}

body.view-slim-sidebar .tree-item:hover span,
body.view-slim-sidebar .tree-item.active span {
  color: var(--ide-text-bright);
}

/* Platform (Top Nav) View */
body.view-platform .ide-sidebar {
  display: none !important;
}

body.view-platform .ide-tabs {
  height: 48px;
  padding: 0 12px;
  align-items: center;
  border-bottom: 1px solid var(--ide-border);
  gap: 4px;
}

body.view-platform .ide-tab {
  border: 1px solid transparent;
  border-radius: 6px;
  height: 32px;
  padding: 0 16px;
  margin: 0;
  background: transparent;
  transition: all 0.2s;
}

body.view-platform .ide-tab:hover {
  background: rgba(255,255,255,0.05);
}

body.view-platform .ide-tab.active {
  background: var(--ide-accent);
  color: #fff;
  border-color: var(--ide-accent-hover);
}

/* Extracted from webapp/index.html head styles. */
      .panel-source {
        margin-top: 4px;
        font-size: 11px;
        color: #9ca3af;
        letter-spacing: 0.02em;
        text-transform: uppercase;
      }
      .panel-source-missing {
        color: #ff6b6b;
      }
      #couponLegend {
        max-width: 100%;
        pointer-events: auto;
      }
      .coupon-range-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        background: #050505;
      }
      .coupon-range-btn {
        border: 1px solid #2e2e2e;
        background: #111;
        color: #c5c5c5;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.02em;
        border-radius: 6px;
        padding: 4px 8px;
        line-height: 1.2;
        cursor: pointer;
      }
      .coupon-range-btn:hover {
        border-color: #5a5a5a;
        color: #fff;
      }
      .coupon-range-btn.active {
        background: #e5e7eb;
        color: #111;
        border-color: #e5e7eb;
      }
      .coupon-axis-label {
        position: absolute;
        top: 50%;
        z-index: 20;
        pointer-events: none;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        padding: 0;
        border: 0;
        background: transparent;
        opacity: 0.7;
        text-shadow: 0 1px 3px #000;
      }
      .coupon-axis-label-left {
        left: 32px;
        color: #67e8f9;
        transform: translate(-50%, -50%) rotate(-90deg);
      }
      .coupon-axis-label-right {
        right: 32px;
        color: #e2e8f0;
        transform: translate(50%, -50%) rotate(90deg);
      }
      .mbs-basis-grid {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
        gap: 10px;
      }
      @media (max-width: 900px) {
        .mbs-basis-grid {
          grid-template-columns: 1fr;
        }
      }

      /* ===== Top bar / chrome rebuild =====================================
         Dense, terminal-leaning analytics layout: sharp 1px borders, no
         decorative gradients, monospace numerals on data, existing IDE
         tokens for consistency.                                          */
      .ide-menubar {
        display: flex;
        align-items: center;
        gap: 12px;
        height: 44px;
        padding: 0 12px;
        background: var(--ide-activity-bg);
        border-bottom: 1px solid var(--ide-border);
      }
      .ide-brand .brand-link {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: var(--ide-text-bright);
        text-decoration: none;
        font-weight: 600;
        font-size: 13px;
        letter-spacing: 0.01em;
      }
      .ide-brand .brand-name { font-weight: 700; }
      .ide-brand .brand-tag {
        font-weight: 400;
        font-size: 11px;
        color: var(--ide-text-muted);
        padding-left: 8px;
        margin-left: 2px;
        border-left: 1px solid var(--ide-border);
        letter-spacing: 0.02em;
      }
      .header-search {
        flex: 1;
        display: flex;
        justify-content: center;
        max-width: 560px;
        margin: 0 auto;
      }
      .header-search-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        height: 28px;
        padding: 0 10px;
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid var(--ide-border);
        border-radius: 4px;
        color: var(--ide-text-muted);
        font-size: 12px;
        font-family: var(--ide-font-ui);
        cursor: pointer;
        transition: border-color 0.12s, color 0.12s, background 0.12s;
      }
      .header-search-btn:hover {
        border-color: rgba(255, 255, 255, 0.22);
        color: var(--ide-text-main);
        background: rgba(0, 0, 0, 0.35);
      }
      .header-search-btn svg { flex-shrink: 0; opacity: 0.65; }
      .header-search-label {
        flex: 1;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .header-search-kbd {
        font: 10px/1 var(--ide-font-ui);
        font-weight: 500;
        color: var(--ide-text-muted);
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--ide-border);
        border-radius: 3px;
        padding: 2px 5px;
      }
      .ide-menubar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .header-icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 4px;
        color: var(--ide-text-muted);
        cursor: pointer;
      }
      .header-icon-btn:hover {
        border-color: var(--ide-border);
        color: var(--ide-text-main);
      }
      .settings-menu { position: relative; }
      .settings-dropdown {
        position: absolute;
        right: 0;
        top: calc(100% + 6px);
        min-width: 200px;
        background: var(--ide-panel-bg);
        border: 1px solid var(--ide-border);
        border-radius: 4px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        padding: 4px 0;
      }
      .settings-section-label {
        padding: 8px 12px 4px;
        font-size: 10px;
        font-weight: 600;
        color: var(--ide-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
      }
      .settings-row {
        padding: 6px 12px;
        font-size: 12px;
        color: var(--ide-text-main);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .settings-row:hover { background: rgba(255, 255, 255, 0.05); }
      .settings-check { color: var(--ide-accent); font-size: 10px; }

      /* Sidebar refresh — denser, drop per-item icons, uppercase headers */
      .ide-sidebar {
        display: flex;
        flex-direction: column;
        width: 200px;
        background: var(--ide-sidebar-bg);
        border-right: 1px solid var(--ide-border);
      }
      .ide-sidebar-content {
        flex: 1;
        overflow-y: auto;
        padding: 6px 0 12px;
      }
      .tree-group {
        padding: 6px 0;
        border-top: 1px solid transparent;
      }
      .tree-group:first-child { padding-top: 8px; }
      .tree-group .ide-tree-header {
        padding: 6px 14px 4px;
        font-size: 10px;
        font-weight: 600;
        color: var(--ide-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.1em;
      }
      .tree-group.section-active .ide-tree-header { color: var(--ide-text-bright); }
      .tree-item {
        position: relative;
        display: flex;
        align-items: center;
        padding: 4px 14px 4px 22px;
        font-size: 12.5px;
        color: var(--ide-text-main);
        cursor: pointer;
        border-left: 2px solid transparent;
        line-height: 1.5;
      }
      .tree-item::before {
        content: '';
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 3px;
        border-radius: 50%;
        background: var(--ide-text-muted);
        opacity: 0.4;
      }
      .tree-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--ide-text-bright); }
      .tree-item:hover::before { opacity: 0.8; }
      .tree-item.active {
        background: rgba(255, 255, 255, 0.06);
        color: var(--ide-text-bright);
        border-left-color: var(--ide-accent);
      }
      .tree-item.active::before { background: var(--ide-accent); opacity: 1; }
      /* Section tabs are mobile-only. The generic .tree-item display:flex in this
         refresh block re-shows them on desktop (overriding the earlier hide), so
         re-hide here. The <=900px block below restores them as the tab bar. */
      .mobile-primary-tab { display: none; }
      .ide-sidebar-footer {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 10px 14px;
        border-top: 1px solid var(--ide-border);
        font-size: 11px;
        color: var(--ide-text-muted);
      }
      .sidebar-footer-link {
        color: var(--ide-text-muted);
        cursor: pointer;
        text-decoration: none;
      }
      .sidebar-footer-link:hover { color: var(--ide-text-bright); }
      .sidebar-footer-version {
        font-variant-numeric: tabular-nums;
        font-size: 10px;
        opacity: 0.6;
      }

      /* Content header: breadcrumb + sub-tab strip */
.content-header {
        display: flex;
        flex-direction: column;
        flex: 0 0 auto;
        gap: 0;
        background: var(--ide-bg);
        border-bottom: 1px solid var(--ide-border);
      }
      .breadcrumb {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px 6px;
        font-size: 12px;
        color: var(--ide-text-muted);
      }
      .breadcrumb .bc-link {
        color: var(--ide-text-muted);
        text-decoration: none;
        cursor: pointer;
      }
      .breadcrumb .bc-link:hover { color: var(--ide-text-main); }
      .breadcrumb .bc-leaf {
        color: var(--ide-text-bright);
        font-weight: 500;
      }
      .breadcrumb .bc-sep {
        color: var(--ide-text-muted);
        opacity: 0.5;
        padding: 0 2px;
      }
      .sub-tab-strip {
        display: flex;
        align-items: stretch;
        gap: 0;
        padding: 0 12px;
      }
      .sub-tab {
        background: transparent;
        border: none;
        padding: 6px 12px 8px;
        margin: 0;
        font-size: 12px;
        font-weight: 500;
        color: var(--ide-text-muted);
        cursor: pointer;
        border-bottom: 2px solid transparent;
        transition: color 0.12s, border-color 0.12s;
        font-family: var(--ide-font-ui);
      }
      .sub-tab:hover { color: var(--ide-text-main); }
      .sub-tab.active {
        color: var(--ide-text-bright);
        border-bottom-color: var(--ide-accent);
      }

      /* ===== Splash mode (home page) ====================================
         When body.is-splash is set, hide the sidebar and content header so
         the home page gets the full width for the search hero.            */
      body.is-splash .ide-sidebar { display: none; }
      body.is-splash .content-header { display: none; }

      /* ===== Home page ================================================== */
      .home-stage {
        max-width: 920px;
        margin: 0 auto;
        padding: 96px 32px 48px;
        display: flex; flex-direction: column;
        align-items: center;
      }
      .home-eyebrow {
        font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
        color: var(--ide-text-muted);
        margin-bottom: 18px;
      }
      .home-h1 {
        font-size: 26px; font-weight: 500; letter-spacing: -0.01em;
        margin: 0 0 32px; text-align: center;
        color: var(--ide-text-bright);
        max-width: 760px;
      }
      .home-h1 b {
        font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
        font-variant-numeric: tabular-nums;
        font-weight: 600;
      }
      .home-search {
        width: 100%; max-width: 720px;
        display: flex; align-items: center; gap: 12px;
        padding: 0 18px; height: 56px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 8px;
        color: var(--ide-text-main);
        cursor: pointer;
        transition: border-color 0.15s, box-shadow 0.15s;
        font: inherit;
      }
      .home-search:hover {
        border-color: rgba(95, 180, 255, 0.5);
        box-shadow: 0 0 0 3px rgba(95, 180, 255, 0.10);
      }
      .home-search svg { color: var(--ide-text-muted); flex-shrink: 0; }
      .home-search-label {
        flex: 1; text-align: left;
        font-size: 16px; color: var(--ide-text-muted);
      }
      .home-search-kbd {
        font: 11px/1 var(--ide-font-ui);
        color: var(--ide-text-muted);
        padding: 3px 7px;
        border: 1px solid var(--ide-border);
        border-radius: 3px;
        background: rgba(255, 255, 255, 0.03);
      }

      .home-nav {
        margin-top: 14px;
        display: flex; gap: 22px; flex-wrap: wrap; justify-content: center;
      }
      .home-nav a {
        font-size: 13px; color: var(--ide-text-muted);
        text-decoration: none;
        cursor: pointer;
        padding: 4px 0;
        border-bottom: 1px solid transparent;
      }
      .home-nav a:hover { color: var(--ide-text-bright); border-bottom-color: rgba(95, 180, 255, 0.5); }

      .home-pill-row {
        margin-top: 32px; width: 100%; max-width: 720px;
      }
      .home-pill-label {
        font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
        color: var(--ide-text-muted);
        margin-bottom: 8px;
      }
      .home-pills { display: flex; flex-wrap: wrap; gap: 8px; }
      .home-pill {
        display: inline-flex; align-items: center; gap: 6px;
        padding: 6px 12px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--ide-border);
        border-radius: 999px;
        color: var(--ide-text-main);
        font-size: 12px;
        cursor: pointer;
      }
      .home-pill:hover { border-color: rgba(255, 255, 255, 0.22); color: var(--ide-text-bright); }
      .home-pill .rk { font-family: "JetBrains Mono", monospace; color: var(--ide-text-muted); font-size: 10px; }
      .home-pill .vol {
        font-family: "JetBrains Mono", monospace; color: var(--ide-text-muted);
        font-size: 11px; padding-left: 4px; border-left: 1px solid var(--ide-border); margin-left: 2px;
      }

      .home-ambient {
        margin-top: 40px;
        width: 100%; max-width: 920px;
        position: relative;
      }
      .home-amb-row {
        display: grid;
        grid-template-columns: 1.4fr auto;
        gap: 18px;
        align-items: stretch;
      }
      .home-anchor {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--ide-border);
        border-radius: 6px;
        padding: 16px 18px;
        display: flex; flex-direction: column; gap: 6px;
        cursor: pointer;
        transition: border-color 0.15s;
      }
      .home-anchor:hover { border-color: rgba(255, 255, 255, 0.22); }
      .home-anchor-eyebrow {
        display: flex; align-items: center; gap: 8px;
        font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
        color: var(--ide-text-muted);
      }
      .home-anchor-eyebrow .dot {
        width: 5px; height: 5px; border-radius: 50%;
        background: #4ade80;
        box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.18);
      }
      .home-anchor-eyebrow .when {
        font-family: "JetBrains Mono", monospace; font-size: 10px;
      }
      .home-update-list {
        list-style: none;
        display: grid;
        gap: 8px;
        margin: 6px 0 0;
        padding: 0;
      }
      .home-update-list li {
        display: grid;
        grid-template-columns: minmax(78px, 104px) minmax(0, 1fr);
        gap: 10px;
        align-items: baseline;
        min-height: 20px;
      }
      .home-update-date {
        color: var(--ide-accent);
        font-family: "JetBrains Mono", monospace;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
      }
      .home-update-main {
        color: var(--ide-text-bright);
        font-size: 13px;
        line-height: 1.35;
        min-width: 0;
      }
      .home-update-meta {
        color: var(--ide-text-muted);
      }
      .home-anchor-foot {
        margin-top: auto; padding-top: 12px;
        font-size: 11px; color: var(--ide-accent);
      }

      .home-chips {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 6px;
      }
      .home-chip {
        width: 92px; height: 40px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--ide-border);
        border-radius: 4px;
        cursor: pointer;
        transition: border-color 0.15s, transform 0.15s;
        overflow: hidden;
        display: flex; align-items: center; justify-content: center;
        padding: 4px 6px;
      }
      .home-chip:hover { border-color: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
      .home-chip svg { width: 100%; height: 100%; }

      /* Tooltip for chips reuses the .amb-tooltip skin */
      .amb-tooltip {
        position: absolute;
        z-index: 50;
        min-width: 240px;
        padding: 12px 14px;
        background: var(--ide-panel-bg);
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 6px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
        pointer-events: none;
        opacity: 0;
        transform: translateY(-2px);
        transition: opacity 0.12s, transform 0.12s;
      }
      .amb-tooltip.is-open { opacity: 1; transform: translateY(0); }
      .amb-tt-l { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ide-text-muted); margin-bottom: 4px; }
      .amb-tt-row { display: flex; align-items: baseline; gap: 8px; font-family: "JetBrains Mono", monospace; }
      .amb-tt-v { font-size: 18px; font-weight: 600; color: var(--ide-text-bright); }
      .amb-tt-d { font-size: 11px; }
      .amb-tt-d.up { color: #4ade80; }
      .amb-tt-d.down { color: #f87171; }
      .amb-tt-spark { width: 100%; height: 36px; margin: 8px 0; opacity: 0.85; }
      .amb-tt-blurb { font-size: 11px; color: var(--ide-text-muted); line-height: 1.5; }

      .home-context-strip {
        margin-top: 36px;
        padding-top: 22px;
        border-top: 1px solid var(--ide-border);
        width: 100%; max-width: 720px;
        display: flex; gap: 28px; flex-wrap: wrap; justify-content: center;
        font-family: "JetBrains Mono", monospace;
        font-size: 12px; color: var(--ide-text-muted);
      }
      .home-context-strip .ctx { display: inline-flex; align-items: center; gap: 6px; }
      .home-context-strip .l { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ide-text-muted); }
      .home-context-strip .v { font-weight: 600; color: var(--ide-text-bright); font-size: 13px; }
      .home-context-strip .d.up { color: #4ade80; }
      .home-context-strip .d.down { color: #f87171; }

      /* ===== Map page =================================================== */
      .map-shell { padding: 14px; }
      .map-controls {
        display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
        margin-top: 12px;
      }
      .metric-tabs {
        display: inline-flex;
        border: 1px solid var(--ide-border);
        border-radius: 4px;
        overflow: hidden;
      }
      .metric-tab {
        padding: 6px 14px;
        background: transparent;
        color: var(--ide-text-muted);
        font-size: 12px; font-weight: 500;
        cursor: pointer;
        border: none; border-right: 1px solid var(--ide-border);
        font-family: inherit;
      }
      .metric-tab:last-child { border-right: none; }
      .metric-tab.active { background: rgba(95, 180, 255, 0.12); color: var(--ide-text-bright); }
      .metric-tab:hover:not(.active) { color: var(--ide-text-main); }
      .eris-summary-line {
        color: var(--ide-text-muted);
        font-size: 12px;
        line-height: 1.6;
        margin-bottom: 12px;
      }
      .eris-summary-line b { color: var(--ide-text-bright); font-weight: 600; }
      .eris-data-source-foot {
        color: var(--ide-text-muted);
        font-size: 12px;
        line-height: 1.6;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid var(--ide-border, #222);
      }
      .eris-data-source-foot a { color: var(--ide-accent, #5fd1a5); text-decoration: none; }
      .eris-data-source-foot a:hover { text-decoration: underline; }
      .eris-kpi-grid {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 12px;
      }
      .eris-kpi {
        border: 1px solid var(--ide-border);
        background: rgba(255, 255, 255, 0.03);
        border-radius: 4px;
        padding: 10px 12px;
        min-width: 0;
      }
      .eris-kpi .label {
        color: var(--ide-text-muted);
        font-size: 10px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .eris-kpi .value {
        color: var(--ide-text-bright);
        font-family: "JetBrains Mono", monospace;
        font-size: 18px;
        font-weight: 600;
        margin-top: 5px;
        font-variant-numeric: tabular-nums;
      }
      .eris-kpi .sub {
        color: var(--ide-text-muted);
        font-size: 11px;
        margin-top: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .eris-chart-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
      }
      .eris-chart {
        width: 100%;
        min-width: 0;
      }
      @media (max-width: 1100px) {
        .eris-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .eris-chart-grid { grid-template-columns: 1fr; }
      }
      .map-vintage-label {
        display: inline-flex; align-items: center; gap: 6px;
        font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
        color: var(--ide-text-muted);
      }
      .map-vintage-label select {
        padding: 4px 6px;
        background: rgba(0, 0, 0, 0.4);
        color: var(--ide-text-main);
        border: 1px solid var(--ide-border);
        border-radius: 3px;
        font-family: "JetBrains Mono", monospace;
        font-size: 12px;
      }
      .map-subtitle { font-size: 12px; color: var(--ide-text-muted); margin-left: auto; }
      .map-grid {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: 14px;
      }
      .map-canvas { width: 100%; min-height: 540px; }
      .map-side {
        border-left: 1px solid var(--ide-border);
        padding: 0 0 0 16px;
        display: flex; flex-direction: column; gap: 18px;
      }
      .map-side h4 {
        margin: 0; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
        color: var(--ide-text-muted); font-weight: 600;
      }
      .map-selected {
        padding: 12px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--ide-border);
        border-radius: 4px;
      }
      .map-selected .state-stat { font-family: "JetBrains Mono", monospace; font-size: 26px; font-weight: 600; color: var(--ide-text-bright); }
      .map-selected .state-blurb { font-size: 12px; color: var(--ide-text-muted); margin-top: 6px; }
      .map-ranks { display: flex; flex-direction: column; gap: 4px; }
      .map-ranks .rank-row {
        display: grid; grid-template-columns: 22px 1fr auto;
        gap: 8px;
        padding: 6px 8px;
        align-items: center;
        font-size: 12px;
        border-radius: 3px;
      }
      .map-ranks .rank-row:hover { background: rgba(255, 255, 255, 0.04); }
      .map-ranks .rank-row .rk { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--ide-text-muted); text-align: right; }
      .map-ranks .rank-row .v { font-family: "JetBrains Mono", monospace; color: var(--ide-text-main); }
      @media (max-width: 900px) {
        .map-grid { grid-template-columns: 1fr; }
        .map-side { border-left: none; border-top: 1px solid var(--ide-border); padding: 16px 0 0; }
      }

      /* ===== Themes ===================================================== */
      /* Default theme is "terminal" — what we just built. Overrides below. */
      body.theme-editorial {
        --ide-bg: #0e0e10;
        --ide-panel-bg: #16161a;
        --ide-sidebar-bg: #131316;
        --ide-activity-bg: #131316;
        --ide-border: rgba(255, 255, 255, 0.08);
        --ide-accent: #5fb4ff;
        --ide-text-main: #ececf1;
        --ide-text-muted: rgba(236, 236, 241, 0.6);
        --ide-text-bright: #ffffff;
      }
      body.theme-editorial .home-h1,
      body.theme-editorial .panel-header h3 {
        font-family: "Charter", "Iowan Old Style", "Source Serif Pro", Georgia, serif;
        font-weight: 500; letter-spacing: -0.01em;
      }
      body.theme-editorial .home-h1 { font-size: 32px; }
      body.theme-editorial .home-stage { padding-top: 120px; }

      body.theme-minimal {
        --ide-bg: #0c0c0e;
        --ide-panel-bg: #161618;
        --ide-sidebar-bg: #131315;
        --ide-activity-bg: #131315;
        --ide-border: rgba(255, 255, 255, 0.07);
        --ide-accent: #5fb4ff;
        --ide-text-main: #f0f0f4;
        --ide-text-muted: #8a8a96;
        --ide-text-bright: #ffffff;
      }
      body.theme-minimal .home-h1 { font-weight: 400; }
      body.theme-minimal .home-stage { padding-top: 120px; }
      body.theme-minimal .home-ambient { display: none; }
      body.theme-minimal .home-pill-row { margin-top: 24px; }

      body.theme-newsprint {
        --ide-bg: #fafaf7;
        --ide-panel-bg: #ffffff;
        --ide-sidebar-bg: #f3f3ee;
        --ide-activity-bg: #f3f3ee;
        --ide-border: #d8d8d4;
        --ide-accent: #1d4ed8;
        --ide-text-main: #2c2c30;
        --ide-text-muted: #6b6b72;
        --ide-text-bright: #0f0f10;
      }
      body.theme-newsprint .home-h1,
      body.theme-newsprint .brand-name,
      body.theme-newsprint .panel-header h3 {
        font-family: "Charter", "Iowan Old Style", "Source Serif Pro", "Times New Roman", Georgia, serif;
        font-weight: 500;
      }
      body.theme-newsprint .home-h1 { font-size: 30px; color: #0f0f10; }
      body.theme-newsprint .home-context-strip .v { color: #0f0f10; }
      body.theme-newsprint .home-context-strip .d.down { color: #b91c1c; }
      body.theme-newsprint .home-context-strip .d.up { color: #16a34a; }

      /* Mobile responsive — collapse sidebar to top bar at narrow viewports */
      @media (max-width: 900px) {
        .ide-main-container {
          flex-direction: column;
        }
        .ide-editor-area {
          width: 100%;
          min-width: 0;
        }
        .ide-sidebar {
          width: 100%;
          flex: 0 0 auto;
          flex-direction: row;
          border-right: none;
          border-bottom: 1px solid var(--ide-border);
          overflow-x: hidden;
        }
        .ide-sidebar-content {
          display: grid;
          grid-template-columns: repeat(4, minmax(0, 1fr));
          padding: 0;
          width: 100%;
          overflow-x: hidden;
        }
        .tree-group {
          display: block;
          min-width: 0;
          padding: 0;
        }
        .tree-group:first-child {
          padding-top: 0;
        }
        .tree-group .ide-tree-header { display: none; }
        .tree-group > .tree-item:not(.mobile-primary-tab) { display: none !important; }
        .mobile-primary-tab {
          display: flex;
          justify-content: center;
          align-items: center;
          box-sizing: border-box;
          width: 100%;
          height: 44px;
          margin: 0;
          padding: 0 8px;
          border-left: 0;
          border-bottom: 2px solid transparent;
        }
        body.theme-pro .mobile-primary-tab {
          margin: 0;
          padding: 0 8px;
        }
        .tree-item { white-space: nowrap; }
        .tree-item::before { display: none; }
        .tree-item.active { border-left-color: transparent; border-bottom-color: var(--ide-accent); }
        .ide-sidebar-footer { display: none; }
        .header-search { max-width: 240px; }
        .header-search-label { display: none; }
        .ide-brand .brand-tag { display: none; }
      }

      @media (max-width: 900px) {
        .chart-grid-2,
        .chart-grid-3,
        .table-card-grid,
        .compare-control-grid {
          grid-template-columns: 1fr;
        }
      }

      @media (max-width: 600px) {
        .ide-menubar {
          gap: 8px;
          padding: 0 8px;
        }
        .header-search {
          flex: 1;
          min-width: 40px;
          max-width: none;
        }
        .dashboard-content {
          padding: 10px;
        }
        body.theme-pro .dashboard-content {
          padding: 14px;
        }
        .panel {
          margin-bottom: 12px;
        }
        .panel-header {
          align-items: flex-start;
          gap: 8px;
          padding: 10px 12px;
        }
        .panel-header h3 {
          font-size: 13px;
          line-height: 1.35;
        }
        .panel-actions {
          display: flex;
          flex-wrap: wrap;
          gap: 6px;
        }
        .kpi-grid {
          grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
        }
        .chart-panel-with-controls {
          display: flex;
          flex-direction: column;
        }
        .chart-panel-with-controls .chart-control-tray {
          order: -1;
        }
        .coupon-range-controls,
        .chart-control-tray,
        .map-controls {
          position: sticky;
          top: 0;
          z-index: 40;
          background: rgba(5, 5, 5, 0.96);
          backdrop-filter: blur(10px);
          -webkit-backdrop-filter: blur(10px);
          border-top: 1px solid rgba(255, 255, 255, 0.10);
          border-bottom: 1px solid rgba(255, 255, 255, 0.12);
          box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
        }
        .market-rates-body #couponRangeControls {
          order: -1;
        }
        .coupon-range-controls {
          display: grid;
          grid-template-columns: repeat(4, minmax(0, 1fr));
          overflow-x: hidden;
          scrollbar-width: none;
          align-items: center;
        }
        .coupon-range-controls::-webkit-scrollbar {
          display: none;
        }
        .coupon-range-btn {
          min-width: 0;
          width: 100%;
          padding-left: 6px;
          padding-right: 6px;
          text-align: center;
        }
        .coupon-series-toggle {
          position: static;
          grid-column: 1 / -1;
          z-index: 1;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          min-height: 36px;
          width: 100%;
          padding: 8px 12px;
          border: 1px solid rgba(95, 180, 255, 0.45);
          border-radius: 6px;
          background: #102033;
          color: #dcecff;
          font: inherit;
          font-size: 11px;
          font-weight: 700;
          letter-spacing: 0.02em;
          box-shadow: none;
        }
        .coupon-series-toggle[aria-expanded="true"] {
          background: #e5e7eb;
          border-color: #e5e7eb;
          color: #111;
        }
        .coupon-endpoint-label {
          max-width: min(260px, calc(100% - 16px));
          gap: 4px;
          padding: 3px 5px;
          font-size: 10px;
        }
        .coupon-axis-label {
          font-size: 9px;
          letter-spacing: 0.06em;
        }
        .coupon-axis-label-left {
          left: 9px;
        }
        .coupon-axis-label-right {
          right: 9px;
        }
        .market-rates-body #couponLegend {
          display: none;
        }
        .market-rates-body #couponLegend.is-open {
          position: fixed;
          left: 10px;
          right: 10px;
          bottom: 10px;
          z-index: 1200;
          display: flex;
          max-height: min(66vh, 540px);
          overflow-y: auto;
          overscroll-behavior: contain;
          padding: 12px;
          border: 1px solid rgba(255, 255, 255, 0.18);
          border-radius: 8px;
          background: rgba(8, 10, 14, 0.98);
          box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7);
        }
        .market-rates-body #couponLegend .legend-header {
          position: sticky;
          top: -12px;
          z-index: 1;
          justify-content: flex-start;
          margin: -12px -12px 4px;
          padding: 12px;
          background: rgba(8, 10, 14, 0.98);
          border-bottom: 1px solid rgba(255, 255, 255, 0.10);
        }
        .market-rates-body #couponLegend .legend-close-btn {
          display: inline-flex;
          margin-left: auto;
        }
        .market-rates-body #couponLegend .legend-group {
          display: grid;
          grid-template-columns: 1fr;
          gap: 6px;
        }
        .market-rates-body #couponLegend .legend-group-label {
          min-width: 0;
          margin: 4px 0 0;
        }
        .market-rates-body #couponLegend .legend-item {
          min-height: 34px;
          padding: 7px 10px;
        }
        .chart-control-tray {
          justify-content: flex-start;
          margin: -10px -10px 10px;
          padding: 8px 10px;
        }
        .map-shell {
          display: flex;
          flex-direction: column;
          gap: 10px;
          padding: 10px;
        }
        .map-controls {
          order: -1;
          margin: -10px -10px 0;
          padding: 8px 10px;
        }
        .chart-frame-xs { height: clamp(240px, 56vh, 300px); }
        .chart-frame-sm { height: clamp(260px, 58vh, 320px); }
        .chart-frame-md { height: clamp(280px, 62vh, 360px); }
        .chart-frame-lg { height: clamp(300px, 66vh, 420px); }
        .chart-frame-xl,
        .chart-frame-2xl,
        .chart-frame-surface,
        .chart-frame-map {
          height: clamp(320px, 70vh, 480px);
        }
        .table-scroll table {
          min-width: 620px;
          font-size: 12px;
        }
        .btn,
        .btn-small,
        .coupon-range-btn,
        .metric-tab,
        .tree-item,
        .settings-row,
        .home-pill,
        .lender-compare-slot,
        .lender-search-row {
          min-height: 36px;
        }
        .btn-small,
        .coupon-range-btn,
        .metric-tab,
        .tree-item {
          padding: 8px 12px;
        }
        .home-stage {
          padding: 48px 16px 24px;
        }
        body.theme-editorial .home-stage,
        body.theme-minimal .home-stage {
          padding-top: 64px;
        }
        .home-h1,
        body.theme-editorial .home-h1,
        body.theme-newsprint .home-h1 {
          font-size: 22px;
          line-height: 1.25;
        }
        .home-search,
        .home-pill-row,
        .home-context-strip {
          width: 100%;
        }
        .home-search-label {
          font-size: 14px;
        }
        .home-search-kbd,
        .header-search-kbd,
        .lender-profile-kbd-group,
        .lender-search-footer-tips {
          display: none;
        }
        .home-amb-row {
          grid-template-columns: 1fr;
        }
        .home-chips {
          grid-template-columns: repeat(3, minmax(0, 1fr));
          grid-template-rows: none;
        }
        .home-chip {
          width: 100%;
        }
        .home-context-strip {
          justify-content: flex-start;
          gap: 10px 16px;
        }
        .map-controls {
          flex-direction: column;
          align-items: stretch;
        }
        .metric-tabs {
          width: 100%;
          overflow-x: auto;
        }
        .metric-tab {
          flex: 0 0 auto;
        }
        .map-vintage-label {
          justify-content: space-between;
        }
        .map-subtitle {
          margin-left: 0;
        }
        .lender-profile-hero {
          padding: 48px 16px 64px;
        }
        .lender-profile-search-button {
          min-width: 0;
          width: 100%;
        }
        .lender-search-overlay {
          padding: 0;
          align-items: stretch;
        }
        .lender-search-modal {
          width: 100%;
          max-height: 100vh;
          border-radius: 0;
          border-left: 0;
          border-right: 0;
        }
      }

      @media (max-width: 380px) {
        .brand-tag,
        .home-search-kbd,
        .header-search-kbd {
          display: none;
        }
        .coupon-range-btn {
          padding-left: 6px;
          padding-right: 6px;
        }
      }

      /* --- Lender Profile hero --- */
      .lender-profile-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 80px 24px 96px;
        text-align: center;
        background:
          radial-gradient(circle at 50% 20%, rgba(10, 132, 255, 0.18), transparent 60%),
          #000;
        color: #e5e7eb;
      }
      .lender-profile-hero-icon {
        color: rgba(255, 255, 255, 0.55);
      }
      .lender-profile-hero-title {
        margin: 0;
        font-size: 26px;
        font-weight: 600;
        letter-spacing: -0.01em;
        color: #fff;
      }
      .lender-profile-hero-subtitle {
        margin: 0;
        font-size: 14px;
        color: #9ca3af;
        max-width: 520px;
      }
      .lender-profile-search-button {
        margin-top: 12px;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        min-width: 380px;
        padding: 12px 14px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        color: #c5c5c5;
        font-size: 14px;
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s;
      }
      .lender-profile-search-button:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.2);
      }
      .lender-profile-search-label {
        flex: 1;
        text-align: left;
      }
      .lender-profile-kbd-group {
        display: inline-flex;
        gap: 4px;
      }
      .lender-profile-kbd {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
        font: 11px/1 var(--ide-font-ui, system-ui);
        color: #cbd5e1;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 5px;
      }
      .lender-profile-hero-tips {
        margin-top: 18px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 18px;
        font-size: 12px;
        color: #94a3b8;
      }
      .lender-profile-hero-tips kbd {
        margin-right: 4px;
      }

      /* --- Search modal --- */
      .lender-search-overlay {
        position: fixed;
        inset: 0;
        z-index: 9000;
        display: none;
        align-items: flex-start;
        justify-content: center;
        padding: 14vh 16px 16px;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
      }
      .lender-search-overlay.is-open {
        display: flex;
      }
      .lender-search-modal {
        width: min(720px, 100%);
        max-height: 70vh;
        display: flex;
        flex-direction: column;
        background: rgba(28, 28, 30, 0.96);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 14px;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
        overflow: hidden;
        color: #e5e7eb;
      }
      .lender-search-input-row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      }
      .lender-search-input-row svg {
        opacity: 0.55;
        flex-shrink: 0;
      }
      .lender-search-input {
        flex: 1;
        background: transparent;
        border: none;
        outline: none;
        color: #fff;
        font-size: 18px;
        font-weight: 400;
        font-family: var(--ide-font-ui, system-ui);
      }
      .lender-search-input::placeholder {
        color: rgba(255, 255, 255, 0.35);
      }
      .lender-search-results {
        flex: 1;
        overflow-y: auto;
        padding: 6px 0;
      }
      .lender-search-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px 6px;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: rgba(255, 255, 255, 0.55);
      }
      .lender-search-section-header .count {
        font-variant-numeric: tabular-nums;
      }
      .lender-search-section-actions {
        display: inline-flex;
        align-items: center;
        gap: 10px;
      }
      .lender-search-view-all {
        font-size: 11px;
        text-transform: none;
        letter-spacing: 0.02em;
        color: #5fb4ff;
        text-decoration: none;
        cursor: pointer;
      }
      .lender-search-view-all:hover {
        text-decoration: underline;
      }
      .lender-search-row {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 9px 16px;
        cursor: pointer;
        border-left: 2px solid transparent;
      }
      .lender-search-row.is-active {
        background: rgba(10, 132, 255, 0.16);
        border-left-color: #0a84ff;
      }
      .lender-search-row .row-name {
        font-size: 14px;
        font-weight: 500;
        color: #fff;
      }
      .lender-search-row .row-meta {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.55);
      }
      .lender-search-row .row-meta b {
        color: rgba(255, 255, 255, 0.78);
        font-weight: 600;
      }
      .lender-search-empty {
        padding: 28px 16px;
        text-align: center;
        color: rgba(255, 255, 255, 0.5);
        font-size: 13px;
      }
      .lender-search-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        font-size: 11px;
        color: rgba(255, 255, 255, 0.55);
        background: rgba(0, 0, 0, 0.2);
      }
      .lender-search-footer-tips {
        display: flex;
        gap: 14px;
        flex-wrap: wrap;
      }
      .lender-search-footer-tips span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
      }
      /* --- Browse Lenders (advanced search) --- */
      .lender-browse-filters {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
      }
      .lender-browse-search {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 6px;
        color: #fff;
        outline: none;
      }
      .lender-browse-search:focus {
        border-color: rgba(10, 132, 255, 0.6);
      }
      .lender-browse-filter-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
        align-items: end;
      }
      .lender-browse-filter-row label {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 11px;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: 0.04em;
      }
      .lender-browse-filter-row select,
      .lender-browse-filter-row input {
        padding: 7px 8px;
        font-size: 13px;
        background: #0b1020;
        color: #fff;
        border: 1px solid #1e2a52;
        border-radius: 4px;
        text-transform: none;
      }
      .lender-browse-filter-row .btn {
        align-self: end;
        height: 32px;
      }
      .lender-browse-status {
        font-size: 12px;
        color: #9ca3af;
        margin: 6px 0 8px;
      }
      .lender-browse-table-wrap {
        overflow: auto;
        max-height: 65vh;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 6px;
      }
      .lender-browse-table {
        width: 100%;
        border-collapse: collapse;
        color: #e5e7eb;
        font-size: 13px;
      }
      .lender-browse-table thead th {
        position: sticky;
        top: 0;
        background: rgba(255, 255, 255, 0.04);
        backdrop-filter: blur(6px);
        text-align: left;
        padding: 9px 10px;
        font-weight: 600;
        font-size: 11px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #9ca3af;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1;
      }
      .lender-browse-table th.num,
      .lender-browse-table td.num {
        text-align: right;
        font-variant-numeric: tabular-nums;
      }
      .lender-browse-table th.sortable {
        cursor: pointer;
        user-select: none;
      }
      .lender-browse-table th.sortable:hover {
        color: #fff;
      }
      .lender-browse-table th .sort-indicator {
        opacity: 0.4;
        margin-left: 2px;
      }
      .lender-browse-table th.is-sorted .sort-indicator {
        opacity: 1;
        color: #0a84ff;
      }
      .lender-browse-table tbody tr {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      }
      .lender-browse-table tbody tr:hover {
        background: rgba(10, 132, 255, 0.08);
        cursor: pointer;
      }
      .lender-browse-table tbody td {
        padding: 8px 10px;
      }
      .lender-browse-table .lender-browse-empty {
        text-align: center;
        color: #9ca3af;
        padding: 28px;
      }
      .lender-browse-table .charter-pill {
        display: inline-block;
        font-size: 11px;
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.06);
        color: #cbd5e1;
        white-space: nowrap;
      }
      .lender-browse-table .charter-pill.bank          { background: rgba(10, 132, 255, 0.18); color: #93c5fd; }
      .lender-browse-table .charter-pill.credit-union  { background: rgba(34, 197, 94, 0.18); color: #86efac; }
      .lender-browse-table .charter-pill.imc           { background: rgba(244, 114, 182, 0.18); color: #f9a8d4; }
      .lender-browse-table .charter-pill.affiliate     { background: rgba(251, 191, 36, 0.18); color: #fde68a; }
      .lender-browse-table .charter-pill.mbs           { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
      .lender-browse-table .charter-pill.other         { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
      .lender-browse-pagination {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-top: 12px;
        font-size: 12px;
        color: #9ca3af;
      }
      .lender-browse-pagination .btn[disabled] {
        opacity: 0.4;
        cursor: not-allowed;
      }
      .lender-browse-aggregate {
        margin-left: auto;
        color: #cbd5e1;
      }
      .lender-browse-aggregate b {
        color: #4ade80;
        font-weight: 600;
      }

      /* --- Lender Compare slot picker (looks like the search button) --- */
      .lender-compare-slot {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin-top: 5px;
        padding: 9px 12px;
        background: #0b1020;
        color: #fff;
        border: 1px solid #1e2a52;
        border-radius: 4px;
        font-size: 13px;
        text-align: left;
        cursor: pointer;
        transition: border-color 0.15s, background 0.15s;
      }
      .lender-compare-slot:hover {
        border-color: #3b5db5;
        background: #0f152e;
      }
      .lender-compare-slot[data-lender=""] .slot-name {
        color: #9ca3af;
      }
      .lender-compare-slot .slot-name {
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .lender-compare-slot .slot-meta {
        font-size: 11px;
        color: #9ca3af;
        white-space: nowrap;
      }
      .lender-search-footer kbd {
        font: 10px/1 var(--ide-font-ui, system-ui);
        color: #cbd5e1;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 4px;
        padding: 2px 5px;
        min-width: 16px;
        text-align: center;
      }

/* Extracted from webapp/index.html heatmap-lab scoped styles. */
            .heatmap-lab-grid {
              display: grid;
              grid-template-columns: repeat(2, minmax(0, 1fr));
              gap: 12px;
            }
            @media (max-width: 1100px) { .heatmap-lab-grid { grid-template-columns: 1fr; } }
            #content-heatmap_lab .lab-card {
              background: linear-gradient(180deg, #121722 0%, #111723 100%);
              border: 1px solid #222b3d;
              border-radius: 10px;
              overflow: hidden;
              box-shadow: 0 8px 24px rgba(0,0,0,0.28);
            }
            #content-heatmap_lab .lab-card-header {
              padding: 10px 12px;
              border-bottom: 1px solid #232c3f;
              background: linear-gradient(90deg, rgba(77,182,255,0.08), rgba(77,182,255,0));
            }
            #content-heatmap_lab .lab-card-title { font-size: 13px; font-weight: 700; color: #e8edf6; }
            #content-heatmap_lab .lab-card-sub { margin-top: 2px; font-size: 11px; color: #99a6bd; }
            #content-heatmap_lab .lab-card-body { padding: 10px; }
            #content-heatmap_lab .lab-hm { display: grid; gap: 2px; }
            #content-heatmap_lab .lab-hm-row { display: grid; grid-template-columns: 52px 1fr; gap: 6px; align-items: center; }
            #content-heatmap_lab .lab-hm-y { color: #99a6bd; font-size: 11px; text-align: right; padding-right: 4px; }
            #content-heatmap_lab .lab-hm-cells { display: grid; gap: 2px; }
            #content-heatmap_lab .lab-cell { border: 1px solid rgba(255,255,255,0.03); border-radius: 2px; min-height: 14px; }
            #content-heatmap_lab .lab-month-labels { margin-left: 58px; margin-bottom: 4px; color: #99a6bd; font-size: 10px; display: grid; gap: 2px; }
            #content-heatmap_lab .lab-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
            #content-heatmap_lab .lab-cols-53 { grid-template-columns: repeat(53, minmax(0, 1fr)); }
            #content-heatmap_lab .lab-cols-26 { grid-template-columns: repeat(26, minmax(0, 1fr)); }
            #content-heatmap_lab .lab-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
            #content-heatmap_lab .lab-mini-title { font-size: 11px; color: #99a6bd; margin-bottom: 6px; }
            #content-heatmap_lab .lab-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #99a6bd; font-size: 11px; }
            #content-heatmap_lab .lab-legend-scale { width: 120px; height: 8px; border-radius: 6px; border: 1px solid #2b344a; }
            #content-heatmap_lab .lab-pill-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
            #content-heatmap_lab .lab-pill { font-size: 11px; padding: 4px 8px; border-radius: 999px; background: #1d2536; color: #99a6bd; border: 1px solid #2d3852; }
            #content-heatmap_lab .lab-timeline { height: 210px; width: 100%; border: 1px solid #253047; border-radius: 8px; background: #0d1320; }
            #content-heatmap_lab .lab-weekly { display: grid; grid-template-columns: 52px 1fr; gap: 6px; margin-top: 4px; }
            #content-heatmap_lab .lab-events { display: grid; grid-template-columns: 1fr 260px; gap: 8px; }
            @media (max-width: 1100px) { #content-heatmap_lab .lab-events { grid-template-columns: 1fr; } }
            #content-heatmap_lab .lab-event-list { border: 1px solid #26314a; border-radius: 8px; padding: 8px; max-height: 245px; overflow: auto; background: #0d1220; }
            #content-heatmap_lab .lab-event-item { font-size: 11px; color: #99a6bd; padding: 5px 0; border-bottom: 1px solid #1f2a40; }
            #content-heatmap_lab .lab-event-item:last-child { border-bottom: 0; }
            #content-heatmap_lab .lab-event-item b { color: #e8edf6; }
            #content-heatmap_lab .lab-desk { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
            @media (max-width: 1100px) { #content-heatmap_lab .lab-desk { grid-template-columns: 1fr; } }
            #content-heatmap_lab .lab-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
            #content-heatmap_lab .lab-kpi { border: 1px solid #2b3550; border-radius: 8px; padding: 8px; background: #0f1625; }
            #content-heatmap_lab .lab-kpi-label { color: #99a6bd; font-size: 11px; }
            #content-heatmap_lab .lab-kpi-value { margin-top: 2px; font-size: 19px; font-weight: 700; color: #e8edf6; }
            #content-heatmap_lab .lab-spark { height: 118px; width: 100%; border: 1px solid #26314a; border-radius: 8px; background: #0d1220; }
            #content-heatmap_lab .heatmap-lab-loading { color: #99a6bd; font-size: 12px; padding: 12px; grid-column: 1 / -1; }

/* ---------- Site footer (visible on every route) ---------- */
.site-footer {
  border-top: 1px solid var(--ide-border);
  background: var(--ide-sidebar-bg, var(--ide-bg));
  color: var(--ide-text-muted);
  font-family: var(--ide-font-ui);
  font-size: 11px;
  padding: 7px 16px;
}
.site-footer-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
}
.site-footer-tagline { letter-spacing: 0.02em; }
.site-footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.site-footer-links a {
  color: var(--ide-text-muted);
  text-decoration: none;
}
.site-footer-links a:hover {
  color: var(--ide-text-bright);
  text-decoration: underline;
}
body.is-splash .site-footer {
  background: transparent;
  border-top-color: transparent;
}

/* ---------- Static policy pages (disclaimer, privacy) ---------- */
.static-policy-body {
  max-width: 720px;
  margin: 24px auto 48px;
  padding: 0 20px;
  font-family: var(--ide-font-ui);
  color: var(--ide-text-main);
  line-height: 1.55;
}
.static-policy-body h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ide-text-bright);
}
.static-policy-body h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ide-text-bright);
  margin: 28px 0 8px;
}
.static-policy-body p,
.static-policy-body ul {
  margin: 0 0 12px;
  font-size: 13.5px;
}
.static-policy-body ul { padding-left: 22px; }
.static-policy-body li { margin: 4px 0; }
.static-policy-body .lede {
  color: var(--ide-text-muted);
  font-size: 12px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}
.static-policy-body a {
  color: var(--ide-accent);
  text-decoration: none;
}
.static-policy-body a:hover { text-decoration: underline; }
.static-policy-body strong {
  color: var(--ide-text-bright);
  font-weight: 600;
}

/* ── Lender drilldown v2 (Monitor) ─────────────────────────────────────────
   Scoped under #content-lender_drilldown so .ld-card/.ld-bar/etc. never
   collide with global components. Narrative is data-driven (see AGENTS.md). */
#content-lender_drilldown {
  --ld-green: #5fd1a5;
  --ld-amber: #ff9a5a;
  --ld-faint: rgba(235,235,245,0.32);
  --ld-mono: "JetBrains Mono","SF Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}
#content-lender_drilldown .ld-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  border: 1px solid var(--ide-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ide-panel-bg);
}
#content-lender_drilldown .ld-rail {
  padding: 26px 24px;
  border-right: 1px solid var(--ide-border);
  background: linear-gradient(180deg, rgba(10,132,255,0.10), transparent 60%);
}
#content-lender_drilldown .ld-rail h1 {
  font-size: 21px; font-weight: 600; letter-spacing: -.02em;
  color: var(--ide-text-bright); margin: 0 0 2px;
}
#content-lender_drilldown .ld-rail .ld-alt { font-size: 12px; color: var(--ide-text-muted); margin-bottom: 18px; }
#content-lender_drilldown .ld-rail dl { margin: 0; display: grid; gap: 13px; }
#content-lender_drilldown .ld-rail dt {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ld-faint);
}
#content-lender_drilldown .ld-rail dd { margin: 3px 0 0; font-size: 12px; color: var(--ide-text-main); }
#content-lender_drilldown .ld-rail dd code { font-family: var(--ld-mono); font-size: 10.5px; }
#content-lender_drilldown .ld-pill {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--ld-mono);
  font-size: 11px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; padding: 4px 10px;
  color: var(--ide-text-main);
}
#content-lender_drilldown .ld-heroR { padding: 26px 28px; display: flex; flex-direction: column; }
#content-lender_drilldown .ld-heroR .ld-big-k {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ld-faint);
}
#content-lender_drilldown .ld-heroR .ld-big-v {
  font-family: var(--ld-mono); font-size: 52px; font-weight: 600; line-height: 1;
  color: var(--ide-text-bright); letter-spacing: -.02em; margin: 10px 0 8px;
}
#content-lender_drilldown .ld-heroR .ld-big-d { font-size: 13px; color: var(--ide-text-muted); }
#content-lender_drilldown .ld-heroR .ld-big-d b { color: var(--ide-text-main); }
#content-lender_drilldown .ld-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 22px; }
#content-lender_drilldown .ld-chip {
  font-size: 11px; border: 1px solid rgba(255,255,255,0.18); border-radius: 6px;
  padding: 5px 11px; color: var(--ide-text-muted); background: rgba(255,255,255,0.03);
}
#content-lender_drilldown .ld-chip b { color: var(--ide-text-main); font-weight: 600; }
#content-lender_drilldown .ld-chip.warn { border-color: rgba(255,154,90,0.4); background: rgba(255,154,90,0.06); }
#content-lender_drilldown .ld-chip.warn b { color: var(--ld-amber); }
#content-lender_drilldown .ld-chip.good { border-color: rgba(95,209,165,0.35); background: rgba(95,209,165,0.06); }
#content-lender_drilldown .ld-chip.good b { color: var(--ld-green); }
#content-lender_drilldown .ld-thesis {
  font-size: 19px; line-height: 1.5; font-weight: 400; color: var(--ide-text-main);
  letter-spacing: -.01em; margin: 14px 0 0; border-left: 2px solid var(--ide-accent);
  padding: 2px 0 2px 20px;
}
#content-lender_drilldown .ld-thesis b { color: var(--ide-text-bright); font-weight: 600; }
#content-lender_drilldown .ld-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
}
#content-lender_drilldown .ld-tile {
  border: 1px solid var(--ide-border); border-radius: 8px; padding: 15px 16px 13px;
  background: var(--ide-panel-bg);
}
#content-lender_drilldown .ld-tile .ld-k {
  font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--ld-faint);
}
#content-lender_drilldown .ld-tile .ld-v {
  font-family: var(--ld-mono); font-size: 22px; font-weight: 600;
  color: var(--ide-text-bright); margin: 9px 0 7px; letter-spacing: -.01em;
}
#content-lender_drilldown .ld-tile .ld-d { font-size: 11px; color: var(--ide-text-muted); }
#content-lender_drilldown .ld-up { color: var(--ld-green); }
#content-lender_drilldown .ld-dn { color: var(--ld-amber); }
#content-lender_drilldown .ld-spark { display: flex; align-items: flex-end; gap: 3px; height: 24px; margin-top: 11px; }
#content-lender_drilldown .ld-spark i { flex: 1; background: rgba(255,255,255,0.14); border-radius: 1px; min-height: 3px; }
#content-lender_drilldown .ld-spark.a i { background: rgba(10,132,255,0.55); }
#content-lender_drilldown .ld-spark.a i:last-child { background: var(--ide-accent); }
#content-lender_drilldown .ld-spark.w i { background: rgba(255,154,90,0.40); }
#content-lender_drilldown .ld-spark.w i:last-child { background: var(--ld-amber); }
#content-lender_drilldown .ld-mixrow { margin-bottom: 15px; }
#content-lender_drilldown .ld-mixrow:last-child { margin-bottom: 0; }
#content-lender_drilldown .ld-mixrow .ld-t {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; color: var(--ide-text-muted); margin-bottom: 7px;
}
#content-lender_drilldown .ld-mixrow .ld-t b { color: var(--ide-text-main); }
#content-lender_drilldown .ld-bar {
  height: 9px; border-radius: 5px; background: rgba(255,255,255,0.06); overflow: hidden; display: flex;
}
#content-lender_drilldown .ld-bar i { display: block; height: 100%; }
#content-lender_drilldown .ld-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 9px; }
#content-lender_drilldown .ld-legend span {
  display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ide-text-muted);
}
#content-lender_drilldown .ld-legend i { width: 8px; height: 8px; border-radius: 2px; display: block; }
#content-lender_drilldown .ld-caveat {
  font-size: 10px; line-height: 1.65; color: rgba(235,235,245,0.20);
  transition: color .25s;
}
#content-lender_drilldown .ld-caveat:hover { color: var(--ld-faint); }
#content-lender_drilldown .ld-caveat code { font-family: var(--ld-mono); }
@media (max-width: 720px) {
  #content-lender_drilldown .ld-hero { grid-template-columns: 1fr; }
  #content-lender_drilldown .ld-rail { border-right: none; border-bottom: 1px solid var(--ide-border); }
  #content-lender_drilldown .ld-heroR .ld-big-v { font-size: 40px; }
}
