/* Uses shared theme variables so both palettes remain available. */
.main-nav .rules-nav { border: 0; background: transparent; padding: 0; color: inherit; white-space: nowrap; }
.main-nav .rules-nav:hover { color: var(--acid); }
.rules-sidebar { margin-top: 16px; width: 100%; justify-content: space-between; }
.rules-home { margin-top: 20px; font-size: 14px; }
.rules-dialog {
  width: min(1080px, calc(100% - 40px)); max-width: none; max-height: 88dvh;
  padding: 0; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); color: var(--text); box-shadow: 0 40px 110px #0005;
}
.rules-dialog[open] { display: flex; flex-direction: column; animation: rules-arrive .35s var(--ease) both; }
.rules-dialog::backdrop { background: #101f3780; backdrop-filter: blur(10px); }
.rules-top { flex-shrink: 0; padding: 28px 30px 20px; border-bottom: 1px solid var(--line); }
.rules-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rules-top h2 { font-size: clamp(23px, 3vw, 32px); line-height: 1.3; margin: 8px 0 12px; }
.rules-intro { color: var(--muted); font-size: 14px; line-height: 1.9; max-width: 850px; }
.rules-notice { color: var(--text); background: var(--surface-up); border-left: 3px solid var(--acid); padding: 10px 14px; font-size: 13px; margin-top: 14px; }
.rules-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.rules-filters .search-field { flex: 1 1 260px; min-width: 0; margin: 0; background: var(--surface-up); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; }
.rules-filters input { color: var(--text); width: 100%; font-size: 14px; }
.rules-filters input::placeholder { color: var(--dim); }
.rules-filters select, .rules-refresh { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); background: var(--surface-up); font-size: 13px; }
.rules-refresh:hover { border-color: var(--acid); }
.rules-status-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 14px; font-size: 12px; color: var(--muted); }
.rules-body { min-height: 120px; overflow: auto; overscroll-behavior: contain; padding: 0 30px 20px; }
.rules-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; line-height: 1.9; }
.rules-table thead { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.rules-table th, .rules-table td { padding: 15px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rules-table thead th { color: var(--muted); font-weight: 500; }
.rules-table th:first-child { width: 130px; }
.rules-table th[scope="row"] { border-right: 1px solid var(--line); font-weight: 500; }
.rules-table code { color: var(--acid); font-size: 13px; white-space: nowrap; }
.rules-table .rules-group th { width: auto; background: var(--surface-up); font-weight: 600; color: var(--text); padding: 10px 18px; }
.rules-group span { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 12px; }
.rule-mode { display: block; font-size: 11px; margin-top: 4px; color: var(--muted); white-space: nowrap; }
.rule-mode-manual_review { color: var(--lilac); }
.rules-bottom { flex-shrink: 0; padding: 12px 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.rules-empty { padding: 45px 5px; color: var(--muted); }
@keyframes rules-arrive { from { opacity: 0; transform: translateY(22px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 650px) {
  .rules-dialog { width: calc(100% - 16px); max-height: 94dvh; border-radius: 17px; }
  .rules-top { padding: 20px 16px 14px; }
  .rules-body { padding: 0 10px 14px; }
  .rules-table th, .rules-table td { padding: 12px 10px; }
  .rules-table th:first-child { width: 96px; }
  .rules-table { font-size: 13px; }
  .rules-table code { font-size: 12px; }
  .rules-bottom { padding: 10px 16px; }
  .rules-filters select { flex: 1; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .rules-dialog[open] { animation: none; } }
