/* ───────────────────────────────────────────────────────────
   FB Panel — дизайн v3
   токены → база → формы/кнопки → каркас → компоненты → страницы
   ─────────────────────────────────────────────────────────── */
:root {
  --bg: #0b0d12;
  --bg-2: #0f1218;
  --surface: #141821;
  --surface-2: #1a1f2b;
  --surface-3: #222938;
  --border: #232937;
  --border-2: #2e3647;
  --text: #e8ebf3;
  --text-2: #b4bccd;
  --muted: #8590a6;
  --faint: #5d667b;
  --primary: #5b8cff;
  --primary-2: #7ea4ff;
  --primary-bg: rgba(91, 140, 255, .14);
  --ok: #3ddc97;
  --ok-bg: rgba(61, 220, 151, .12);
  --warn: #f5c451;
  --warn-bg: rgba(245, 196, 81, .12);
  --bad: #ff6b7a;
  --bad-bg: rgba(255, 107, 122, .12);
  --violet: #b39dff;
  --violet-bg: rgba(179, 157, 255, .13);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --side-w: 232px;
  --font: Inter, "SF Pro Text", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 650; margin: 0 0 12px; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h3 { font-size: 14px; font-weight: 650; margin: 0 0 8px; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
::selection { background: var(--primary-bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12.5px; }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; }
.err { color: var(--bad); font-size: 13px; min-height: 1.2em; }
.sub-note { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-warn { color: var(--warn); }
.check-ok { color: var(--ok); } .check-bad { color: var(--bad); }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ───────── иконки ───────── */
.ic { width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic.sm { width: 13px; height: 13px; flex-basis: 13px; vertical-align: -2px; }
.ic.lg { width: 20px; height: 20px; flex-basis: 20px; }

/* ───────── формы ───────── */
input, select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 8px 11px; font: inherit; font-size: 13.5px; min-height: 36px;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; line-height: 1.45; }
textarea.mono, .mono-in { font-family: var(--mono); font-size: 12.5px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #3b4560; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
select { appearance: none; padding-right: 30px; cursor: pointer;
  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='%238590a6' 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 10px center; }
select option { background: var(--surface); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; cursor: pointer; accent-color: var(--primary); flex: 0 0 auto; margin: 0; }
input[type="file"] { padding: 6px 8px; font-size: 12.5px; }
.small-inp { width: 62px; padding: 4px 8px; min-height: 30px; font-size: 12.5px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
label:not(.inl):not(.chk):not(.out-chip) { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 0; }
label:not(.inl):not(.chk):not(.out-chip) > :is(input, select, textarea, div, datalist) { flex: 1 1 100%; }
.rcards > label { flex-wrap: nowrap !important; align-items: flex-start !important; column-gap: 10px !important; }
.rcards > label > input { flex: 0 0 auto !important; }
label.inl { flex-direction: row !important; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 450; cursor: pointer; }
label.inl select, label.inl input:not([type=checkbox]):not([type=radio]) { width: auto; }
.w-auto { width: auto !important; }
.w-160 { width: 160px !important; } .w-200 { width: 200px !important; } .w-260 { width: 260px !important; }
.field-hint { font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.45; }

/* галочка-карточка: заголовок + пояснение */
label.chk { flex-direction: row; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 13px; cursor: pointer; background: var(--bg-2); transition: border-color .12s; }
label.chk:hover { border-color: var(--border-2); }
label.chk input { margin-top: 2px; }
label.chk .chk-t { display: flex; flex-direction: column; gap: 2px; font-weight: 550; }
label.chk small { color: var(--muted); font-size: 12px; line-height: 1.45; font-weight: 400; }

/* ───────── кнопки ───────── */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--primary); color: #fff; border: 1px solid transparent;
  padding: 0 14px; height: 36px; border-radius: var(--radius-sm);
  font: 600 13px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
button:hover { background: #6f9bff; }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
button.secondary { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
button.secondary:hover { background: #2b3448; }
button.ghost { background: transparent; color: var(--text-2); border-color: transparent; }
button.ghost:hover { background: var(--surface-2); color: var(--text); }
button.danger { background: var(--bad-bg); color: var(--bad); border-color: rgba(255, 107, 122, .28); }
button.danger:hover { background: rgba(255, 107, 122, .22); }
button.danger.solid { background: #e5485a; color: #fff; border-color: transparent; }
button.danger.solid:hover { background: #f05a6b; }
button.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(61, 220, 151, .3); }
button.ok:hover { background: rgba(61, 220, 151, .2); }
button.small { height: 30px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
button.xs { height: 24px; padding: 0 8px; font-size: 12px; gap: 5px; border-radius: 6px; }
button.icon { width: 32px; padding: 0; }
button.small.icon { width: 30px; } button.xs.icon { width: 24px; }
button.link { background: none; border: 0; color: var(--primary-2); padding: 0; height: auto; font-weight: 550; }
button.link:hover { text-decoration: underline; background: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-group { display: inline-flex; }
.btn-group button { border-radius: 0; }
.btn-group button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group button + button { border-left: 1px solid rgba(255,255,255,.07); }

/* ───────── каркас ───────── */
#app { min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: 0 0 var(--side-w); background: var(--bg-2);
  border-right: 1px solid var(--border); padding: 18px 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 16px; font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.side .brand i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, #5b8cff, #8a6bff); color: #fff; font-style: normal; font-size: 14px; }
.nav-group { padding: 14px 12px 6px; font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.side a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px;
  color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; transition: background .12s, color .12s; }
.side a .ic { width: 18px; height: 18px; flex-basis: 18px; stroke-width: 1.9; opacity: .85; }
.side a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side a.on { background: var(--primary-bg); color: var(--primary-2); }
.side a.on .ic { opacity: 1; }
.side-badge { margin-left: auto; font-size: 11px; font-weight: 650; background: var(--bad-bg); color: var(--bad); padding: 0 7px; border-radius: 10px; line-height: 18px; }
.side-badge:empty { display: none; }
.side-badge.run { background: var(--primary-bg); color: var(--primary-2); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 4px 0; border-top: 1px solid var(--border); }
.foot-links { display: flex; gap: 6px; }
.foot-links button { flex: 1; }

/* статус App Attest в сайдбаре */
.sys { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.sys .dotx { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-top: 5px; flex: 0 0 8px; }
.sys.ok .dotx { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.sys.bad { border-color: rgba(255,107,122,.35); }
.sys.bad .dotx { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.sys b { display: block; color: var(--text); font-size: 12.5px; }
.sys .sys-t { flex: 1; min-width: 0; line-height: 1.35; }
.sys .sys-t span { color: var(--muted); }

.content { flex: 1; min-width: 0; padding: 26px 32px 90px; max-width: 1520px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 760px; }
.page-head .row-actions > :is(button, select) { height: 34px; min-height: 34px; font-size: 13px; border-radius: var(--radius-sm); }
.page-head .row-actions > button { padding: 0 12px; }
.tabpage { display: none; }
.tabpage.on { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* баннер «App Attest недоступен» — только при проблеме */
.attest-banner { display: none; align-items: center; gap: 10px; padding: 9px 32px; font-size: 13px; background: var(--bad-bg); color: var(--bad); border-bottom: 1px solid rgba(255,107,122,.25); }
.attest-banner.bad { display: flex; }
.attest-banner button { margin-left: auto; }

/* ───────── карточки / сетки ───────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; font-weight: 400; }
.card.flush > .card-head { padding: 14px 16px 0; }
.sec-title { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin: 18px 0 10px; display: flex; align-items: center; gap: 6px; }
.sec-title:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; align-items: end; }
.g6 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > button { align-self: end; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols-2 > .card { margin-bottom: 0; }

/* ───────── тулбар ───────── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.toolbar.boxed { padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; }
.toolbar .sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px; }
.toolbar .grow { flex: 1; }
.toolbar select, .toolbar input:not([type=checkbox]) { width: auto; min-height: 32px; padding-top: 5px; padding-bottom: 5px; }
.toolbar .lbl { font-size: 12px; color: var(--muted); }
.search { position: relative; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 32px !important; width: 240px !important; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { height: 28px; padding: 0 11px; font-size: 12.5px; background: transparent; color: var(--text-2); border: 0; font-weight: 550; border-radius: 7px; }
.seg button:hover { background: var(--surface-2); color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.35); }

/* ───────── таблицы ───────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.table-wrap.tall { max-height: 560px; overflow: auto; }
.table-wrap.scroll-340 { max-height: 340px; overflow: auto; }
.card > .table-wrap:last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; vertical-align: middle; border-bottom: 1px solid var(--border); }
thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 650;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: rgba(255,255,255,.022); }
tbody tr.sel { background: var(--primary-bg); }
tbody tr.clickable { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
td b { font-weight: 600; }
td:first-child, th:first-child { padding-left: 14px; }
td.row-actions { display: table-cell; white-space: nowrap; text-align: right; }
td.row-actions > * { margin-left: 4px; vertical-align: middle; }
td.row-actions > *:first-child { margin-left: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.chk, th.chk { width: 38px; text-align: center; padding-left: 12px !important; padding-right: 4px; }
td.top { vertical-align: top; }
table.mini th, table.mini td { padding: 7px 12px; font-size: 13px; }
td.empty, .empty { color: var(--muted); text-align: center; padding: 28px 16px; font-size: 13px; }

/* ───────── статусы ───────── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill.on, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.off, .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.st.ok { background: var(--ok-bg); color: var(--ok); }
.st.bad { background: var(--bad-bg); color: var(--bad); }
.st.warn { background: var(--warn-bg); color: var(--warn); }
.st.run { background: var(--primary-bg); color: var(--primary-2); }
.st.run::before { animation: pulse 1.2s infinite; }
.st.mute { background: var(--surface-3); color: var(--muted); }
.st.farm { background: var(--violet-bg); color: var(--violet); }
.status-active { color: var(--ok); } .status-2fa { color: var(--warn); }
.status-error { color: var(--bad); } .status-new, .status-login_pending { color: var(--muted); }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-2); }
.dot.ok { background: var(--ok); box-shadow: none; } .dot.err { background: var(--bad); box-shadow: none; }
.dot.run { background: var(--primary); box-shadow: none; animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.barx { height: 4px; background: var(--surface-3); border-radius: 3px; margin-top: 6px; width: 130px; overflow: hidden; }
.barx > i, .progress > i { display: block; height: 100%; background: linear-gradient(90deg, #5b8cff, #8a6bff); border-radius: 3px; transition: width .3s; }
.progress { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress.ok > i { background: var(--ok); }

/* теги в ячейке аккаунта: маленькие, с иконкой; кликабельные — <button class="tag"> */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 6px; font: 550 11.5px var(--font);
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.tag .ic { width: 12px; height: 12px; flex-basis: 12px; vertical-align: 0; }
button.tag { cursor: pointer; }
button.tag:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.tag.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.tag.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.tag.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.tag.info { color: var(--primary-2); background: var(--primary-bg); border-color: transparent; }
.tag.violet { color: var(--violet); background: var(--violet-bg); border-color: transparent; }
.acc-name { font-weight: 600; color: var(--text); }
.acc-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 1px; }
.acc-meta a { color: var(--muted); } .acc-meta a:hover { color: var(--primary-2); }
.activity { margin-top: 6px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.activity:empty { display: none; }
.activity > div:empty { display: none; }
.code-big { font: 700 13px var(--mono); color: var(--text); letter-spacing: 1px; user-select: all; }

/* ───────── фильтр-чипы (кликабельные счётчики) ───────── */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fchip { height: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 112px; padding: 9px 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; color: var(--muted); font: 500 12.5px/1.3 var(--font); text-align: left; }
.fchip b { font-size: 21px; font-weight: 700; color: var(--text); letter-spacing: -.02em; line-height: 1.2; }
.fchip:hover { background: var(--surface-2); border-color: var(--border-2); }
.fchip.on { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-2); }
.fchip.ok b { color: var(--ok); } .fchip.bad b { color: var(--bad); } .fchip.warn b { color: var(--warn); } .fchip.info b { color: var(--primary-2); }
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin-bottom: 14px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 13px; font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.chip b { display: block; font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.02em; margin-bottom: 2px; }
.chip.ok b { color: var(--ok); } .chip.bad b { color: var(--bad); } .chip.warn b { color: var(--warn); }
span.chip.inline { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; }

/* ───────── KPI ───────── */
.kpis, .fm-state { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 11px 14px; min-width: 0; }
.kpi .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.kpi .v small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .v.sm { font-size: 15px; font-weight: 650; }
.kpi.run { border-color: rgba(61,220,151,.35); background: linear-gradient(180deg, rgba(61,220,151,.07), var(--surface)); }
.kpi.alert { border-color: rgba(255,107,122,.35); background: linear-gradient(180deg, rgba(255,107,122,.06), var(--surface)); }
.kpi .on { color: var(--ok); } .kpi .off { color: var(--muted); }
.kpi .act { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ───────── панель действий над выбранными (липнет к низу) ───────── */
.actionbar { position: sticky; bottom: 16px; z-index: 40; display: none; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 14px auto 0; padding: 9px 10px 9px 16px; width: fit-content; max-width: 100%;
  background: #1b2130; border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); }
.actionbar.on { display: flex; animation: rise .16s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.actionbar .count { font-weight: 650; font-size: 13px; color: var(--text); margin-right: 4px; white-space: nowrap; }
.actionbar .sep { width: 1px; height: 22px; background: var(--border-2); margin: 0 2px; }

/* ───────── уведомление-полоса (прогресс проверок и т.п.) ───────── */
.callout { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 12px;
  background: var(--primary-bg); color: var(--text-2); border: 1px solid rgba(91,140,255,.25); }
.callout b { color: var(--text); }
.callout.ok { background: var(--ok-bg); border-color: rgba(61,220,151,.25); }
.callout.warn { background: var(--warn-bg); border-color: rgba(245,196,81,.25); color: var(--warn); }
.callout.bad { background: var(--bad-bg); border-color: rgba(255,107,122,.3); color: var(--bad); }
.callout .grow { flex: 1; }
.callout:empty { display: none; }

/* ───────── спиннер, логи, баннеры ───────── */
.login-banner { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.lb { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.lb.busy { background: var(--warn-bg); color: var(--warn); }
.lb.ok { background: var(--ok-bg); color: var(--ok); }
.lb.bad { background: var(--bad-bg); color: var(--bad); }
.spin { display: inline-block; width: 14px; height: 14px; flex: 0 0 14px; border: 2px solid rgba(255,255,255,.22);
  border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage { margin-top: 4px; font-size: 12px; }
pre { background: var(--bg-2); border: 1px solid var(--border); padding: 12px 14px; border-radius: 10px;
  max-height: 380px; overflow: auto; font: 12px/1.6 var(--mono); margin: 0; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
pre:empty { display: none; }
pre.log { max-height: 60vh; }
pre.short { max-height: 160px; }

/* «Как это работает» */
.howto > summary { cursor: pointer; color: var(--primary-2); font-size: 13.5px; font-weight: 600; padding: 2px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::before { content: "▸"; display: inline-block; transition: transform .15s; color: var(--muted); }
.howto[open] > summary::before { transform: rotate(90deg); }
.howto[open] > summary { margin-bottom: 10px; }
.howto-body { font-size: 13.5px; line-height: 1.6; color: var(--text-2); max-width: 900px; }
.howto-body h3 { font-size: 14px; color: var(--text); margin: 16px 0 6px; }
.howto-body ul, .howto-body ol { margin: 0 0 4px 20px; padding: 0; }
.howto-body li { margin: 3px 0; }

/* ⓘ подсказки */
.ib { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 6px;
  border-radius: 50%; border: 1px solid #4a5672; color: var(--muted); font: 600 10px/1 var(--mono);
  cursor: help; vertical-align: middle; text-transform: none; letter-spacing: 0; flex: 0 0 auto; }
.ib:hover, .ib:focus { background: var(--primary-bg); border-color: var(--primary); color: var(--primary-2); outline: none; }
#tipbox { position: fixed; z-index: 1300; max-width: min(360px, calc(100vw - 24px)); padding: 10px 13px;
  background: #090b10; color: var(--text-2); border: 1px solid var(--border-2); border-radius: 10px;
  box-shadow: var(--shadow); font: 12.5px/1.55 var(--font); white-space: pre-line; pointer-events: none;
  opacity: 0; transform: translateY(3px); transition: opacity .1s, transform .1s; }
#tipbox.on { opacity: 1; transform: none; }

/* подвкладки */
.subtabs { display: inline-flex; gap: 2px; margin: 0 0 16px; padding: 3px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.subtabs a { padding: 6px 14px; color: var(--muted); font-size: 13px; font-weight: 550; border-radius: 7px; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.subtabs a:hover { color: var(--text); text-decoration: none; }
.subtabs a.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.subtabs a .n { font-size: 11px; color: var(--muted); }

/* ───────── модалка (ui.js) ───────── */
.ui-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(5, 7, 10, .68); backdrop-filter: blur(4px); opacity: 0; transition: opacity .15s; }
.ui-modal.on { opacity: 1; }
.ui-modal-box { background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: calc(100vh - 48px); width: 100%; transform: translateY(6px); transition: transform .15s; }
.ui-modal.on .ui-modal-box { transform: none; }
.ui-modal-box.w-sm { max-width: 440px; } .ui-modal-box.w-md { max-width: 580px; } .ui-modal-box.w-lg { max-width: 900px; } .ui-modal-box.w-xl { max-width: 1120px; }
.ui-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--border); }
.ui-modal-head h3 { margin: 0; font-size: 16px; }
.ui-modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.ui-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-2); border-radius: 0 0 14px 14px; }
.ui-text { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.dlg { display: none; }
.dlg.on { display: flex; flex-direction: column; gap: 14px; }
.dlg-target { font-size: 13px; color: var(--text-2); padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; }
.dlg-target b { color: var(--text); }

/* ───────── меню «⋯» ───────── */
.ui-menu { position: fixed; z-index: 1000; min-width: 230px; max-width: 320px; padding: 5px; background: #171c27;
  border: 1px solid var(--border-2); border-radius: 11px; box-shadow: var(--shadow); animation: fade .1s ease; }
.ui-menu-item { width: 100%; height: 34px; justify-content: flex-start; gap: 10px; padding: 0 10px; background: transparent; border: 0;
  color: var(--text-2); font-weight: 500; font-size: 13px; border-radius: 7px; }
.ui-menu-item:hover { background: var(--surface-3); color: var(--text); }
.ui-menu-item .ic { color: var(--muted); }
.ui-menu-item:hover .ic { color: var(--text); }
.ui-menu-item small { margin-left: auto; color: var(--faint); font-size: 11.5px; font-weight: 450; }
.ui-menu-item.danger, .ui-menu-item.danger .ic { color: var(--bad); }
.ui-menu-item.danger:hover { background: var(--bad-bg); }
.ui-menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.ui-menu-head { padding: 6px 10px 3px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 650; }

/* ───────── карточки-радио (выбор режима) ───────── */
.rcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.rcards label { flex-direction: row; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; color: var(--text); font-size: 13px; background: var(--bg-2); transition: border-color .12s, background .12s; }
.rcards label:hover { border-color: var(--border-2); }
.rcards label.on { border-color: var(--primary); background: var(--primary-bg); }
.rcards input { margin-top: 2px; }
.rcards .rc-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rcards .rc-t b { font-weight: 600; }
.rcards .rc-t small { color: var(--muted); font-size: 11.5px; line-height: 1.4; font-weight: 400; }
.rcards.compact { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.rcards.compact label { padding: 9px 11px; }

/* key-value сводка */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 18px; }
.kv > div { min-width: 0; }
.kv span { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 2px; }
.kv b { font-weight: 550; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.kv .sub-note { margin-top: 3px; }

/* ───────── drawer «Настройки аккаунта» ───────── */
.drawer-back { position: fixed; inset: 0; background: rgba(5,7,10,.55); z-index: 300; opacity: 0; pointer-events: none; transition: opacity .18s; }
.drawer-back.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 310; background: var(--surface);
  border-left: 1px solid var(--border-2); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .22s ease; display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-body { padding: 18px 20px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.drawer-sec { display: flex; flex-direction: column; gap: 12px; }
.drawer-sec > h3 { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 650; }
.drawer-sec + .drawer-sec { padding-top: 18px; border-top: 1px solid var(--border); }

/* ───────── вход ───────── */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1000px 500px at 20% 0%, #1a2444, var(--bg) 62%); }
.gate-box { width: min(380px, 92vw); background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; padding: 30px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.gate-box h1 { margin: 0; font-size: 21px; }
.gate-box input { font-size: 15px; padding: 12px; min-height: 46px; }
.gate-box button { height: 44px; font-size: 14px; }

/* ───────── toast ───────── */
#toast { position: fixed; left: 50%; bottom: 26px; z-index: 1200; transform: translate(-50%, 12px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 10px 16px; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; max-width: min(560px, calc(100vw - 24px)); }
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast.bad, #toast.error { border-color: rgba(255,107,122,.5); color: var(--bad); }
#toast a { color: var(--primary-2); cursor: pointer; text-decoration: underline; }

/* ───────── медиа (фото-пак, видео) ───────── */
.media-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.media-item { width: 172px; }
.media-item img { width: 172px; border-radius: 9px; display: block; border: 1px solid var(--border); }
.media-item .sub-note { margin: 5px 0; }
.video-view { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.video-view video { width: 300px; max-height: 440px; border-radius: 10px; background: #000; display: block; }
.video-view .meta { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 12px; }
.video-view img.thumb { width: 140px; border-radius: 8px; border: 1px solid var(--border); }

/* ───────── «Ключи» ───────── */
.kg-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
.kg-layout .card { margin-bottom: 0; }
.kg-row { cursor: pointer; }
.kg-row.sel { background: var(--primary-bg); }
.kg-row:hover { background: var(--surface-2); }

/* ───────── папки аккаунтов / варианты фарма ───────── */
.ff-card .ff-chips { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-bottom: 10px; }
.ff-card .chip b { font-size: 20px; }
.ff-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; margin-bottom: 10px; }
.ff-actions { margin: 6px 0; }
.ff-next { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.fp-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; }
.fp-group label.fp-act { margin: 3px 0; }
.fp-act.risky { color: var(--text); }
.fp-extras { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }

/* ───────── FlashProxy / ASN ───────── */
.fp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
.fp-plan { border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; min-width: 0; background: var(--bg-2); }
.fp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fp-bar { height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.fp-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5b8cff, #8a6bff); border-radius: 6px; transition: width .3s; }
.fp-bar > i.warn { background: #e0a030; } .fp-bar > i.low { background: var(--bad); }
.fp-out { margin-top: 8px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 10px; }
.fp-chip { white-space: nowrap; }
.fp-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.fp-presets button { height: 28px; padding: 0 10px; font-size: 12px; }
.fp-warn { margin-top: 8px; font-size: 12px; }
.fp-pick { margin-top: 8px; }
.fp-pick > input { width: 100%; margin: 8px 0 6px; }
.fp-asnlist { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; }
.fp-asnrow { display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px; gap: 6px; align-items: center; padding: 2px 0; font-size: 12.5px; overflow-wrap: anywhere; }
.fp-asnrow.head { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-size: 11.5px; }
.fp-asnrow input { justify-self: center; }
.fp-log { margin-top: 6px; font-size: 12.5px; }
#asnTable th, #asnTable td { padding: 6px 6px; font-size: 13px; }
#asnTable th:first-child, #asnTable td:first-child { padding-left: 12px; }
#asnTable td.asn-act button { margin-left: 3px; }
#asnTable td.asn-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── Регистрация ───────── */
.out-pick { display: flex; align-items: center; gap: 8px; }
.out-pick select { width: auto; min-width: 280px; font-family: var(--mono); font-size: 12.5px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 16px; align-items: start; }
.split > .card { margin-bottom: 0; }
.feed { max-height: 34vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; font: 12px/1.45 var(--mono); }
.feed .ev { display: flex; gap: 12px; padding: 4px 12px; border-bottom: 1px solid rgba(255,255,255,.03); }
.feed .ev .code { width: 36px; font-weight: 700; color: var(--muted); }
.feed .ev.ok .code { color: var(--ok); }
.feed .ev.bad { background: rgba(255,107,122,.06); }
.feed .ev.bad .code { color: var(--bad); }
.feed .ev .t { margin-left: auto; color: var(--faint); }
.feed .ev.empty { color: var(--muted); font-family: var(--font); justify-content: center; padding: 18px; }
.rg-err { padding: 9px 12px; border-radius: 9px; background: var(--bad-bg); color: var(--bad); border: 1px solid rgba(255,107,122,.25); font: 12px/1.45 var(--mono); white-space: pre-wrap; margin-bottom: 10px; }
.rg-err:empty { display: none; }
.card.flush > .rg-err, .card.flush > .feed { margin: 0 16px 12px; }
.card.flush > .card-head { margin-bottom: 12px; }
.rgst { font-weight: 650; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; display: inline-block; background: var(--surface-3); color: var(--text-2); font-family: var(--mono); }
.rgst.LIVE { background: var(--ok-bg); color: var(--ok); }
.rgst.RUNNING, .rgst.running { background: var(--primary-bg); color: var(--primary-2); }
.rgst.EMAIL_REJECTED, .rgst.CODE_REJECTED, .rgst.ATTEST_REQUIRED, .rgst.CRITICAL, .rgst.STALE, .rgst.ERR, .rgst.IMAP_DEAD,
.rgst.PROXY_LOST, .rgst.PROXY_LOST_AFTER_CREATE, .rgst.CHECKPOINT, .rgst.SESSION_DEAD, .rgst.DISABLED, .rgst.PROXY_DEAD { background: var(--bad-bg); color: var(--bad); }
.rgst.PROXY_WAIT, .rgst.IN_REVIEW, .rgst.UNKNOWN, .rgst.queued { background: var(--warn-bg); color: var(--warn); }
.rgst.farm { background: var(--violet-bg); color: var(--violet); }
.out-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.out-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border: 1px solid var(--border-2); border-radius: 999px;
  background: var(--bg-2); font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; flex-direction: row; font-weight: 500; }
.out-chip.on { border-color: var(--primary); background: var(--primary-bg); color: var(--text); }
.out-chip b { color: var(--text); }
/* трафик (как Charles) */
.traf { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; min-height: 66vh; }
.flowlist { max-height: 72vh; overflow: auto; padding: 0; }
.flowlist .f { padding: 7px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 12px; }
.flowlist .f:hover { background: var(--surface-2); }
.flowlist .f.on { background: var(--primary-bg); }
.flowlist .code { font-weight: 700; width: 34px; display: inline-block; font-family: var(--mono); }
.flowlist .code.s2 { color: var(--ok); } .flowlist .code.s3 { color: var(--warn); } .flowlist .code.s4, .flowlist .code.s5 { color: var(--bad); }
.flowlist .f .hint { color: var(--faint); font: 11px var(--mono); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-pane { padding: 0; overflow: hidden; }
.ex-pane .seg { margin: 12px 14px 0; }
.ex-sec { padding: 10px 14px; border-top: 1px solid var(--border); }
.ex-sec:first-of-type { border-top: 0; }
.ex-sec h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ex-note { margin: 12px 14px 0; }
.hdrs { width: 100%; font: 11.5px var(--mono); }
.hdrs td { padding: 3px 8px; border-bottom: 1px solid rgba(255,255,255,.03); vertical-align: top; word-break: break-all; }
.hdrs td:first-child { color: var(--primary-2); width: 34%; padding-left: 0; }
.tree { font: 12px/1.55 var(--mono); }
.tree details { margin-left: 14px; }
.tree summary { cursor: pointer; color: var(--primary-2); }
.tree .k { color: #c792ea; } .tree .s { color: #c3e88d; } .tree .n { color: #f78c6c; } .tree .b { color: #82aaff; } .tree .null { color: var(--muted); }
.slotrow { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); font-size: 12.5px; flex-wrap: wrap; }

/* ───────── адаптив ───────── */
@media (max-width: 1180px) {
  .split, .cols-2 { grid-template-columns: 1fr; }
  .traf { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  :root { --side-w: 200px; }
  .content { padding: 20px 18px 80px; }
  .kg-layout { grid-template-columns: 1fr; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px;
    border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .side .brand, .side-foot, .nav-group { display: none; }
  .side a { padding: 7px 10px; font-size: 13px; }
  .side a .ic { display: none; }
  .content { padding: 16px 12px 80px; }
  .form-row, .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .search input { width: 100% !important; }
}

/* сворачиваемая карточка: <details class="card fold"><summary class="card-head">… */
details.fold > summary { list-style: none; cursor: pointer; user-select: none; margin-bottom: 0; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { margin-bottom: 12px; }
details.fold > summary h2 .chev { transition: transform .15s; color: var(--muted); }
details.fold[open] > summary h2 .chev { transform: rotate(90deg); }
details.fold > summary:hover h2 { color: var(--primary-2); }
details.fold .feed { max-height: 30vh; }
details.fold pre.log { max-height: 46vh; }
#regAccs td:nth-child(4) { max-width: 280px; word-break: break-all; }
#regAccs td:nth-child(3) { max-width: 320px; overflow-wrap: anywhere; }
#regAccs .tag { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* ───────── камера апелляции UFAC ───────── */
.cam-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.cam-status { width: 100%; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; text-align: center; }
.cam-gestures { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
.cam-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-2); transition: all .15s; }
.cam-chip.active { background: var(--primary); color: #fff; border-color: var(--primary-2); transform: scale(1.08); box-shadow: 0 0 14px rgba(79,140,255,.45); }
.cam-chip.done { background: var(--ok-bg); color: var(--ok); border-color: rgba(46,204,113,.35); }
.cam-viewport { position: relative; width: 240px; height: 320px; border-radius: 16px; overflow: hidden; background: #090c12;
  border: 2px solid var(--border-2); box-shadow: 0 8px 28px rgba(0,0,0,.45); flex-shrink: 0; }
.cam-viewport.rec { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(46,204,113,.22), 0 8px 28px rgba(0,0,0,.45); }
.cam-viewport video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-viewport video.mirror { transform: scaleX(-1); }
.cam-oval { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-hud { position: absolute; left: 12px; right: 12px; bottom: 16px; padding: 10px 14px; border-radius: 12px;
  background: rgba(10, 14, 22, 0.84); backdrop-filter: blur(8px); color: #fff; text-align: center; pointer-events: none;
  border: 1px solid rgba(255,255,255,.14); }
.cam-hud .big { font-size: 20px; font-weight: 700; letter-spacing: .2px; line-height: 1.25; }
.cam-hud .sub { font-size: 12px; color: rgba(255,255,255,.76); margin-top: 3px; }
.cam-bar-wrap { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.12); }
.cam-bar { height: 100%; width: 0%; background: var(--ok); transition: width .12s linear; }
.cam-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; width: 100%; }

