/* ONCC Stats Hub additions v1.0
   Homepage CSS is reused unchanged.
*/

.onccf-stats-hub .onccf-home-refbody{
  padding-top:0;
}

.onccf-stats-title{
  margin:0 0 14px;
  padding:18px 20px 16px;
  border-left:5px solid #d3a53b;
  border-bottom:1px solid #dce4e9;
  background:#f8fafb;
}

.onccf-stats-title>span{
  display:block;
  margin-bottom:5px;
  color:#9b6d00;
  font-size:11px;
  font-weight:900;
  letter-spacing:.04em;
}

.onccf-stats-title h1{
  margin:0;
  color:#08243a;
  line-height:1.2;
  font-weight:950;
}

.onccf-stats-title p{
  max-width:900px;
  margin:7px 0 0!important;
  color:#607483!important;
  font-size:13px!important;
  line-height:1.65!important;
}

.onccf-stats-benchmark-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.onccf-stats-benchmark-card{
  overflow:hidden;
  border:1px solid #d7e0e7;
  border-radius:11px;
  background:#fff;
  box-shadow:0 4px 13px rgba(7,20,31,.045);
}

.onccf-stats-benchmark-card>span{
  display:block;
  padding:10px 13px 4px;
  color:#6d7d89;
  font-size:10.5px;
  font-weight:900;
}

.onccf-stats-benchmark-card>strong{
  display:block;
  padding:0 13px 10px;
  color:#0b304c;
  font-size:24px;
}

.onccf-stats-benchmark-card dl{
  margin:0;
  padding:0 13px 10px;
}

.onccf-stats-benchmark-card dl>div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-top:1px solid #e5eaee;
}

.onccf-stats-benchmark-card dt,
.onccf-stats-benchmark-card dd{
  margin:0;
  font-size:12px;
}

.onccf-stats-benchmark-card dt{
  color:#6d7d89;
}

.onccf-stats-benchmark-card dd{
  color:#102a43;
  font-weight:900;
}

.onccf-stats-benchmark-card.is-all{
  border-top:5px solid #0b304c;
}

.onccf-stats-benchmark-card.is-rolling{
  border-top:5px solid #d3a53b;
}

.onccf-stats-benchmark-card.is-month{
  border-top:5px solid #1c8c52;
}

.onccf-stats-matrix-wrap{
  overflow-x:auto;
  border:1px solid #cfd9e1;
  border-radius:9px;
  background:#fff;
}

.onccf-stats-matrix{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

.onccf-stats-matrix th{
  padding:10px 12px;
  background:#0b304c;
  color:#fff;
  font-size:11px;
  font-weight:900;
  text-align:left;
  white-space:nowrap;
}

.onccf-stats-matrix td{
  padding:10px 12px;
  border-right:1px solid #e1e7ec;
  border-bottom:1px solid #e1e7ec;
  color:#263f52;
  font-size:12px;
}

.onccf-stats-matrix tbody tr:nth-child(even) td{
  background:#f7f9fb;
}

.onccf-stats-matrix tbody tr:last-child td{
  border-bottom:0;
}

.onccf-stats-matrix td:last-child,
.onccf-stats-matrix th:last-child{
  border-right:0;
}

.onccf-stats-chart-card{
  position:relative;
  margin-top:12px;
  padding:16px;
  border:1px solid #d8e1e7;
  border-radius:12px;
  background:#fff;
  box-shadow:0 4px 14px rgba(7,20,31,.035);
}

.onccf-stats-chart-canvas{
  position:relative;
  min-height:270px;
}

.onccf-stats-chart-canvas svg{
  display:block;
  width:100%;
  min-height:250px;
}

.onccf-stats-trend-table-wrap{
  margin-top:12px;
  overflow-x:auto;
  border-radius:9px;
}

.onccf-stats-settlement-strip{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}

.onccf-stats-settlement-strip span{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:48px;
  border:1px solid #d7e0e7;
  border-radius:8px;
  background:#f7fafc;
  color:#526a7a;
  font-size:11px;
}

.onccf-stats-settlement-strip b{
  color:#0b304c;
  font-size:17px;
}

.onccf-stats-integrity-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.onccf-stats-integrity-grid article{
  min-height:125px;
  padding:15px;
  border:1px solid #d7e0e7;
  border-radius:10px;
  background:#f7fafc;
}

.onccf-stats-integrity-grid span,
.onccf-stats-integrity-grid strong,
.onccf-stats-integrity-grid small{
  display:block;
}

.onccf-stats-integrity-grid span{
  color:#6d7e8b;
  font-size:10.5px;
  font-weight:900;
}

.onccf-stats-integrity-grid strong{
  margin:7px 0 5px;
  color:#0b304c;
  font-size:22px;
}

.onccf-stats-integrity-grid small{
  color:#6d7e8b;
  font-size:11px;
}

.onccf-stats-notes{
  margin-top:18px;
}

@media(max-width:900px){
  .onccf-stats-benchmark-grid{
    grid-template-columns:1fr;
  }

  .onccf-stats-settlement-strip{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .onccf-stats-integrity-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:760px){
  .onccf-stats-title{
    padding:14px 13px;
  }

  .onccf-stats-title h1{
  }

  .onccf-stats-matrix-wrap{
    overflow:visible;
    border:0;
    background:transparent;
  }

  .onccf-stats-matrix,
  .onccf-stats-matrix tbody{
    display:block;
  }

  .onccf-stats-matrix thead{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    overflow:hidden!important;
    clip:rect(0 0 0 0)!important;
    clip-path:inset(50%)!important;
  }

  .onccf-stats-matrix tr{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    margin-bottom:10px;
    overflow:hidden;
    border:1px solid #ced9e1;
    border-radius:9px;
    background:#fff;
  }

  .onccf-stats-matrix td{
    display:block;
    padding:9px 10px;
    border-right:1px solid #e1e7ec;
    border-bottom:1px solid #e1e7ec;
    background:#fff!important;
  }

  .onccf-stats-matrix td:first-child{
    grid-column:1/-1;
    background:#0b304c!important;
    color:#fff;
    font-weight:900;
  }

  .onccf-stats-matrix td:nth-child(odd):not(:first-child){
    border-right:0;
  }

  .onccf-stats-settlement-strip{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .onccf-stats-integrity-grid{
    grid-template-columns:1fr;
  }

  .onccf-stats-chart-card{
    padding:11px;
  }

  .onccf-stats-chart-canvas{
    min-height:220px;
  }

  .onccf-stats-chart-canvas svg{
    min-height:210px;
  }
}


/* v1.1.0 — detailed market performance cards */

.onccf-stats-market-card-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.onccf-stats-market-card{
  overflow:hidden;
  border:1px solid #cfd9e1;
  border-radius:10px;
  background:#fff;
  box-shadow:0 4px 14px rgba(7,20,31,.04);
}

.onccf-stats-market-card h3{
  margin:0;
}

.onccf-stats-market-card .onccf-home-market-ref__media{
  margin:0;
}

.onccf-stats-market-card dl{
  margin:0;
}

.onccf-stats-market-card__detail{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  border-top:1px solid #dfe6eb;
  background:#f3f6f8;
}

.onccf-stats-market-card__detail>div{
  min-height:62px;
  padding:9px 6px;
  border-right:1px solid #dfe6eb;
  text-align:center;
}

.onccf-stats-market-card__detail>div:last-child{
  border-right:0;
}

.onccf-stats-market-card__detail span,
.onccf-stats-market-card__detail strong{
  display:block;
}

.onccf-stats-market-card__detail span{
  color:#71818e;
  font-size:9.5px;
  font-weight:800;
}

.onccf-stats-market-card__detail strong{
  margin-top:4px;
  color:#0b304c;
  font-size:16px;
}

.onccf-stats-market-card__coverage{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  border-top:1px solid #dfe6eb;
  background:#fffaf0;
}

.onccf-stats-market-card__coverage>div{
  min-height:78px;
  padding:10px 11px;
  border-right:1px solid #eadfbd;
}

.onccf-stats-market-card__coverage>div:last-child{
  border-right:0;
}

.onccf-stats-market-card__coverage span,
.onccf-stats-market-card__coverage strong,
.onccf-stats-market-card__coverage small{
  display:block;
}

.onccf-stats-market-card__coverage span{
  color:#7a6b42;
  font-size:9.5px;
  font-weight:850;
}

.onccf-stats-market-card__coverage strong{
  margin:4px 0 2px;
  color:#102a43;
  font-size:15px;
}

.onccf-stats-market-card__coverage small{
  color:#7b7f7f;
  font-size:9.5px;
}

.onccf-stats-market-summary{
  margin-top:16px;
}

@media(max-width:1000px){
  .onccf-stats-market-card-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:760px){
  .onccf-stats-market-card-grid{
    grid-template-columns:1fr;
  }

  .onccf-stats-market-card__detail>div{
    min-height:58px;
  }
}


/* v1.2.0 — Stats market images: show the COMPLETE image, no crop */
.onccf-stats-market-card .onccf-home-market-ref__media{
  height:auto!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  overflow:hidden!important;
  background:#071d2b;
}

.onccf-stats-market-card .onccf-home-market-ref__media img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  max-width:100%!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center!important;
}

@media(max-width:760px){
  #markets .onccf-stats-market-card .onccf-home-market-ref__media{
    height:auto!important;
    min-height:0!important;
  }

  #markets .onccf-stats-market-card .onccf-home-market-ref__media img{
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    object-fit:contain!important;
  }
}


/* =========================================================
   ONCC Stats Hub v1.3.0 — CLEAN LAYOUT / READABILITY
   No section reordering. No market-image redesign.
   ========================================================= */

.onccf-stats-hub{
  width:100%;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  overflow-x:hidden;
  background:#fff;
}

.onccf-stats-hub *{
  box-sizing:border-box;
}

.onccf-stats-body-v2{
  width:min(1480px,calc(100% - 48px));
  max-width:1480px;
  margin-inline:auto;
  padding:12px 0 20px;
}

.onccf-stats-hub .is-green{color:#20963c!important}
.onccf-stats-hub .is-red{color:#df2328!important}

/* H1 follows the site's global heading scale. */
.onccf-stats-hub .onccf-stats-title p{
  font-size:15px!important;
  line-height:1.65!important;
}

/* Dedicated overview KPI — no homepage KPI layout inheritance. */
.onccf-stats-kpi-v2{
  display:grid;
  grid-template-columns:245px repeat(6,minmax(0,1fr));
  overflow:hidden;
  border:1px solid #e3bd5b;
  border-radius:7px;
  background:#fff;
  box-shadow:0 6px 18px rgba(7,20,31,.035);
}

.onccf-stats-kpi-v2__lead,
.onccf-stats-kpi-v2__cell{
  min-width:0;
  min-height:82px;
  border-right:1px solid #ecddae;
}

.onccf-stats-kpi-v2__lead{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 15px;
}

.onccf-stats-kpi-v2__lead i{
  flex:0 0 48px;
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:7px;
  background:#fff3cf;
  color:#c88d0c;
  font-size:28px;
  font-style:normal;
}

.onccf-stats-kpi-v2__lead span{
  min-width:0;
  display:grid;
  gap:3px;
}

.onccf-stats-kpi-v2__lead strong{
  color:#10253b;
  font-size:18px;
  line-height:1.25;
}

.onccf-stats-kpi-v2__lead small{
  color:#536274;
  font-size:13px;
  line-height:1.35;
}

.onccf-stats-kpi-v2__cell{
  display:grid;
  place-items:center;
  align-content:center;
  padding:8px;
  text-align:center;
}

.onccf-stats-kpi-v2__cell small{
  color:#536274;
  font-size:13px;
  line-height:1.25;
  font-weight:800;
}

.onccf-stats-kpi-v2__cell strong{
  max-width:100%;
  margin-top:4px;
  color:#10253b;
  font-size:24px;
  line-height:1.05;
  font-weight:950;
}

.onccf-stats-kpi-v2__cell span{
  margin-top:3px;
  color:#758494;
  font-size:12px;
}

/* Readable non-title text */
.onccf-stats-hub .onccf-home-trend__lead{
  font-size:15px!important;
  line-height:1.6!important;
}

.onccf-stats-hub .onccf-stats-benchmark-card>span{
  font-size:13px!important;
}

.onccf-stats-hub .onccf-stats-benchmark-card>strong{
  font-size:26px!important;
}

.onccf-stats-hub .onccf-stats-benchmark-card dt,
.onccf-stats-hub .onccf-stats-benchmark-card dd{
  font-size:15px!important;
}

.onccf-stats-hub .onccf-stats-matrix th{
  font-size:14px!important;
}

.onccf-stats-hub .onccf-stats-matrix td{
  font-size:15px!important;
}

.onccf-stats-hub .onccf-stats-settlement-strip span{
  font-size:14px!important;
}

.onccf-stats-hub .onccf-stats-settlement-strip b{
  font-size:19px!important;
}

.onccf-stats-hub .onccf-stats-integrity-grid span{
  font-size:13px!important;
}

.onccf-stats-hub .onccf-stats-integrity-grid strong{
  font-size:24px!important;
}

.onccf-stats-hub .onccf-stats-integrity-grid small{
  font-size:13px!important;
}

.onccf-stats-hub .onccf-stats-market-card dt,
.onccf-stats-hub .onccf-stats-market-card dd{
  font-size:14px!important;
}

.onccf-stats-hub .onccf-stats-market-card__detail span,
.onccf-stats-hub .onccf-stats-market-card__coverage span{
  font-size:12px!important;
}

.onccf-stats-hub .onccf-stats-market-card__detail strong{
  font-size:17px!important;
}

.onccf-stats-hub .onccf-stats-market-card__coverage strong{
  font-size:16px!important;
}

.onccf-stats-hub .onccf-stats-market-card__coverage small{
  font-size:12px!important;
}

/* Server charts are present in initial HTML. */
.onccf-stats-hub .onccf-stats-server-chart{
  display:block;
  width:100%;
  height:auto;
  min-height:250px;
}

/* Static method / FAQ / trust text */
.onccf-stats-hub .onccf-home-method-ref__steps strong{
  font-size:16px!important;
}
.onccf-stats-hub .onccf-home-method-ref__steps span{
  font-size:14px!important;
}
.onccf-stats-hub .onccf-home-faq-ref summary{
  font-size:15px!important;
}
.onccf-stats-hub .onccf-home-faq-ref details p,
.onccf-stats-hub .onccf-home-trust-ref>p{
  font-size:14px!important;
}
.onccf-stats-hub .onccf-home-trust-ref article strong{
  font-size:15px!important;
}
.onccf-stats-hub .onccf-home-trust-ref article span{
  font-size:13px!important;
}

/* Mobile: same containment strategy that fixed /records/. */
@media(max-width:760px){

  .onccf-stats-body-v2{
    width:calc(100vw - 48px)!important;
    max-width:calc(100vw - 48px)!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding:10px 0 84px!important;
  }

  .onccf-stats-title{
    width:100%!important;
    max-width:100%!important;
    padding:18px 14px 16px!important;
    overflow:visible!important;
  }

  .onccf-stats-title h1,
  .onccf-stats-title p{
    width:100%!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:break-word!important;
  }

  .onccf-stats-hub .onccf-quickjump{
    width:100%!important;
    max-width:100%!important;
    display:flex!important;
    flex-wrap:wrap!important;
    gap:7px!important;
    overflow:visible!important;
    white-space:normal!important;
    margin:14px 0 20px!important;
    padding:10px!important;
  }

  .onccf-stats-hub .onccf-quickjump strong{
    flex:0 0 100%!important;
    display:block!important;
    padding:2px 4px!important;
  }

  .onccf-stats-hub .onccf-quickjump a{
    flex:0 0 auto!important;
    white-space:nowrap!important;
    font-size:13px!important;
  }

  .onccf-stats-kpi-v2{
    width:100%!important;
    max-width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .onccf-stats-kpi-v2__lead{
    grid-column:1 / -1!important;
    min-height:72px!important;
    border-right:0!important;
    border-bottom:1px solid #ecddae!important;
    padding:10px 12px!important;
  }

  .onccf-stats-kpi-v2__lead strong{
    font-size:17px!important;
  }

  .onccf-stats-kpi-v2__lead small{
    font-size:12.5px!important;
  }

  .onccf-stats-kpi-v2__cell{
    min-width:0!important;
    min-height:90px!important;
    padding:9px 7px!important;
    border-bottom:1px solid #ecddae!important;
  }

  .onccf-stats-kpi-v2__cell:nth-child(odd){
    border-right:0!important;
  }

  .onccf-stats-kpi-v2__cell small{
    max-width:100%!important;
    font-size:12px!important;
    white-space:normal!important;
  }

  .onccf-stats-kpi-v2__cell strong{
    max-width:100%!important;
    font-size:21px!important;
    white-space:normal!important;
  }

  .onccf-stats-kpi-v2__cell span{
    font-size:11.5px!important;
  }

  .onccf-stats-benchmark-grid,
  .onccf-stats-period-grid,
  .onccf-stats-market-card-grid{
    grid-template-columns:1fr!important;
  }

  .onccf-stats-chart-card{
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
  }

  .onccf-stats-chart-canvas{
    width:100%!important;
    max-width:100%!important;
    min-height:220px!important;
    overflow:hidden!important;
  }

  .onccf-stats-server-chart{
    width:100%!important;
    min-height:210px!important;
  }
}

@media(max-width:390px){
  .onccf-stats-body-v2{
    width:calc(100vw - 32px)!important;
    max-width:calc(100vw - 32px)!important;
  }

  .onccf-stats-kpi-v2{
    grid-template-columns:1fr!important;
  }

  .onccf-stats-kpi-v2__lead{
    grid-column:auto!important;
  }

  .onccf-stats-kpi-v2__cell{
    border-right:0!important;
  }
}
