:root {
  --bg: #f6f4ef; --paper: #fff; --ink: #1f2a37; --muted: #6b7280; --line: #e3ded4; --side: #f0ece3;
  --accent: #1d4ed8; --accent-ink: #fff; --ok: #15803d; --ok-bg: #dcfce7; --warn: #b45309; --warn-bg: #fef3c7;
  --bad: #b91c1c; --bad-bg: #fee2e2; --info: #1d4ed8; --info-bg: #dbeafe; --muted-bg: #eceae4;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
code { background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 small { font-weight: 400; font-size: 14px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; font-weight: 650; }
h2 .more { float: right; text-transform: none; letter-spacing: 0; font-weight: 400; }
h3 { margin: 0 0 4px; font-size: 16px; }
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand a { font-weight: 750; font-size: 18px; color: var(--ink); letter-spacing: -0.02em; }
.brand .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.side nav { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.side nav a { padding: 7px 10px; border-radius: 7px; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.side nav a:hover { background: #e7e2d7; text-decoration: none; }
.side nav a.on { background: var(--paper); box-shadow: 0 1px 0 var(--line); font-weight: 600; }
.side-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); }
.automation { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); margin-bottom: 8px; color: var(--ink); }
.automation .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.automation.paused .dot { background: var(--bad); }
.automation form { margin-left: auto; }
.who { padding: 0 10px; }
.main { padding: 22px 28px 60px; min-width: 0; }
.demo-bar { background: var(--info-bg); border: 1px solid #bfdbfe; border-radius: 8px; padding: 8px 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 13px; }
.flash { padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.flash.bad { background: var(--bad-bg); color: var(--bad); border-color: #fecaca; }
.flash.info { background: var(--info-bg); color: var(--info); border-color: #bfdbfe; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .muted { flex-basis: 100%; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions.mb { margin-bottom: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi a { color: inherit; display: block; }
.kpi a:hover { text-decoration: none; }
.kpi .n { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .n small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi.warn { border-color: #fde68a; background: #fffbeb; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 7px 8px; border-bottom: 1px solid #efece5; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.off td { opacity: 0.55; }
table.list { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.kv th { width: 34%; font-size: 13px; padding: 6px 8px 6px 0; color: var(--muted); font-weight: 500; }
table.kv td { padding: 6px 0; }
.trace td { font-size: 13px; }
.trace .lvl-ok td:last-child { color: #14532d; }
.trace .lvl-warn td:last-child { color: #78350f; }
.trace .lvl-error td:last-child { color: var(--bad); }
.trace .lvl-skip td:last-child { color: var(--muted); }
.trace .small-link { margin-left: 6px; font-size: 12px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: var(--muted-bg); color: var(--muted); }
.pill { background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 7px 12px; border-radius: 7px; font: inherit; font-weight: 550; cursor: pointer; line-height: 1.2; }
.btn:hover { background: #f4f2ec; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #1e40af; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
form.inline { display: inline; }
.form label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.form label input, .form label select, .form label textarea, .row input, .row select, .filters input, .filters select { display: block; width: 100%; margin-top: 3px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; color: var(--ink); background: var(--paper); }
.form label.check, label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.form label.check input, label.check input { width: auto; margin: 0; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.row > label { flex: 1; min-width: 140px; }
.row > input, .row > select { flex: 1; min-width: 120px; width: auto; }
.row > button, .row > a.btn { flex: 0 0 auto; }
.row.tight { margin: 0; flex-wrap: nowrap; }
.row.tight input { padding: 4px 7px; font-size: 12.5px; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; margin: 0; }
.filters input[type=search] { min-width: 260px; }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline-block; margin-right: 4px; }
.decision { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.decision.ok { background: var(--ok-bg); border-color: #bbf7d0; color: #14532d; }
.decision.blocked { background: var(--warn-bg); border-color: #fde68a; color: #78350f; }
.decision strong { display: block; letter-spacing: 0.04em; font-size: 12px; }
.decision div { font-size: 14px; margin: 4px 0; }
.review-item { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
.review-item .reason { margin-top: 6px; color: #78350f; }
.review-actions { display: flex; flex-direction: column; gap: 6px; }
.review-actions .row { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 3px 0; }
.email-preview { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fdfcfa; }
.email-preview .subject { font-weight: 650; margin-bottom: 8px; }
.email-preview pre { white-space: pre-wrap; font: 13.5px/1.55 Georgia, "Times New Roman", serif; margin: 0; }
.email-preview .attachment { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; }
pre.code { background: #1f2a37; color: #e5e7eb; padding: 12px 14px; border-radius: 8px; overflow: auto; white-space: pre-wrap; font-size: 12px; margin: 0; }
.pager { display: flex; gap: 4px; margin-top: 10px; }
.pager a { padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; }
.pager a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.mt { margin-top: 10px; }
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.docs-nav a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--ink); }
.docs-nav a.on { background: var(--paper); font-weight: 600; box-shadow: 0 1px 0 var(--line); }
.prose { max-width: 860px; line-height: 1.6; }
.prose h1 { font-size: 24px; margin: 0 0 12px; }
.prose h2 { font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 22px 0 8px; }
.prose h3 { font-size: 15px; margin: 16px 0 6px; }
.prose pre { background: #1f2a37; color: #e5e7eb; padding: 12px 14px; border-radius: 8px; overflow: auto; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose table { margin: 10px 0; }
.prose td, .prose th { border: 1px solid var(--line); padding: 5px 8px; }
.prose li { margin: 3px 0; }
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login { width: 340px; }
.login label { display: block; margin: 10px 0; font-size: 13px; color: var(--muted); }
.login input { display: block; width: 100%; margin-top: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.login .btn { width: 100%; margin-top: 8px; }
