/* Кабинет: разделы «Оформление», «Формы», «Вебхуки». Общие токены — из app.css. */
.page-wide { max-width: 1240px; }

/* переключатель вкл/выкл */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; width: 40px; height: 24px; margin: 0; cursor: pointer; }
.switch .track { width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(12, 22, 51, .3); transition: transform .15s; }
.switch input:checked + .track { background: var(--mint); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

/* сегментированный выбор */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 13px; background: var(--glass-2); border: 1px solid var(--line-2); }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg-opt span { display: block; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.seg-opt input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(12, 22, 51, .1), 0 4px 10px -6px rgba(12, 22, 51, .3); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 1px; }

/* ---------- оформление ---------- */
.bgrid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1080px) { .bgrid { grid-template-columns: minmax(0, 1fr) 380px; } }
.bform { display: grid; gap: 18px; min-width: 0; }
.bsave, .fed-save { position: sticky; bottom: 12px; z-index: 3; justify-self: start; padding: 8px; border-radius: 18px; background: var(--glass-bar); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); -webkit-backdrop-filter: var(--blur-bar); backdrop-filter: var(--blur-bar); }
.logo-box .hint { font-weight: 400; }
.colorrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.colorpick { width: 46px; height: 46px; padding: 3px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.colorrow .colortext { width: 130px; flex: none; }
.logo-box { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.logo-thumb { width: 72px; height: 72px; border-radius: 16px; border: 1px dashed var(--line); display: grid; place-items: center; background: var(--surface); overflow: hidden; flex: none; }
.logo-thumb img { width: 100%; height: 100%; object-fit: contain; }
div.field { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
div.field > .hint { font-weight: 400; color: var(--ink-3); font-size: .82rem; }

.bpv-sticky { position: sticky; top: 84px; display: grid; gap: 12px; }
.bpv { --cobalt: #2F4BFF; }
.bpv-card {
  border-radius: var(--r-xl); padding: 20px; display: grid; gap: 14px; background: var(--glass); border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.bpv-head { padding-bottom: 12px; border-bottom: 2px dashed var(--line-2); min-height: 44px; display: flex; align-items: center; }
.bpv .bm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bpv .bm-logo { width: 32px; height: 32px; border-radius: 9px; object-fit: contain; background: var(--surface); }
.bpv .bm-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bpv-body { display: grid; gap: 8px; }
.bpv-amount { font: 800 2.4rem/1 var(--display); letter-spacing: -0.04em; }
.bpv-amount span { font-size: .5em; color: var(--ink-2); }
.bpv-note { padding: 10px 12px; border-radius: 12px; background: var(--cobalt-soft); font-size: .88rem; white-space: pre-line; overflow-wrap: anywhere; }
.bpv-coins { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.bpv-coin { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .88rem; }
.bpv-coin.on { border-color: var(--cobalt); box-shadow: inset 0 0 0 2px var(--cobalt); background: var(--cobalt-soft); }
.bpv-btn { display: grid; place-items: center; min-height: 46px; border-radius: 14px; background: var(--cobalt); color: var(--cobalt-ink); font-weight: 650; margin-top: 4px; }
.bpv-done { display: flex; align-items: center; gap: 10px; font: 750 1.3rem/1.2 var(--display); }
.bpv-check { width: 36px; height: 36px; border-radius: 50%; background: var(--mint-soft); display: grid; place-items: center; }
.bpv-check svg { width: 20px; height: 20px; fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bpv .support { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: .86rem; }
.bpv .support-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* ---------- формы ---------- */
.forms-grid { display: grid; gap: 12px; }
@media (min-width: 900px) { .forms-grid { grid-template-columns: 1fr 1fr; } }
.fcard-d { background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; min-width: 0; }
.fcard-d.off { opacity: .72; }
.fc-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fc-title { display: grid; gap: 2px; min-width: 0; }
.fc-title a { color: var(--ink); text-decoration: none; }
.fc-title a:hover b { text-decoration: underline; }
.fc-title .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.fc-stats dt { font-size: .74rem; color: var(--ink-3); font-weight: 600; }
.fc-stats dd { margin: 2px 0 0; font-weight: 650; font-size: .92rem; overflow-wrap: anywhere; }
.fc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fc-actions button.copy { width: 36px; height: 36px; }
.fq .qrbox { width: 160px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.fq .qrbox svg { display: block; width: 100%; height: auto; }

.fed { display: grid; gap: 18px; }
.fed-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fed-link .copyfield { flex: 1; min-width: 240px; }
.fb-list { display: grid; gap: 10px; }
.fb-row { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); }
.fb-main { display: grid; gap: 10px; }
@media (min-width: 700px) { .fb-main { grid-template-columns: 1.4fr 1fr .9fr; } }
.fb-more { display: grid; gap: 10px; align-items: end; }
@media (min-width: 700px) { .fb-more { grid-template-columns: 1fr auto; } }
.fb-tools { display: flex; gap: 4px; justify-content: flex-end; }
.coinpick { display: grid; gap: 6px; margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.coinopt { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-size: .86rem; cursor: pointer; }
.coinopt input { width: 18px; height: 18px; accent-color: var(--cobalt); }

/* ---------- вебхуки ---------- */
.eps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ep { padding: 14px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); display: grid; gap: 8px; min-width: 0; }
.ep-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ep-url { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.ep-url code { overflow-wrap: anywhere; font-weight: 600; }
.ep-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ep-events { display: flex; gap: 4px; flex-wrap: wrap; }
.evchip { font-size: .74rem; padding: 2px 7px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line-2); }
.ep-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.wst[data-wst=active] { color: var(--mint); background: var(--mint-soft); border-color: transparent; }
.badge.wst[data-wst=failing] { color: var(--amber); background: var(--amber-bg); border-color: transparent; }
.badge.wst[data-wst=disabled] { color: var(--red); background: var(--red-soft); border-color: transparent; }
.ep-adddet > summary { list-style: none; display: inline-flex; cursor: pointer; }
.ep-adddet > summary::-webkit-details-marker { display: none; }
.ep-add { display: grid; gap: 14px; margin-top: 12px; padding: 16px; border-radius: 14px; border: 1px dashed var(--line); }
.evpick { display: grid; gap: 10px; margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.evgroup { border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 12px 10px; margin: 0; display: grid; gap: 4px; background: var(--surface); }
.evgroup legend { padding: 0 4px; }
.evgroup .check { font-weight: 500; flex-wrap: wrap; gap: 4px 8px; }
.evgroup .faint { font-size: .78rem; }

.dlv-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.dlv-filters .field { min-width: 180px; }
.dlv-list { list-style: none; margin: 0; padding: 0; border-radius: 14px; border: 1px solid var(--line-2); background: var(--glass-2); overflow: hidden; }
.dlv + .dlv { border-top: 1px solid var(--line-2); }
.dlv-empty { padding: 18px; }
.dlv summary { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 11px 14px; cursor: pointer; list-style: none; }
.dlv summary::-webkit-details-marker { display: none; }
.dlv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; }
.dlv-dot[data-ok=true] { background: var(--mint); }
.dlv-code { font-weight: 700; color: var(--red); }
.dlv-code[data-ok=true] { color: var(--mint); }
.dlv-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.dlv-time { margin-left: auto; }
.dlv-body { display: grid; gap: 10px; padding: 0 14px 14px; }
pre.code.small-code { font-size: .76rem; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* вход кошельком и почтой */
.authx { display: grid; gap: 10px; }
.authx-title { font-weight: 700; margin: 0; }
.wbtn { justify-content: flex-start; gap: 12px; }
.wicon svg { width: 22px; height: 22px; display: block; }
.wbtn[aria-busy=true] { opacity: .6; cursor: progress; }
.authx-mail { display: grid; gap: 10px; }
.authx-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .85rem; }
.authx-or::before, .authx-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* безопасность */
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sec-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); }
.sec-item.cur { border-color: var(--cobalt); }
.sec-main { display: grid; gap: 2px; min-width: 0; }
.sec-main .mono { overflow-wrap: anywhere; }
.sec-main .badge { justify-self: start; }

/* заморозка */
.frozen-banner { margin: 16px 16px 0; padding: 14px 16px; border-radius: 14px; background: var(--red-soft); border: 2px solid rgba(196, 43, 43, .35); }
.frozen-banner b { color: var(--red); display: block; }
@media (min-width: 920px) { .frozen-banner { margin: 24px 40px 0; } }

/* возврат */
.rf-dialog { width: min(560px, calc(100vw - 24px)); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.rf-dialog::backdrop { background: rgba(12, 22, 51, .35); }
.rf-form { display: grid; gap: 14px; padding: 22px; }
.rf-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rf-head h2 { font-size: 1.3rem; }
.rf-quote .wd-get b { font: 750 1.5rem/1.1 var(--display); }
.rf-quote dl { margin: 6px 0; }
.rf-hist ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.wbtn { text-align: left; }

/* права ключей */
.keyform { display: grid; gap: 10px; }
.scope-pick { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px 12px; margin: 0; display: grid; gap: 6px; }
.scope-list { display: grid; gap: 4px; padding-left: 28px; }
.scope-list[hidden] { display: none; }
.scope-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.scope-tag { font-size: .72rem; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2); }
.scope-tag.all { background: var(--cobalt-soft); color: var(--cobalt); border-color: transparent; }

/* Telegram (dash-telegram.js) */
.tg-qr svg { width: 168px; height: 168px; display: block; margin-top: 6px; border-radius: 12px; }
.tg-cmds { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.tg-chat .sec-main { flex: 1; }
.tg-ev { margin-top: 6px; }
.tg-ev summary { cursor: pointer; color: var(--cobalt); }
.tg-ev .evpick { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tg-ev .check { font-weight: 500; align-items: flex-start; }
.tg-ev .check input { flex: none; margin-top: 1px; }
.tg-evname { display: grid; gap: 1px; }
.tg-evname code { font-size: .74rem; font-weight: 400; }
.tg-ev .row { margin-top: 10px; }
@media (max-width: 560px) { .tg-chat { flex-direction: column; } }

/* Экран «касса на вашу почту» (dash-claim.js) */
.cl-row { display: grid; grid-template-columns: minmax(140px, 30%) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.cl-row:last-child { border-bottom: 0; }
.cl-list { margin: 0; padding: 0; list-style: none; }
.cl-list li { overflow-wrap: anywhere; }
.cl-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
@media (max-width: 560px) { .cl-row { grid-template-columns: 1fr; gap: 2px; } }
.cl-top { justify-content: flex-end; gap: 8px; margin-bottom: 8px; }

/* Поддержка (dash-support.js) */
.sp-item a.sec-main { color: inherit; text-decoration: none; flex: 1; }
.sp-item a.sec-main:hover b { color: var(--cobalt); }
.sp-prev { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-head { justify-content: space-between; align-items: center; }
.sp-subj { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.sp-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sp-msg { padding: 12px 14px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); max-width: 88%; }
.sp-msg.merchant { justify-self: end; background: var(--cobalt-soft); border-color: transparent; }
.sp-meta { font-size: .84rem; margin-bottom: 4px; }
.sp-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
@media (max-width: 600px) { .sp-msg { max-width: 100%; } }
