/* Live-only customer detail: aligned amounts and one compact composition view. */
.emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-customer-detail-trigger {
  display:inline-flex!important;
  flex-wrap:nowrap;
  justify-content:center;
  align-content:center;
  align-items:center;
  column-gap:.12em;
  row-gap:0;
  max-width:100%;
  min-height:44px;
  cursor:pointer;
  border-radius:4px;
}
.emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-customer-detail-cue {
  flex:0 0 auto;
  display:block;
  min-width:0;
  margin-left:8px;
  color:#b9d4d3;
  font-size:14px!important;
  line-height:1.25;
  font-weight:500;
  text-align:center;
  text-decoration:underline;
  text-decoration-color:#5b8382;
  text-underline-offset:3px;
}
.emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-customer-detail-trigger:hover .emc-customer-detail-cue { color:#eefaf8; }
.emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-customer-detail-trigger:focus-visible,
[data-emc-popup-live="true"] .emc-customer-detail-close:focus-visible { outline:3px solid #73d8d0; outline-offset:3px; }
/* A body portal avoids table clipping and transformed dashboard ancestors.
   Both live editors share this surface; neither PDF tree gets the attribute. */
.emc-customer-detail-dialog[data-emc-popup-live="true"] {
  position:fixed;
  inset:auto;
  width:260px;
  max-width:calc(100vw - 24px);
  height:auto;
  margin:0;
  padding:0;
  box-sizing:border-box;
  border:0;
  background:transparent;
  color:#eefaf8;
  font-family:"Microsoft YaHei","PingFang SC",Inter,system-ui,sans-serif;
  font-size:16px;
  line-height:1.4;
  text-align:left;
  z-index:10000;
}
.emc-customer-detail-dialog[data-emc-popup-live="true"]:not([open]) { display:none; }
.emc-customer-detail-dialog[data-emc-popup-live="true"][open] { display:block; }
.emc-customer-detail-dialog[data-emc-popup-live="true"][data-emc-detail-closing="true"],
.emc-customer-detail-dialog[data-emc-popup-live="true"][data-emc-popup-closing="true"] { pointer-events:none; }
[data-emc-popup-live="true"] .emc-customer-detail-panel {
  width:100%;
  max-height:min(400px,60vh);
  overflow:auto;
  overscroll-behavior:contain;
  box-sizing:border-box;
  padding:10px;
  border:1px solid rgba(210,250,244,.55);
  border-radius:12px;
  background:#102629;
  box-shadow:0 10px 24px rgba(0,10,13,.18),inset 0 1px 0 rgba(240,255,253,.28),inset 0 -1px 0 rgba(181,233,228,.12);
  text-align:left;
  transform-origin:top right;
}
[data-emc-popup-live="true"][data-emc-popup-placement="above"] .emc-customer-detail-panel { transform-origin:bottom right; }
/* V64d: balanced deep-teal frost. Background colours remain visible, while
   stronger blur and a moderate tint keep underlying text from competing. */
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  [data-emc-popup-live="true"] .emc-customer-detail-panel {
    background:linear-gradient(125deg,rgba(192,255,246,.025),rgba(192,255,246,.006) 46%,rgba(192,255,246,.015)),rgba(8,25,29,.20);
    -webkit-backdrop-filter:blur(16px) saturate(1.15);
    backdrop-filter:blur(16px) saturate(1.15);
  }
  [data-emc-popup-live="true"] :is(.emc-customer-detail-title,.emc-customer-detail-close,.emc-customer-detail-total-label,.emc-customer-detail-value,.emc-customer-detail-label),
  .emc-cost-popover[data-emc-popup-live="true"] :is(.emc-v61-cost-label,.emc-v61-cost-field,.emc-v61-cost-full-value,.emc-v63-cost-error) {
    width:fit-content;
    max-width:100%;
    background:transparent;
    box-shadow:none;
  }
  [data-emc-detail-live="true"] .emc-customer-detail-row > .emc-customer-detail-value { justify-self:end; }
}
@media(prefers-reduced-transparency:reduce) {
  [data-emc-popup-live="true"] .emc-customer-detail-panel { background:#102629; -webkit-backdrop-filter:none; backdrop-filter:none; }
}
@media(forced-colors:active) {
  [data-emc-popup-live="true"] .emc-customer-detail-panel { background:Canvas; border-color:CanvasText; box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none; }
}
[data-emc-popup-live="true"] .emc-customer-detail-head { display:flex; gap:12px; align-items:center; justify-content:space-between; }
[data-emc-popup-live="true"] .emc-customer-detail-title { margin:0; color:#eefaf8; font-size:16px!important; line-height:1.4; font-weight:700; }
[data-emc-popup-live="true"] .emc-customer-detail-close { flex:none; min-width:44px; min-height:44px; margin:-8px -8px -8px 0; padding:8px; border:0; border-radius:6px; background:transparent; color:#d1e5e3; font:inherit; font-size:24px!important; line-height:1; cursor:pointer; }
[data-emc-popup-live="true"] .emc-customer-detail-close:hover { background:#203e41; color:#fff; }
[data-emc-detail-live="true"] .emc-customer-detail-total { display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.5fr); align-items:center; gap:4px; padding:4px 0; }
[data-emc-detail-live="true"] .emc-customer-detail-total-label { margin:0; color:#d8e7e7; font-size:16px!important; line-height:1.4; }
[data-emc-detail-live="true"] .emc-customer-detail-value { display:flex; flex-wrap:nowrap; align-items:baseline; justify-content:flex-end; gap:0 .2em; min-width:0; margin:0; color:inherit; font-size:16px!important; line-height:1.4; font-weight:650; font-variant-numeric:tabular-nums; white-space:nowrap; }
[data-emc-detail-live="true"] .emc-customer-detail-total > .emc-customer-detail-value { justify-self:end; justify-content:flex-end; color:#eefaf8; font-size:24px!important; }
[data-emc-detail-live="true"] .emc-customer-detail-number { min-width:0; font:inherit!important; color:inherit!important; white-space:nowrap; }
[data-emc-detail-live="true"] .emc-customer-detail-unit { font-size:.8em!important; font-weight:500; line-height:1.4; color:inherit; }
[data-emc-detail-live="true"] .emc-customer-detail-composition { grid-column:1 / -1; height:8px; margin-top:4px; overflow:hidden; border-radius:3px; background:#294247; }
[data-emc-detail-live="true"] .emc-customer-detail-bar { display:flex; width:100%; height:100%; transform-origin:left center; }
[data-emc-detail-live="true"] .emc-customer-detail-segment { display:block; flex:0 0 auto; min-width:0; height:100%; transition:width 400ms cubic-bezier(.2,.7,.2,1); }
[data-emc-detail-live="true"] .emc-customer-detail-segment.is-energy { background:#73d8d0; }
[data-emc-detail-live="true"] .emc-customer-detail-segment.is-purchase { background:#f0bc66; }
[data-emc-detail-live="true"] .emc-customer-detail-segment.is-maintenance { background:#B0BFF4; }
[data-emc-detail-live="true"] .emc-customer-detail-list { margin:0; padding:0; }
[data-emc-detail-live="true"] .emc-customer-detail-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); gap:6px; align-items:baseline; padding:4px 0; border-bottom:1px solid rgba(199,235,232,.2); }
[data-emc-detail-live="true"] .emc-customer-detail-row:last-child { border-bottom:0; padding-bottom:0; }
[data-emc-detail-live="true"] .emc-customer-detail-label { margin:0; color:inherit; font-size:16px!important; line-height:1.4; font-weight:500; }
[data-emc-detail-live="true"] .emc-customer-detail-row.is-energy { color:#b0f0e8; }
[data-emc-detail-live="true"] .emc-customer-detail-row.is-purchase { color:#ffe0a2; }
[data-emc-detail-live="true"] .emc-customer-detail-row.is-maintenance { color:#B0BFF4; }
/* Fee text uses the same amber/purple families as the live chart. */
.emc-cost-popover[data-emc-popup-live="true"] .emc-v61-cost-item.is-purchase { --emc-cost-color:#ffe0a2; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v61-cost-item.is-maintenance { --emc-cost-color:#B0BFF4; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v61-cost-item :is(.emc-v2-input,.emc-v2-currency-symbol,.emc-v2-input-unit) { color:#eef6f3; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v63-cost-error { color:#ffd8d3; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v2-input::placeholder { color:#d8e7e7; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v61-costs { margin-top:4px; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v61-cost-body { gap:4px; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v61-cost-item { gap:0; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v61-cost-field { min-height:36px; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v2-input { height:36px; line-height:36px; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v61-cost-field { flex-wrap:nowrap; }
.emc-cost-popover[data-emc-popup-live="true"] .emc-v2-input-unit { flex:0 0 auto; white-space:nowrap; }
@media(max-width:720px) {
  .emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-customer-detail-trigger { display:grid!important; grid-template-columns:repeat(3,max-content); row-gap:3px; justify-content:end; }
  .emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-customer-detail-trigger > :is(.emc-v2-money-symbol,.emc-v2-money-number,.emc-v2-money-unit) { grid-row:1; align-self:center; }
  .emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-customer-detail-cue { grid-column:1 / -1; grid-row:2; margin-left:0; text-align:right; }
  /* Every live summary row must wrap, including investor/saving and zero fees. */
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-mobile-total {
    --emc-detail-main-row:minmax(min-content,auto);
    --emc-detail-cue-row:44px;
    grid-template-rows:minmax(72px,auto) minmax(78px,auto) minmax(78px,auto);
  }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-mobile-total > .is-saving { grid-template-rows:minmax(32px,auto) minmax(min-content,auto); }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-mobile-total > :is(.is-customer,.is-investor) {
    grid-template-rows:var(--emc-detail-main-row) var(--emc-detail-cue-row);
  }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-mobile-total .emc-v2-summary-label { min-width:0; white-space:normal; overflow-wrap:anywhere; align-self:center; }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-mobile-total > .emc-v2-mobile-summary-row.is-customer { grid-template-areas:"label money" "share money"; }
  /* Older mobile engines without :has still align the amount's own row. */
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-mobile-total > .emc-v2-mobile-summary-row.is-customer > .emc-v2-money:not(.emc-customer-detail-trigger) { grid-column:2; grid-row:1; align-self:center; }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-mobile-total .emc-customer-detail-trigger {
    /* Fallback: span the parent's whole two-row area, reserving the same cue
       track; the remaining stretch space is exactly the parent's main row. */
    grid-template-rows:minmax(min-content,1fr) var(--emc-detail-cue-row);
    row-gap:0;
    align-self:stretch;
    align-content:stretch;
  }
  @supports(grid-template-rows:subgrid) {
    .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-mobile-total .emc-customer-detail-trigger { grid-template-rows:subgrid; }
  }
  .emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-v2-mobile-total .emc-customer-detail-cue { align-self:start; padding-top:3px; }
  /* Annual amounts use the same label/value main row as summaries. The share
     input retains its lower-left slot; the old share heading remains accessible. */
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card { grid-template-rows:minmax(50px,auto) minmax(80px,auto) minmax(80px,auto); }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language][data-emc-wan-scale="false"] .emc-v2-year-card { grid-template-rows:minmax(62px,auto) minmax(84px,auto) minmax(84px,auto); }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card .emc-v2-year-line {
    --emc-detail-main-row:minmax(min-content,auto);
    --emc-detail-cue-row:44px;
    grid-template-rows:var(--emc-detail-main-row) var(--emc-detail-cue-row);
    row-gap:0;
  }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card .emc-v2-year-field-label { min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card .emc-v2-year-line > .emc-v2-year-share-label {
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card .emc-v2-year-line > .emc-v2-year-amount-label { grid-column:1; grid-row:1; align-self:center; justify-self:start; text-align:left; }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card .emc-v2-year-line > .emc-v2-year-share { grid-column:1; grid-row:2; align-self:center; }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card .emc-v2-year-line > .emc-v2-money { grid-column:2; grid-row:1; align-self:center; }
  .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card .emc-v2-year-line > .emc-customer-detail-trigger {
    grid-row:1 / 3;
    grid-template-rows:minmax(min-content,1fr) var(--emc-detail-cue-row);
    row-gap:0;
    align-self:stretch;
    align-content:stretch;
  }
  @supports(grid-template-rows:subgrid) {
    .emc-dashboard-v2[data-emc-v2-pdf="false"][data-emc-language] .emc-v2-year-card .emc-v2-year-line > .emc-customer-detail-trigger { grid-template-rows:subgrid; }
  }
  .emc-dashboard-v2[data-emc-v2-pdf="false"] .emc-v2-year-card .emc-customer-detail-cue { align-self:start; padding-top:3px; }
}
@media(prefers-reduced-motion:reduce) {
  [data-emc-popup-live="true"] .emc-customer-detail-panel,
  [data-emc-detail-live="true"] .emc-customer-detail-bar,
  [data-emc-detail-live="true"] .emc-customer-detail-segment { animation:none!important; transition:none!important; }
}
