/* ArchiFlow — защита расходов ИИ: полоса сверху и панель в «Площадке» (guard-v13.js). Тёмная тема приложения. */

/* ---------- полоса сверху ---------- */
html.afgb-on #root { height: calc(100% - var(--afgb-h, 40px)); margin-top: var(--afgb-h, 40px); }
/* Панели с position: fixed от верха окна — тоже под полосой. */
html.afgb-on .afd { top: var(--afgb-h, 40px); }
html.afgb-on .app.phone.pane-project > .chatpane.side { top: var(--afgb-h, 40px); }
.afgb {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2000; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 14px;
  font-size: 13px; line-height: 1.35; color: var(--text);
}
.afgb.crit { background: #6b2516; border-bottom: 1px solid var(--conf); }
.afgb.warn { background: #4a2119; border-bottom: 1px solid #a8503a; }
.afgb.calm { background: #2c2a24; border-bottom: 1px solid var(--gold-line); color: var(--text); justify-content: center; }
.afgb-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--conf); box-shadow: 0 0 0 3px rgba(224,122,85,.25); }
.afgb.warn .afgb-dot { background: var(--check); box-shadow: 0 0 0 3px rgba(216,180,74,.25); }
.afgb-t { flex: 1 1 auto; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.afgb.calm .afgb-t { flex: 0 1 auto; text-align: center; }
.afgb-more { color: var(--muted); }
.afgb-acts { flex: none; display: flex; gap: 6px; }
.afgb-acts button { height: 28px; padding: 0 12px; border-radius: 14px; border: 1px solid rgba(242,240,236,.35); background: transparent; color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap; }
.afgb-acts button:hover { background: rgba(242,240,236,.08); }
.afgb.calm .afgb-acts button { width: 28px; padding: 0; font-size: 16px; line-height: 1; border-color: transparent; color: var(--muted); }
@media (max-width: 600px) {
  .afgb { flex-wrap: wrap; padding: 7px 12px; }
  .afgb-acts { margin-left: auto; }
}

/* ---------- панель ---------- */
.afguard { display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.afgd-sub { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.afguard h5 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.afgd-level { border-radius: 14px; padding: 12px 14px; background: #232326; border: 1px solid var(--line2, #4a4a4f); display: flex; flex-direction: column; gap: 8px; }
.afgd-level.l0 { border-color: rgba(143,176,138,.45); }
.afgd-level.l1 { border-color: rgba(216,180,74,.55); background: linear-gradient(0deg, rgba(216,180,74,.06), rgba(216,180,74,.06)), #232326; }
.afgd-level.l2 { border-color: rgba(224,150,85,.7); background: linear-gradient(0deg, rgba(224,150,85,.09), rgba(224,150,85,.09)), #232326; }
.afgd-level.l3 { border-color: var(--conf); background: linear-gradient(0deg, rgba(224,122,85,.14), rgba(224,122,85,.14)), #232326; }
.afgd-lhead { display: flex; align-items: center; gap: 10px; }
.afgd-lhead small { display: block; color: var(--muted); font-size: 11.5px; }
.afgd-lhead b { display: block; font-size: 17px; font-weight: 600; letter-spacing: .1px; }
.afgd-ldot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); }
.l1 .afgd-ldot { background: var(--check); } .l2 .afgd-ldot { background: #E0964F; } .l3 .afgd-ldot { background: var(--conf); }
.afgd-level.l1 .afgd-lhead b { color: var(--check); } .afgd-level.l2 .afgd-lhead b { color: #E0964F; } .afgd-level.l3 .afgd-lhead b { color: var(--conf); }
.afgd-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.afgd-steps span { font-size: 10.5px; color: var(--dim); text-align: center; padding-top: 6px; border-top: 3px solid #3a3a3e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.afgd-steps span.on { color: var(--text); font-weight: 600; }
.afgd-steps span.on.l0 { border-top-color: var(--ok); } .afgd-steps span.on.l1 { border-top-color: var(--check); }
.afgd-steps span.on.l2 { border-top-color: #E0964F; } .afgd-steps span.on.l3 { border-top-color: var(--conf); }
.afgd-reason { margin: 0; font-size: 12.5px; line-height: 1.45; }
.afgd-reason.dim { color: var(--muted); }
.afgd-level > small { color: var(--muted); font-size: 11.5px; }
.afgd-lacts { display: flex; flex-wrap: wrap; gap: 8px; }
.afplat-mini.afgd-stop { border-color: rgba(224,122,85,.6); color: #F0A487; }
.afplat-mini.afgd-stop:hover { background: var(--conf-soft); border-color: var(--conf); }
.afplat-mini.afgd-go { border-color: rgba(143,176,138,.6); color: #B5D1AF; }
.afplat-mini.afgd-go:hover { background: rgba(143,176,138,.12); }

.afgd-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.afgd-kpi { background: #232326; border-radius: 12px; padding: 9px 11px; min-width: 0; }
.afgd-kpi small { display: block; color: var(--muted); font-size: 11.5px; }
.afgd-kpi b { display: block; font-size: 18px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }
.afgd-kpi i { display: block; font-style: normal; color: var(--dim); font-size: 11.5px; margin-top: 1px; line-height: 1.35; }
.afgd-kpi.wide { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; }
.afgd-kpi.wide small { grid-column: 1 / -1; }
.afgd-kpi.wide i { color: var(--muted); }
.afgd-kpi.warn b { color: var(--check); } .afgd-kpi.bad b { color: var(--conf); }
.afgd-kpi.nodata b { color: var(--muted); font-size: 15px; }

.afgd-top ol { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: t; }
.afgd-top li { counter-increment: t; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.afgd-top li::before { content: counter(t); color: var(--dim); font-size: 11px; }
.afgd-tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afgd-tp { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.afgd-top b { font-weight: 600; font-variant-numeric: tabular-nums; }

.afgd-sec { display: flex; flex-direction: column; gap: 6px; }
.afgd-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.afgd-h .afplat-mini { height: 26px; font-size: 11.5px; }
.afgd-new { font-weight: 500; font-size: 11px; color: #1c1c1e; background: var(--conf); border-radius: 9px; padding: 1px 7px; }
.afgd-cnt { font-weight: 500; font-size: 11px; color: var(--muted); }
.afgd-alerts, .afgd-restr { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.afgd-al { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; padding: 8px 10px; border-radius: 10px; background: #232326; font-size: 12.5px; }
.afgd-al p { margin: 2px 0 2px; color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.afgd-al small { color: var(--dim); font-size: 11px; }
.afgd-adot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--muted); }
.afgd-al.critical { background: rgba(224,122,85,.12); } .afgd-al.critical .afgd-adot { background: var(--conf); }
.afgd-al.warning { background: rgba(216,180,74,.09); } .afgd-al.warning .afgd-adot { background: var(--check); }
.afgd-al.seen { background: #232326; opacity: .72; }
.afgd-restr li { padding: 8px 10px; border-radius: 10px; background: #232326; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.afgd-rw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.afgd-names { color: var(--text) !important; }
.afgd-restr small { color: var(--muted); font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
.afgd-rb { display: flex; flex-wrap: wrap; gap: 6px; }
.afgd-rb .afplat-mini { height: 26px; font-size: 11.5px; }
.afgd-tag { font-size: 10.5px; border-radius: 8px; padding: 1px 7px; white-space: nowrap; }
.afgd-tag.red { background: var(--conf-soft); color: #F0A487; }
.afgd-tag.amber { background: var(--check-soft); color: var(--check); }
.afgd-tag.grey { background: #34343a; color: var(--muted); }

.afgd-det { border-top: 1px solid var(--line); padding-top: 8px; }
.afgd-det > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); list-style: none; display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.afgd-det > summary::-webkit-details-marker { display: none; }
.afgd-det > summary::before { content: "›"; color: var(--gold); font-size: 16px; transition: transform .15s; display: inline-block; width: 10px; }
.afgd-det[open] > summary::before { transform: rotate(90deg); }
.afgd-hint { font-weight: 400; font-size: 11.5px; color: var(--check); }
.afgd-detb { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }

.afgd-rules { display: flex; flex-direction: column; gap: 10px; }
.accbox .afgd-rule, .afgd-rule { display: grid; grid-template-columns: minmax(0, 1fr) 92px; column-gap: 10px; row-gap: 2px; align-items: center; padding: 0; }
.afgd-rule > span { font-size: 12.5px; color: var(--text); }
.accbox .afgd-rule > input { height: 32px; font-size: 13px; text-align: right; min-width: 0; }
.afgd-rule > small { grid-column: 1 / -1; color: var(--dim); font-size: 11.5px; line-height: 1.4; }
.afgd-rule.afgd-reset, .afgd-pd-wrap { grid-template-columns: 1fr; }
.afgd-rr { display: flex; flex-direction: column; gap: 4px; }
.accbox .afgd-rr label { flex-direction: row; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); padding: 0; }
.accbox .afgd-rr input[type="radio"] { appearance: auto; -webkit-appearance: radio; width: 15px; height: 15px; margin: 0; padding: 0; border: 0; background: none; accent-color: var(--gold); flex: none; }
.accbox .afgd-rr .afgd-hrs { width: 52px; height: 28px; font-size: 13px; text-align: center; padding: 0 4px; }
.afgd-rule:has(.afgd-pd) { grid-template-columns: 1fr; }
.afgd-pd { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.accbox .afgd-pd label { font-size: 11px; color: var(--muted); padding: 0; gap: 2px; }
.accbox .afgd-pd input { height: 30px; font-size: 13px; min-width: 0; text-align: right; }
.afgd-rbtns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.afgd-rbtns .newbtn { flex: 1 1 auto; }

.afgd-ch { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: #232326; }
.afgd-ch.dim { opacity: .8; }
.afgd-ch small { color: var(--muted); font-size: 11.5px; }
.afgd-chh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; font-size: 13px; }
.afgd-route { margin-left: auto; font-size: 11px; color: var(--dim); }
.afgd-ok { font-size: 11.5px; color: var(--ok); } .afgd-wait { font-size: 11.5px; color: var(--check); } .afgd-off { font-size: 11.5px; color: var(--muted); }
.afgd-secret { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.accbox .afgd-secret input { flex: 1 1 180px; height: 32px; font-size: 12.5px; min-width: 0; }
.afgd-secret .afplat-mini { height: 32px; }
.afgd-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.afgd-link .afplat-mini { display: inline-flex; align-items: center; text-decoration: none; }
.afgd-tglink { border-color: var(--gold-line); color: var(--gold); }
.afgd-link small { flex-basis: 100%; }
.afgd-link code { color: var(--gold); font-size: 12px; }
.afgd-steps-help { margin: 0; padding-left: 18px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.afgd-steps-help b { color: var(--text); font-weight: 500; }
.afgd-tests { display: flex; flex-wrap: wrap; gap: 8px; }
.afguard .afplat-mini[disabled] { opacity: .45; cursor: default; }

.afgd-log { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.afgd-log th { text-align: left; font-weight: 500; color: var(--dim); padding: 3px 6px 5px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.afgd-log td { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.afgd-log td small { display: block; color: var(--dim); font-size: 11px; overflow-wrap: anywhere; }
.afgd-log .num { text-align: right; font-variant-numeric: tabular-nums; }
.afgd-log td:first-child { white-space: nowrap; color: var(--muted); }
.afgd-lv { display: inline-block; min-width: 16px; text-align: center; border-radius: 6px; font-size: 10.5px; background: #34343a; color: var(--muted); }
.afgd-lv.l1 { background: var(--check-soft); color: var(--check); } .afgd-lv.l2 { background: rgba(224,150,85,.16); color: #E0964F; } .afgd-lv.l3 { background: var(--conf-soft); color: var(--conf); }

/* ---------- «Площадка» → Пользователи: поиск, сортировка, страницы, защита (account-v13.js) ---------- */
.afplat-utools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.accbox .afplat-utools input { flex: 1 1 160px; height: 32px; font-size: 13px; min-width: 0; }
.accbox .afplat-utools select { height: 32px; font-size: 12.5px; flex: 0 1 auto; }
.afplat-upager { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.afplat-upager .afplat-mini { height: 26px; min-width: 30px; padding: 0 9px; }
.afplat-upager .afplat-mini[disabled] { opacity: .35; cursor: default; }
.afplat-ugd { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.afplat-ugd .afplat-mini { height: 24px; padding: 0 9px; font-size: 11px; }
.afplat-ugd .afgd-tag { font-size: 10.5px; }
.afplan-day { font-size: 12.5px; color: var(--muted); margin: 0; }
.afplan-day b { color: var(--text); font-weight: 500; }
.afplan-day.full { color: var(--conf); }
