/* Capy Cloud pages (/app/*). Uses only the tokens from styles.css. */
.cloud { min-height: 100vh; display: flex; flex-direction: column; }
.cloud-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; height: 64px; border-bottom: 1px solid var(--border); }
.cloud-user { display: flex; align-items: center; gap: 12px; }
.cloud-main { flex: 1; width: 100%; margin: 0 auto; padding: 48px 24px 64px; display: flex; flex-direction: column; gap: 20px; }
.cloud-narrow { max-width: 460px; }
.cloud-wide { max-width: 980px; }
.cloud-main > * { min-width: 0; }
.cloud-card { min-width: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.cloud-card h1 { font-size: 26px; }
.cloud-capy { align-self: center; margin: -8px 0 -4px; }
.cloud-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 12px 0; }
.cloud-msg-success, .cloud-msg-warning, .cloud-msg-error { text-align: center; align-items: center; }
.cloud-card h2 { font-size: 18px; }
.cloud-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cloud-head h1 { font-size: 28px; line-height: 1.2; }
.cloud-text { color: var(--text-2); }
.cloud-form { display: flex; flex-direction: column; gap: 16px; }
.cloud-form > label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.cloud input[type="password"], .cloud input[type="url"] {
  height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-alt); color: var(--text); font: 15px var(--font);
}
.cloud input[type="password"]:focus, .cloud input[type="url"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cloud-error { color: var(--err); background: var(--err-soft); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.cloud-links { text-align: center; }
.cloud-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cloud-grow { flex: 1; min-width: 220px; display: flex; }
.cloud-grow input { width: 100%; }
.cloud-newkey { border-color: var(--accent-line); background: var(--accent-soft); }
.cloud-key { width: 100%; min-width: 0; font-family: var(--mono); font-size: 13px; }
.cloud-table-wrap { overflow-x: auto; }
.cloud-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cloud-table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 0 12px 10px 0; }
.cloud-table td { padding: 12px 12px 12px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.cloud-table .is-revoked td { color: var(--text-muted); }
.cloud-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cloud-danger { color: var(--err); }
.cloud-ws { display: flex; gap: 6px; flex-wrap: wrap; }
.cloud-ws a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); font-size: 13px; }
.cloud-ws a[aria-current="page"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cloud-m { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .cloud-main { padding: 28px 16px 48px; }
  .cloud-card { padding: 20px; }
  .cloud-user .muted { display: none; }
  .cloud-grow { min-width: 0; flex-basis: 100%; }
  .cloud-inline .btn { width: 100%; }
  .cloud-table, .cloud-table tbody { display: block; width: 100%; }
  .cloud-table thead { display: none; }
  .cloud-m { display: inline; }
  .cloud-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--border); }
  .cloud-table td { border: 0; padding: 0; }
  .cloud-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .cloud * { transition: none !important; } }
/* device pairing (/app/connect) */
/* Selects. Without JS: a native select with a drawn chevron and a dark list. With site/cloud.js: .combo (below). */
.cloud select {
  height: 46px; padding: 0 38px 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background-color: var(--bg-alt); color: var(--text); font: 15px var(--font); color-scheme: dark;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.cloud select:hover { border-color: var(--border-hover); }
.cloud select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cloud select option { background: var(--surface-2); color: var(--text); }

.combo { position: relative; display: block; width: 100%; min-width: 0; }
.combo-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 14px; text-align: left;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-alt); color: var(--text);
  font: 15px var(--font); cursor: pointer; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.combo-btn.mono { font-family: var(--mono); font-size: 14px; }
.combo-btn:hover { border-color: var(--border-hover); background: var(--surface); }
.combo-btn:focus-visible, .combo.is-open .combo-btn { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-val { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-btn::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: -4px 2px 0 0;
  border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg); transition: transform .18s var(--ease), border-color .15s var(--ease);
}
.combo.is-open .combo-btn::after { transform: rotate(-135deg); margin-top: 4px; border-color: var(--accent); }
.combo-pop {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; min-width: 220px;
  padding: 6px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2);
  box-shadow: var(--shadow); animation: combo-in .14s var(--ease);
}
@keyframes combo-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.combo-search {
  display: block; width: 100%; height: 36px; margin-bottom: 6px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); font: 14px var(--font);
}
.combo-search:focus { outline: none; border-color: var(--accent-line); }
.combo-search::-webkit-search-cancel-button { filter: invert(.7); }
/* short lists: the field only catches type-ahead keys */
.combo-typeahead { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.combo-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.combo-opt {
  position: relative; padding: 9px 34px 9px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-btn.mono ~ .combo-pop .combo-opt { font-family: var(--mono); font-size: 13px; }
.combo-opt.is-active { background: var(--surface-3); color: var(--text); }
.combo-opt[aria-selected="true"] { color: var(--accent); }
.combo-opt[aria-selected="true"]::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 5px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg);
}
.combo-empty { padding: 12px; font-size: 14px; color: var(--text-muted); text-align: center; }
.cab-filters .combo-btn { height: 40px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .combo-pop { animation: none; } .combo-btn::after { transition: none; } }
.cloud-check { align-self: center; font-size: 26px; font-weight: 650; letter-spacing: .12em; color: var(--accent); padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--accent-line); background: var(--accent-soft); }

/* beta: survey form and the owner's overview */
.cloud textarea, .cloud input[type="number"] {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-alt); color: var(--text); font: 15px var(--font); resize: vertical;
}
.cloud input[type="number"] { height: 46px; padding: 0 14px; max-width: 160px; }
.cloud textarea:focus, .cloud input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cloud-q { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.cloud-q legend { padding: 0; margin-bottom: 8px; }
.cloud-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.cloud-choices label { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; }
.cloud-choices input { accent-color: var(--accent); }
.cloud-choices label:has(input:checked) { border-color: var(--accent); color: var(--text); }
.cloud-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.cloud-stat { flex: 1; min-width: 140px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.cloud-stat b { display: block; font-size: 22px; color: var(--text); }
.cloud-report { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.cloud-report:first-of-type { border-top: 0; padding-top: 0; }
.cloud-report p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.cloud-steps { font-family: var(--mono); font-size: 12px; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.cloud-bad { color: var(--err); }

/* web cabinet (phase 3.2): side navigation, sections, task log, two-factor setup */
.cloud input[type="date"] {
  height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-alt); color: var(--text); font: 15px var(--font); color-scheme: dark;
}
.cloud input[type="date"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cloud-langs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); }
.cloud-langs a { padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; color: var(--text-muted); letter-spacing: .03em; }
.cloud-langs a:hover { color: var(--text); text-decoration: none; }
.cloud-langs a[aria-current="true"] { background: var(--surface-3); color: var(--text); }
.cloud-me:hover { color: var(--text); }
.cloud-ok { color: var(--ok); background: var(--ok-soft); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.cloud-break { overflow-wrap: anywhere; }
.cab-act-cell .cloud-actions { flex-wrap: nowrap; }
.cab-role { align-self: flex-start; display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 12px; border: 1px solid var(--border-strong); color: var(--text-2); }
.cab-role-owner { border-color: var(--accent-line); color: var(--accent); }
.cab-banner { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--warn-line); background: var(--warn-soft); }
.cab-banner b { color: var(--warn); }
.cab-banner p { color: var(--text-2); margin-top: 4px; }
.cab-banner-hard { border-color: var(--err-line); background: var(--err-soft); }
.cab-banner-hard b { color: var(--err); }
.cab-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.cab-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-muted); min-width: 0; }
.cab-filters select, .cab-filters input[type="date"] { width: 100%; min-width: 0; height: 40px; font-size: 14px; }
.cab-by { max-width: 200px; }
.cab-ell { display: block; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab-act { font-size: 12px; white-space: nowrap; }
.cab-filter-btns { display: flex; gap: 8px; }
.cab-nowrap { white-space: nowrap; }
.cab-task { display: flex; flex-direction: column; gap: 2px; min-width: 220px; overflow-wrap: anywhere; }
.cab-status { display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid var(--border-strong); color: var(--text-2); vertical-align: middle; }
.cab-status-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.cab-status-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.cab-status-error, .cab-status-interrupted { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.cab-status-running { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.cab-stat-small { font-size: 15px !important; overflow-wrap: anywhere; padding-top: 6px; }
.cab-stat-wide { flex: 2; min-width: 220px; }
.cab-rollback { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; background: var(--surface-2); color: var(--text-2); }
.cab-rollback-rolled_back { color: var(--ok); background: var(--ok-soft); }
.cab-rollback-kept { color: var(--warn); background: var(--warn-soft); }
.cab-json { margin: 0; max-height: 420px; overflow: auto; padding: 14px; border-radius: var(--radius-sm); background: var(--bg-alt); border: 1px solid var(--border); font: 12px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.cab-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 13px; }
.cab-step { display: grid; grid-template-columns: 150px 64px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.cab-step:first-child { border-top: 0; }
.cab-step-at { color: var(--text-faint); font-size: 12px; }
.cab-step-lvl { color: var(--text-muted); font-size: 12px; }
.cab-step-msg { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.cab-step-error .cab-step-lvl, .cab-step-error .cab-step-msg { color: var(--err); }
.cab-step-warn .cab-step-lvl { color: var(--warn); }
.cab-step-ok .cab-step-lvl { color: var(--ok); }
.cab-details summary { cursor: pointer; font-weight: 600; }
.cab-details-inline summary { cursor: pointer; color: var(--text-muted); }
.cab-details-inline[open] summary { margin-bottom: 12px; }
.cab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cab-grid > label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); min-width: 0; }
.cab-grid input[type="text"], .cab-grid input[type="url"], .cab-grid input[type="password"] { width: 100%; min-width: 0; }
.cab-span { grid-column: 1 / -1; }
.cab-check { flex-direction: row !important; align-items: center; gap: 10px !important; }
.cab-check input { accent-color: var(--accent); width: 18px; height: 18px; }
.cloud input.mono, .cloud textarea.mono { font-family: var(--mono); font-size: 13px; }
.cab-code { width: 100%; min-height: 320px; font: 12px/1.5 var(--mono) !important; }
.cab-qr-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.cab-qr { border-radius: var(--radius-sm); border: 1px solid var(--border-strong); }
.cab-secret { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.cab-howto { margin: 0; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.cab-codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 28px; font-size: 16px; color: var(--text); }
.cab-soon { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cab-soon li { padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-2); font-size: 14px; }
.cab-facts { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.cab-good { color: var(--ok); }
.cab-bad { color: var(--err); }
.cab-join-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cab-warn-text { color: var(--warn); }
.cloud-card h2 .cab-status { margin-left: 8px; }

@media (max-width: 1000px) {
  .cab-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cab-filter-btns { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .cloud-top { padding: 0 16px; }
  .cloud-me { display: none; }
  .cab-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cab-filter-btns .btn { flex: 1; }
  .cab-by, .cab-ell { max-width: none; }
  .cab-act-cell { grid-column: 1 / -1; }
  .cab-act-cell .cloud-actions { flex-wrap: wrap; justify-content: flex-start; }
  .cab-task { min-width: 0; }
  .cab-jobs tr { grid-template-columns: minmax(0, 1fr) auto; }
  .cab-jobs td:first-child { grid-column: 1 / -1; color: var(--text-muted); font-size: 12px; }
  .cab-jobs td:nth-child(3) { justify-self: end; align-self: start; }
  .cab-jobs td:nth-child(n+4) { grid-column: 1 / -1; }
  .cab-jobs .cab-ell { display: inline; }
  .cab-tpls td:nth-child(2) { justify-self: end; color: var(--text-muted); }
  .cab-tpls td:nth-child(n+3) { grid-column: 1 / -1; }
  .cab-jobs .cab-by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cab-jobs .cab-ell + .cab-ell::before { content: " · "; }
  .cab-grid { grid-template-columns: minmax(0, 1fr); }
  .cab-step { grid-template-columns: minmax(0, 1fr) auto; }
  .cab-step-msg { grid-column: 1 / -1; }
  .cab-codes { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 14px; }
  .cab-qr-row { justify-content: center; }
  .cab-banner .btn { width: 100%; }
}

/* ---- cabinet shell (layout A): top bar, grouped side navigation, extension card --------------------------- */
.app-skip { position: absolute; left: -9999px; }
.app-skip:focus { left: 16px; top: 12px; z-index: 50; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text); }
.app-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 20px; background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.app-top .brand { flex: none; }
.app-top-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.app-ws, .app-user { position: relative; }
.app-ws summary, .app-user summary { list-style: none; cursor: pointer; }
.app-ws summary::-webkit-details-marker, .app-user summary::-webkit-details-marker { display: none; }
.app-ws summary { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); max-width: 320px; }
.app-ws summary:hover, .app-ws[open] summary { border-color: var(--border-hover); }
.app-ws summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: translateY(-2px) rotate(45deg); flex: none; }
.app-ws-name { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 240px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); box-shadow: var(--shadow); }
.app-pop-end { left: auto; right: 0; padding: 10px; gap: 8px; }
.app-pop a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--radius-xs); color: var(--text); }
.app-pop a:hover { background: var(--surface-3); text-decoration: none; }
.app-pop a[aria-current="page"] { color: var(--accent); }
.app-avatar { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); color: var(--accent); font-weight: 700; font-size: 12px; }
.app-user[open] .app-avatar, .app-user summary:hover .app-avatar { box-shadow: 0 0 0 2px var(--accent-line); }

.app-row { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.app-side { position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto; box-sizing: border-box; padding: 16px 12px; display: flex; flex-direction: column; gap: 16px; background: var(--bg-alt); border-right: 1px solid var(--border); }
.app-nav { display: flex; flex-direction: column; gap: 2px; }
.app-group { margin: 14px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.app-group:first-child { margin-top: 0; }
.app-nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 14px; }
.app-nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.app-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.app-ext { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.app-ext-head { display: flex; flex-direction: column; gap: 4px; }
.app-ext-head b { font-size: 15px; line-height: 1.3; }
.app-ext .btn { align-self: stretch; justify-content: center; text-align: center; }
.app-ext > a.small { align-self: center; color: var(--accent); }

.app-main { min-width: 0; box-sizing: border-box; width: 100%; max-width: 1240px; padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 20px; }
.app-flush .app-main { max-width: none; padding: 0; gap: 0; }
.app-flush .app-main > .cab-banner { margin: 16px 20px 0; }

/* ---- overview ---------------------------------------------------------------------------------------- */
.ov-start { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; border-color: var(--accent-line); }
.ov-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ov-kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.ov-kpi b { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.2; }
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ov-grid .cloud-card { padding: 20px; gap: 12px; }
.ov-wide { grid-column: span 2; }
.ov-tall { grid-row: span 3; }
.ov-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ov-card-head h2, .ov-card-head h3 { font-size: 15px; }
.ov-legend { display: flex; align-items: center; gap: 6px; }
.ov-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.ov-legend .ov-dot { margin-left: 8px; border-radius: 2px; }
.ov-dot-all { background: var(--surface-3); }
.ov-dot-bad { background: var(--err); }
.ov-st-ok { background: var(--ok); }
.ov-st-warn { background: var(--warn); }
.ov-st-error, .ov-st-interrupted { background: var(--err); }
.ov-st-running { background: var(--accent); }
.ov-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.ov-bar-col { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; }
.ov-bar-n { text-align: center; color: var(--text-2); }
.ov-bar-track { height: 160px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; border-bottom: 1px solid var(--border); }
.ov-bar-track > .ov-bar { flex: none; }
.ov-bar-track > .ov-h1 { height: 8.5%; } .ov-bar-track > .ov-h2 { height: 17%; } .ov-bar-track > .ov-h3 { height: 25.5%; }
.ov-bar-track > .ov-h4 { height: 34%; } .ov-bar-track > .ov-h5 { height: 42.5%; } .ov-bar-track > .ov-h6 { height: 51%; }
.ov-bar-track > .ov-h7 { height: 59.5%; } .ov-bar-track > .ov-h8 { height: 68%; } .ov-bar-track > .ov-h9 { height: 76.5%; }
.ov-bar-track > .ov-h10 { height: 85%; }
.ov-bar { position: relative; display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--surface-3); overflow: hidden; }
.ov-bar-bad { position: absolute; left: 0; right: 0; bottom: 0; background: var(--err); opacity: .85; }
.ov-bar-day { text-align: center; }
.ov-h0 { height: 0; } .ov-h1 { height: 10%; } .ov-h2 { height: 20%; } .ov-h3 { height: 30%; } .ov-h4 { height: 40%; } .ov-h5 { height: 50%; }
.ov-h6 { height: 60%; } .ov-h7 { height: 70%; } .ov-h8 { height: 80%; } .ov-h9 { height: 90%; } .ov-h10 { height: 100%; }
.ov-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ov-list > li { border-top: 1px solid var(--border); }
.ov-list > li:first-child { border-top: 0; }
.ov-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; font-size: 14px; }
.ov-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-row > .small { flex: none; text-align: right; max-width: 45%; }
.ov-job { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; color: var(--text); }
.ov-job:hover { text-decoration: none; }
.ov-job:hover .ov-job-title { color: var(--accent); }
.ov-job .ov-dot { margin-top: 6px; }
.ov-job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ov-job-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.ov-job-main .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- activity (layout C): task list + inspector -------------------------------------------------------- */
.insp { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); min-height: calc(100vh - 60px); }
.insp-list { min-width: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.insp-list-head { display: flex; flex-direction: column; gap: 12px; padding: 20px 18px 14px; border-bottom: 1px solid var(--border); }
.insp-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.insp-title h1 { font-size: 20px; }
.insp-segs { display: flex; gap: 6px; flex-wrap: wrap; }
.insp-segs a { padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); font-size: 13px; }
.insp-segs a:hover { color: var(--text); text-decoration: none; }
.insp-segs a[aria-current="true"] { background: var(--surface-3); border-color: var(--border-hover); color: var(--text); }
.insp-filters summary { cursor: pointer; color: var(--text-muted); }
.insp-filters[open] summary { margin-bottom: 10px; }
.insp-list .cab-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.insp-list .cab-filter-btns { grid-column: 1 / -1; }
.insp-jobs { list-style: none; margin: 0; padding: 0; }
.insp-job { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; border-bottom: 1px solid var(--border); border-left: 2px solid transparent; color: var(--text); }
.insp-job:hover { background: var(--surface); text-decoration: none; }
.insp-job.is-on { background: var(--surface); border-left-color: var(--accent); }
.insp-job .ov-dot { margin-top: 6px; }
.insp-job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.insp-job-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.insp-job-main .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-job-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.insp-more { padding: 14px 18px; }
.insp-empty-list { padding: 32px 18px; }
.insp-pane { min-width: 0; box-sizing: border-box; padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; background: var(--bg-alt); }
.insp-back { display: none; }
.insp-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.insp-head-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.insp-head-main .cab-status { align-self: flex-start; }
.insp-head h2 { font-size: 22px; line-height: 1.25; }
.insp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.insp-facts > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.insp-facts b { font-size: 15px; overflow-wrap: anywhere; }
.insp-cols { display: flex; flex-direction: column; gap: 16px; }
.insp-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; min-width: 0; }
.insp-side > p { grid-column: 1 / -1; }
.insp-box { min-width: 0; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.insp-box h3 { font-size: 14px; }
.insp-log .cab-step { grid-template-columns: 64px 72px minmax(0, 1fr); font-size: 12px; }
.insp-log .cab-step-msg { font-family: var(--mono); }
.insp-empty { flex: 1; justify-content: center; max-width: 420px; margin: 0 auto; }

/* ---- install, inside the cabinet ----------------------------------------------------------------------- */
.inst-jump { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -6px; }
.inst-jump a { padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-2); font-size: 13px; }
.inst-jump a:hover { color: var(--text); text-decoration: none; border-color: var(--border-hover); }
.inst-dl-card { border-color: var(--accent-line); }
.inst-dl-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.inst-dl-head img { flex: none; margin: -6px 0; }
.inst-sum { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.inst-code { font: 13px/1.5 var(--mono); color: var(--text-2); padding: 3px 8px; border-radius: var(--radius-xs); background: var(--bg-alt); border: 1px solid var(--border); overflow-wrap: anywhere; }
.inst-sha { display: block; padding: 10px 12px; color: var(--text); user-select: all; }
.inst-cmds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.inst-cmds li { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.inst-browser { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.inst-browser h3 { font-size: 16px; }
.inst-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.inst-steps code, .inst-faq code, .inst-browser p code, .cloud-card > p code { font: 12.5px var(--mono); padding: 1px 6px; border-radius: var(--radius-xs); background: var(--bg-alt); border: 1px solid var(--border); color: var(--text); }
.inst-steps b { color: var(--text); }
.inst-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.inst-shot { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.inst-shot-frame { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); background: var(--bg-alt); color: var(--text-faint); font-size: 12px; }
.inst-connect { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); display: flex; flex-direction: column; gap: 6px; }
.inst-connect h3 { font-size: 15px; }
.inst-faq { border-top: 1px solid var(--border); padding: 12px 0; }
.inst-faq summary { cursor: pointer; font-weight: 500; color: var(--text); }
.inst-faq p { margin-top: 8px; color: var(--text-2); }
#download, #browsers, #update, #help { scroll-margin-top: 80px; }

@media (max-width: 1180px) {
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-tall { grid-row: auto; }
  .insp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .app-row { grid-template-columns: minmax(0, 1fr); }
  .app-side { position: sticky; top: 60px; z-index: 15; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
  .app-side::-webkit-scrollbar { display: none; }
  .app-nav { flex-direction: row; gap: 6px; }
  .app-group, .app-ext { display: none; }
  .app-nav a { flex: none; padding: 6px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); font-size: 13px; white-space: nowrap; }
  .app-nav a[aria-current="page"] { border-color: var(--accent); }
  .insp { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .insp-list { border-right: 0; }
  .insp-pane { display: none; }
  .insp-has-job .insp-list { display: none; }
  .insp-has-job .insp-pane { display: flex; }
  .insp-back { display: block; }
}
@media (max-width: 760px) {
  .app-top { padding: 0 12px; gap: 10px; height: 56px; }
  .app-top .brand span { display: none; }
  .app-ws summary { max-width: 44vw; }
  .app-ws summary .cab-role { display: none; }
  .app-top-end { gap: 8px; }
  .app-side { top: 56px; }
  .app-main { padding: 20px 16px 40px; }
  .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ov-kpi { padding: 12px 14px; }
  .ov-kpi b { font-size: 22px; }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-wide { grid-column: auto; }
  .ov-bars { gap: 6px; }
  .ov-bar-track { height: 120px; }
  .insp-list-head { padding: 16px 16px 12px; }
  .insp-job { padding: 12px 16px; }
  .insp-pane { padding: 18px 16px 40px; }
  .insp-head { flex-direction: column; }
  .insp-head .btn { align-self: stretch; }
  .insp-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .insp-log .cab-step { grid-template-columns: minmax(0, 1fr) auto; }
  .inst-dl-head img { display: none; }
}

/* ---- trackers: sidebar group, cards (T1), tracker page with tabs (T2), ad id detect (T3) ---------------- */
.trk-dot-ok { background: var(--ok); }
.trk-dot-fail { background: var(--err); }
.trk-dot-untested { background: var(--text-faint); }
.app-nav a.app-nav-sub { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 12px 6px 16px; font-size: 13px; }
.app-nav-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-nav a.app-nav-add { color: var(--accent); }
.trk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.trk-card { gap: 10px; }
.trk-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trk-mono { display: flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--accent); font-weight: 700; }
.trk-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trk-card-title .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-name { font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.trk-name:hover { color: var(--accent); text-decoration: none; }
.trk-pill { flex: none; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; border: 1px solid var(--border-strong); color: var(--text-muted); }
.trk-pill-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.trk-pill-fail { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.trk-connect { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 80px; }
.trk-connect h2 { font-size: 17px; }
.trk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.trk-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
a.trk-tile:hover { border-color: var(--border-hover); text-decoration: none; }
.trk-tile.is-on { border-color: var(--accent); background: var(--accent-soft); }
.trk-tile.is-off { opacity: .55; border-style: dashed; }
.trk-form-card { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.trk-form-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.trk-form-main h3 { font-size: 16px; }
.trk-form-side { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-alt); border: 1px solid var(--border); }
.trk-adv > summary { cursor: pointer; color: var(--text-muted); }
.trk-adv[open] > summary { margin-bottom: 10px; }
.trk-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.trk-tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 500; }
.trk-tabs a:hover { color: var(--text); text-decoration: none; }
.trk-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.trk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.trk-main, .trk-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.trk-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trk-checks > li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.trk-checks > li:first-child { border-top: 0; padding-top: 0; }
.trk-checks .ov-dot { margin-top: 6px; }
.trk-detect { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.trk-slots { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.trk-slots legend { margin-bottom: 6px; }
.trk-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-alt); cursor: pointer; }
.trk-slot:hover { border-color: var(--border-hover); }
.trk-slot.is-best { border-color: var(--ok-line); }
.trk-slot:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.trk-slot-name { min-width: 92px; font-weight: 600; color: var(--text); }
.trk-slot-found { flex: 1; min-width: 160px; color: var(--text-2); }
.trk-slot-sample { flex-basis: 100%; padding-left: 26px; overflow-wrap: anywhere; }
@media (max-width: 1000px) {
  .trk-layout, .trk-form-card { grid-template-columns: minmax(0, 1fr); }
  .app-nav a.app-nav-sub { padding: 6px 13px; }
}
@media (max-width: 760px) {
  .trk-cards { grid-template-columns: minmax(0, 1fr); }
  .trk-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .trk-tabs { overflow-x: auto; scrollbar-width: none; }
  .trk-slot-sample { padding-left: 0; }
  .trk-card .cloud-inline { flex-direction: row; flex-wrap: nowrap; align-items: stretch; }
  .trk-card .cloud-inline > * { flex: 1; }
  .trk-card .cloud-inline .btn { width: 100%; justify-content: center; }
}

/* ---- billing (B2 + the inline checkout of B3) ---------------------------------------------------------- */
.app-nav a.app-nav-tailed { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-nav-tail { flex: none; font-size: 11px; font-weight: 600; color: var(--warn); }
.app-nav-tail-expired { color: var(--err); }
.bill-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bill-now, .bill-buy { gap: 16px; }
.bill-now-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.bill-now-head h2 { font-size: 24px; margin-top: 2px; }
.bill-pill { flex: none; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-2); }
.bill-pill-trial, .bill-pill-grace { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.bill-pill-active { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.bill-pill-expired { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.bill-track { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bill-fill { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.bill-fill-trial, .bill-fill-grace, .bill-fill-near { background: var(--warn); }
.bill-fill-active, .bill-fill-ok { background: var(--accent); }
.bill-fill-expired, .bill-fill-full { background: var(--err); }
.bill-w0 { width: 0; } .bill-w1 { width: 10%; } .bill-w2 { width: 20%; } .bill-w3 { width: 30%; } .bill-w4 { width: 40%; }
.bill-w5 { width: 50%; } .bill-w6 { width: 60%; } .bill-w7 { width: 70%; } .bill-w8 { width: 80%; } .bill-w9 { width: 90%; }
.bill-w10 { width: 100%; }
.bill-meters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.bill-meters li { display: flex; flex-direction: column; gap: 7px; }
.bill-meter-head { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 14px; }
.bill-meter-head b { color: var(--text); }
.bill-form { display: flex; flex-direction: column; gap: 14px; }
.bill-opts, .bill-nets { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bill-list { list-style: none; }
.bill-opts legend, .bill-nets legend { margin-bottom: 4px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.bill-nets { flex-direction: row; flex-wrap: wrap; }
.bill-opt, .bill-net { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-alt); cursor: pointer; }
.bill-net { flex: 1 1 160px; }
.bill-opt:hover, .bill-net:hover { border-color: var(--border-hover); }
.bill-opt:has(input:checked), .bill-net:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.bill-opt.is-contact, .bill-opt.is-static { cursor: default; }
.bill-opt.is-contact:hover, .bill-opt.is-static:hover { border-color: var(--border); }
.bill-opt input, .bill-net input { flex: none; accent-color: var(--accent); }
.bill-opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bill-price { flex: none; font-size: 16px; }
.bill-form .btn-primary { align-self: stretch; }
.bill-invoice { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--accent-line); background: var(--bg-alt); scroll-margin-top: 80px; }
.bill-inv-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bill-inv-body { display: flex; gap: 16px; align-items: center; }
.bill-qr { flex: none; width: 132px; height: 132px; border-radius: var(--radius-sm); background: #fff; }
.bill-inv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bill-amount { font-size: 22px; color: var(--text); }
#pay { scroll-margin-top: 80px; }
@media (max-width: 1000px) {
  .bill-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .bill-inv-body { flex-direction: column; align-items: flex-start; }
  .bill-now-head h2 { font-size: 20px; }
}
.bill-cycle { margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-alt); display: flex; gap: 4px; }
.bill-cycle label { flex: 1; display: flex; align-items: center; justify-content: center; padding: 9px 8px; border-radius: var(--radius-xs); color: var(--text-muted); font-weight: 600; cursor: pointer; text-align: center; }
.bill-cycle input { position: absolute; opacity: 0; pointer-events: none; }
.bill-cycle label:has(input:checked) { background: var(--surface-3); color: var(--text); }
.bill-cycle label:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--accent-line); }
.bill-save { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--ok-soft); color: var(--ok); font-size: 11px; }
.bill-price { display: flex; flex-direction: column; align-items: flex-end; }
.bill-p-year { display: none; }
.bill-form:has(input[name="period"][value="year"]:checked) .bill-p-year { display: inline; }
.bill-form:has(input[name="period"][value="year"]:checked) .bill-p-month { display: none; }

/* Badges (role, status, plan, trackers): one shape everywhere: fixed height, text centred on both axes. */
.cab-role, .cab-status, .trk-pill, .bill-pill, .bill-save {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  height: 22px; padding: 0 10px; line-height: 1; white-space: nowrap; vertical-align: middle;
  font-size: 12px; font-weight: 550; letter-spacing: .01em;
}
.bill-pill { height: 26px; padding: 0 12px; }
.bill-save { height: 18px; padding: 0 7px; font-size: 11px; margin-left: 6px; }
.app-ws summary .cab-role { align-self: center; flex: none; }
.app-ws summary::after { margin-left: 2px; }
.cloud-legal { margin-top: 4px; } .cloud-legal a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; } .cloud-legal a:hover { color: var(--text); }

/* Disclosure blocks (Advanced, Filters, Parameters, Help): a drawn chevron instead of the browser triangle. */
.cloud details:not(.app-ws):not(.app-user) > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  margin-left: -10px; padding: 7px 12px 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px; line-height: 1.35; cursor: pointer; user-select: none;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.cloud details:not(.app-ws):not(.app-user) > summary::-webkit-details-marker { display: none; }
.cloud details:not(.app-ws):not(.app-user) > summary::before {
  content: ""; flex: none; width: 6px; height: 6px; margin: 0 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s var(--ease);
}
.cloud details:not(.app-ws):not(.app-user) > summary:hover { background: var(--surface-2); color: var(--text); }
.cloud details:not(.app-ws):not(.app-user) > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); color: var(--text); }
.cloud details:not(.app-ws):not(.app-user)[open] > summary { color: var(--text); }
.cloud details:not(.app-ws):not(.app-user)[open] > summary::before { transform: rotate(45deg); margin-top: -3px; }
.cloud .inst-faq > summary, .cloud .cab-details > summary { color: var(--text); font-weight: 550; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .cloud details > summary::before { transition: none; } }

/* Partner program */
.ref-how { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ref-how li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.ref-how b { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.ref-stats { margin: 4px 0; }
.ref-avail { border-color: var(--accent-line); }
.ref-avail b { color: var(--accent); }
.ref-wallet { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.ref-wallet label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); min-width: 0; }
.ref-payout { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.ref-tx { margin-left: 8px; }
.ref-table td { vertical-align: middle; }
@media (max-width: 760px) { .ref-wallet { grid-template-columns: 1fr; } }

/* ---- Admin panel (/app/admin) ---- */
.adm-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.adm-filters label { flex: 1 1 180px; }
.adm-filters input[type="search"] { width: 100%; min-width: 0; height: 40px; font-size: 14px; }
.adm-pager { justify-content: flex-start; }
.adm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-actions:empty { display: none; }
.adm-danger { border-top: 1px solid var(--border); padding-top: 12px; }
.adm-danger summary { color: var(--err); }
.adm-danger .cloud-form { margin-top: 12px; max-width: 460px; }
.adm-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.adm-pair label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); min-width: 0; }
.adm-inline-form { gap: 8px; }
.adm-inline-form label { display: flex; align-items: center; gap: 8px; }
.adm-inline-form input[type="number"], .adm-num { width: 84px; }
.adm-check { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); }
.adm-payout { display: flex; flex-direction: column; gap: 10px; }
.adm-payout .cloud-form { max-width: 520px; }
td .adm-inline-form + form { margin-top: 6px; }
@media (max-width: 760px) { .adm-inline-form .btn { width: auto; } .adm-danger .cloud-form { max-width: none; } }

/* ---- profiles (phase A: server executor) --------------------------------------------------------------- */
.prof-group { padding: 12px 18px 6px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.prof-hint { padding: 10px 18px 18px; }
.insp-facts .prof-ip { font-size: 13px; }
.prof-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.prof-dot-ok { background: var(--ok); }
.prof-dot-warn { background: var(--warn); }
.prof-dot-error { background: var(--err); }
.prof-dot-paused { background: var(--surface-3); }
.prof-note { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--warn-line); background: var(--warn-soft); color: var(--text-2); }
.prof-team { margin: 0 18px; width: calc(100% - 36px); }
.prof-team td, .prof-team th { vertical-align: middle; }
.prof-proxy { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.prof-proxy label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); min-width: 0; grid-column: span 3; }
.prof-proxy label:nth-of-type(1) { grid-column: span 2; }
.prof-proxy label:nth-of-type(3) { grid-column: span 1; }
.prof-wide { grid-column: 1 / -1; }
.prof-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.prof-erase { border-top: 1px solid var(--border); padding-top: 10px; }
.prof-erase summary { color: var(--err); cursor: pointer; font-size: 14px; }
.prof-erase form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; align-items: flex-start; }
.prof-erase label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.prof-erase input { width: 120px; }
@media (max-width: 760px) {
  .prof-proxy label, .prof-proxy label:nth-of-type(1) { grid-column: 1 / -1; }
  .prof-proxy label:nth-of-type(2) { grid-column: span 4; }
  .prof-proxy label:nth-of-type(3) { grid-column: span 2; }
  .prof-team { margin: 0 16px; width: calc(100% - 32px); }
}

/* ---- alerts (phase B: Telegram) ------------------------------------------------------------------------ */
.al-tg { display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.al-tg-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.al-tg-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.al-form { display: flex; flex-direction: column; gap: 16px; }
.al-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.al-card { display: flex; flex-direction: column; gap: 10px; }
.al-card-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.al-card-head h2 { font-size: 16px; }
.al-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.al-event { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.al-switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; min-width: 0; }
.al-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.al-knob { flex: none; position: relative; width: 34px; height: 20px; margin-top: 1px; border-radius: var(--radius-pill); background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .15s, border-color .15s; }
.al-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: transform .15s, background .15s; }
.al-switch input:checked + .al-knob { background: var(--accent-soft); border-color: var(--accent-line); }
.al-switch input:checked + .al-knob::after { transform: translateX(14px); background: var(--accent); }
.al-switch input:focus-visible + .al-knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.al-event-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.al-event-name { font-size: 14px; color: var(--text); }
.al-level { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); white-space: nowrap; }
.al-level-critical { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.al-level-important { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.al-th { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; padding-left: 46px; }
.al-th input { width: 72px; }
.al-accts summary { cursor: pointer; color: var(--text-muted); }
.al-accts[open] summary { margin-bottom: 8px; }
.al-note { padding-top: 6px; border-top: 1px solid var(--border); }
.al-quiet { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.al-quiet label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); min-width: 0; }
.al-quiet .al-wide { grid-column: 1 / -1; }
.al-save { display: flex; justify-content: flex-end; }
@media (max-width: 760px) {
  .al-grid { grid-template-columns: minmax(0, 1fr); }
  .al-save .btn { width: 100%; }
  .al-th { padding-left: 0; }
}

/* Naming rules: macro chips, own variables, reference */
.nm-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.nm-field > label { font-size: 14px; color: var(--text-2); }
.nm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nm-chip { font: 500 12px/1 var(--mono); color: var(--text-muted); background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 6px 9px; cursor: pointer; transition: color .15s var(--ease), border-color .15s var(--ease); }
.nm-chip:hover, .nm-chip:focus-visible { color: var(--accent); border-color: var(--accent-line); outline: none; }
.nm-chip-own { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.nm-unknown { color: var(--warn); }
.nm-vars { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; border-top: 1px solid var(--border); }
.nm-vars h3 { font-size: 15px; margin-top: 10px; }
.nm-var-head, .nm-var-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; }
.nm-var-head span:last-child { min-width: 72px; }
.nm-var-list { display: flex; flex-direction: column; gap: 8px; }
.nm-var-row input { width: 100%; min-width: 0; }
.nm-var-foot { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.nm-ref summary { cursor: pointer; color: var(--text); font-size: 14px; }
.nm-ref[open] summary { margin-bottom: 8px; }
.nm-ref-wrap { overflow-x: auto; }
.nm-ref-table td { vertical-align: top; }
.nm-ref-table td:first-child { white-space: nowrap; color: var(--accent); }
@media (max-width: 760px) {
  .nm-var-head { display: none; }
  .nm-var-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
  .nm-var-row input[name="var_hint"] { grid-column: 1 / -1; }
  .nm-var-row [data-var-remove] { grid-column: 1 / -1; justify-self: start; }
  .nm-ref-table th:nth-child(2), .nm-ref-table td:nth-child(2) { display: none; }
}

/* Auto-rules (phase C): list by group, editor with preview and log */
.rl-head-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rl-table-wrap { overflow-x: auto; }
.rl-table td, .rl-log td { vertical-align: top; }
.rl-off { opacity: .6; }
.rl-toggle-cell { text-align: right; white-space: nowrap; }
.rl-group-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.rl-group-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rl-mode { display: inline-block; font-size: 12px; line-height: 1; padding: 5px 9px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); white-space: nowrap; }
.rl-mode-live { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.rl-mode-notify { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.rl-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rl-inline input[type="text"] { flex: 1 1 220px; min-width: 0; }
.rl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 16px; align-items: start; }
.rl-form { gap: 18px; }
.rl-form label, .rl-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); min-width: 0; }
.rl-label { font-size: 14px; color: var(--text-2); }
.rl-form input[type="text"], .rl-form select { width: 100%; min-width: 0; }
.rl-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rl-row4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rl-sec { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; margin: 0; min-width: 0; }
.rl-sec legend { padding: 0 6px; font-weight: 600; color: var(--text); }
.rl-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rl-form label.rl-seg-item, .bk-form label.rl-seg-item { flex-direction: row; }
.rl-seg-item { position: relative; }
.rl-seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.rl-seg-item span { padding: 7px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); cursor: pointer; font-size: 13px; }
.rl-seg-item input:checked + span { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.rl-seg-item input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.rl-checks { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.rl-checks-row { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; max-height: none; }
.rl-cond { display: grid; grid-template-columns: minmax(0, 2fr) 70px minmax(0, 1fr); gap: 8px; }
.rl-cond-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.rl-save { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.rl-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rl-side-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.rl-mode-card form { display: inline; }
.rl-warn { color: var(--warn); }
.rl-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rl-pv { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rl-pv-top { display: flex; gap: 8px; justify-content: space-between; align-items: center; min-width: 0; }
.rl-pv-top .ell, .rl-obj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; display: block; max-width: 260px; }
.rl-dec { font-size: 12px; white-space: nowrap; color: var(--text-muted); }
.rl-dec-notified { color: var(--accent); }
.rl-dec-acted { color: var(--ok); }
.rl-dec-failed { color: var(--err); }
.rl-dec-skip_changed, .rl-dec-skip_cap, .rl-dec-skip_bid_limit { color: var(--warn); }
.rl-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.rl-num { white-space: nowrap; }
.rl-live-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.rl-danger { border-color: var(--err-line); }
@media (max-width: 1100px) {
  .rl-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .rl-row3, .rl-row4 { grid-template-columns: minmax(0, 1fr); }
  .rl-cond { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); }
  .rl-table th:nth-child(2), .rl-table td:nth-child(2), .rl-log th:nth-child(5), .rl-log td:nth-child(5) { display: none; }
  .rl-sec { padding: 12px; }
}

/* ---- Comments (phase D, layout B: pages first) ---------------------------------------------------- */
.rl-form textarea { width: 100%; min-width: 0; resize: vertical; }
.cm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cm-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; }
.cm-card-head { display: flex; gap: 10px; justify-content: space-between; align-items: center; min-width: 0; }
.cm-card-head h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cm-card p { margin: 0; }
.cm-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.cm-card-actions form { display: inline; }
.cm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-tags:empty { display: none; }
.cm-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); white-space: nowrap; }
.cm-tag-warn { color: var(--warn); border-color: var(--warn); }
.cm-tag-ok { color: var(--ok); border-color: var(--ok); }
.cm-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.cm-stats div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; min-width: 0; }
.cm-stats dt { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-stats dd { margin: 2px 0 0; font-size: 16px; color: var(--text); }
.cm-found { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cm-found li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; min-width: 0; }
.cm-found .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.cm-manual { margin-top: 12px; }
.cm-manual summary { cursor: pointer; color: var(--text-muted); }
.cm-manual form { margin-top: 10px; }
.cm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.cm-tabs a, .cm-view { padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); text-decoration: none; font-size: 14px; }
.cm-tabs a[aria-current="page"], .cm-view[aria-current="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.cm-views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cm-view { font-size: 13px; padding: 5px 12px; }
.cm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cm-item { display: flex; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.cm-list-plain .cm-item { padding: 8px 12px; }
.cm-state-hidden { opacity: 0.75; }
.cm-state-deleted { opacity: 0.5; }
.cm-pick { padding-top: 2px; }
.cm-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.cm-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cm-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.cm-body p.small { margin: 0; }
.cm-clip { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cm-reply summary { cursor: pointer; color: var(--accent); width: max-content; }
.cm-reply form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; align-items: flex-start; }
.cm-reply select, .cm-reply textarea { width: 100%; max-width: 520px; }
.cm-bulk { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0 0; margin-top: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.cm-bulk .small { margin-right: auto; }
.cm-rule { border-top: 1px dashed var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cm-rule:first-of-type { border-top: 0; padding-top: 0; }
.rl-form label.cab-check { flex-direction: row; align-items: flex-start; gap: 8px; }
.rl-form label.cab-check input { margin-top: 3px; flex: none; }
.cm-danger-check { color: var(--warn); }
.cm-reply-preview { border: 1px solid var(--accent-line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.rl-dec-queued, .rl-dec-would { color: var(--accent); }
@media (max-width: 760px) {
  .cm-cards { grid-template-columns: minmax(0, 1fr); }
  .cm-log th:nth-child(1), .cm-log td:nth-child(1) { display: none; }
  .cm-item { padding: 10px; gap: 10px; }
  .cm-bulk .small { display: none; }
  .cm-bulk { justify-content: flex-end; }
}

/* ---- Stats (phase E): drill-down table ---- */
.st-filters { gap: 12px; padding: 20px; }
.st-presets, .st-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.st-presets a, .st-levels a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.st-presets a:hover, .st-levels a:hover { border-color: var(--border-hover); color: var(--text); }
.st-presets a[aria-current="page"], .st-levels a[aria-current="page"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.st-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.st-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cloud .st-field input[type="date"] { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-alt); color: var(--text); font: 14px var(--font); color-scheme: dark; }
.cloud .st-field select { height: 40px; font-size: 14px; }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0; }
.st-kpis .cloud-stat { min-width: 0; padding: 10px 14px; }
.st-kpis dt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-kpis dd { margin: 4px 0 0; font-size: 18px; color: var(--text); }
.st-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.st-bar h2 { margin: 0; }
.st-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; min-width: 0; }
.st-crumbs a { color: var(--text-2); }
.st-crumbs a:hover { color: var(--accent); }
.st-crumbs span { color: var(--text-muted); }
.st-crumbs b { color: var(--text); font-weight: 600; max-width: 320px; }
.st-cols summary { cursor: pointer; color: var(--text-2); }
.st-cols form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; padding-top: 10px; }
.st-col-group { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.st-col-group legend { padding: 0 0 6px; }
.st-col-group label.cab-check { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); }
.st-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.st-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-table th, .st-table td { padding: 10px 12px; border-top: 1px solid var(--border); text-align: left; white-space: nowrap; }
.st-table thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.st-table thead a { color: inherit; }
.st-table thead a:hover, .st-table thead a[aria-sort] { color: var(--accent); }
.st-table .num { text-align: right; }
.st-table td.num { font-size: 13px; color: var(--text-2); }
.st-table tbody tr:hover { background: var(--surface-2); }
.st-name { position: sticky; left: 0; background: var(--surface); font-weight: 500; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.st-table tbody tr:hover .st-name { background: var(--surface-2); }
.st-name a { color: var(--text); }
.st-name a:hover { color: var(--accent); }
.st-name .mono { margin-left: 6px; }
.st-table tfoot th, .st-table tfoot td { border-top: 1px solid var(--border-strong); color: var(--text); font-weight: 600; }
.st-table td.st-pos { color: var(--ok); }
.st-table td.st-neg { color: var(--err); }
.st-sync { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.st-sync li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.st-sync li:first-child { border-top: 0; }
.st-sync-main { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.st-sync-main p { flex-basis: 100%; margin: 0; }
.st-sync-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  .st-filters { padding: 16px; }
  .st-form { display: grid; grid-template-columns: 1fr 1fr; }
  .st-form button { grid-column: 1 / -1; }
  .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .st-kpis .cloud-stat { padding: 8px 10px; }
  .st-kpis dt { font-size: 11px; }
  .st-kpis dd { font-size: 15px; }
  .st-name { max-width: 200px; }
  .st-name .mono { display: none; }
  .st-crumbs b { max-width: 200px; }
}
.st-kpis dd.st-pos { color: var(--ok); }
.st-kpis dd.st-neg { color: var(--err); }
.st-chart-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.st-yax { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; height: 180px; font-size: 11px; color: var(--text-muted); line-height: 1; }
.st-plot { min-width: 0; }
.st-chart { display: block; width: 100%; height: 180px; }
.st-chart .st-grid, .st-chart .st-base { vector-effect: non-scaling-stroke; }
.st-xax { display: flex; justify-content: space-between; padding-top: 6px; font-size: 11px; color: var(--text-muted); }
.st-chart .st-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.st-chart .st-base { stroke: var(--border-strong); stroke-width: 1; }
.st-chart .st-hit { fill: transparent; }
.st-chart .st-barfill { fill: var(--accent); opacity: .85; }
.st-chart .st-col:hover .st-hit { fill: var(--surface-2); }
.st-chart .st-col:hover .st-barfill { opacity: 1; }
.st-table th.st-name { min-width: 260px; }
.st-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; white-space: normal; font-weight: 400; }
.st-badge { display: inline-block; font-size: 11px; line-height: 1; padding: 4px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); }
.st-badge-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.st-col-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.st-col-note { flex-basis: 100%; margin: 0; }
@media (max-width: 760px) {
  .st-yax, .st-chart { height: 140px; }
  .st-table th.st-name { min-width: 150px; }
}

/* ---- Bulk edits (phase F): 4-step wizard ---- */
.bk-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.bk-steps li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.bk-steps li a { color: var(--text-2); }
.bk-steps li a:hover { color: var(--accent); }
.bk-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 12px; }
.bk-steps li.is-done .bk-num { border-color: var(--ok-line); color: var(--ok); }
.bk-steps li.is-current { color: var(--text); font-weight: 600; }
.bk-steps li.is-current .bk-num { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.bk-form { display: flex; flex-direction: column; gap: 16px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.bk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cloud .bk-field input[type="text"], .cloud .bk-field input[type="datetime-local"] { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-alt); color: var(--text); font: 14px var(--font); color-scheme: dark; }
.cloud .bk-field input.mono { font-family: var(--mono); }
.cloud .bk-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bk-bad input, .bk-field.bk-bad input { border-color: var(--err) !important; }
.cloud-card.bk-bad { border-color: var(--err-line); }
.bk-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; max-height: 320px; overflow-y: auto; }
.bk-accounts label.cab-check, .bk-form label.cab-check, .bk-confirm label.cab-check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); min-width: 0; }
.bk-more summary { cursor: pointer; color: var(--text-2); }
.bk-more { display: flex; flex-direction: column; gap: 10px; }
.bk-more[open] > :not(summary) { margin-top: 10px; }
.bk-period { max-width: 220px; }
.bk-cond { display: grid; grid-template-columns: minmax(0, 2fr) 72px minmax(0, 1fr); gap: 8px; }
.cloud .bk-cond select, .cloud .bk-cond input { height: 42px; }
.cloud .bk-cond input { padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-alt); color: var(--text); font: 14px var(--mono); }
.bk-actions, .bk-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bk-g { display: none; flex-direction: column; gap: 12px; padding-top: 6px; }
.bk-act:has(input[name="type"][value="status"]:checked) .bk-g-status,
.bk-act:has(input[name="type"][value="budget"]:checked) .bk-g-money,
.bk-act:has(input[name="type"][value="bid"]:checked) .bk-g-money,
.bk-act:has(input[name="type"][value="name"]:checked) .bk-g-name,
.bk-act:has(input[name="type"][value="end"]:checked) .bk-g-end,
.bk-act:has(input[name="type"][value="utm"]:checked) .bk-g-utm,
.bk-act:has(input[name="kind"][value="template"]:checked) .bk-g-template,
.bk-act:has(input[name="kind"][value="duplicate"]:checked) .bk-g-duplicate { display: flex; }
.bk-macros { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bk-state { display: inline-block; font-size: 12px; line-height: 1; padding: 5px 9px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); white-space: nowrap; }
.bk-state-done, .bk-state-undone { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.bk-state-ready, .bk-state-previewing, .bk-state-confirmed, .bk-state-running, .bk-state-undoing { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.bk-state-partial { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.bk-state-failed { color: var(--err); border-color: var(--err); background: var(--err-soft); }
.bk-state-rolled_back, .bk-state-interrupted { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.bk-items .bk-val { font-size: 13px; color: var(--text-2); white-space: normal; min-width: 120px; max-width: 360px; overflow-wrap: anywhere; }
.bk-items .bk-val b { color: var(--text); font-weight: 600; }
.bk-items td.small { white-space: normal; min-width: 140px; }
.bk-items tr.bk-it-skip, .bk-items tr.bk-it-not_run, .bk-items tr.bk-it-undo_skipped { opacity: .6; }
.bk-items tr.bk-it-failed td, .bk-items tr.bk-it-rollback_failed td { color: var(--err); }
.bk-confirm { border-color: var(--accent-line); }
.bk-warn { color: var(--warn) !important; }
.cloud .bk-count { width: 140px; }
.bk-sum { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
/* ---- mass launch (phase G) ---- */
.ml-targets { display: flex; flex-direction: column; }
.ml-trow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) 84px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.ml-thead { border-top: 0; padding-top: 0; }
.ml-trow .bk-field { gap: 0; }
.ml-lab { display: none; }
.bk-form label.ml-acc { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; min-width: 0; }
.ml-acc > span { display: flex; flex-direction: column; min-width: 0; }
.cloud .ml-copies { width: 72px; }
.ml-acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ml-act { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.ml-act > .ell { min-width: 0; max-width: 100%; }
.ml-act > .small:last-child { margin-left: auto; }
.ml-act-skip { opacity: .75; }
.ml-items td.small { white-space: normal; min-width: 220px; }
.ml-items th.st-name { text-overflow: clip; overflow: visible; }
.ml-items .st-name span { white-space: normal; overflow-wrap: anywhere; min-width: 180px; display: inline-block; }
@media (max-width: 760px) {
  .bk-steps { gap: 6px 12px; }
  .bk-steps li span:not(.bk-num), .bk-steps li a { font-size: 13px; }
  .bk-accounts { grid-template-columns: 1fr; }
  .bk-cond { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 90px); }
  .bk-items .bk-val { min-width: 100px; }
  .ml-thead { display: none; }
  .ml-trow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; padding: 12px 0; }
  .ml-acc { grid-column: 1 / -1; }
  .ml-lab { display: block; }
  .ml-trow .bk-field { gap: 4px; }
  .ml-act > .small:last-child { margin-left: 0; flex-basis: 100%; }
}

/* Billing: pay with a token, then a network (payments rails) */
.bill-step-title { margin: 0 0 -4px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.bill-rails { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.bill-rails legend { grid-column: 1 / -1; }
.bill-rail { flex: none; padding: 11px 12px; }
.bill-rail-ico { flex: none; width: 22px; height: 22px; color: var(--text-muted); }
.bill-rail:has(input:checked) .bill-rail-ico { color: var(--accent); }
.bill-form:has(input[name="token"][value="USDT"]:checked) .bill-rails:not([data-token="USDT"]),
.bill-form:has(input[name="token"][value="USDC"]:checked) .bill-rails:not([data-token="USDC"]) { display: none; }
@media (max-width: 420px) {
  .bill-rails { grid-template-columns: 1fr; }
}
