/* Shared presentation for calculation memories. Calculation and source data stay in JS. */
.calculation-memory{
  overflow:hidden;
  border:1px solid var(--border, #e5e2dc);
  border-radius:8px;
  background:var(--bg-surface, #fff);
  box-shadow:none;
}

.calculation-memory__summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  width:100%;
  min-height:58px;
  padding:0 22px;
  border:0;
  background:var(--bg-surface, #fff);
  color:var(--text-primary, #191918);
  font-family:'Inter', sans-serif;
  cursor:pointer;
  list-style:none;
}

.calculation-memory__summary::-webkit-details-marker{
  display:none;
}

.calculation-memory__title{
  color:var(--text-primary, #191918);
  font-size:0.92rem;
  font-weight:750;
  line-height:1.25;
  letter-spacing:0;
  text-transform:none;
}

.calculation-memory__action{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex:0 0 auto;
  color:var(--text-muted, #8b877f);
  font-size:0.68rem;
  font-weight:750;
  line-height:1;
  letter-spacing:0;
  text-transform:uppercase;
}

.calculation-memory__chevron{
  display:block;
  width:8px;
  height:8px;
  border-right:1.5px solid currentColor;
  border-bottom:1.5px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transition:transform 160ms ease;
}

.calculation-memory.is-open .calculation-memory__chevron,
.calculation-memory[open] .calculation-memory__chevron{
  transform:rotate(225deg) translate(-1px, -1px);
}

.calculation-memory__action-open{
  display:none;
}

.calculation-memory[open] .calculation-memory__action-closed{
  display:none;
}

.calculation-memory[open] .calculation-memory__action-open{
  display:inline;
}

.calculation-memory__body{
  display:grid;
  gap:0;
  padding:20px 22px 22px;
  border-top:1px solid var(--border-subtle, #f0eee9);
  background:var(--bg-surface, #fff);
}

.calculation-memory__notice{
  margin:0 0 18px;
  padding:13px 15px;
  border:0;
  border-radius:6px;
  background:var(--bg-subtle, #f8f7f4);
  color:var(--text-secondary, #68645e);
  font-size:0.76rem;
  font-weight:550;
  line-height:1.55;
}

.calculation-memory__notice--warning{
  border-left:3px solid color-mix(in srgb, var(--gold, #b08b47) 72%, var(--border));
}

.calculation-memory__section{
  min-width:0;
}

.calculation-memory__metric{
  min-width:0;
  padding:12px 14px;
  border:1px solid var(--border-subtle, #f0eee9);
  border-radius:6px;
  background:var(--bg-subtle, #f8f7f4);
}

/* CDI: one readable asset section followed by flat lot sections. */
.cdi-dev-audit.calculation-memory{
  margin-top:18px;
}

.cdi-dev-audit .calculation-memory__body{
  padding-top:20px;
}

.cdi-dev-audit .cdi-dev-asset{
  padding:20px 0;
  border:0;
  border-top:1px solid var(--border-subtle, #f0eee9);
  border-radius:0;
  background:transparent;
}

.cdi-dev-audit .cdi-dev-asset:first-of-type{
  padding-top:2px;
  border-top:0;
}

.cdi-dev-audit .cdi-dev-asset:last-child{
  padding-bottom:0;
}

.cdi-dev-audit .cdi-dev-asset__head{
  align-items:center;
  margin-bottom:14px;
}

.cdi-dev-audit .cdi-dev-asset__ticker{
  color:var(--text-primary, #191918);
  font-size:1.02rem;
  font-weight:800;
  letter-spacing:0;
}

.cdi-dev-audit .cdi-dev-asset__diff{
  font-size:0.86rem;
  font-weight:800;
  font-variant-numeric:tabular-nums;
}

.cdi-dev-audit .cdi-dev-grid{
  gap:8px;
  margin-top:0;
}

.cdi-dev-audit .cdi-dev-label{
  margin-bottom:5px;
  color:var(--text-muted, #8b877f);
  font-size:0.64rem;
  font-weight:750;
  letter-spacing:0.08em;
}

.cdi-dev-audit .cdi-dev-value{
  color:var(--text-primary, #191918);
  font-size:0.79rem;
  font-weight:600;
  line-height:1.35;
}

.cdi-dev-audit .cdi-dev-lots{
  gap:16px;
  margin-top:16px;
}

.cdi-dev-audit .cdi-dev-lot{
  padding:16px 0 0;
  border:0;
  border-top:1px solid var(--border, #e5e2dc);
  border-radius:0;
  background:transparent;
}

.cdi-dev-audit .cdi-dev-lot__title{
  margin-bottom:12px;
  color:var(--text-secondary, #68645e);
  font-size:0.76rem;
  font-weight:750;
  letter-spacing:0;
}

/* Performance: two balanced columns with the same cream data rows. */
.performance-real-audit.calculation-memory{
  border-radius:8px;
}

.performance-real-audit .calculation-memory__body{
  padding-top:20px;
}

.performance-real-audit .performance-real-audit__box{
  margin:0 0 18px;
}

.performance-real-audit .performance-real-audit__box strong{
  margin-bottom:9px;
  font-size:0.79rem;
  font-weight:800;
}

.performance-real-audit .performance-real-audit__box .performance-real-audit__list{
  gap:6px;
}

.performance-real-audit .performance-real-audit__box .performance-real-audit__list li{
  padding:0;
  border:0;
  background:transparent;
}

.performance-real-audit .performance-real-audit__grid{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:22px 20px;
  padding-top:0;
}

.performance-real-audit .calculation-memory__section{
  padding:0;
}

.performance-real-audit h4{
  margin:0 0 10px;
  color:var(--text-primary, #191918);
  font-size:0.78rem;
  font-weight:800;
  line-height:1.3;
}

.performance-real-audit .performance-real-audit__list li{
  gap:4px;
  padding:11px 13px;
  border:1px solid var(--border-subtle, #f0eee9);
  border-radius:6px;
  background:var(--bg-subtle, #f8f7f4);
  font-size:0.74rem;
  line-height:1.4;
}

.performance-real-audit .performance-real-audit__empty{
  min-height:43px;
  padding:11px 13px;
  border:1px solid var(--border-subtle, #f0eee9);
  border-radius:6px;
  background:var(--bg-subtle, #f8f7f4);
  font-size:0.78rem;
}

@media (max-width:767px){
  .calculation-memory__summary{
    min-height:54px;
    padding:0 16px;
  }

  .calculation-memory__title{
    font-size:0.86rem;
  }

  .calculation-memory__action > span{
    display:none;
  }

  .calculation-memory__body,
  .cdi-dev-audit .calculation-memory__body,
  .performance-real-audit .calculation-memory__body{
    padding:16px;
  }

  .calculation-memory__notice{
    margin-bottom:16px;
  }

  .performance-real-audit .performance-real-audit__grid{
    grid-template-columns:1fr;
    gap:18px;
  }
}

@media (max-width:560px){
  .cdi-dev-audit .cdi-dev-asset__head{
    align-items:flex-start;
  }

  .cdi-dev-audit .cdi-dev-asset__diff{
    width:100%;
  }
}
