.rulebook {
  --rb-bg: #fff; --rb-soft: #f6f7f8; --rb-line: #e6e8eb; --rb-text: #2b2d31; --rb-muted: #80858d; --rb-accent: #1c95f3;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; color: var(--rb-text);
}
html.dark-mode .rulebook { --rb-bg: var(--dm-surface); --rb-soft: var(--dm-surface-2); --rb-line: var(--dm-border); --rb-text: var(--dm-text); --rb-muted: var(--dm-muted); --rb-accent: var(--dm-accent); }
.rulebook p { margin: 0; color: inherit; font-size: inherit; line-height: inherit; }
.rulebook a { transition: color .15s ease, border-color .15s ease; }
.rb-label { margin-bottom: 8px !important; color: var(--rb-muted) !important; font: 700 10.5px "Roboto", sans-serif !important; letter-spacing: .08em; text-transform: uppercase; }

/* Kenar çubuğu */
.rb-aside { position: sticky; top: 20px; padding: 20px; border: 1px solid var(--rb-line); border-radius: 12px; background: var(--rb-soft); }
.rb-nav { display: flex; flex-direction: column; border-left: 1px solid var(--rb-line); }
.rb-nav-item { display: flex; align-items: baseline; gap: 8px; margin-left: -1px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; color: var(--rb-muted); font-size: 13.5px; }
.rb-nav-item:hover { color: var(--rb-text); }
.rb-nav-item.is-selected { border-color: var(--rb-text); color: var(--rb-text); font-weight: 700; }
.rb-nav-number { flex-shrink: 0; width: 18px; font-variant-numeric: tabular-nums; }
.rb-nav-name { flex: 1; min-width: 0; }
.rb-nav-count { color: var(--rb-muted); font-size: 11.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.rb-nav-all { margin-top: 6px; padding-top: 11px; border-top: 1px solid var(--rb-line); }
.rb-nav-all .fa { font-size: 11px; }
.rb-side-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rb-line); }
.rb-side-title { display: block; margin-bottom: 4px; color: var(--rb-text); font-size: 13px; font-weight: 700; line-height: 1.4; }
.rb-updated-at { margin-top: 20px !important; padding-top: 14px; border-top: 1px solid var(--rb-line); color: var(--rb-muted) !important; font-size: 12px !important; }
.rb-change { color: var(--rb-muted); font-size: 12.5px; line-height: 1.5; }
.rb-change + .rb-change { margin-top: 8px !important; }
.rb-change time { display: block; color: var(--rb-text); font-size: 11.5px; font-weight: 700; }
.rb-side-text { color: var(--rb-muted); font-size: 12.5px; line-height: 1.55; }
.rb-side-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--rb-accent) !important; font-size: 13px; font-weight: 700; }
.rb-side-link:hover { filter: brightness(1.15); }

/* Üst araçlar ve giriş */
.rb-toolbar { display: flex; gap: 10px; }
.rb-search { position: relative; flex: 1; margin: 0; }
.rb-search .fa { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: var(--rb-muted); font-size: 13px; }
.rb-search input { width: 100%; height: 38px; padding: 0 40px 0 36px; border: 1px solid var(--rb-line); border-radius: 6px; background: var(--rb-bg); color: var(--rb-text); font-size: 13.5px; }
.rb-search input:focus { border-color: var(--rb-text); outline: none; }
.rb-search kbd { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); padding: 0 6px; border: 1px solid var(--rb-line); border-radius: 4px; background: var(--rb-soft); color: var(--rb-muted); font: 11px/18px monospace; box-shadow: none; }
.rb-tool { display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; height: 38px; border: 1px solid var(--rb-line); border-radius: 6px; background: var(--rb-bg); color: var(--rb-muted); font-size: 13px; cursor: pointer; }
.rb-tool:hover { border-color: var(--rb-text); color: var(--rb-text); }
.rb-preamble { margin-top: 22px; padding: 16px 18px; border: 1px solid var(--rb-line); border-radius: 6px; background: var(--rb-soft); font-size: 13.5px; line-height: 1.65; }
.rb-preamble-text + .rb-preamble-text { margin-top: 8px; }
.rb-preamble-text.is-strong { color: var(--rb-text); }
.rb-preamble-text:not(.is-strong) { color: var(--rb-muted); }
.rb-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px !important; padding-top: 12px; border-top: 1px solid var(--rb-line); color: var(--rb-muted) !important; font-size: 12px !important; }
.rb-legend span::before { content: ''; display: inline-block; width: 10px; height: 2px; margin-right: 6px; background: var(--pc); vertical-align: middle; }
.rb-search-info { margin-top: 16px !important; color: var(--rb-muted) !important; font-size: 13px !important; }

/* Bölüm ve maddeler */
.rb-section { margin-top: 30px; }
.rb-section[hidden] { display: none; }
.rb-section + .rb-section { margin-top: 44px; }
.rb-section-head { padding-bottom: 14px; border-bottom: 1px solid var(--rb-line); }
.rb-section-title { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--rb-text); font: 700 20px/1.3 "Exo", sans-serif; text-transform: none; }
.rb-scope { padding: 0 8px; border-radius: 10px; background: var(--rb-soft); color: var(--rb-muted); font: 500 11px/20px "Roboto", sans-serif; }
.rb-anchor { color: var(--rb-line) !important; font-size: 13px; }
.rb-section-head:hover .rb-anchor { color: var(--rb-muted) !important; }
.rb-anchor:hover { color: var(--rb-accent) !important; }
.rb-section-intro { margin-top: 6px; color: var(--rb-muted); font-size: 13.5px; line-height: 1.6; }
.rulebook.is-searching .rb-section-head { padding-bottom: 8px; }
.rulebook.is-searching .rb-section-intro { display: none; }

.rb-rules { margin: 0; padding: 0; list-style: none; }
.rb-rule { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--rb-line); scroll-margin-top: 20px; }
.rb-rule[hidden] { display: none; }
.rb-rule.is-flash { animation: rb-flash 2s ease; }
@keyframes rb-flash { 0%, 50% { background: color-mix(in srgb, var(--rb-accent) 9%, transparent); } }
.rb-rule-number a { color: var(--rb-muted) !important; font-size: 13px; font-weight: 700; line-height: 21px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rb-rule-number a:hover { color: var(--rb-accent) !important; }
.rb-rule-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--rb-text); font: 700 15px/1.45 "Roboto", sans-serif; text-transform: none; }
.rb-tag { padding: 0 6px; border: 1px solid; border-radius: 3px; font: 700 9.5px/16px "Roboto", sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.rb-tag.is-important { border-color: #c62828; color: #c62828; }
.rb-tag.is-new { border-color: #2e7d32; color: #2e7d32; }
html.dark-mode .rb-tag.is-important { border-color: #ef5350; color: #ef5350; }
html.dark-mode .rb-tag.is-new { border-color: #66bb6a; color: #66bb6a; }
.rb-rule-section { color: var(--rb-muted); font-size: 11.5px; font-weight: 400; }
.rb-rule-description { margin-top: 5px; color: var(--rb-muted); font-size: 13.5px; line-height: 1.65; }
.rb-rule-description p + p { margin-top: 6px; }

.rb-penalties { width: auto; margin-top: 10px; border-collapse: collapse; font-size: 13px; }
.rb-penalties th, .rb-penalties td { padding: 3px 0; vertical-align: baseline; }
.rb-penalties th { width: 70px; padding-left: 10px; border-left: 2px solid var(--pc); color: var(--rb-muted); font-weight: 400; text-align: left; white-space: nowrap; }
.rb-penalties td { padding-right: 18px; color: var(--rb-text); }
.rb-note { margin-top: 8px !important; color: var(--rb-muted) !important; font-size: 12.5px !important; font-style: italic; }
.rb-rule-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 10px; }
.rb-action { padding: 0; border: 0; background: none; color: var(--rb-muted); font-size: 12px; cursor: pointer; opacity: .55; transition: opacity .15s ease, color .15s ease; }
.rb-rule:hover .rb-action, .rb-action:focus-visible { opacity: 1; }
.rb-action:hover { color: var(--rb-accent); }
.rb-action .fa { margin-right: 3px; }
.rb-updated { color: var(--rb-muted); font-size: 12px; font-style: italic; }

.rb-no-result, .rb-empty { margin-top: 20px !important; padding: 26px; border: 1px dashed var(--rb-line, #e6e8eb); border-radius: 6px; color: var(--rb-muted, #80858d) !important; font-size: 13.5px; text-align: center; }
.rb-toast { position: fixed; z-index: 9999; bottom: 24px; left: 50%; padding: 9px 16px; border-radius: 6px; background: #2b2d31; color: #fff; font-size: 13px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25); opacity: 0; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.rb-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media screen and (max-width: 860px) {
  .rulebook { grid-template-columns: 1fr; gap: 24px; }
  .rb-aside { position: static; padding: 14px; }
  .rb-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; border-left: 0; }
  .rb-nav-item { margin: 0; padding: 6px 12px; border: 1px solid var(--rb-line); border-radius: 16px; }
  .rb-nav-item.is-selected { border-color: var(--rb-text); }
  .rb-nav-number { width: auto; }
  .rb-nav-all { margin: 0; padding-top: 6px; border-top: 1px solid var(--rb-line); }
  .rb-side-block, .rb-updated-at { display: none; }
  .rb-nav-item { background: var(--rb-bg); }
  .rb-action { opacity: 1; }
}

@media print {
  body * { visibility: hidden; }
  .rb-main, .rb-main * { visibility: visible; }
  .rb-main { position: absolute; top: 0; left: 0; width: 100%; }
  .rb-toolbar, .rb-rule-actions, .rb-anchor, .rb-no-result, .rb-search-info { display: none !important; }
  .rb-section[hidden] { display: block !important; }
  .rb-rule { break-inside: avoid; }
}
