/* ILS_V18_UI_CSS — integración final limpia */
html,body{max-width:100%;overflow-x:hidden}
.wrap,.panel,.hero,.hero-readout,.hero-chart,.codebox-shell{max-width:100%;min-width:0;overflow-x:clip}

/* Widget principal: porcentaje a la izquierda, botones apilados a la derecha, gráfica abajo */
.hero{
  display:flex!important;
  flex-direction:column!important;
  gap:.86rem!important;
  padding:1.02rem 1.08rem!important;
}
.hero-readout{display:block!important;min-width:0!important}
.afp-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(158px,214px)!important;
  align-items:center!important;
  gap:.88rem!important;
  margin:0 0 .52rem!important;
}
.afp-main{min-width:0!important}
.afp-line{margin:0!important;align-items:flex-start!important}
.afp-num{font-size:clamp(3.45rem,12.6vw,5.05rem)!important;line-height:.86!important;letter-spacing:-.055em!important}
.afp-pct{font-size:1.22rem!important;line-height:1!important;margin-top:.36rem!important;color:rgba(231,238,244,.68)!important}
.afp-meta{margin-top:.22rem!important;height:.9rem!important;display:flex!important;align-items:center!important;gap:0!important}
#estadoTxt{display:none!important}
.lamp{width:.54rem!important;height:.54rem!important;min-width:.54rem!important;opacity:.86!important;box-shadow:0 0 8px currentColor!important}
.hero-report-actions{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:stretch!important;
  justify-self:center!important;
  align-self:center!important;
  width:100%!important;
  max-width:210px!important;
  min-width:0!important;
  gap:.56rem!important;
  padding:0!important;
}
.hero-report-actions .btn{
  width:100%!important;
  min-height:2.72rem!important;
  justify-content:center!important;
  border-radius:999px!important;
  padding:.64rem .82rem!important;
  line-height:1.08!important;
  font-size:.86rem!important;
  font-weight:760!important;
  letter-spacing:.005em!important;
  white-space:normal!important;
  text-align:center!important;
}
.btn-report-day{
  color:#06241a!important;
  border-color:rgba(131,255,199,.55)!important;
  background:linear-gradient(180deg,#b9ffe0 0%,#66dea5 54%,#36bf84 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 10px 24px rgba(52,211,153,.12)!important;
}
.btn-report-range{
  color:#eef7ff!important;
  border-color:rgba(115,138,170,.48)!important;
  background:linear-gradient(180deg,rgba(25,36,52,.86),rgba(9,14,22,.92))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05)!important;
}
.readout-grid{margin-top:.56rem!important;gap:.54rem .82rem!important}
.hero-chart{margin:0!important;min-width:0!important}
.hero-chart figcaption{font-size:.74rem!important;margin-bottom:.32rem!important;line-height:1.22!important}
.hero .curve{height:154px!important;min-height:154px!important;max-height:154px!important}
.legend{font-size:.72rem!important;margin-top:.4rem!important;gap:.8rem!important;flex-wrap:wrap!important}

@media (min-width:760px){
  .hero{padding:1.12rem 1.25rem!important}
  .hero .curve{height:168px!important;min-height:168px!important;max-height:168px!important}
  .afp-head{grid-template-columns:minmax(0,1fr) minmax(190px,236px)!important}
}
@media (max-width:420px){
  .hero{padding:.94rem .92rem!important;gap:.72rem!important}
  .afp-head{grid-template-columns:minmax(0,1fr) minmax(132px,158px)!important;gap:.58rem!important;margin-bottom:.42rem!important}
  .afp-num{font-size:clamp(3.05rem,15.4vw,3.9rem)!important}
  .afp-pct{font-size:1rem!important;margin-top:.22rem!important}
  .hero-report-actions{max-width:158px!important;gap:.42rem!important}
  .hero-report-actions .btn{min-height:2.22rem!important;padding:.48rem .44rem!important;font-size:.72rem!important;border-radius:16px!important}
  .hero .curve{height:142px!important;min-height:142px!important;max-height:142px!important}
}
@media (max-width:350px){
  .afp-head{grid-template-columns:1fr!important}
  .hero-report-actions{max-width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important}
}

/* Colapsables ejecutivos */
.v18-collapsible > .panel-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;align-items:center!important;gap:.62rem!important;margin-bottom:0!important;flex-wrap:nowrap!important}
.v18-collapsible .panel-head h2{min-width:0!important;line-height:1.18!important}
.v18-collapsible .panel-head .hint{grid-column:1 / 2!important;width:auto!important;margin-top:.18rem!important}
.v18-collapsible-body{margin-top:.88rem!important}
.v18-collapsed .v18-collapsible-body{display:none!important}
.v18-toggle-btn{
  border:1px solid rgba(115,138,170,.44)!important;
  background:linear-gradient(180deg,rgba(25,36,52,.76),rgba(9,14,22,.84))!important;
  color:var(--ink)!important;
  border-radius:999px!important;
  padding:.48rem .78rem!important;
  min-width:5.2rem!important;
  font-weight:700!important;
  cursor:pointer!important;
}
.v18-collapsed .v18-toggle-btn::after{content:'Mostrar'}
.v18-collapsible:not(.v18-collapsed) .v18-toggle-btn::after{content:'Ocultar'}
.v18-collapsible .icon-btn{margin-left:0!important;justify-self:end!important}

/* Memoria documental/fotográfica */
.v18-repo-actions{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:.55rem;margin:.1rem 0 .85rem}
.v18-repo-actions .btn{justify-content:center;border-radius:13px;min-height:2.35rem;white-space:normal;text-align:center;line-height:1.1}
.v18-repo-modal .modal-card{width:min(860px,100%)}
.v18-tabs{display:flex;gap:.45rem;flex-wrap:wrap;margin-bottom:.85rem}
.v18-tab{border:1px solid var(--line2);background:var(--surface2);color:var(--ink);border-radius:999px;padding:.48rem .75rem;font-weight:700;cursor:pointer}
.v18-tab.active{background:linear-gradient(180deg,#b9ffe0,#66dea5);color:#06241a;border-color:transparent}
.v18-upload-card{border:1px solid var(--line);background:rgba(255,255,255,.035);border-radius:14px;padding:.8rem;margin:.7rem 0;display:grid;gap:.65rem}
.v18-upload-row{display:grid;grid-template-columns:1fr 1fr auto;gap:.55rem;align-items:end}
.v18-upload-row .btn{justify-content:center;min-height:2.75rem}
.v18-progress{font-size:.82rem;color:var(--muted);min-height:1.1rem}
.v18-repo-list{display:grid;gap:.52rem}
.v18-repo-item{display:grid;gap:.14rem;border:1px solid var(--line);background:var(--bg2);border-radius:12px;padding:.72rem .8rem;text-decoration:none}
.v18-repo-item:hover{border-color:var(--accent)}
.v18-repo-item strong{font-size:.92rem;line-height:1.25}.v18-repo-item small{font-family:var(--mono);color:var(--muted2);font-size:.72rem;word-break:break-word}
.v18-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(126px,1fr));gap:.55rem}
.v18-photo-grid figure{margin:0;border:1px solid var(--line);background:var(--bg2);border-radius:12px;overflow:hidden}.v18-photo-grid img{width:100%;height:104px;display:block;object-fit:cover}.v18-photo-grid figcaption{font-size:.68rem;color:var(--muted);padding:.35rem .45rem;line-height:1.15}
.repo-page{padding-top:1rem}
@media (max-width:760px){
  .v18-repo-actions{grid-template-columns:1fr;gap:.48rem}
  .v18-upload-row{grid-template-columns:1fr}
  .v18-collapsible > .panel-head{grid-template-columns:minmax(0,1fr) auto auto!important;gap:.5rem!important}
  .v18-toggle-btn{min-width:4.8rem;padding:.44rem .68rem!important}
}
