/* RULES_SURFACE_CANONICAL_V1
 * Sole visual owner for rules-page accordions, explanations, and all rules data tables.
 * Basic / A-G / Special keep family classes only as data/JS hooks; visual styling comes from table[data-rules-table].
 */
body.ref-rules{--rules-col-primary:112px;--rules-col-dist:118px}

body.ref-rules .rule-block{margin-bottom:9px!important;border:1px solid #cbd9e1!important;background:#fff!important;box-shadow:none!important}
body.ref-rules .rule-block>summary{list-style:none!important;min-height:43px!important;padding:0 14px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;cursor:pointer!important;user-select:none!important;background:#fff!important;color:#173f57!important;border:0!important}
body.ref-rules .rule-block>summary::-webkit-details-marker{display:none!important}
body.ref-rules .rule-block>summary::marker{content:""!important}
body.ref-rules .rule-block>summary::before{content:none!important;display:none!important}
body.ref-rules .rule-block>summary strong{color:#173f57!important;font-size:15px!important;font-weight:900!important}
body.ref-rules .rule-block>summary::after{content:"+";flex:0 0 27px;width:27px;height:27px;border:1px solid #aac0cc;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#567489;background:#fff;font-size:18px;font-weight:500;line-height:1}
body.ref-rules .rule-block>summary:hover{background:#f8fbfc!important}
body.ref-rules .rule-block[open]>summary{background:#fff!important;border-bottom:0!important}
body.ref-rules .rule-block[open]>summary::after{content:"−"}

/* One full-width definition list for basic / A-G explanation text at every viewport. */
body.ref-rules .rules-explanation{
  display:block;
  box-sizing:border-box;
  width:100%;
  margin:0;
  padding:0;
  border-top:1px solid #cbd9e1;
  border-bottom:1px solid #cbd9e1;
  background:#fff;
}
body.ref-rules .rules-explanation>dt,
body.ref-rules .rules-explanation>dd{
  display:block;
  box-sizing:border-box;
  width:100%;
  min-width:0;
  margin:0;
  text-align:left;
  overflow-wrap:anywhere;
}
body.ref-rules .rules-explanation>dt{
  padding:9px 11px;
  border-bottom:1px solid #e4ebef;
  background:#eaf2f6;
  color:#4f6778;
  font-size:11px;
  font-weight:900;
}
body.ref-rules .rules-explanation>dd{
  padding:10px 12px;
  background:#fff;
  color:#40596d;
  font-size:12px;
  line-height:1.65;
}
body.ref-rules .rules-explanation>dd+dt{border-top:1px solid #e4ebef}
/* Keep wide rules tables scrollable inside their own viewport, not the page. */
body.ref-rules .table-wrap{
  box-sizing:border-box;
  display:block;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
}
body.ref-rules .rule-block .table-wrap{max-height:520px!important;overflow:auto!important;position:relative!important}

body.ref-rules table[data-rules-table]{width:100%!important;table-layout:fixed!important;border-collapse:collapse!important;border:1px solid #cbd9e1!important;background:#fff!important;box-shadow:none!important}
body.ref-rules table[data-rules-table] col.rules-col-primary-col{width:var(--rules-col-primary)!important}
body.ref-rules table[data-rules-table] col.rules-col-dist-col{width:var(--rules-col-dist)!important}
html body.ref-rules .methodology .principle>span{display:block!important}
html body.ref-rules .methodology .metric-term{color:inherit!important;font-weight:850!important}
html body.ref-rules .rules-all-notes{margin-top:6px!important;color:inherit!important;font-size:10.5px!important;line-height:1.5!important;font-weight:400!important}

/* Special-ability search: Flat Integrated. */
html body.ref-rules .rules-section-search{margin:0 0 10px!important}
html body.ref-rules .rules-search-row{display:flex!important;align-items:stretch!important;width:min(520px,100%)!important;gap:0!important;margin:0!important}
html body.ref-rules .rules-search-row input{flex:1 1 auto!important;min-width:0!important;height:36px!important;margin:0!important;padding:0 38px 0 12px!important;border:1px solid #b9cbd4!important;border-right:0!important;background-color:#fff!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23537181' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 11px center!important;background-size:15px 15px!important;color:#274657!important;outline:0!important;box-shadow:none!important}
html body.ref-rules .rules-search-row input:focus{border-color:#7899a8!important;box-shadow:inset 0 0 0 1px #7899a8!important}
html body.ref-rules .rules-search-row button{flex:0 0 auto!important;height:36px!important;margin:0!important;padding:0 18px!important;border:1px solid #d7193f!important;background:#d7193f!important;color:#fff!important;font-size:12px!important;font-weight:900!important;cursor:pointer!important}
html body.ref-rules .rules-search-row button:hover{border-color:#b91434!important;background:#b91434!important}

/* Special abilities: keep the two prose columns at a strict 4:6 ratio. */
html body.ref-rules table.rules-special-table col.rules-col-primary-col{width:9.30%!important}
html body.ref-rules table.rules-special-table col.rules-col-criteria-col{width:32.36%!important}
html body.ref-rules table.rules-special-table col.rules-col-reason-col{width:48.54%!important}
html body.ref-rules table.rules-special-table col.rules-col-dist-col{width:9.80%!important}

/* Distribution: use the basic table's 86px + 12 equal-track geometry exactly. */
html body.ref-rules #collected-player-distribution .trajectory-distribution-table{
  min-width:0!important;
  width:100%!important;
  display:grid!important;
  grid-template-columns:86px minmax(0,1fr) minmax(0,1fr) repeat(4,minmax(0,2.25fr)) minmax(0,1fr)!important;
}
html body.ref-rules #collected-player-distribution .trajectory-distribution-table thead,
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody,
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tr{display:contents!important}
html body.ref-rules #collected-player-distribution .trajectory-distribution-table th,
html body.ref-rules #collected-player-distribution .trajectory-distribution-table td{height:auto!important;min-height:31px!important}
/* Keep 4-1 two-line cells unchanged; vertically center the single-line cells. */
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(1),
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(2),
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(3),
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(8){display:flex!important;align-items:center!important}
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(1){justify-content:flex-start!important}
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(2),
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(3),
html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(8){justify-content:center!important}
body.ref-rules table[data-rules-table] th,
body.ref-rules table[data-rules-table] td{min-width:0!important;padding:10px 10px!important;border-top:0!important;border-left:0!important;border-right:1px solid #e4ebef!important;border-bottom:1px solid #e4ebef!important;background:#fff!important;font-size:11px!important;line-height:1.55!important;vertical-align:middle!important;text-align:center!important;white-space:normal!important}
/* Unbroken model coefficients and long metric expressions must wrap inside cells. */
body.ref-rules table[data-rules-table] td{overflow-wrap:anywhere!important;word-break:break-word!important}
body.ref-rules table[data-rules-table] td :is(code,pre),
body.ref-rules .rules-explanation>dd :is(code,pre){
  white-space:pre-wrap!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  max-width:100%;
}
body.ref-rules table[data-rules-table] th{background:#eaf2f6!important;color:#4f6778!important;font-weight:900!important}
html body.ref-rules table.ag-family-table tbody td,
html body.ref-rules table.rules-special-table tbody td{background:#fff!important}
body.ref-rules table[data-rules-table] td.rules-prose{text-align:left!important}
body.ref-rules table[data-rules-table] th:last-child,
body.ref-rules table[data-rules-table] td:last-child{border-right:0!important}
body.ref-rules table[data-rules-table] tbody tr:last-child td{border-bottom:0!important}
body.ref-rules table[data-rules-table] thead th{position:sticky!important;top:0!important;z-index:4!important}
body.ref-rules table[data-rules-table] th:first-child,
body.ref-rules table[data-rules-table] td:first-child{position:sticky!important;left:0!important;z-index:3!important}
body.ref-rules table[data-rules-table] th:last-child,
body.ref-rules table[data-rules-table] td:last-child{position:sticky!important;right:0!important;z-index:3!important;box-shadow:-1px 0 0 #cbd9e1!important}
body.ref-rules table[data-rules-table] th:first-child,
body.ref-rules table[data-rules-table] th:last-child{z-index:6!important;background:#eaf2f6!important;color:#4f6778!important}

@media(max-width:760px){
  /* Do not let a long table or formula make the whole mobile viewport pan. */
  html:has(>body.ref-rules),body.ref-rules{overflow-x:clip}
  body.ref-rules :is(main.shell,.rule-block,.rules-section,.ag-groups){min-width:0!important;max-width:100%!important}
  body.ref-rules table[data-rules-table]{min-width:820px!important}
  body.ref-rules table.basic-rules-table th:first-child,
  body.ref-rules table.basic-rules-table th:last-child,
  body.ref-rules table.ag-family-table th:first-child,
  body.ref-rules table.ag-family-table th:last-child,
  body.ref-rules table.rules-special-table th:first-child,
  body.ref-rules table.rules-special-table th:last-child{left:auto!important;right:auto!important;z-index:4!important;box-shadow:none!important}
  body.ref-rules table.basic-rules-table td:first-child,
  body.ref-rules table.basic-rules-table td:last-child,
  body.ref-rules table.ag-family-table td:first-child,
  body.ref-rules table.ag-family-table td:last-child,
  body.ref-rules table.rules-special-table td:first-child,
  body.ref-rules table.rules-special-table td:last-child{position:static!important;left:auto!important;right:auto!important;z-index:auto!important;box-shadow:none!important}

  /* MOBILE_DISTRIBUTION_COLUMNS_V1 — mobile-only distribution table contract. */
  html body.ref-rules #collected-player-distribution{--mobile-dist-meta-col:86px}
  html body.ref-rules #collected-player-distribution .trajectory-distribution-table{
    min-width:780px!important;
    grid-template-columns:var(--mobile-dist-meta-col) var(--mobile-dist-meta-col) repeat(4,minmax(110px,1fr)) var(--mobile-dist-meta-col)!important;
  }
  html body.ref-rules #collected-player-distribution .score-distribution-table{
    min-width:900px!important;
    width:100%!important;
    display:grid!important;
    grid-template-columns:var(--mobile-dist-meta-col) var(--mobile-dist-meta-col) repeat(8,minmax(72px,1fr)) var(--mobile-dist-meta-col)!important;
  }
  html body.ref-rules #collected-player-distribution .score-distribution-table thead,
  html body.ref-rules #collected-player-distribution .score-distribution-table tbody,
  html body.ref-rules #collected-player-distribution .score-distribution-table tr{display:contents!important}
  html body.ref-rules #collected-player-distribution .score-distribution-table th,
  html body.ref-rules #collected-player-distribution .score-distribution-table td{min-width:0!important}

  /* Match the trajectory distribution's visible two-line row height on mobile.
     Keep column widths, horizontal scrolling and desktop sizing unchanged. */
  html body.ref-rules #collected-player-distribution .score-distribution-table tbody td{
    box-sizing:border-box!important;
    height:auto!important;
    min-height:42px!important;
    align-content:center!important;
  }

  /* Mobile: trajectory hides median; basic scores hide median and exact-100. */
  html body.ref-rules #collected-player-distribution .trajectory-distribution-table thead th:nth-child(3),
  html body.ref-rules #collected-player-distribution .trajectory-distribution-table tbody td:nth-child(3),
  html body.ref-rules #collected-player-distribution .score-distribution-table thead th:nth-child(3),
  html body.ref-rules #collected-player-distribution .score-distribution-table tbody td:nth-child(3),
  html body.ref-rules #collected-player-distribution .score-distribution-table thead th:nth-child(4),
  html body.ref-rules #collected-player-distribution .score-distribution-table tbody td:nth-child(4){display:none!important}

}

/* RULES_ERA_V4_20261023 -- approved, expanded content only.
   Ability summary rows, header, navigation and unrelated tables are unchanged.
   One shared 88px first-column width for every Basic and A-G era table. */
body.ref-rules .rule-mock-content{--rules-value-column-width:88px;min-width:0;width:100%;padding:0;background:#fff;border-top:1px solid #cbd9e1}
body.ref-rules .rule-mock-content .mock-position{min-width:0;padding:0}
body.ref-rules .rule-mock-content .mock-position+.mock-position{border-top:8px solid #f4f8fa}
body.ref-rules .rule-mock-content .mock-position-title{margin:0;padding:12px 13px 10px;background:#f4f8fa;border-bottom:1px solid #d4e0e7;color:#234e62;font-size:14px;font-weight:900;letter-spacing:0}
body.ref-rules .rule-mock-content .mock-era{padding:0;margin:0;min-width:0;background:#fff}
body.ref-rules .rule-mock-content .mock-era+.mock-era{border-top:8px solid #f4f8fa}
body.ref-rules .rule-mock-content .mock-era-year{margin:0;padding:10px 12px;background:#f8fafb;color:#285267;font-size:14px;line-height:1.5;font-weight:900;border-bottom:1px solid #dce8ed;letter-spacing:0}
body.ref-rules .rule-mock-content .mock-methodology{border-top:0!important;border-bottom:0!important}
body.ref-rules .rule-mock-content .mock-methodology>dt{padding:9px 12px!important;font-size:11px!important;background:#eaf2f6!important;border-top:0!important;border-bottom:1px solid #e0e9ee!important;color:#506a7b!important;font-weight:900!important}
body.ref-rules .rule-mock-content .mock-methodology>dd{padding:12px 13px!important;line-height:1.85!important;font-size:12px!important;white-space:normal!important;overflow-wrap:anywhere!important;color:#40596d!important;background:#fff!important}
body.ref-rules .rule-mock-content .mock-grade-distinct{display:flex;gap:9px;align-items:flex-start;border-bottom:1px solid #ebf0f3;padding:8px 0}
body.ref-rules .rule-mock-content .mock-grade-distinct:first-child{padding-top:0}
body.ref-rules .rule-mock-content .mock-grade-distinct:last-child{padding-bottom:0;border-bottom:0}
body.ref-rules .rule-mock-content .mock-grade-scope{color:#234a5e;min-width:33px;font-size:11px;font-weight:900;flex:none}
body.ref-rules .rule-mock-content .mock-grade-distinct>span:last-child{flex:1;min-width:0}
body.ref-rules .rule-mock-content .mock-criteria{display:block;min-width:0;border-top:1px solid #d8e5eb;background:#fff}
html body.ref-rules .rule-block .rule-mock-content .table-wrap.mock-criteria-table-wrap{box-sizing:border-box;display:block;width:100%!important;max-width:100%!important;min-width:0!important;max-height:420px!important;overflow-x:hidden!important;overflow-y:auto!important;border-top:1px solid #e4ebef}
html body.ref-rules .rule-block .rule-mock-content .mock-criteria-table-wrap table[data-rules-table]{box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important;border-collapse:collapse!important}
body.ref-rules .rule-mock-content .mock-criteria-table-wrap table col.mock-value-column,
body.ref-rules .rule-mock-content .mock-criteria-table-wrap table th:first-child,
body.ref-rules .rule-mock-content .mock-criteria-table-wrap table td:first-child{box-sizing:border-box!important;width:var(--rules-value-column-width)!important;min-width:var(--rules-value-column-width)!important;max-width:var(--rules-value-column-width)!important}
html body.ref-rules .rule-block .rule-mock-content .mock-criteria-table-wrap table[data-rules-table] :is(th,td){box-sizing:border-box!important;min-width:0!important;max-width:100%!important;padding:7px 5px!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important}
body.ref-rules .rule-mock-content .mock-criteria-table-wrap table td{font-variant-numeric:tabular-nums}
body.ref-rules .rule-mock-content .mock-criteria-table-wrap table td strong{color:#1c4d62}
/* All criterion subrows in Basic / A-G follow the same centered alignment. */
body.ref-rules .rule-mock-content .mock-rule-line{padding:3px 0;border-bottom:1px solid #eef3f6;overflow-wrap:anywhere;text-align:center}
body.ref-rules .rule-mock-content .mock-rule-line:last-child{border-bottom:0}
@media(max-width:760px){
 body.ref-rules .rule-mock-content{max-width:100%;overflow-x:hidden}
 html body.ref-rules .rule-block .rule-mock-content .mock-criteria-table-wrap table[data-rules-table] :is(th,td){font-size:10px!important;line-height:1.4!important;padding:5px 3px!important}
}

