.site-tabs { flex-wrap:wrap }
.rule-head,.rule-head-actions,.rule-tools,.rule-title,.rule-outcome,.rule-enable { display:flex;align-items:center;gap:8px }
.rule-head { justify-content:space-between;gap:16px;flex-wrap:wrap }
.rule-head h2 { margin:0 }
.rule-head h2 small { color:var(--muted);font-size:.75rem;font-weight:500;margin-left:4px }
.rule-head .subtext { margin:8px 0 0 }
.rule-head-actions { gap:16px;flex-wrap:wrap }
.rule-empty { padding:24px 0 2px;border-top:1px solid var(--line);color:var(--muted) }
.rule-list { list-style:none;margin:18px 0 0;padding:0 }
.rule-row { display:grid;grid-template-columns:28px minmax(140px,1fr) auto;align-items:start;gap:10px;padding:16px 0;border-top:1px solid var(--line) }
.rule-row:last-child { padding-bottom:0 }
.rule-index { padding-top:2px;color:var(--muted);font-size:.85rem;font-variant-numeric:tabular-nums }
.rule-title,.rule-tools { flex-wrap:wrap }
.rule-title strong,.rule-conditions,.rule-delete-name { overflow-wrap:anywhere }
.rule-state { font-size:.72rem;color:var(--muted) }
.rule-state.on { color:#9bdbbb }
.rule-conditions,.rule-outcome { font-size:.82rem;line-height:1.5;margin:4px 0 0;color:var(--muted) }
.rule-outcome { color:#c6e1fd }
.rule-outcome canvas { width:14px;height:14px;flex:none }
.rule-tools { justify-content:flex-end;gap:4px;align-self:center }
.rule-control { min-width:34px;min-height:34px;border:1px solid var(--line);border-radius:6px;background:transparent;color:#e0e7ef;font:inherit;font-size:.78rem;padding:4px 8px;cursor:pointer }
.rule-control:hover:enabled { background:#20324a }
.rule-control:disabled { cursor:default;opacity:.4 }
.rule-control[data-rule-op="delete"] { color:#e8a8ba }
.rule-domain { margin:0 0 16px;color:var(--muted);font-size:.85rem;overflow-wrap:anywhere }
.rule-fields { display:grid;grid-template-columns:1fr 1.45fr;gap:12px }
.rule-enable { min-height:36px;width:max-content;font-size:.9rem;cursor:pointer }
.rule-enable input { accent-color:#86bffb;width:17px;height:17px }
.rule-warning { background:#352a21;color:#eed3ac;border-radius:6px;padding:9px 12px }
.rule-dialog [data-rule-latest] { overflow-wrap:anywhere }
.history-versions,.history-changes { list-style:none;margin:12px 0 16px;padding:0 }
.history-versions li+li,.history-change { border-top:1px solid var(--line) }
.history-version { display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;padding:13px 6px;background:transparent;text-align:left;color:inherit;border:0;border-radius:4px;cursor:pointer;font:inherit }
.history-version:hover { background:#1b2a3e }
.history-version strong,.history-version small { display:block }
.history-version small,.history-version>span:last-child,.history-change p { color:var(--muted);font-size:.83rem }
.history-version small { margin-top:5px;overflow-wrap:anywhere }
.history-version>span:last-child { flex:none }
.history-dialog { overflow-wrap:anywhere }
.history-dialog h2:focus:not(:focus-visible) { outline:none }
.history-change { padding:12px 0 }
.history-change>div,.history-consent { display:flex;align-items:center;gap:10px }
.history-change>div { flex-wrap:wrap;justify-content:space-between }
.history-change>div span { color:#b5cde7;font-size:.8rem }
.history-change dl,.history-change p { margin:6px 0 0 }
.history-change dl>div { display:grid;grid-template-columns:minmax(72px,.7fr) minmax(0,1.3fr);gap:10px;margin-top:4px;font-size:.85rem }
.history-change dt,.history-change del { color:var(--muted) }
.history-change dd { margin:0 }
.history-change ins { color:#b5e7cd;text-decoration:none }
.history-consent { min-height:44px;cursor:pointer }
.history-consent input { accent-color:#86bffb;width:18px;height:18px;flex:none }
.history-dialog .dialog-foot { flex-wrap:wrap }
.rule-dialog .dialog-foot,.rule-panel [data-rules-error]:not(:empty){ margin-top:16px }
@media(max-width:1150px){
  .rule-row {grid-template-columns:24px minmax(0,1fr)}
  .rule-tools {grid-column:2;justify-content:flex-start}
}
@media(max-width:650px){
  .rule-head-actions {gap:10px}
  .rule-fields {grid-template-columns:1fr 1.25fr;gap:8px}
  .rule-tools {gap:5px}
  .rule-control {min-height:44px}
  .rule-dialog .dialog-foot {position:sticky;bottom:0;background:var(--card,#131e2d);padding:8px 0}
}
#rule-preview-form [data-preview-result]:not(:empty) { margin:15px 0; padding:12px 15px; border-left:3px solid #8ab6e6; background:#172436; border-radius:4px; overflow-wrap:anywhere }
#rule-preview-form [data-preview-result] p { margin:.4rem 0 }
#rule-preview-form [data-preview-result] small { color:var(--muted) }
.rule-row:has(.rule-count) {grid-template-columns:28px minmax(140px,1fr) minmax(90px,auto) auto}
.rule-count {align-self:center;display:grid;gap:3px;font-variant-numeric:tabular-nums}
.rule-count small,.rule-activity-foot small {color:var(--muted);font-size:.76rem}
.rule-count strong {font-size:1rem}
.rule-activity-foot {display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;padding-top:14px;border-top:1px solid var(--line);margin-top:14px}
.rule-activity-foot a {color:var(--violet);font-size:.83rem;text-decoration:underline}
.rule-activity-foot [hidden] {display:none}
@media(max-width:1150px){
  .rule-row:has(.rule-count) {grid-template-columns:24px minmax(0,1fr) minmax(72px,auto)}
  .rule-row:has(.rule-count) .rule-tools {grid-column:2/-1}
}
@media(max-width:480px){
  .rule-row:has(.rule-count) {grid-template-columns:20px minmax(0,1fr)}
  .rule-count {grid-column:2;display:flex;align-items:baseline;gap:.5em}
}
