/* «Автоматизация → Права агента» */
.ag-card { margin: 0 0 20px; padding: 16px; border: 1px solid var(--line, #e3e6ec); border-radius: 12px; background: var(--panel, #fff); }
.ag-card h2 { margin: 0 0 12px; font-size: 17px; }
.ag-switch { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ag-state { font-size: 18px; font-weight: 600; }
.ag-state.on { color: var(--good, #1f8a4c); }
.ag-state.off { color: var(--bad, #c0392b); }
.ag-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
.ag-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted-text, #5b6270); }
.ag-form input, .ag-table input { padding: 6px 8px; border: 1px solid var(--line, #d5d9e0); border-radius: 8px; font: inherit; }
.ag-table input { width: 90px; }
.ag-table td { vertical-align: top; }
.ag-why { max-width: 460px; white-space: pre-wrap; }
.ag-viol { color: var(--bad, #c0392b); font-size: 13px; }
.ag-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-status { font-size: 13px; padding: 2px 8px; border-radius: 10px; background: var(--accent-soft, #eef2ff); white-space: nowrap; }
.ag-status.executed { background: #e6f6ec; color: #1f6b3d; }
.ag-status.failed, .ag-status.rejected { background: #fdecea; color: #a12a1e; }
.ag-status.pending { background: #fff5e0; color: #8a5a00; }
.ag-empty { color: var(--muted-text, #5b6270); }
.ag-card h3 { margin: 16px 0 8px; font-size: 15px; }
.ag-form select, .ag-notes { padding: 6px 8px; border: 1px solid var(--line, #d5d9e0); border-radius: 8px; font: inherit; }
.ag-wide { grid-column: 1 / -1; }
.ag-notes { width: 100%; box-sizing: border-box; resize: vertical; }
.ag-add { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.ag-find { flex: 1 1 320px; max-width: 520px; padding: 6px 8px; border: 1px solid var(--line, #d5d9e0); border-radius: 8px; font: inherit; }
.ag-kinds { display: flex; flex-direction: column; gap: 4px; }
.ag-modeline { display: flex; align-items: center; justify-content: space-between; gap: 8px; white-space: nowrap; font-size: 13px; }
.ag-mode { padding: 2px 6px; font: inherit; font-size: 13px; border: 1px solid var(--line, #d5d9e0); border-radius: 6px; background: var(--surface, #fff); color: inherit; }
.ag-mode[data-mode="off"] { color: var(--muted); }
.ag-mode[data-mode="approve"] { border-color: #e0b44a; }
.ag-mode[data-mode="auto"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ag-check { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 13px; }
.ag-taskbox { display: flex; flex-direction: column; gap: 6px; }
.ag-tpl { max-width: 260px; padding: 4px 6px; border: 1px solid var(--line, #d5d9e0); border-radius: 8px; font: inherit; }
.ag-task { width: 100%; min-width: 220px; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--line, #d5d9e0); border-radius: 8px; font: inherit; resize: vertical; }
.ag-off td { opacity: .6; }
.ag-playbook { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line, #d5d9e0); border-radius: 8px; font: inherit; line-height: 1.45; resize: vertical; }
.ag-note { font-size: 12px; margin-top: 4px; color: #8a5a00; }
.ag-views { margin-left: 12px; }
.ag-views .btn { text-decoration: none; }
.ag-versions { margin-top: 10px; }
.ag-version-text { white-space: pre-wrap; max-height: 320px; overflow: auto; font: inherit; font-size: 13px; background: var(--surface, #fff); border: 1px solid var(--line, #d5d9e0); border-radius: 8px; padding: 8px; }
.ag-ok { color: #1f6b3d; }
.ag-warn { color: #8a5a00; }
.ag-bad { color: #a12a1e; font-weight: 600; }
.ag-board td { vertical-align: top; white-space: nowrap; }
.ag-board-head .ag-actions { margin-bottom: 10px; }
.ag-limit { width: 80px; padding: 3px 6px; border: 1px solid var(--line, #d5d9e0); border-radius: 6px; font: inherit; font-size: 13px; }
.ag-limit-note { width: 180px; padding: 3px 6px; border: 1px solid var(--line, #d5d9e0); border-radius: 6px; font: inherit; font-size: 13px; margin-bottom: 4px; }
.ag-pair { display: flex; gap: 4px; }
.ag-sku-plan, .ag-sku-price { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
/* Что изменилось в версии методички (владелец 24.11.2026). */
.ag-diff-new { background: #fff3b0; color: #3d3200; }
.ag-diff-gone { color: var(--muted, #7a8190); text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ag-diff-new { background: #5c4d00; color: #fff3c4; }
}
:root[data-theme="dark"] .ag-diff-new { background: #5c4d00; color: #fff3c4; }
