/* Loaded after appearance and mobile assets: desktop Dashboard reference. */
@layer desktop-screen-fit {
  @media (min-width: 1101px) {
    html body #dashboard-section .dashboard-advanced-metrics-header {
      padding-inline: 0 !important;
      padding-block: 5px !important;
    }
    html body #dashboard-section .dashboard-advanced-metrics-grid {
      margin-bottom: 3px !important;
    }
    html:is(:not([data-appearance="light"]), [data-theme="warm-oak"]) body .container > #dashboard-section#dashboard-section .dashboard-advanced-metrics-panel {
      padding-bottom: 17px !important;
    }
    html body #dashboard-section .dashboard-advanced-metrics-kicker {
      font: 700 13px/18px Inter, system-ui, -apple-system, "Segoe UI", sans-serif !important;
      letter-spacing: .1em !important;
      text-transform: uppercase !important;
      text-align: left !important;
      margin: 0 !important;
    }
    html:is([data-appearance="light"], [data-theme="warm-oak"]) body #dashboard-section .dashboard-advanced-metrics-kicker {
      letter-spacing: .035em !important;
    }
    /* Light's Breakdown/Cash Flow grid is scaled to 95%. Match its heading inset and type scale. */
    html[data-appearance="light"]:not([data-theme="warm-oak"]) body #dashboard-section .dashboard-advanced-metrics-header {
      padding-inline-start: 18px !important;
      zoom: .95 !important;
    }
  }
}

@media (min-width: 1101px) {
  html body #dashboard-section#dashboard-section#dashboard-section .dashboard-advanced-metrics-header {
    padding: 8px 16px !important;
    min-height: 0 !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section .dashboard-advanced-metrics-period {
    text-transform: none !important;
    text-align: right !important;
    line-height: 18px !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section .dashboard-advanced-metrics-grid {
    margin: 0 12px 6px !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section .dashboard-insight-card {
    min-height: 56px !important;
    padding: 6px 12px !important;
    row-gap: 2px !important;
  }
}

@media (min-width: 1101px) {
  html:not([data-appearance="light"]) body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard {
    /* Use Portfolio Breakdown's surface across all Dashboard panels. */
    --dashboard-panel-bg: #0b1e27;
    --dashboard-panel-alt: #0b1e27;
  }
}

@media (min-width: 1101px) {
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-content {
    box-sizing: border-box !important;
    padding: 0 42px 24px !important;
    row-gap: var(--dashboard-panel-gap, 12px) !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 1.1fr 1fr 1fr 1fr 1.02fr 1fr .7fr !important;
    width: calc(100% + 84px) !important;
    max-width: none !important;
    height: 78px !important;
    min-height: 78px !important;
    margin: 0 -42px !important;
    padding: 4px 2.8vw !important;
    gap: 0 !important;
    align-items: stretch !important;
    border: 0 !important;
    border-block: 1px solid var(--dashboard-border) !important;
    border-radius: 0 !important;
    background: var(--dashboard-panel-bg) !important;
    box-shadow: none !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0 clamp(14px, 2.2vw, 44px) !important;
    gap: 6px !important;
    min-width: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-item:first-child { padding-left: 0 !important; }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-icon { display: none !important; }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-label {
    font-size: clamp(12px, .95vw, 18px) !important;
    line-height: 24px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    color: var(--dashboard-secondary) !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-value {
    font-size: clamp(23px, 1.85vw, 38px) !important;
    line-height: 44px !important;
    font-weight: 650 !important;
    letter-spacing: -.025em !important;
    margin: 0 !important;
    color: var(--dashboard-text) !important;
    text-shadow: none !important;
    filter: none !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard #dashboard-summary-balance { color: var(--dashboard-accent) !important; }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-value.positive { color: #00cda8 !important; }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-value.negative { color: var(--dashboard-negative) !important; }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-rankscore {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 0 0 28px !important;
    background: transparent !important;
    border: 0 !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-badge-row {
    display: flex !important; align-items: center !important; gap: 8px !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-badge-row > span {
    font-size: clamp(12px, .95vw, 18px) !important;
    line-height: 24px !important; font-weight: 400 !important;
    letter-spacing: 0 !important; text-transform: none !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-rank-icon {
    display: block !important; width: 22px !important; height: 22px !important;
    border-radius: 0 !important; padding: 0 !important; background: transparent !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-badge-row--score .dashboard-rank-icon { visibility: hidden !important; }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-badge-row strong {
    font-size: clamp(19px, 1.35vw, 28px) !important;
    line-height: 30px !important; margin-left: auto !important;
    color: var(--dashboard-text) !important; font-weight: 650 !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-item::before,
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-rankscore::before {
    display: block !important; top: 0 !important; bottom: 0 !important;
    background: var(--dashboard-divider) !important;
  }
}

@media (min-width: 1101px) {
  html[data-appearance="light"] body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary {
    height: 78px !important;
    min-height: 78px !important;
    overflow: hidden !important;
  }
  html[data-appearance="light"] body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard :is(#dashboard-summary-balance,#dashboard-summary-profit,#dashboard-summary-money-invested) {
    font-size: clamp(16px, 1.2vw, 23px) !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
  }
  html[data-appearance="light"] body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-value,
  html[data-appearance="light"] body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard .dashboard-summary-badge-row strong {
    font-size: clamp(16px, 1.2vw, 23px) !important;
    line-height: 1.25 !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section.banymay-dashboard #metric-net-invested-capital-meta {
    grid-column: 2 / 4 !important;
    white-space: nowrap !important;
    font-size: clamp(10px, .68vw, 13px) !important;
  }
}

#performance-desktop-readout { display: none; }
@media (min-width: 761px) {
  #dashboard-section .performance-controls-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px 24px;
    margin-bottom: 18px;
  }
  html body #dashboard-section#dashboard-section#dashboard-section .performance-controls-row .dashboard-period-selector {
    flex: 0 1 auto !important;
    width: auto !important;
    margin: 0 !important;
    gap: 8px !important;
  }
  html body #dashboard-section#dashboard-section#dashboard-section .performance-controls-row .time-btn {
    min-width: 42px !important;
    padding: 10px 12px !important;
  }
  #performance-desktop-readout {
    display: flex;
    min-height: 52px;
    margin-left: auto;
    align-items: center;
    flex-wrap: nowrap;
    gap: 14px 20px;
    color: var(--dashboard-text, #edf5fa);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
  }
  #performance-desktop-readout > div {
    padding-left: 20px;
    border-left: 1px solid var(--dashboard-divider, #38505c);
  }
  #performance-desktop-readout:not(.is-visible) :is(.performance-readout-snapshot, .performance-readout-series strong) { visibility: hidden; }
  html body #dashboard-section .dashboard-performance .dashboard-performance-legend { display: none !important; }
  .performance-readout-snapshot { display: grid; gap: 8px; text-align: right; }
  .performance-readout-date { color: var(--dashboard-muted, #a9bbc9); font-size: 12px; }
  .performance-readout-snapshot strong { margin-left: 10px; font-size: 18px; white-space: nowrap; }
  .performance-readout-series { display: grid; justify-items: center; gap: 8px; white-space: nowrap; }
  .performance-readout-series-label { display: flex; align-items: center; gap: 8px; }
  .performance-readout-series strong { color: var(--series-color); font-size: 20px; }
  .performance-readout-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--series-color); }
  html body #performance-chart-tooltip { display: none !important; }
}

/* Light uses the same category/percentage rows as the dark desktop risk panel. */
@layer desktop-screen-fit {
  @media (min-width:1101px) {
    html[data-appearance="light"]:not([data-theme="warm-oak"]) body #dashboard-section#dashboard-section#dashboard-section#dashboard-section .dashboard-risk-legend:not([hidden]) {
      display:flex !important; flex-direction:column !important; flex-wrap:nowrap !important; width:100% !important;
      gap:0 !important; padding:0 16px !important; margin:0 !important; box-sizing:border-box !important;
    }
    html[data-appearance="light"]:not([data-theme="warm-oak"]) body #dashboard-section#dashboard-section#dashboard-section#dashboard-section .dashboard-risk-legend-item {
      display:flex !important; align-items:center !important; gap:12px !important; width:100% !important;
      min-height:40px !important; border-top:1px solid #dfeaf3 !important; padding:7px 0 !important; box-sizing:border-box !important;
    }
    html[data-appearance="light"]:not([data-theme="warm-oak"]) body #dashboard-section#dashboard-section#dashboard-section#dashboard-section .dashboard-risk-legend-dot {
      width:17px !important; height:17px !important; flex:0 0 17px !important; border-radius:50% !important;
    }
    html[data-appearance="light"]:not([data-theme="warm-oak"]) body #dashboard-section#dashboard-section#dashboard-section#dashboard-section .dashboard-risk-legend-text {
      font-size:14px !important; color:#173353 !important; font-weight:400 !important;
    }
    html[data-appearance="light"]:not([data-theme="warm-oak"]) body #dashboard-section#dashboard-section#dashboard-section#dashboard-section .dashboard-risk-legend-percentage {
      display:block !important; margin-left:auto !important; color:#173353 !important; font-size:14px !important; font-variant-numeric:tabular-nums;
    }
  }
}
