:root {
  color-scheme: dark;
  --bg: #0a0b0f;
  --surface: #12141b;
  --raised: #171a23;
  --hover: #1b1f2a;
  --line: #222634;
  --line-strong: #2e3342;
  --text: #e9ebf1;
  --muted: #8e95a8;
  --faint: #5f667a;
  --accent: #ff5cab;
  --accent-hover: #ff7ebd;
  --accent-soft: rgba(255, 92, 171, 0.14);
  --ok: #3fb67b;
  --ok-soft: rgba(63, 182, 123, 0.14);
  --bad: #ef5a5f;
  --bad-soft: rgba(239, 90, 95, 0.14);
  --warn: #f2a93b;
  --warn-soft: rgba(242, 169, 59, 0.14);
  --info: #4aa8f0;
  --info-soft: rgba(74, 168, 240, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset, 0 12px 32px rgba(0, 0, 0, 0.30);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: #2e3342 transparent; }
::selection { background: rgba(255, 92, 171, 0.35); }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(255, 92, 171, 0.10), transparent 60%),
    radial-gradient(900px 460px at 96% -12%, rgba(139, 92, 246, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
time { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.burger { display: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 18px 14px; background: rgba(18, 20, 27, 0.78); backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand-icon, .brand-fallback { width: 40px; height: 40px; border-radius: 12px; flex: none; object-fit: cover; }
.brand-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #c05cff); font-weight: 700; font-size: 17px; box-shadow: 0 6px 18px rgba(255, 92, 171, 0.28); }
.brand-name { font-weight: 650; line-height: 1.2; }
.brand-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.menu-label { color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; transition: background 0.15s, color 0.15s; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav[aria-current="page"] { background: linear-gradient(90deg, rgba(255, 92, 171, 0.20), rgba(255, 92, 171, 0.05)); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav[aria-current="page"] .i { color: var(--accent-hover); }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--line); margin-top: 10px; }
.me-text { min-width: 0; }
.me-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { color: var(--muted); font-size: 12px; }
.me form { margin-left: auto; }

.main { min-width: 0; }
.content { padding: 34px clamp(18px, 4vw, 52px) 60px; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.page-head h1 { font-size: 27px; font-weight: 750; letter-spacing: -0.025em; }
.page-head p { color: var(--muted); margin-top: 4px; }

.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); align-items: start; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.eq { align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 120px), var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-body { padding: 18px 20px; }
.fill { display: flex; flex-direction: column; }
.fill > .grow { flex: 1; }
.stackform { display: flex; flex-direction: column; gap: 14px; }
.stackform .field { margin: 0; }
.stackform .btn-row.end { margin-top: auto; }
.state { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); border: 1px solid rgba(63, 182, 123, 0.28); }
.state.off { background: var(--bad-soft); border-color: rgba(239, 90, 95, 0.3); }
.state.off .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.state b { display: block; font-weight: 650; line-height: 1.3; }
.state span.sub { color: var(--muted); font-size: 12.5px; }
.subhead { padding: 14px 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.inline { display: flex; gap: 10px; align-items: stretch; }
.inline input { flex: 1; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.card-head h2 .i { color: var(--muted); }
.card-head .meta { color: var(--muted); font-size: 12.5px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }

.stat { padding: 18px 20px; display: flex; align-items: center; gap: 14px; transition: border-color 0.15s, transform 0.15s; }
a.stat:hover { border-color: rgba(255, 92, 171, 0.45); transform: translateY(-2px); }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-hover); }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.bad { background: var(--bad-soft); color: var(--bad); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-n { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.stat-l { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: rgba(255, 255, 255, 0.02); }
th { text-align: left; color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 11px 16px; white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
td.wrap { min-width: 110px; max-width: 320px; overflow-wrap: break-word; }
td.right, th.right { text-align: right; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--raised); flex: none; }
.avatar.ph { display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, #ff5cab, #8b5cf6); }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.usercell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.uname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.uname:hover { color: var(--accent-hover); }
.uid { color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.copy { background: none; border: 0; color: var(--faint); padding: 2px; cursor: pointer; border-radius: 5px; display: inline-grid; }
.copy:hover { color: var(--text); background: var(--hover); }
.copy .i { width: 13px; height: 13px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--raised); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent-hover); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); display: inline-block; }

.btn, button { font: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; background: linear-gradient(135deg, #ff6db5, #f0489a); color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 6px 16px rgba(255, 92, 171, 0.22); transition: filter 0.15s, border-color 0.15s, opacity 0.15s, transform 0.1s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.ghost { background: var(--raised); border-color: var(--line-strong); color: var(--text); box-shadow: none; }
.btn.ghost:hover { background: var(--hover); filter: none; }
.btn.ok { background: var(--ok); box-shadow: 0 6px 16px rgba(63, 182, 123, 0.2); }
.btn.bad { background: var(--bad); box-shadow: 0 6px 16px rgba(239, 90, 95, 0.2); }
.btn.soft-bad { background: var(--bad-soft); color: var(--bad); box-shadow: none; border-color: rgba(239, 90, 95, 0.18); }
.btn.soft-bad:hover { background: rgba(239, 90, 95, 0.22); filter: none; }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn.icon { padding: 7px; min-width: 38px; }
.btn.icon.sm { min-width: 32px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row.split .btn { flex: 1 1 190px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.hint { color: var(--faint); font-size: 12px; }
input, select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px; font: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e95a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #3b4153; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search input { padding-left: 36px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle:first-of-type { border-top: 0; }
.toggle b { display: block; font-weight: 600; }
.toggle input { appearance: none; width: 42px; height: 24px; min-height: 0; padding: 0; margin: 0; border-radius: 99px; background: var(--line-strong); border: 0; position: relative; flex: none; cursor: pointer; transition: background 0.15s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.18s; }
.toggle input:checked { background: var(--ok); }
.toggle input:checked::after { transform: translateX(18px); }

.params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 14px; }
.params .field { margin: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; max-height: 210px; overflow: auto; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; padding: 3px 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checks input { width: 16px; min-height: 16px; height: 16px; padding: 0; flex: none; accent-color: var(--accent); }
@media (max-width: 560px) { .params { grid-template-columns: 1fr; } }

.savebar { position: sticky; bottom: 20px; height: 0; margin-top: 28px; z-index: 30; }
.savebar-in { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px 12px 18px; background: rgba(23, 26, 35, 0.94); backdrop-filter: blur(14px); border: 1px solid rgba(255, 92, 171, 0.35); border-radius: 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 92, 171, 0.08); transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.savebar.armed .savebar-in { opacity: 0; transform: translateY(26px) scale(0.98); pointer-events: none; }
.savebar.armed.show .savebar-in { opacity: 1; transform: none; pointer-events: auto; }
.savebar-text { display: flex; align-items: center; gap: 12px; min-width: 0; }
.savebar-text b { display: block; font-weight: 600; font-size: 14px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 0 rgba(255, 92, 171, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255, 92, 171, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 92, 171, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } .savebar-in { transition: none; } }
.rule .card-body { transition: opacity 0.15s; }

.toasts { position: fixed; top: 18px; right: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line-strong); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45); animation: toast-in 0.25s ease, toast-out 0.4s ease 7s forwards; cursor: pointer; }
.toast.ok { border-color: rgba(63, 182, 123, 0.5); }
.toast.ok .i { color: var(--ok); }
.toast.err { border-color: rgba(239, 90, 95, 0.55); }
.toast.err .i { color: var(--bad); }
.toast .i { margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; transform: translateY(-8px); } }

.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .i { width: 54px; height: 54px; padding: 14px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); color: var(--faint); margin-bottom: 12px; }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--accent); }
.chart .bar.zero { fill: var(--line-strong); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 13px; font-family: var(--font); }
.chart text.val { fill: var(--text); font-weight: 600; }

.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.kv > div:first-child { border-top: 0; padding-top: 0; }
.kv span:first-child { color: var(--muted); }
.kv b { font-weight: 600; }

details.qa { border-top: 1px solid var(--line); }
details.qa summary { cursor: pointer; padding: 12px 20px; color: var(--muted); font-weight: 550; list-style: none; display: flex; align-items: center; gap: 8px; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
details.qa[open] summary::before { transform: rotate(45deg); }
.answers { padding: 4px 20px 16px; counter-reset: q; }
.answer { padding: 10px 0; border-top: 1px solid var(--line); }
.answer:first-child { border-top: 0; }
.answer b { display: block; color: var(--muted); font-size: 12.5px; font-weight: 550; margin-bottom: 2px; }
.answer b::before { counter-increment: q; content: counter(q) ". "; color: var(--accent-hover); }
.answer p { white-space: pre-wrap; overflow-wrap: anywhere; }

.pager { display: flex; align-items: center; gap: 6px; }
.pager a, .pager span { min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); font-weight: 550; }
.pager a:hover { background: var(--hover); }
.pager .on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .off { opacity: 0.4; }
.filters { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; }

.profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile h2 { font-size: 19px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); text-align: center; padding: 38px 32px; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: -40% -20% auto; height: 220px; background: radial-gradient(closest-side, rgba(255, 92, 171, 0.32), transparent); pointer-events: none; }
.login-card > * { position: relative; }
.login-logo { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 18px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #c05cff); font-weight: 800; font-size: 24px; box-shadow: 0 10px 30px rgba(255, 92, 171, 0.4); }
.login-card h1 { font-size: 22px; letter-spacing: -0.02em; }
.login-card .lead { color: var(--muted); margin: 6px 0 24px; }
.login-card .btn { width: 100%; padding: 12px 18px; }
.login-card .foot { color: var(--faint); font-size: 12.5px; margin-top: 18px; }
.login-card .alert { background: var(--bad-soft); color: #ffb3b6; border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 16px; font-size: 13.5px; }

@media (max-width: 1050px) {
  .cols, .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.three { grid-template-columns: minmax(0, 1fr); }
  .btn-row .btn { flex: 1 1 100%; }
  .btn-row .btn.icon { flex: 0 0 auto; }
  .stat { padding: 14px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-n { font-size: 22px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: auto; z-index: 40; flex-direction: column; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .burger { display: grid; place-items: center; position: absolute; right: 14px; top: 12px; width: 40px; height: 40px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line-strong); cursor: pointer; }
  .menu, .me { display: none; }
  .nav-toggle:checked ~ .sidebar .menu { display: flex; padding-top: 10px; max-height: 70vh; }
  .nav-toggle:checked ~ .sidebar .me { display: flex; }
  .content { padding-top: 24px; }
  .filters { grid-template-columns: 1fr; }
  th, td { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

details.qa summary .rt { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
details.qa > form.card-body { padding-top: 4px; }
.btn-row.between { justify-content: space-between; }

.group-title { margin: 26px 2px 12px; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rules .rule { display: flex; flex-direction: column; margin: 0; }
.rules .rule.wide, .rules .rule:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 900px) { .rules .rule { grid-column: 1 / -1; } }
.rules .rule .card-body { flex: 1; }
.rule-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.rule-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-hover); transition: background 0.2s, color 0.2s; }
.rule.off .rule-ic { background: var(--line); color: var(--faint); }
.rule-title { flex: 1; min-width: 0; }
.rule-title h3 { font-size: 15px; font-weight: 650; }
.rule-title p { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.switch { position: relative; flex: none; cursor: pointer; display: inline-block; width: 44px; height: 26px; }
.switch input { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 99px; background: var(--line-strong); cursor: pointer; transition: background 0.18s; }
.switch input:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; pointer-events: none; transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.switch input:checked { background: var(--ok); }
.switch input:checked + span { transform: translateX(18px); }
.rule.off .card-body { opacity: 0.5; }
.rule.off .card-body:focus-within, .rule.off .card-body:hover { opacity: 0.85; }
.rule { transition: border-color 0.2s, box-shadow 0.2s; }
.rule:not(.off) { border-color: rgba(63, 182, 123, 0.28); }
.card-body > p.muted.small { margin-bottom: 14px; line-height: 1.5; }
