.rules-page { padding-top: 36px; }
.rules-page-head { border-bottom: 1px solid var(--border); padding-bottom: 24px; }
.rules-eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); }
.rules-page h1 { font-size: 36px; line-height: 1.5; margin: 0; padding-left: 20px; border-left: 4px solid var(--primary); }
.rules-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 24px 0 28px; }
.rules-search { display: grid; gap: 8px; width: 100%; margin-bottom: 28px; font-size: 14px; color: var(--text); }
.rules-search input { padding: 12px 14px; font: inherit; font-size: 15px; color: var(--text); border: 1px solid var(--border-strong); border-radius: 6px; width: 100%; background: var(--surface); }
.rules-search input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rules-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rules-actions .btn { padding: 8px 10px; min-height: 40px; font-size: 13px; background: transparent; }
.rules-actions .btn:hover { background: var(--primary-soft); }
.rules-reader-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.rules-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 36px; align-items: start; margin-top: 32px; }
.rules-reader { margin-top: 0; min-width: 0; }
.rules-sidebar { position: sticky; top: 108px; max-height: calc(100dvh - 132px); overflow-y: auto; padding-right: 24px; border-right: 1px solid var(--border); }
.rules-sidebar h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 14px 12px; }
.rules-sidebar nav { display: grid; gap: 4px; }
.rules-nav-link { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.7; color: var(--text); }
.rules-nav-link span:first-child { color: var(--primary); font-weight: 700; }
.rules-nav-link:hover { color: var(--text); background: var(--surface-soft); }
.rules-nav-link[aria-current="true"] { color: var(--primary-dark); background: var(--primary-soft); border-radius: 6px; }
.rules-mobile-chapters { display: none; }
.rules-status { font-size: 14px; color: var(--muted); }
.rules-chapter { border-bottom: 1px solid var(--border); scroll-margin-top: 94px; }
.rules-chapter summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; gap: 12px; align-items: center; list-style: none; cursor: pointer; padding: 20px 8px; }
.rules-chapter summary::-webkit-details-marker { display: none; }
.rules-chapter summary::after { content: ''; width: 20px; height: 20px; background: url('./icons/chevron-down.svg') center / contain no-repeat; }
.rules-chapter[open] summary::after { transform: rotate(180deg); }
.rules-chapter summary:focus-visible, .rules-nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rules-chapter-number { display: grid; place-items: center; height: 36px; font-size: 24px; color: var(--primary-dark); border-right: 1px solid #c6dfee; font-weight: 700; font-variant-numeric: tabular-nums; }
.rules-chapter h2 { margin: 0; font-size: 20px; line-height: 1.7; font-weight: 700; overflow-wrap: anywhere; }
.rules-chapter[open] h2 { display: block; }
.rules-chapter[open] { background: #fff; }
.rules-chapter-body { padding: 0 16px 24px; max-width: 72ch; font-size: 16px; line-height: 1.9; }
.rules-chapter-body p { white-space: pre-line; margin: 0 0 18px; }
.rules-chapter-body h3 { font-size: 15px; line-height: 1.8; margin: 24px 0 10px; }
.rules-chapter-body mark { background: #d9ecfb; color: inherit; border-radius: 2px; }
.rules-error { color: var(--danger); padding: 20px 0; }
.rules-empty { padding: 24px 0; }
.rules-empty h2 { font-size: 18px; }
@media (max-width: 800px) {
  .rules-page h1 { font-size: 26px; }
  .rules-toolbar { align-items: stretch; flex-direction: column; }
  .rules-search { width: 100%; }
  .rules-layout { display: block; }
  .rules-sidebar { position: static; max-height: none; overflow: visible; padding-right: 0; border-right: 0; }
  .rules-sidebar h2, .rules-sidebar nav { display: none; }
  .rules-search { margin-bottom: 24px; }
  .rules-mobile-chapters { display: grid; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
  .rules-mobile-chapters select { width: 100%; min-width: 0; padding: 12px 8px; font: inherit; color: var(--text); border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
  .rules-chapter summary { grid-template-columns: 32px minmax(0, 1fr) 16px; padding: 18px 8px; gap: 10px; }
  .rules-chapter h2 { font-size: 14px; }
  .rules-chapter-body { padding: 0 16px 16px; }
}
