:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #091118;
  color: #f5f7f9;
  font-synthesis: none;
  --surface: #111a22;
  --surface-2: #17212b;
  --line: #283540;
  --muted: #a2aeb6;
  --green: #38e693;
  --cyan: #42c9df;
  --blue: #4b9fff;
  --amber: #f2bd45;
  --coral: #ee7883;
  --purple: #aa8df5;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #091118; letter-spacing: 0; }
button, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.app-shell { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); overflow: hidden; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: #03130d; background: var(--green); border-radius: 8px; font-weight: 900; font-size: 20px; box-shadow: 0 0 22px rgb(56 230 147 / .25); }
.brand-lockup div { min-width: 0; }
.brand-lockup div strong, .brand-lockup div span { display: block; }
.brand-lockup > .brand-mark { display: grid; place-items: center; line-height: 1; }
.brand-lockup strong { font-size: 15px; white-space: nowrap; }
.brand-lockup div span { margin-top: 2px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.top-actions { display: flex; gap: 8px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; color: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.admin-nav-button { min-height: 42px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; color: var(--green); border: 1px solid rgb(56 230 147 / .4); border-radius: 8px; background: rgb(56 230 147 / .08); font-size: 12px; font-weight: 750; white-space: nowrap; }
.admin-nav-button svg { width: 16px; height: 16px; flex: 0 0 auto; }
.icon-button.telegram { color: var(--cyan); }
.icon-button svg, .action svg, .select-wrap svg { width: 19px; height: 19px; flex: 0 0 auto; }
.hero { min-height: 190px; margin: 18px -16px 8px; padding: 26px 24px; display: flex; align-items: flex-end; background-image: linear-gradient(90deg, rgb(5 14 18 / .96) 0%, rgb(5 14 18 / .62) 58%, rgb(5 14 18 / .15)), url('/assets/vnezemnoy-banner.png'); background-size: cover; background-position: center 29%; border-bottom: 1px solid var(--line); }
.hero-copy { max-width: 390px; }
.eyebrow { display: block; margin-bottom: 6px; color: var(--green); font-size: 11px; line-height: 1.2; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { max-width: 13ch; font-size: 42px; line-height: 1.02; }
.hero p { margin-top: 11px; color: #c0c9d0; font-size: 14px; line-height: 1.5; }
.hidden { display: none !important; }
.loading { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.loading span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1s ease-in-out infinite; }
.loading span:nth-child(2) { animation-delay: .14s; }.loading span:nth-child(3) { animation-delay: .28s; }
@keyframes pulse { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-5px); } }
.notice { margin: 24px 0; padding: 18px; display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--coral); border-radius: 8px; }
.notice svg { width: 24px; flex: 0 0 auto; color: var(--coral); }.notice p { margin-top: 4px; color: var(--muted); line-height: 1.5; }
.status-panel { padding: 24px 0 28px; border-bottom: 1px solid var(--line); }
.connection-card { padding: 28px 0; border-bottom: 1px solid var(--line); }
.connection-copy { margin-top: -5px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.connection-node { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 700; }
.connection-node .select-wrap { flex: 0 1 230px; }
.subscription-link-row { margin-top: 16px; display: flex; align-items: center; gap: 8px; }
.subscription-link-row code { min-width: 0; flex: 1; padding: 12px; overflow: hidden; color: var(--cyan); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.subscription-link-row .icon-button { flex: 0 0 auto; }
.connection-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.connection-actions .action { flex: 1 1 180px; }
.connection-steps { margin: 18px 0 0; padding-left: 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.status-heading { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.status-icon, .step-icon { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; }
.status-icon { width: 48px; height: 48px; color: var(--green); background: rgb(56 230 147 / .1); border: 1px solid rgb(56 230 147 / .42); }
.status-icon.inactive { color: var(--coral); background: rgb(238 120 131 / .1); border-color: rgb(238 120 131 / .42); }
.status-heading h2 { overflow-wrap: anywhere; font-size: 23px; }.status-heading p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.badge { padding: 7px 9px; color: var(--green); border: 1px solid rgb(56 230 147 / .32); border-radius: 6px; background: rgb(56 230 147 / .08); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge.inactive { color: var(--coral); border-color: rgb(238 120 131 / .32); background: rgb(238 120 131 / .08); }
.metrics { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metric { min-height: 94px; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; }
.metric span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; min-width: 0; }.metric span svg { width: 15px; height: 15px; }.metric strong { overflow-wrap: anywhere; font-size: 17px; line-height: 1.15; }
.metric.blue { border-color: rgb(75 159 255 / .35); }.metric.blue span svg { color: var(--blue); }
.metric.green { border-color: rgb(56 230 147 / .35); }.metric.green span svg { color: var(--green); }
.metric.coral { border-color: rgb(238 120 131 / .35); }.metric.coral span svg { color: var(--coral); }
.metric.amber { border-color: rgb(242 189 69 / .35); }.metric.amber span svg { color: var(--amber); }
.metric.purple { border-color: rgb(170 141 245 / .35); }.metric.purple span svg { color: var(--purple); }
.section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 17px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading h2 { font-size: 27px; }
.select-wrap { width: 165px; height: 45px; padding: 0 10px; display: flex; align-items: center; gap: 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.select-wrap select { min-width: 0; width: 100%; appearance: none; color: #e8edf1; border: 0; outline: 0; background: transparent; }
.select-wrap svg:last-child { width: 14px; }
.server-select { width: min(230px, 52vw); }
.server-status { min-height: 66px; padding: 13px 0; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.server-status p, .empty-copy { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.server-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.server-status.online .server-dot { background: var(--green); box-shadow: 0 0 12px rgb(56 230 147 / .65); }
.server-status.offline .server-dot { background: var(--coral); }
.device-list { border-top: 1px solid var(--line); }
.device-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.device-row > div { min-width: 0; }
.device-row strong, .device-row span { display: block; overflow-wrap: anywhere; }
.device-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.device-remove { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; color: var(--coral); border: 0; border-radius: 8px; background: transparent; }
.device-remove:hover, .device-remove:focus-visible { background: rgb(238 120 131 / .1); outline: 0; }
.device-remove:disabled { opacity: .45; cursor: wait; }
.device-remove svg { width: 19px; height: 19px; }
.empty-copy { padding: 18px 0; }
.client-switch { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.client-tab { min-height: 58px; padding: 13px; display: flex; align-items: center; gap: 9px; color: #e7ebee; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; }
.client-tab.active { color: var(--cyan); border-color: rgb(66 201 223 / .55); background: rgb(66 201 223 / .09); box-shadow: inset 4px 0 0 var(--cyan); }
.client-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px rgb(242 189 69 / .7); }
.steps { margin: 20px 0 0; padding: 0; list-style: none; }
.step { padding: 20px 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; border-top: 1px solid var(--line); }
.step-icon { width: 44px; height: 44px; }.step-icon svg { width: 23px; height: 23px; }
.step-icon.purple { color: var(--purple); background: rgb(170 141 245 / .12); border: 1px solid rgb(170 141 245 / .35); }
.step-icon.cyan { color: var(--cyan); background: rgb(66 201 223 / .1); border: 1px solid rgb(66 201 223 / .35); }
.step-icon.green { color: var(--green); background: rgb(56 230 147 / .1); border: 1px solid rgb(56 230 147 / .35); }
.step-icon.amber { color: var(--amber); background: rgb(242 189 69 / .1); border: 1px solid rgb(242 189 69 / .35); }
.step h3 { font-size: 18px; }.step p { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.action { min-height: 44px; margin-top: 14px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 8px; font-weight: 800; }
.action.primary { color: #032026; border: 1px solid var(--cyan); background: var(--cyan); }.action.primary:disabled { color: var(--muted); border-color: var(--line); background: var(--surface-2); cursor: not-allowed; }
.action.secondary { color: var(--cyan); border: 1px solid rgb(66 201 223 / .42); background: rgb(66 201 223 / .09); }
.action:disabled { opacity: .5; cursor: not-allowed; }
.promo-form { display: flex; gap: 8px; margin-bottom: 8px; }
.promo-form input { min-width: 0; flex: 1; height: 44px; padding: 0 12px; color: #e8edf1; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); outline: 0; }
.promo-form input:focus { border-color: var(--cyan); }
.promo-form .action { margin-top: 0; }
.promo-status { min-height: 18px; color: var(--muted); font-size: 12px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.plan { min-height: 122px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.plan span { color: var(--muted); font-size: 12px; }.plan strong { display: block; margin-top: 4px; font-size: 24px; }.plan button { width: 100%; margin-top: 14px; }
.plan-actions { width: 100%; display: grid; gap: 6px; }
.plan-actions .action { margin-top: 10px; }
.referral-band { padding: 28px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.referral-copy { display: flex; align-items: center; gap: 13px; min-width: 0; }.referral-copy h2 { font-size: 21px; }.referral-copy p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.referral-band > .action { flex: 0 0 auto; margin-top: 0; }
.app-legal-footer { padding: 25px 0 8px; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.app-legal-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.app-legal-footer a:hover, .app-legal-footer a:focus-visible { color: var(--cyan); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20; max-width: calc(100vw - 32px); padding: 11px 15px; color: #06130e; background: #f5f7f9; border-radius: 8px; box-shadow: 0 12px 40px rgb(0 0 0 / .35); font-size: 13px; font-weight: 750; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; padding: 20px; display: grid; place-items: center; background: rgb(3 9 13 / .82); }
.modal-dialog { position: relative; width: min(100%, 420px); padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: #111a22; box-shadow: 0 24px 70px rgb(0 0 0 / .55); text-align: center; }
.modal-dialog > .status-icon { margin: 0 auto 18px; }
.modal-dialog h2 { font-size: 27px; }
.modal-dialog p { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-dialog p strong { color: #f5f7f9; }
.modal-close { position: absolute; top: 10px; right: 10px; border: 0; background: transparent; }
.modal-primary { width: 100%; margin-top: 10px; }
.modal-dialog p + .modal-primary { margin-top: 22px; }
.modal-later { width: 100%; min-height: 42px; margin-top: 8px; color: var(--muted); border: 0; background: transparent; }
.admin-panel { padding: 26px 0 32px; }
.admin-panel h1 { max-width: none; font-size: 30px; line-height: 1.2; }
.admin-search { display: flex; gap: 8px; margin-top: 14px; }
.admin-search input, .admin-control-row select { min-width: 0; height: 44px; flex: 1; padding: 0 12px; color: #f5f7f9; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); outline: 0; }
.admin-search input:focus, .admin-control-row select:focus { border-color: var(--green); }
.admin-search .action, .admin-pagination .action { margin-top: 0; }
.admin-count { margin: 12px 0 8px; color: var(--muted); font-size: 12px; }
.admin-users, .admin-records { display: grid; gap: 7px; }
.admin-user { width: 100%; min-height: 64px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: inherit; border: 1px solid var(--line); border-radius: 8px; background: rgb(9 17 24 / .75); text-align: left; }
.admin-user.selected, .admin-user:focus-visible { border-color: var(--green); outline: 0; }
.admin-user-main, .admin-user-meta { min-width: 0; display: grid; gap: 5px; }
.admin-user-main strong { overflow-wrap: anywhere; }.admin-user small, .admin-user-meta small { color: var(--muted); font-size: 11px; }
.admin-user-meta { text-align: right; flex: 0 0 auto; }.admin-user-meta strong { font-size: 12px; }
.admin-pagination { display: flex; justify-content: space-between; margin-top: 10px; }
.admin-pagination .action { min-height: 38px; padding: 7px 12px; }
.admin-detail { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.admin-detail-heading h3 { font-size: 20px; overflow-wrap: anywhere; }.admin-detail-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.admin-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 14px 0; }
.admin-summary span { min-width: 0; padding: 10px; display: grid; gap: 6px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; font-size: 11px; overflow-wrap: anywhere; }
.admin-summary strong { color: #f5f7f9; font-size: 13px; }
.admin-controls { margin: 14px 0 18px; padding: 13px; border-radius: 8px; background: var(--surface-2); }
.admin-controls > label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.admin-control-row { display: flex; align-items: center; gap: 8px; }.admin-control-row .action { flex: 0 0 auto; margin: 0; }
.admin-revoke { width: 100%; margin-top: 9px; color: var(--coral); border-color: rgb(238 120 131 / .35); }
.admin-detail h4 { margin: 18px 0 8px; font-size: 14px; }
.admin-record { padding: 10px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 7px; background: rgb(9 17 24 / .55); }
.admin-record strong { font-size: 12px; overflow-wrap: anywhere; }.admin-record span { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.admin-users .empty-copy, .admin-records .empty-copy { padding: 12px; }
.app-shell.admin-shell { width: min(100%, 1050px); }
.monitor-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.monitor-tabs button { min-width: 0; min-height: 46px; padding: 10px 4px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: none; font-size: 13px; }
.monitor-tabs button[aria-current] { color: var(--green); border-bottom-color: var(--green); }
.monitor-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.monitor-toolbar span { min-width: 0; overflow-wrap: anywhere; }
.monitor-toolbar select, .monitor-detail-heading select { min-width: 100px; min-height: 36px; max-width: 140px; padding: 6px 8px; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.monitor-band { padding: 20px 0; border-bottom: 1px solid var(--line); }
.monitor-band h2 { margin: 0 0 14px; font-size: 16px; line-height: 1.4; }
.monitor-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; }
.monitor-metric { min-width: 0; display: grid; align-content: start; gap: 7px; }
.monitor-metric span, .monitor-health-grid > div > span, .monitor-node-grid > div > span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.monitor-metric strong { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; font-weight: 600; }
.monitor-node-list { display: grid; gap: 10px; }
.monitor-node { width: 100%; min-width: 0; padding: 15px; color: inherit; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.monitor-node:focus-visible, .monitor-node:hover { border-color: var(--cyan); outline: none; }
.monitor-node-heading { display: grid; grid-template-columns: minmax(0,1fr) 18px; gap: 4px 10px; align-items: center; }
.monitor-node-heading strong { grid-row: 1; font-size: 15px; overflow-wrap: anywhere; }
.monitor-node-heading span { grid-column: 1; font-size: 11px; color: var(--muted); }
.monitor-node-heading svg { grid-column: 2; grid-row: 1 / 3; width: 18px; height: 18px; }
.monitor-node-grid, .monitor-health-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px 8px; margin: 14px 0; }
.monitor-node-grid > div, .monitor-health-grid > div { min-width: 0; display: grid; align-content: start; gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.monitor-status { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.monitor-node-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.good { color: var(--green); }.warn { color: var(--amber); }.bad { color: var(--coral); }
.monitor-detail-heading { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 9px; }
.monitor-detail-heading h2 { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.monitor-detail-heading span, .monitor-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.monitor-note { margin: 14px 0 0; overflow-wrap: anywhere; }
.monitor-error { padding: 12px 0; color: var(--amber); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.monitor-events { display: grid; gap: 15px; padding: 0; margin: 0; list-style: none; }
.monitor-events li { display: flex; align-items: flex-start; gap: 10px; }
.monitor-event-dot { width: 7px; height: 7px; margin-top: 5px; flex: 0 0 auto; background: currentColor; border-radius: 50%; }
.monitor-events li div { min-width: 0; display: grid; gap: 5px; }
.monitor-events strong { font-size: 12px; overflow-wrap: anywhere; }.monitor-events li div > span { color: var(--muted); font-size: 11px; }
.monitor-charts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.monitor-chart { min-width: 0; margin: 0; }.monitor-chart figcaption { font-size: 13px; margin-bottom: 8px; }
.monitor-chart-legend { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.monitor-chart-legend span::before { content: ''; display: inline-block; width: 9px; height: 3px; background: var(--series-color); margin: 0 5px 2px 0; }
.monitor-chart canvas { display: block; width: 100%; height: 160px; touch-action: pan-y; }
.monitor-chart-time { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.monitor-chart-tooltip { min-height: 30px; display: block; font-size: 10px; line-height: 1.5; color: var(--cyan); overflow-wrap: anywhere; }
@media(max-width: 600px) {
  .monitor-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 14px; }
  .monitor-metric strong { font-size: 14px; }
  .monitor-node-grid, .monitor-health-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .monitor-charts { grid-template-columns: minmax(0,1fr); }
  .monitor-detail-heading { grid-template-columns: 34px minmax(0,1fr); }
  .monitor-detail-heading select { grid-column: 2; }
  .monitor-tabs button { font-size: 12px; }
}
@media (max-width: 430px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .hero { margin-left: -12px; margin-right: -12px; padding-left: 18px; min-height: 176px; }
  h1 { font-size: 36px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 88px; padding: 12px; }.metric strong { font-size: 15px; }
  .section-heading { align-items: center; }.select-wrap { width: 142px; }.server-select { width: min(210px, 58vw); }
  .referral-band { align-items: flex-start; flex-direction: column; }.referral-band > .action { width: 100%; }
  .topbar { flex-wrap: wrap; padding-bottom: 10px; }.top-actions { justify-content: flex-end; flex: 1 1 auto; }
  .admin-user { align-items: flex-start; }.admin-user-meta { max-width: 43%; }.admin-control-row { align-items: stretch; flex-direction: column; }.admin-control-row .action { width: 100%; }.admin-summary { grid-template-columns: 1fr; }
}
@media (max-width: 350px) {
  .brand-lockup strong { font-size: 13px; }.top-actions { gap: 5px; }.icon-button { width: 38px; height: 38px; }
  h1 { font-size: 32px; }
  .status-heading { grid-template-columns: 42px minmax(0, 1fr); }.status-heading .badge { grid-column: 2; justify-self: start; }.status-icon { width: 42px; height: 42px; }
  .metrics, .plans { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; }.select-wrap { width: 100%; }
  .connection-node { align-items: stretch; flex-direction: column; }.connection-node .select-wrap { flex: 0 0 45px; }
}

/* Cabinet views share the subscription summary and bottom navigation. */
.app-shell { width: min(100%, 640px); padding: max(12px, env(safe-area-inset-top)) 16px calc(100px + env(safe-area-inset-bottom)); overflow: visible; }
.topbar { min-height: 56px; gap: 8px; flex-wrap: nowrap; padding: 0 0 10px; }
.brand-lockup { gap: 10px; }
.brand-mark { width: 32px; height: 32px; border-radius: 6px; box-shadow: none; font-size: 19px; font-weight: 800; }
.brand-lockup strong { font-size: 13px; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.top-actions { flex: 0 0 auto; gap: 0; }
.icon-button { width: 44px; height: 44px; color: var(--muted); border: 0; border-radius: 6px; background: transparent; }
.icon-button:hover { color: #f5f7f9; background: var(--surface); }
.icon-button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.access-summary { min-height: 87px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.access-summary > div { min-width: 0; }
.access-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 13px; font-weight: 600; }
.access-status svg { width: 15px; height: 15px; flex: 0 0 auto; }
.access-status.inactive { color: var(--muted); }
.access-summary p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.text-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 2px; color: var(--cyan); border: 0; background: transparent; font-size: 13px; }
.text-button svg { width: 16px; height: 16px; flex: 0 0 auto; }
.access-summary > .text-button { flex: 0 0 auto; }
.connection-section { padding: 22px 0 24px; border-bottom: 1px solid var(--line); }
.connection-heading { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.connection-heading > div { min-width: 0; }
.cabinet-view h1 { max-width: none; font-size: 24px; line-height: 1.3; font-weight: 650; overflow-wrap: anywhere; }
.overline { color: var(--muted); font-size: 12px; line-height: 1.4; margin-bottom: 6px; }
.device-caption { display: flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.device-caption svg { width: 16px; height: 16px; flex: 0 0 auto; }
.connection-notice { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.connection-actions { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; margin-top: 20px; }
.connection-actions .action { min-height: 48px; margin: 0; font-size: 14px; font-weight: 650; padding: 10px; }
.copy-access { width: 48px; height: 48px; border: 1px solid var(--line); background: var(--surface); color: #f5f7f9; }
.install-shortcut { display: flex; margin-top: 10px; font-size: 12px; }
.access-settings { position: relative; flex: 0 0 auto; }
.access-settings > summary { list-style: none; cursor: pointer; }
.access-settings > summary::-webkit-details-marker { display: none; }
.settings-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 5; width: min(300px, calc(100vw - 40px)); padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 30px rgb(0 0 0 / .3); }
.menu-button { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 6px; color: #f5f7f9; background: transparent; font-size: 13px; text-align: left; }
.menu-button:hover { background: var(--surface-2); }
.menu-button svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); }
.manual-link { display: grid; gap: 6px; padding: 10px; color: var(--muted); font-size: 12px; }
.manual-link input { min-width: 0; width: 100%; height: 42px; padding: 0 8px; color: #f5f7f9; border: 1px solid var(--line); border-radius: 6px; background: #091118; font-size: 16px; }
.devices-section { padding-top: 22px; }
.section-heading { margin-bottom: 12px; align-items: center; flex-direction: row; }
.cabinet-view .section-heading h2 { font-size: 18px; line-height: 1.4; font-weight: 600; }
.device-quota { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.device-list { border-top: 0; }
.device-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 44px; min-height: 68px; gap: 9px; }
.device-row > svg { width: 19px; height: 19px; color: var(--muted); }
.device-row strong { font-size: 14px; font-weight: 550; line-height: 1.5; }
.device-row span { font-size: 12px; line-height: 1.4; }
.device-remove { width: 44px; height: 44px; color: var(--muted); }
.device-remove:hover, .device-remove:focus-visible { color: var(--coral); }
.empty-copy { color: var(--muted); font-size: 13px; }
.view-heading { padding: 24px 0 16px; }
.account-summary { margin: 0; }
.account-summary > div { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.account-summary dt { color: var(--muted); }
.account-summary dd { margin: 0; text-align: right; font-weight: 550; overflow-wrap: anywhere; }
.plans-section { padding-top: 24px; }
.promo-details { margin-bottom: 8px; }
.promo-details > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.promo-details > summary::-webkit-details-marker { display: none; }
.promo-details > summary svg { width: 16px; height: 16px; }
.promo-form input { font-size: 16px; }
.promo-form .icon-button { flex: 0 0 auto; color: var(--cyan); background: var(--surface); }
.promo-status:empty { display: none; }
.plans { margin-top: 14px; }
.plan { border-radius: 6px; }
.plan strong { font-size: 24px; font-weight: 650; }
.plan-actions .action { font-size: 13px; font-weight: 600; }
.referral-band { align-items: flex-start; flex-direction: row; padding-top: 26px; }
.referral-copy { gap: 10px; align-items: flex-start; }
.referral-copy > svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--muted); }
.referral-copy h2 { font-size: 17px; line-height: 1.4; font-weight: 600; }
.referral-copy p { font-size: 12px; line-height: 1.5; }
.referral-band > .icon-button { flex: 0 0 auto; }
.install-section { padding: 6px 0 18px; }
.select-wrap { width: 155px; height: 44px; border-radius: 6px; }
.select-wrap select { font-size: 16px; }
.client-tab { min-height: 48px; padding: 10px 12px; border-radius: 6px; }
.client-tab strong { font-size: 14px; font-weight: 550; }
.client-tab.active { box-shadow: none; }
.client-dot { display: none; }
.steps { margin-top: 18px; }
.step { grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 18px 0; }
.step-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--muted); background: var(--surface-2); font-size: 12px; }
.step h3 { font-size: 16px; line-height: 1.5; font-weight: 600; }
.step p { font-size: 13px; line-height: 1.5; }
.step .action { font-size: 13px; font-weight: 600; }
.support-link { min-height: 56px; display: grid; grid-template-columns: 20px minmax(0, 1fr) 18px; align-items: center; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #f5f7f9; text-decoration: none; font-size: 14px; }
.support-link svg { width: 19px; height: 19px; color: var(--muted); }
.history-section { border-bottom: 1px solid var(--line); padding: 14px 0; }
.history-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; font-size: 14px; }
.history-section > summary::-webkit-details-marker { display: none; }
.history-section > summary span { display: flex; align-items: center; gap: 9px; min-width: 0; }
.history-section svg { width: 18px; height: 18px; flex-shrink: 0; }
.history-section[open] > summary > svg { transform: rotate(180deg); }
.history-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 16px; border-bottom: 1px solid var(--line); }
.history-tabs button { min-height: 40px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.history-tabs button[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.history-row strong { font-weight: 500; overflow-wrap: anywhere; }
.history-row p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.history-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-amount.credit { color: var(--green); }
.history-error { color: #f6b2ad; font-size: 13px; line-height: 1.5; }
.cabinet-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 10; width: min(100%, 640px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #091118; }
.cabinet-nav button { min-height: 52px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 4px 0; color: var(--muted); border: 0; background: transparent; font-size: 11px; }
.cabinet-nav button[aria-current="page"] { color: var(--cyan); }
.cabinet-nav svg { width: 20px; height: 20px; }
.toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
.modal-backdrop { padding: 16px; overflow-y: auto; }
.modal-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal-dialog h2 { font-size: 24px; }
@media (max-width: 350px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .brand-lockup { gap: 7px; }
  .brand-lockup strong { font-size: 12px; }
  .cabinet-view h1 { font-size: 21px; }
  .select-wrap { width: 140px; }
  .plans { grid-template-columns: 1fr; }
  .topbar:has(#adminBack:not(.hidden)) .brand-lockup strong { font-size: 11px; }
  .admin-nav-button { font-size: 11px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { .loading span { animation: none; } .toast { transition: none; } }
