/* DIAR-6B.4-R1.3 — first-frame geometry and evidence-presentation closure.
 * The HTML root now receives the stability classes on the server, before CSS
 * and before deferred JavaScript. This layer therefore controls frame zero,
 * pageshow/BFCache restoration and the normal steady state with one contract.
 */

html.diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]{
  overflow-anchor:none!important;
}
html.diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"] :is(.elite-shell,.elite-main,.elite-topbar--diar-premium){
  overflow-anchor:none!important;
}

@media (min-width:761px){
  html.diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]{
    display:grid!important;
    grid-template-rows:auto!important;
    align-items:start!important;
    width:100%!important;
    min-width:0!important;
    min-height:100vh!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    gap:0!important;
    overflow:visible!important;
  }
  html[dir="ltr"].diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]{
    grid-template-columns:296px minmax(0,1fr)!important;
    grid-template-areas:"native-sidebar native-main"!important;
    direction:ltr!important;
  }
  html[dir="rtl"].diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]{
    grid-template-columns:minmax(0,1fr) 296px!important;
    grid-template-areas:"native-main native-sidebar"!important;
    direction:ltr!important;
  }
  html.diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]>.elite-sidebar[data-native-sidebar-contract="R4"]{
    grid-area:native-sidebar!important;
    grid-row:1!important;
    position:fixed!important;
    top:0!important;
    bottom:0!important;
    width:296px!important;
    min-width:296px!important;
    max-width:296px!important;
    height:100dvh!important;
    margin:0!important;
    transform:none!important;
    translate:none!important;
  }
  html[dir="ltr"].diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]>.elite-sidebar[data-native-sidebar-contract="R4"]{left:0!important;right:auto!important}
  html[dir="rtl"].diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]>.elite-sidebar[data-native-sidebar-contract="R4"]{right:0!important;left:auto!important;direction:rtl!important}

  html.diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]>.elite-main[data-native-main-contract="R4"]{
    grid-area:native-main!important;
    grid-row:1!important;
    align-self:start!important;
    position:relative!important;
    top:0!important;
    bottom:auto!important;
    inset-block-start:0!important;
    width:auto!important;
    min-width:0!important;
    min-height:100vh!important;
    max-width:none!important;
    margin:0!important;
    padding-block-start:0!important;
    transform:none!important;
    translate:none!important;
    overflow-x:clip!important;
  }
  html[dir="ltr"].diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]>.elite-main[data-native-main-contract="R4"]{grid-column:2!important;direction:ltr!important}
  html[dir="rtl"].diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]>.elite-main[data-native-main-contract="R4"]{grid-column:1!important;direction:rtl!important}

  html.diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"]
  .elite-main[data-native-main-contract="R4"]>.elite-topbar--diar-premium:first-child{
    position:sticky!important;
    top:0!important;
    inset-block-start:0!important;
    margin-block-start:0!important;
    transform:none!important;
    translate:none!important;
  }

  /* One-time defensive state used only when the runtime gate finds stale
     inline geometry after a BFCache restore. It has the same steady geometry. */
  html.diar-geometry-self-heal body[data-native-sidebar-page^="diar-"]
  .elite-shell[data-native-shell-contract="R4"]>.elite-main[data-native-main-contract="R4"]{
    top:0!important;margin-block-start:0!important;padding-block-start:0!important;transform:none!important;translate:none!important
  }
}

/* Evidence reason presentation: business labels first, raw codes only on demand. */
.evidence-reason-summary{display:grid;gap:10px;padding:17px 18px;border:1px solid #cce5e1;border-radius:16px;background:linear-gradient(135deg,#eef9f7,#f7fbff)}
.evidence-reason-summary>span{color:#55727c;font-size:13px;font-weight:850}
.evidence-reason-chips{display:flex;flex-wrap:wrap;gap:8px}
.evidence-reason-chips strong{display:inline-flex;align-items:center;min-height:34px;padding:7px 11px;border-radius:999px;background:#fff;border:1px solid #bcded8;color:#0b665f;font-size:13px;line-height:1.25}
.evidence-raw-codes{margin-top:12px;border:1px dashed #ccdce2;border-radius:13px;background:#fbfdfd;padding:10px 13px}
.evidence-raw-codes>summary{cursor:pointer;color:#47646e;font-weight:850}
.evidence-raw-codes code{display:block;margin-top:10px;padding:10px;border-radius:9px;background:#eef4f6;color:#244956;white-space:normal;overflow-wrap:anywhere}
.signal-list article header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.signal-list article header code{flex:0 0 auto;padding:4px 7px;border-radius:7px;background:#eef4f7;color:#56707a;font-size:11px;direction:ltr}
.signal-list article p{font-variant-numeric:tabular-nums;line-height:1.75}
.metric-grid article strong bdi{font-variant-numeric:tabular-nums;unicode-bidi:isolate}

/* Seven evidence sections must remain visible without a clipped final tab. */
.frozen-evidence-page .evidence-tabs{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr))!important;
  gap:7px!important;
  width:100%!important;
  overflow:visible!important;
  padding:8px!important;
  scrollbar-width:none!important;
}
.frozen-evidence-page .evidence-tabs button{
  width:100%!important;
  min-width:0!important;
  min-height:46px!important;
  white-space:normal!important;
  text-align:center!important;
  line-height:1.25!important;
}

.related-grid>a{position:relative;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.related-grid>a:hover,.related-grid>a:focus-visible{transform:translateY(-1px);outline:2px solid rgba(11,116,107,.15);outline-offset:2px}
.related-grid>a footer{align-items:center;flex-wrap:wrap}
.related-grid>a footer b{margin-inline-start:auto;color:#0b746b;font-size:12px;white-space:nowrap}
html[dir="rtl"] .related-grid>a footer b{margin-inline-start:0;margin-inline-end:auto}

@media (max-width:1100px) and (min-width:761px){
  .frozen-evidence-page .evidence-tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media (max-width:760px){
  html.diar-initial-render-r1-3 body[data-native-sidebar-page^="diar-"] .elite-main[data-native-main-contract="R4"]{padding-block-start:0!important}
  .frozen-evidence-page .evidence-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  .frozen-evidence-page .evidence-tabs button{min-height:44px!important;padding:8px!important;font-size:13px!important}
  .signal-list article header{display:grid}
  .signal-list article header code{justify-self:start}
  html[dir="rtl"] .signal-list article header code{justify-self:end}
}
@media (max-width:420px){.frozen-evidence-page .evidence-tabs{grid-template-columns:1fr!important}}
