/* QuantumTrader LK — Apple HIG + warm interior glass */
:root {
  --glass: rgba(255, 255, 255, 0.09);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.22);
  --fill-tertiary: rgba(118, 118, 128, 0.28);
  --text: #f4f7ff;
  --text-secondary: rgba(244, 247, 255, 0.78);
  --text-tertiary: rgba(244, 247, 255, 0.56);
  --accent: #0a84ff;
  --accent-pressed: #0077ed;
  --ok: #30d158;
  --danger: #ff453a;
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.32);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  --scrollbar-size: 8px;
  --scrollbar-thumb: rgba(255, 255, 255, 0.24);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.38);
}

/* Apple-style scrollbars — site-wide (WebKit + Firefox) */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body.cabinet-body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}
body.cabinet-body .btn,
body.cabinet-body input,
body.cabinet-body select,
body.cabinet-body textarea,
body.cabinet-body canvas {
  text-shadow: none;
}
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* LK adm147 + adm149 admin: overflow только на html */
html:has(body.cabinet-body:not(.admin-body)),
html:has(body.admin-body),
html.lk-preset-detailed,
html.lk-preset-summary,
html.lk-preset-custom {
  height: 100%;
  overflow: hidden;
  background-color: #0a0e14;
}
body.cabinet-body:not(.admin-body),
body.admin-body {
  background: transparent;
  overflow: visible;
  height: 100%;
  min-height: 100%;
}

.dash-bg {
  position: fixed;
  inset: 0;
  background: #0a0e14 center/cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

/* LK — тёплый фон + оверлеи (паттерн админки).
   LQIP: размытая мини-версия самого фото (base64, тон совпадает 1:1) лежит под
   полноразмерным JPG, поэтому стекло «прозрачно» с первого кадра — без прыжка
   яркости. Само фото ужато до ~87KB и грузится почти мгновенно (?v= для рефетча). */
body.cabinet-body:not(.admin-body) .dash-bg {
  background-color: #12151e;
  background-image:
    url("/assets/dashboard-bg.jpg?v=2"),
    url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABMNDhEODBMRDxEVFBMXHTAfHRoaHToqLCMwRT1JR0Q9Q0FMVm1dTFFoUkFDX4JgaHF1e3x7SlyGkIV3j214e3b/2wBDARQVFR0ZHTgfHzh2T0NPdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnb/wAARCAAVACADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDnzEAuQajt186UqzAAVGs+VOaYpy2QalKxTfY27fSY5FyGDVdfRwkOVFY9hdGNsbiMe9aNxrIWLbuOatya2JUU9zmwgzUgGw8UUVJRKmAc4qRwHUZFFFLqPof/2Q=="),
    linear-gradient(180deg, #161d2b 0%, #1a1c26 46%, #130f0d 100%);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
body.cabinet-body:not(.admin-body) .dash-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 65% at 72% 38%, rgba(255, 168, 92, 0.14), transparent 58%);
  pointer-events: none;
}
body.cabinet-body:not(.admin-body) .dash-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 10, 8, 0.14) 0%,
    rgba(8, 12, 22, 0.08) 42%,
    rgba(6, 8, 18, 0.16) 100%
  );
  pointer-events: none;
}

/* Admin adm149 — тот же фон и оверлеи, что в ЛK (dashboard-bg) */
body.admin-body {
  --ui-bg-image: url("/assets/dashboard-bg.jpg?v=2");
  --ui-bg-warm-x: 72%;
}
body.admin-body .dash-bg {
  background-color: #0a0e14;
  background-image: var(--ui-bg-image);
}

body.admin-body .dash-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 85% 65% at var(--ui-bg-warm-x) 38%,
    rgba(255, 168, 92, var(--ui-overlay-warm, 0.14)),
    transparent 58%
  );
  pointer-events: none;
}

body.admin-body .dash-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 10, 8, 0.14) 0%,
    rgba(8, 12, 22, 0.08) 42%,
    rgba(6, 8, 18, 0.16) 100%
  );
  pointer-events: none;
}

/* Admin glass — те же значения, что LK adm147 (не admin-bg / не 1.45 brightness) */
body.admin-body {
  --glass: transparent;
  --glass-strong: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-1: none;
  --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.22);
  --ui-glass-alpha: 0.03;
  --ui-glass-alpha-hover: 0.045;
  --ui-glass-border-a: 0.12;
  --ui-glass-border-hover-a: 0.16;
  --ui-blur: 12px;
  --ui-blur-inset: 8px;
  --ui-brightness: 1.42;
  --ui-brightness-inset: 1.35;
  --ui-brightness-strip: 1.4;
  --ui-saturate: 1.2;
  --ui-saturate-inset: 1.15;
  --ui-font-size: 13px;
  --ui-scale: 1;
  --ui-radius-xl: 20px;
  --ui-sidebar-col: 68px;
  --ui-grid-gap: 10px;
  --ui-app-pad-y: 12px;
  --ui-app-pad-x: 14px;
  --ui-overlay-warm: 0.14;
  font-size: calc(var(--ui-font-size) * var(--ui-scale));
}
body.admin-body .glass {
  background: rgba(255, 255, 255, var(--ui-glass-alpha));
  border-color: rgba(255, 255, 255, var(--ui-glass-border-a));
  border-radius: var(--ui-radius-xl);
  backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  -webkit-backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  box-shadow: var(--shadow-2), inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
}
body.admin-body .glass:hover {
  background: rgba(255, 255, 255, var(--ui-glass-alpha-hover));
  border-color: rgba(255, 255, 255, var(--ui-glass-border-hover-a));
}
body.admin-body .glass-inset {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset))
    brightness(var(--ui-brightness-inset));
  -webkit-backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset))
    brightness(var(--ui-brightness-inset));
}
body.admin-body .platform-credit {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(var(--ui-blur-inset)) brightness(var(--ui-brightness-inset));
  -webkit-backdrop-filter: blur(var(--ui-blur-inset)) brightness(var(--ui-brightness-inset));
}
body.admin-body .top-strip.glass {
  backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness-strip));
  -webkit-backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness-strip));
}

/* Admin layout shells — прозрачные; стекло = те же токены :root / .glass что в ЛК */
.nav-admin[hidden] {
  display: none !important;
}

.dash-app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  transition: grid-template-columns 0.22s var(--ease);
}
.dash-app.sidebar-expanded {
  grid-template-columns: 220px minmax(0, 1fr);
}

.glass {
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  box-shadow: var(--shadow-1), var(--shadow-2), inset 0 0.5px 0 rgba(255,255,255,0.12);
  transition: box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
}
@media (prefers-reduced-motion: no-preference) {
  .glass:hover { border-color: rgba(255,255,255,0.28); }
}

/* LK adm147 — стекло как в админке: низкая alpha + brightness (стабильно без blur) */
body.cabinet-body:not(.admin-body) {
  --glass: transparent;
  --glass-strong: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-1: none;
  --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.22);
}
body.cabinet-body:not(.admin-body) .glass {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px) saturate(1.2) brightness(1.42);
  -webkit-backdrop-filter: blur(12px) saturate(1.2) brightness(1.42);
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
}
body.cabinet-body:not(.admin-body) .glass:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.16);
}
body.cabinet-body:not(.admin-body) .glass-inset {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px) saturate(1.15) brightness(1.35);
  -webkit-backdrop-filter: blur(8px) saturate(1.15) brightness(1.35);
}
body.cabinet-body:not(.admin-body) .platform-credit {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px) brightness(1.35);
  -webkit-backdrop-filter: blur(8px) brightness(1.35);
}
body.cabinet-body:not(.admin-body) .top-strip:not(.glass) {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px) saturate(1.2) brightness(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.2) brightness(1.4);
}

/* Kuna Technology — дисклеймер внизу ЛК и админки */
.platform-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 2px 4px;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  background: rgba(10, 12, 18, 0.58);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
}
.platform-credit-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 120px;
  opacity: 1;
  flex-shrink: 0;
}
.platform-credit-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}
.platform-credit-text strong {
  color: var(--text);
  font-weight: 600;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  gap: 6px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.sidebar .brand {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #64d2ff, #0a84ff);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: -0.04em;
  margin-bottom: 4px;
  box-shadow: 0 4px 14px rgba(10,132,255,0.35);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-ico {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.nav-svg { width: 22px; height: 22px; display: block; }
.nav-ico:hover { background: var(--glass-strong); color: var(--text); }
.nav-ico.active {
  background: rgba(10,132,255,0.22);
  color: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(10,132,255,0.45);
}
.nav-ico:active { transform: scale(0.94); }
.sidebar .avatar {
  margin-top: auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #7ec8ff, #0a84ff);
  border: 1.5px solid rgba(255,255,255,0.45);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: #fff;
  box-shadow: 0 2px 10px rgba(10,132,255,0.3);
}

.dash-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.dash-main > .top-strip,
.dash-main > .top-alerts-host,
.dash-main > .top-onboarding-host,
.dash-main > .rooms-bar {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
}
.dash-main > .main-scroll {
  position: relative;
  z-index: 1;
}
.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.top-strip:not(.glass) {
  background: rgba(22, 24, 30, 0.58);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
}
.top-strip-left {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  flex: 1;
  min-width: 0;
}
.top-title {
  min-width: 0;
  overflow: hidden;
}
.top-title .sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-metrics {
  flex-shrink: 0;
  justify-self: end;
}
.top-alerts-host {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.top-alerts-host:empty {
  display: none;
}
.top-alerts-host .billing-banner,
.top-alerts-host .trading-alert-banner {
  margin: 0;
}
.top-onboarding-host {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.top-onboarding-host:not(:has(#setupChecklist:not([hidden]))) {
  display: none;
}
.top-strip h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.top-strip .sub { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.global-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.global-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.global-metric-val {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.global-metric-lbl {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.global-metric-equity .global-metric-val { font-size: 16px; }
.global-metric-val.eq-ok,
.finance-card .val.eq-ok { color: #34c759; }
.global-metric-val.eq-warn,
.finance-card .val.eq-warn { color: #ffcc00; }
.global-metric-val.eq-bad,
.finance-card .val.eq-bad { color: #ff453a; }
.global-metric-val.eq-info,
.finance-card .val.eq-info { color: #0a84ff; }
.global-metric-val.dd-ok { color: #34c759; }
.global-metric-val.dd-soft { color: var(--text-secondary); }
.global-metric-val.dd-warn { color: #ffcc00; }
.global-metric-val.dd-bad { color: #ff453a; }
.global-metric-val.dd-peak { color: #34c759; }
.global-metric-dd.is-at-peak .global-metric-lbl { color: #34c759; }
.global-metric-autotrade {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.global-metric-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff453a;
  flex-shrink: 0;
}
.global-metric-autotrade.is-on .global-metric-dot { background: #34c759; }
.global-metric-autotrade.is-on .global-metric-val { color: #34c759; }
.global-metric-autotrade.is-off .global-metric-val { color: #ff453a; }
[data-widget-id].widget-hidden,
[data-widget-id][hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  border: none !important;
  box-shadow: none !important;
}
.overview-hero.zone-empty,
.overview-metrics.zone-empty { display: none; }

.dashboard-widgets-btn {
  min-width: 32px;
  padding: 4px 8px !important;
}
.dashboard-customizer {
  position: fixed;
  top: 72px;
  right: 16px;
  width: min(300px, calc(100vw - 32px));
  max-height: min(70dvh, 520px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  overflow: hidden;
}
.dashboard-customizer[hidden] { display: none !important; }
.dashboard-customizer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dashboard-customizer-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.dashboard-customizer-note { margin: 0; font-size: 11px; }
.dashboard-customizer-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dashboard-customizer-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dashboard-customizer-grp {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.dashboard-customizer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 0;
}
.dashboard-customizer-row input { accent-color: var(--accent); }
.dashboard-customizer-row.is-locked {
  opacity: 0.78;
  cursor: default;
}
.dashboard-customizer-row.is-locked input[type="checkbox"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.dashboard-customizer-lock {
  margin-left: auto;
  font-size: 10px;
  white-space: nowrap;
}
.dashboard-customizer-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
  border-top: 0.5px solid var(--glass-border);
}
.signal-preview-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 4px;
}
.notif-preview-item {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.notif-preview-item.unread strong { color: var(--text); }
.notif-preview-item:not(.unread) strong { color: var(--text-secondary); font-weight: 500; }
.login-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hint { color: var(--text-secondary); font-size: 12px; }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.12s var(--ease);
}
.btn:hover { background: #409cff; }
.btn:active { background: var(--accent-pressed); transform: scale(0.97); }
.btn.ghost {
  background: var(--fill-tertiary);
  color: var(--text);
  border: 0.5px solid var(--glass-border);
}

.main-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lk-pages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* Не затемняем стекло при загрузке — иначе «прыгает» прозрачность до ответа API */
.lk-pages.is-loading { pointer-events: none; cursor: wait; }

.lk-page {
  display: none !important;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-bottom: 4px;
  visibility: hidden;
  pointer-events: none;
}
.lk-page.active {
  display: flex !important;
  visibility: visible;
  pointer-events: auto;
}

/* lk46: page transition */
.lk-pages.is-page-switching {
  opacity: 0.88;
  transition: opacity 0.1s var(--ease);
}
.lk-page.active.lk-page-enter {
  animation: lk-page-enter 0.2s var(--ease) both;
}
@keyframes lk-page-enter {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.route-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}
.status-pill.route-pill {
  cursor: pointer;
}
.status-pill.route-pill:hover {
  filter: brightness(1.08);
}
button.autotrade-skip-chip.route-link {
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  background: var(--fill-tertiary);
  border: none;
  margin: 2px 4px 2px 0;
}
button.autotrade-skip-chip.route-link:hover {
  background: rgba(10, 132, 255, 0.18);
}
button.skip-tag.route-link {
  cursor: pointer;
  font: inherit;
}
button.skip-tag.route-link:hover {
  filter: brightness(1.15);
}

/* lk86: pairs table */
.pairs-stats-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}
.pairs-mode-panel {
  padding: 10px 12px;
}
.pairs-mode-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pairs-mode-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.pairs-mode-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.pairs-mode-panel.is-auto-best {
  border-color: rgba(10, 132, 255, 0.35);
  box-shadow: inset 0 0 0 0.5px rgba(10, 132, 255, 0.2);
}
.pair-vol-up { color: var(--ok); }
.pair-vol-down { color: var(--danger); }
tr.pair-rotation-row td:first-child {
  border-left: 2px solid var(--accent);
}
/* «Было → Стало» — обычный вес; списки пар через « / » с переносом */
.rot-change {
  font-weight: 400;
}
.rot-change.rot-pairs {
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}
.pairs-table-sort th[data-sort-key] {
  cursor: pointer;
  user-select: none;
}
.pairs-table-sort th[data-sort-key]:hover {
  color: var(--accent);
}
.pair-score-spark {
  width: 64px;
  height: 28px;
}
.pair-score-spark canvas {
  width: 100% !important;
  height: 100% !important;
}
.pair-analyze-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.pair-analyze-badge.buy { color: var(--ok); }
.pair-analyze-badge.sell { color: var(--danger); }
.pair-analyze-badge.hold { color: var(--text-secondary); }
.market-pulse-host {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.market-pulse-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
}
.market-pulse-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.market-pulse-main:hover {
  color: var(--accent);
}
.market-pulse-score {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.market-pulse-spark {
  height: 40px;
  min-width: 72px;
  flex: 0 0 88px;
}
.market-pulse-spark canvas {
  width: 100% !important;
  height: 100% !important;
}
.market-pulse-spark .mp-spark-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 10px;
  color: var(--text-tertiary);
}
.density-lbl-only {
  font-size: 11px;
  opacity: 0.72;
  white-space: nowrap;
}
.insights-feed-host {
  min-height: 2.5rem;
}
.insights-feed-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--fill-tertiary);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.insights-feed-line:hover {
  background: rgba(10, 132, 255, 0.14);
}
.insights-feed-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.portfolio-donut-wrap {
  height: 100px;
  margin-top: 8px;
}
.portfolio-donut-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.rail-feed-tabs {
  display: flex;
  gap: 4px;
  padding: 0 8px 8px;
  flex-wrap: wrap;
}
.rail-tab-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.rail-tab-panel[hidden] {
  display: none !important;
}
.rail-tab-panel[data-rail-panel="positions"],
.rail-tab-panel[data-rail-panel="alerts"] {
  overflow-y: auto;
  max-height: 280px;
  padding: 0 8px 8px;
}
.rail-tab-panel .pairs-table {
  font-size: 0.82rem;
}
.rail-alert-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--glass-border);
}
.rail-alert-item.unread strong {
  color: var(--accent);
}

.lk-page[data-page="overview"] {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 4px;
}
body.lk-density-summary .lk-page[data-page="overview"],
body.lk-density-detailed .lk-page[data-page="overview"],
body.lk-density-custom .lk-page[data-page="overview"] {
  overflow: hidden;
  padding-bottom: 0;
}
body.lk-density-summary .lk-page[data-page="overview"] .page-grid-overview,
body.lk-density-detailed .lk-page[data-page="overview"] .page-grid-overview,
body.lk-density-custom .lk-page[data-page="overview"] .page-grid-overview {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.lk-density-detailed .lk-page[data-page="overview"] .page-grid-overview,
body.lk-density-custom .lk-page[data-page="overview"] .page-grid-overview {
  overflow-x: hidden;
  overflow-y: auto;
}
body.lk-density-summary .lk-page[data-page="overview"] .page-grid-overview {
  overflow-x: hidden;
  overflow-y: auto;
}
.lk-page[data-page="overview"] .page-grid-overview {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.page-grid-overview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.overview-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  align-items: start;
}
.overview-top .panel-strategy,
.overview-top .panel-chart-mini {
  min-height: 0;
  max-height: none;
}
.panel-chart-mini {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
}
.chart-wrap-mini {
  position: relative;
  flex: 1 1 auto;
  min-height: 100px;
  height: 100px;
  max-height: none;
  background: linear-gradient(165deg, rgba(10, 132, 255, 0.12) 0%, rgba(142, 142, 147, 0.1) 48%, rgba(0, 0, 0, 0.18) 100%);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}
.chart-wrap-axis {
  padding: 4px 6px 2px 2px;
}
.chart-legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 10px;
}
.chart-legend-bar span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chart-legend-compact {
  margin-top: 4px;
}
.chart-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.chart-legend-green { background: #30d158; }
.chart-legend-red { background: #ff453a; }
.chart-legend-yellow { background: #ff9f0a; }
.chart-legend-blue { background: #0a84ff; }
.chart-wrap-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.28) 100%);
  border-radius: inherit;
}
.chart-wrap-mini canvas,
.chart-wrap-equity-mini canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
#overviewTradesHost {
  max-height: 280px;
  overflow-y: auto;
}
#overviewOpenPositionsHost {
  max-height: 160px;
  overflow-y: auto;
}
#signalsPreviewHost.signal-preview-list {
  max-height: 140px;
  overflow-y: auto;
}
#overviewPairScoresHost {
  max-height: 180px;
  overflow-y: auto;
}
#overviewNotificationsHost {
  max-height: 100px;
  overflow-y: auto;
}
body.lk-density-summary .chart-wrap-mini,
body.lk-density-detailed .chart-wrap-mini {
  min-height: 100px;
  height: 100px;
}
.chart-wrap-mini.is-empty::before {
  content: "Нет закрытых сделок за период";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 8px;
  z-index: 1;
}
.pairs-table tbody tr:nth-child(even) {
  background: rgba(242, 242, 247, 0.05);
}
.overview-widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  grid-auto-rows: minmax(min-content, auto);
  align-content: start;
}
.overview-widget {
  padding: 10px 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
}
.overview-widget .card-head { flex-shrink: 0; margin-bottom: 0; }
.overview-widget .card-head.tight { margin-bottom: 0; }
.overview-widget > :not(.card-head) {
  flex: 0 0 auto;
  min-height: 0;
}
.overview-preview {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.overview-preview .chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--fill-tertiary);
  font-size: 11px;
  color: var(--text);
}
.btn-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 999px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.btn-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
}
/* Ссылки-действия в таблицах админки остаются заметными (accent) */
.admin-table .btn-link { color: var(--accent); }
.admin-table .btn-link:hover { color: var(--accent); background: rgba(10, 132, 255, 0.14); }
.nav-admin {
  border: 1px solid rgba(255, 159, 10, 0.45);
  background: rgba(255, 159, 10, 0.14);
  color: #ffb340;
}
.nav-admin:hover {
  background: rgba(255, 159, 10, 0.24);
  color: #ffd60a;
}
.metrics-row-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.panel-chart-full { flex: 1; min-height: 280px; }
.chart-wrap-tall { min-height: 220px; flex: 1; }
.analytics-extras { display: flex; flex-direction: column; gap: 8px; }
.analytics-equity-panel {
  flex-shrink: 0;
  margin-top: 8px;
  max-height: 280px;
}
.chart-wrap-equity {
  position: relative;
  height: 200px;
  min-height: 200px;
  max-height: 200px;
  width: 100%;
}
.chart-wrap-equity canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.lk-page[data-page="analytics"] {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.analytics-tier1 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}
.analytics-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.85fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}
.analytics-main-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}
.analytics-side-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}
.analytics-insights-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex-shrink: 0;
}
.analytics-insight-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
}
.analytics-insight-tile .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.analytics-insight-tile .val {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.analytics-factor-panel {
  padding: 10px;
}
.analytics-factor-grid {
  display: grid;
  gap: 10px;
}
.analytics-factor-host .pairs-table.compact td {
  padding: 4px 6px;
  font-size: 12px;
}
.notif-prefs-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
}
.notif-prefs-row .toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
}
.notif-prefs-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.analytics-heatmap-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
}
.analytics-heatmap-panel .analytics-heatmap-7x24 {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.analytics-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.analytics-tier2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.analytics-tab-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.analytics-tab-panel .pairs-table {
  width: 100%;
}
.analytics-detail-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.analytics-tab-panel[hidden] { display: none !important; }
.analytics-heatmap-7x24 {
  display: grid;
  grid-template-columns: 32px repeat(24, minmax(0, 1fr));
  gap: 2px;
  font-size: 9px;
  overflow-x: auto;
}
.analytics-heatmap-7x24 .hm-corner { grid-column: 1; }
.analytics-heatmap-7x24 .hm-hour {
  text-align: center;
  color: var(--text-tertiary);
  padding: 2px 0;
}
.analytics-heatmap-7x24 .hm-day {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 10px;
}
.analytics-heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  min-width: 0;
  background: var(--fill-tertiary);
}
.analytics-heatmap-cell.pos { background: rgba(48, 209, 88, 0.45); }
.analytics-heatmap-cell.neg { background: rgba(255, 69, 58, 0.45); }
.analytics-heatmap-cell.zero { background: rgba(255, 255, 255, 0.06); }
.analytics-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  min-width: 56px;
}
.analytics-spark i {
  flex: 1;
  min-width: 4px;
  border-radius: 2px 2px 0 0;
  background: var(--fill-tertiary);
}
.analytics-spark i.pos { background: rgba(48, 209, 88, 0.75); }
.analytics-spark i.neg { background: rgba(255, 69, 58, 0.75); }
.lk-page[data-page="manual"] {
  overflow: hidden;
  max-width: none;
}
.manual-page-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.manual-trade-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.manual-recommend-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
}
.manual-recommend-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.manual-recommend-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.manual-trade-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 12px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.manual-trade-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.manual-pair-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.manual-chart-block {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.manual-inline-chart {
  flex: 1;
  min-height: 120px;
  max-height: none;
  height: auto;
  margin-top: 6px;
}
.manual-score-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  min-height: 0;
  overflow: hidden;
}
.manual-score-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.manual-score-ring-sm {
  width: 88px;
  height: 88px;
}
.manual-score-ring-sm .analyze-score-val {
  font-size: 18px;
}
.manual-score-ring-sm .analyze-score-lbl {
  font-size: 10px;
}
.manual-analyze-reason {
  max-height: 72px;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}
.manual-compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.manual-compare-head h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}
.manual-compare-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.manual-compare-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.manual-compare-card:hover,
.manual-compare-card.is-active {
  border-color: rgba(10, 132, 255, 0.45);
  background: rgba(10, 132, 255, 0.08);
}
.manual-compare-card .mcc-pair {
  font-weight: 600;
  font-size: 12px;
}
.manual-compare-card .mcc-score {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
}
.analytics-kpi-foot {
  margin: -4px 0 8px;
  font-size: 11px;
}
.chart-wrap-analytics-equity {
  min-height: 140px;
  height: clamp(140px, 18vh, 190px);
  flex-shrink: 0;
}
.setup-checklist {
  padding: 8px 12px;
  background: rgba(22, 24, 30, 0.9);
}
.setup-checklist-head {
  margin-bottom: 4px;
}
.setup-checklist-head h3 {
  margin: 0;
  font-size: 13px;
}
.setup-checklist-head .hint {
  margin: 0;
  font-size: 11px;
}
.setup-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}
.setup-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  flex: 1 1 min(180px, 100%);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(8, 10, 16, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.setup-step .hint {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-secondary);
}
.setup-step-link {
  font-size: 13px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}
.setup-step.is-done {
  opacity: 0.78;
}
.setup-step.is-done .setup-step-link {
  font-weight: 500;
  color: var(--text-secondary);
}
.setup-step-check {
  font-weight: 700;
  color: var(--ok);
}
.setup-step:not(.is-done) .setup-step-check {
  color: var(--accent);
}
.setup-step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-guide {
  padding: 12px 14px;
}
.settings-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.settings-guide-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  min-height: 108px;
  background: rgba(8, 10, 16, 0.35);
}
.settings-guide-step strong {
  color: var(--text);
  font-weight: 650;
  font-size: 13px;
}
.settings-guide-step .hint {
  color: var(--text-secondary);
  font-size: 12px;
}
.settings-guide-step .sg-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: rgba(10, 132, 255, 0.28);
  color: #7ec8ff;
}
.settings-guide-foot {
  margin: 8px 0 0;
  font-size: 11px;
}
.autotrade-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}
.autotrade-checklist li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.autotrade-checklist .chk {
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.billing-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .analytics-body-grid { grid-template-columns: 1fr; overflow-y: auto; }
  .settings-guide-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .settings-guide-grid { grid-template-columns: 1fr; }
  .analytics-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.analytics-dual-equity .card-head-inline {
  align-items: flex-start;
}
.manual-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  flex: 0 1 clamp(120px, 28vh, 200px);
  min-height: 100px;
  overflow: hidden;
}
.manual-side-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 10px 12px;
}
.manual-side-panel .card-head {
  flex-shrink: 0;
  margin-bottom: 6px;
}
.manual-scroll-host {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.manual-analyze-reason {
  width: 100%;
  max-height: 140px;
  min-height: 48px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
  word-break: break-word;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.12);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}
.order-source-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
}
.order-source-badge.auto {
  background: rgba(10, 132, 255, 0.22);
  color: #64d2ff;
}
.order-source-badge.manual {
  background: rgba(255, 159, 10, 0.2);
  color: #ff9f0a;
}
.label.wk-tip-trigger {
  cursor: help;
}
.analyze-score-ring {
  position: relative;
  width: 120px;
  height: 120px;
}
.analyze-score-ring svg {
  width: 100%;
  height: 100%;
}
.analyze-score-ring .score-track {
  stroke: rgba(255, 255, 255, 0.1);
}
.analyze-score-ring .score-arc {
  stroke: var(--text-tertiary);
  stroke-dasharray: 0 326.7;
  transition: stroke-dasharray 0.35s var(--ease), stroke 0.25s var(--ease);
}
.analyze-score-ring[data-tone="buy"] .score-arc { stroke: var(--ok); }
.analyze-score-ring[data-tone="sell"] .score-arc { stroke: var(--danger); }
.analyze-score-ring[data-tone="hold"] .score-arc { stroke: var(--text-tertiary); }
.analyze-score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.analyze-score-val {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.analyze-score-lbl {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.analyze-card-score {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid var(--glass-border);
  flex-shrink: 0;
}
.analyze-card-score.buy { border-color: var(--ok); color: var(--ok); }
.analyze-card-score.sell { border-color: var(--danger); color: var(--danger); }
.analyze-card-score.hold { color: var(--text-secondary); }
.analyze-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.lk-page[data-page="analytics"] .analytics-equity-panel {
  margin-top: 0;
}

.toggles-row-page {
  display: block;
  grid-template-columns: none;
  overflow: visible;
  min-height: auto;
}
.toggles-row-page .pair-toggles-inner {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 4px 0 10px;
}
.lk-page[data-page="pairs"] article.panel:has(#pairToggles) {
  overflow: visible;
  min-height: auto;
  flex: 0 0 auto;
}
.lk-page[data-page="pairs"] .toggle-tile {
  min-height: 100px;
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.lk-page[data-page="pairs"] .toggle-tile .name {
  font-size: 13px;
  line-height: 1.3;
  max-width: 100%;
  word-break: break-word;
}
.lk-page[data-page="pairs"] .toggle-tile .pair-ico {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.lk-page[data-page="pairs"] #pairsStatsHost,
.lk-page[data-page="pairs"] #pairsTradesHost {
  overflow-x: auto;
}

.panel-economics-full,
.billing-panel-full {
  flex: 1;
  min-height: 0;
}

.rooms-bar {
  display: none;
  flex-shrink: 0;
  margin: 0;
  height: 0;
  min-height: 0;
  padding: 0;
  border: none;
  overflow: hidden;
}
.rooms-bar.is-visible {
  display: flex;
  height: auto;
  margin: 0;
}

.main-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 0.72fr) auto;
  grid-template-areas:
    "strategy chart"
    "metrics metrics"
    "wallet wallet"
    "pairs pairs";
  gap: 8px;
  transition: opacity 0.2s var(--ease);
}
.main-grid.is-loading { pointer-events: none; cursor: wait; }
.panel-strategy { grid-area: strategy; }
.panel-chart { grid-area: chart; }
.metrics-row { grid-area: metrics; }
.wallet-panel { grid-area: wallet; }
.toggles-row { grid-area: pairs; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.card-head.tight { margin-bottom: 6px; }
.card-head.tight h3 { margin: 0; }
.card-head.tight .hint { margin: 2px 0 0; }
.card-head.center { flex-direction: column; align-items: center; text-align: center; }

.panel, .wallet-panel, .metric-card, .dial-card, .player-card {
  padding: 12px 14px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel h3, .wallet-panel h3, .dial-card h3, .player-card h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.panel .hint, .wallet-panel .hint, .dial-card .hint, .player-card .hint {
  color: var(--text-secondary);
  font-size: 11px;
  margin: 0;
}

.strategy-badge {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: rgba(10,132,255,0.18);
  display: grid; place-items: center;
  color: #64b5ff;
  flex-shrink: 0;
}
.strategy-badge svg { width: 20px; height: 20px; }

.stat-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.stat-pills.compact { margin-top: 0; margin-bottom: 8px; }
.pill {
  padding: 8px 11px;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.22);
  border: 0.5px solid rgba(255,255,255,0.1);
  min-width: 88px;
}
.pill .lbl {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill .val {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.pill .val.positive { color: var(--ok); }
.pill .val.negative { color: var(--danger); }

.chart-wrap {
  flex: 1;
  min-height: 0;
  background: rgba(0,0,0,0.18);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 6px;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.metric-card .lbl { color: var(--text-secondary); font-size: 11px; }
.metric-card .val {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.wallet-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}
.wallet-row input {
  width: 96px;
  background: rgba(0,0,0,0.22);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
}
.wallet-row input:focus {
  outline: none;
  border-color: rgba(10,132,255,0.65);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.22);
}
.wallet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 4px;
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.ledger-list { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

.pair-toggles-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.strategy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.strategy-chips .chip {
  cursor: pointer;
  user-select: none;
}
.strategy-chips .chip.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.autotrade-master {
  display: flex;
  align-items: center;
  gap: 8px;
}
.autotrade-master .ios-switch { flex-shrink: 0; }
.toggle-tile { cursor: pointer; }
.toggle-tile .toggle { margin: 8px auto 0; cursor: pointer; }

.admin-app { grid-template-columns: 68px minmax(0, 1fr); }
.admin-body .dash-app { grid-template-columns: 68px minmax(0, 1fr); }
.admin-body .main-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-body .admin-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.admin-body .admin-pages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-body .admin-page {
  display: none;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 4px;
}
.admin-body .admin-page.active {
  display: flex !important;
}
.admin-table .btn-link,
.admin-table .btn-open-user {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.admin-table .btn-open-user {
  white-space: nowrap;
}
.admin-pre {
  font-size: 11px;
  white-space: pre-wrap;
  color: var(--text-secondary);
  max-height: 200px;
  overflow: auto;
}
#adminKey {
  min-width: 180px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.toggles-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.toggle-tile { padding: 10px 12px; text-align: center; }
.toggle-tile .pair-ico {
  width: 28px; height: 28px;
  margin: 0 auto 6px;
  border-radius: 8px;
  background: rgba(10,132,255,0.15);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  letter-spacing: -0.03em;
  color: #7ec8ff;
}
.toggle-tile .name { font-size: 12px; font-weight: 600; letter-spacing: -0.02em; }
.toggle-tile .pair-score-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(10, 132, 255, 0.22);
  color: #64d2ff;
  vertical-align: middle;
}
.settings-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  flex-shrink: 0;
}
.settings-subnav .chip {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.settings-subnav .chip.active {
  background: rgba(10, 132, 255, 0.22);
  color: var(--text);
  border-color: rgba(10, 132, 255, 0.45);
}
.settings-unified {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.settings-section { flex-shrink: 0; }
.settings-snap {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.settings-snap strong { color: var(--text); }
.settings-account-host {
  margin-top: 4px;
}
.settings-account-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-account-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.settings-account-block {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(142, 142, 147, 0.1);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}
.settings-account-block-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.settings-account-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}
.settings-account-row + .settings-account-row {
  border-top: 0.5px solid rgba(255, 255, 255, 0.06);
}
.settings-account-lbl {
  font-size: 12px;
  color: var(--text-secondary);
}
.settings-account-val {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
}
.settings-account-val.commission-val {
  color: #ff9f0a;
}
.settings-account-note {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.4;
}
.settings-account-net {
  padding: 10px 12px;
  border-radius: var(--radius-md);
}
.settings-account-row-net .settings-account-lbl {
  font-size: 13px;
  color: var(--text);
}
.settings-account-net-val {
  font-size: 18px;
}
.settings-account-net-hint {
  margin: 4px 0 0;
  font-size: 11px;
}
.settings-account-meta {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.settings-account-meta strong {
  color: var(--text);
}
@media (max-width: 720px) {
  .settings-account-cols {
    grid-template-columns: 1fr;
  }
}
.lk-page[data-page="settings"] {
  overflow: hidden;
  max-width: none;
}
.settings-plan-host {
  margin-bottom: 10px;
}
.settings-usage-meter {
  margin-bottom: 12px;
}
.usage-meter-panel {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.usage-meter-title {
  font-size: 12px;
  letter-spacing: 0.02em;
}
.usage-meter-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.usage-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}
.usage-meter-head strong {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.usage-meter-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.usage-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.85), rgba(10, 132, 255, 0.55));
  transition: width 0.35s var(--ease);
}
.usage-meter-fill.is-warn {
  background: linear-gradient(90deg, rgba(255, 69, 58, 0.9), rgba(255, 159, 10, 0.75));
}
.api-perms-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.api-perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 0.5px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
  color: var(--text-secondary);
}
.api-perm-chip svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.api-perm-chip.is-on {
  color: var(--ok);
  border-color: rgba(48, 209, 88, 0.35);
  background: rgba(48, 209, 88, 0.1);
}
.api-perm-chip.is-off {
  color: var(--text-tertiary);
  opacity: 0.72;
}
.api-perm-chip.is-warn {
  color: var(--danger);
  border-color: rgba(255, 69, 58, 0.35);
  background: rgba(255, 69, 58, 0.1);
}
.api-perm-chip.is-muted {
  color: var(--text-tertiary);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.68;
}
.insights-skip-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: rgba(10, 132, 255, 0.1);
  border: 0.5px solid rgba(10, 132, 255, 0.28);
}
.skip-stat-chip.route-highlight {
  border-color: rgba(10, 132, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(10, 132, 255, 0.25);
}
.pos-reconcile-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  text-transform: uppercase;
}
.pos-reconcile-badge.warn {
  color: var(--danger);
  background: rgba(255, 69, 58, 0.14);
}
.pos-reconcile-badge.stale {
  color: #ff9f0a;
  background: rgba(255, 159, 10, 0.14);
}
.pos-reconcile-badge.soon {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
}
.pos-reconcile-badge.ok {
  color: #34c759;
  background: rgba(52, 199, 89, 0.14);
}
.pos-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.5;
}
.pos-legend .pos-reconcile-badge { margin-left: 4px; }
.pos-legend .hint { margin-right: 4px; }
.pos-legend .pos-reconcile-badge:first-child { margin-left: 0; }
.settings-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.settings-plan-card {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-plan-card.is-current {
  border-color: rgba(10, 132, 255, 0.5);
  background: rgba(10, 132, 255, 0.12);
}
.settings-plan-card strong {
  font-size: 14px;
}
.settings-plan-card .settings-plan-meta {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}
.settings-plan-card .chip {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 10px;
}
.settings-topup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.settings-topup-row .input-sm {
  width: 96px;
}
.settings-security-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.12);
  border: 0.5px solid var(--glass-border);
  font-size: 12px;
}
.settings-security-row strong {
  font-weight: 600;
}
.lk-page[data-page="insights"] {
  overflow: hidden;
  max-width: none;
}
.lk-page[data-page="insights"] .insights-page-compact {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.lk-page[data-page="learning"] .page-panel,
.lk-page[data-page="notifications"] .notif-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.lk-page[data-page="analytics"] {
  max-width: none;
}
.toggle {
  width: 42px; height: 26px;
  border-radius: 999px;
  background: var(--fill-tertiary);
  margin: 6px auto 0;
  cursor: pointer;
  position: relative;
  transition: background 0.25s var(--ease);
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.28);
  transition: transform 0.28s var(--ease);
}
.toggle.on::after { transform: translateX(16px); }

.rooms-bar.is-visible,
#symbolTabs.is-visible {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  flex-shrink: 0;
  height: auto;
  min-height: 0;
}
#symbolTabs:not(.is-visible) {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  visibility: hidden !important;
}
.room-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.room-tab:hover { color: var(--text); background: var(--glass-strong); }
.room-tab.active {
  background: rgba(255,255,255,0.14);
  color: var(--text);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.2);
}
.room-tab.add { color: var(--accent); font-weight: 600; }

.dash-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.rail-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.signal-rail-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.signal-rail-card .signal-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: calc(100dvh - 200px);
  padding: 0 8px 8px;
}
.signal-rail-card .card-head.tight {
  padding-right: 40px;
}
.rail-toggle:hover { background: var(--glass-strong); color: var(--text); }
.dash-app.rail-collapsed .rail-toggle svg { transform: rotate(180deg); }
.rail-expanded-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.dash-app.rail-collapsed .rail-expanded-body { display: none; }
.rail-collapsed-bar {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  flex: 1;
}
.dash-app.rail-collapsed .rail-collapsed-bar { display: flex; }
.rail-mini-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--fill-tertiary);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.rail-mini-btn:hover {
  background: var(--glass-strong);
  color: var(--text);
}
.dial-card { flex-shrink: 0; text-align: center; }
.risk-hub-card {
  padding-bottom: 10px;
}
.risk-hub-visual {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 4px auto 6px;
}
.risk-hub-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.risk-hub-svg .ring-track {
  stroke: rgba(60, 60, 67, 0.72);
}
.risk-hub-svg .ring-arc {
  transition: stroke-dasharray 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.35));
}
.activity-rings-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 4px 8px;
  text-align: left;
}
.ring-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
}
.ring-legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ring-legend--move i { background: #FA114F; }
.ring-legend--exercise i { background: #A8E82F; }
.ring-legend--stand i { background: #04C7FD; }
.ring-legend-item strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.ring-legend-item .hint {
  font-size: 10px;
  margin-left: 2px;
}
.risk-hub-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -2px 0 10px;
  flex-wrap: wrap;
}
.risk-hub-summary-strat {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.risk-hub-summary-sep {
  color: var(--text-tertiary);
  font-size: 12px;
}
.risk-hub-summary-auto {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.risk-hub-summary-auto.is-on {
  color: var(--ok);
}
.risk-stepper-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px;
  background: var(--fill-tertiary);
  border-radius: 999px;
}
.risk-stepper-chips .risk-step {
  min-width: 34px;
  padding: 5px 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-secondary);
}
.risk-stepper-chips .risk-step:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}
.risk-stepper-chips .risk-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.risk-stepper-chips .risk-step-val {
  min-width: 48px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.risk-hub-more {
  width: 100%;
  margin-top: 4px;
  border-radius: var(--radius-md);
}
.risk-hub-section {
  margin-bottom: 8px;
}
.risk-hub-lbl {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.activity-chips-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 3px;
  background: var(--fill-tertiary);
  border-radius: 10px;
}
.activity-chips-rail .chip {
  padding: 4px 8px;
  font-size: 10px;
}
.mode-chips {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 2px;
  background: var(--fill-tertiary);
  border-radius: 999px;
}
.chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.chip.active {
  background: rgba(255,255,255,0.92);
  color: #1c1c1e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.chip.locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.chip.locked.active { opacity: 1; }
.chip-lock { font-size: 9px; margin-left: 2px; opacity: 0.85; }

/* Trading profile (persona) — master control */
.autotrade-profile-row { align-items: center; }
.profile-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.profile-chip {
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border: 0.5px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-secondary);
}
.profile-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 6px rgba(10,132,255,0.4);
}
.profile-chip.locked { opacity: 0.55; }
.profile-chip.locked.active { opacity: 1; }
/* Карточки персон: метрики риск/частота/защита для осознанного выбора */
.profile-card {
  flex: 1 1 150px;
  min-width: 138px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.profile-card:hover { border-color: rgba(255, 255, 255, 0.22); }
.profile-card.active {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.12);
  box-shadow: 0 1px 8px rgba(10, 132, 255, 0.22);
}
.profile-card.locked { opacity: 0.6; cursor: default; }
.profile-card.locked.active { opacity: 1; }
.profile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.profile-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.profile-card-metrics { display: flex; gap: 6px; }
.profile-card-metrics > span {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.profile-card-metrics b {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-card-metrics i {
  font-size: 8.5px;
  font-style: normal;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
/* Actionable пустые состояния */
.empty-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 0.5px dashed rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}
.empty-cta-ico { font-size: 16px; opacity: 0.85; }
.empty-cta .btn-link { white-space: nowrap; font-weight: 600; }
/* Ручная: расчёт объёма ордера до отправки */
.manual-order-calc {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.manual-order-calc-warn { color: #ffcc00; }
/* Бейдж сети (testnet/mainnet) в шапке */
.net-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.4;
}
.net-badge.is-testnet {
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.14);
  border: 0.5px solid rgba(255, 204, 0, 0.4);
}
.net-badge.is-mainnet {
  color: #30d158;
  background: rgba(48, 209, 88, 0.14);
  border: 0.5px solid rgba(48, 209, 88, 0.4);
}
/* Выбор биржи (каркас под мультибиржевость) */
.api-exchange-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}
.api-exchange-row label { margin: 0; }
.api-exchange-soon { opacity: 0.7; font-size: 11px; }
/* Плашка сети на странице подключения API */
.api-net-note {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.api-net-note strong { color: var(--text); }
.api-net-note.is-testnet {
  background: rgba(255, 204, 0, 0.08);
  border: 0.5px solid rgba(255, 204, 0, 0.32);
}
.api-net-note.is-mainnet {
  background: rgba(48, 209, 88, 0.08);
  border: 0.5px solid rgba(48, 209, 88, 0.3);
}
/* Список сохранённых API-ключей (несколько на биржу: testnet/mainnet/…) */
.api-keys-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}
.api-keys-empty {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 0.5px dashed rgba(255, 255, 255, 0.16);
}
.api-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}
.api-key-row.is-active {
  background: rgba(48, 209, 88, 0.07);
  border-color: rgba(48, 209, 88, 0.32);
}
.api-key-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.api-key-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.api-key-label { font-weight: 600; color: var(--text); }
.api-key-meta { font-size: 11px; }
.api-net-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.api-net-tag.is-testnet { background: rgba(255, 204, 0, 0.16); color: #ffd60a; }
.api-net-tag.is-mainnet { background: rgba(48, 209, 88, 0.16); color: #30d158; }
.api-key-active-badge {
  font-size: 10px;
  font-weight: 700;
  color: #30d158;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(48, 209, 88, 0.14);
}
.api-key-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Форма добавления ключа (.glass-inset задаёт margin позже в файле — нужна
   повышенная специфичность, иначе горизонтальный inset 18px и нулевой top) */
.api-add-key { border-radius: var(--radius-md); padding: 0; }
.api-add-key.glass-inset { margin: 16px 0 10px; }
.api-add-key-summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  list-style: none;
  color: var(--accent, #0a84ff);
}
.api-add-key-summary::-webkit-details-marker { display: none; }
.api-add-key-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.api-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.api-makeactive-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-direction: row !important;
}
.api-makeactive-row input { width: auto; }
.api-disconnect-all-row { margin-top: 4px; }
/* Глобально кликабельные карточки (вся область — переход по шапке-ссылке) */
.card-clickable { cursor: pointer; }
.card-clickable:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.card-clickable .card-head [data-goto],
.card-clickable .card-head [data-settings-scroll] {
  text-decoration: none;
}
body.dashboard-drag-enabled .card-clickable { cursor: default; }
/* Тарифные теги в админке + полоса распределения по тарифам */
.plan-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}
.plan-tag.plan-pro { color: #ffd60a; background: rgba(255, 214, 10, 0.12); border-color: rgba(255, 214, 10, 0.35); }
.plan-tag.plan-growth { color: #30d158; background: rgba(48, 209, 88, 0.12); border-color: rgba(48, 209, 88, 0.35); }
.plan-tag.plan-starter { color: #0a84ff; background: rgba(10, 132, 255, 0.12); border-color: rgba(10, 132, 255, 0.35); }
.plan-tag.plan-trial, .plan-tag.plan-free_paper { color: var(--text-secondary); }
.plan-dist-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}
.metric-card .lbl.has-tip {
  cursor: help;
  text-decoration: underline dotted rgba(255, 255, 255, 0.28);
  text-underline-offset: 3px;
}
.admin-page-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: rgba(10, 132, 255, 0.08);
  border: 0.5px solid rgba(10, 132, 255, 0.22);
}
.admin-page-intro-icon {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.4;
  color: var(--accent, #0a84ff);
}
.admin-page-intro p {
  flex: 1 1 auto;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.admin-page-intro-x {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: var(--text-tertiary);
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1.2;
}
.admin-page-intro-x:hover { color: var(--text-primary); }
.ref-funnel { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.ref-funnel-row { display: flex; flex-direction: column; gap: 5px; }
.ref-funnel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.ref-funnel-head strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ref-funnel-head i { color: var(--text-tertiary); font-style: normal; font-size: 11px; }
.ref-funnel-bar {
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.ref-funnel-bar > span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.85), rgba(48, 209, 88, 0.85));
  transition: width 0.4s ease;
}
/* Admin → каналы использования (срез аудитории) */
.admin-section-head { margin: 26px 2px 12px; }
.admin-section-head h3 { margin: 0 0 3px; font-size: 15px; color: var(--text-primary); }
.admin-section-head .hint { margin: 0; font-size: 12px; color: var(--text-tertiary); }
.admin-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.chan-card { padding: 16px 18px; }
.chan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chan-head h4 { margin: 0; font-size: 13.5px; color: var(--text-primary); }
.chan-head .chan-sub { font-size: 11px; color: var(--text-tertiary); }
.chan-bar {
  display: flex;
  height: 12px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}
.chan-seg { display: block; height: 100%; transition: width 0.4s ease; background: rgba(255, 255, 255, 0.18); }
.chan-seg.c-mini, .chan-dot.c-mini { background: #0a84ff; }
.chan-seg.c-bot, .chan-dot.c-bot { background: #5e5ce6; }
.chan-seg.c-web, .chan-dot.c-web { background: #30d158; }
.chan-seg.c-ref, .chan-dot.c-ref { background: #ff9f0a; }
.chan-seg.c-test, .chan-dot.c-test { background: #64d2ff; }
.chan-seg.c-main, .chan-dot.c-main { background: #30d158; }
.chan-seg.c-mut, .chan-dot.c-mut { background: rgba(255, 255, 255, 0.22); }
.chan-legend { display: flex; flex-direction: column; gap: 6px; }
.chan-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.chan-legend-row strong { margin-left: auto; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.chan-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chan-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-top { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--glass-border); }
.chan-top-h { font-size: 11px; color: var(--text-tertiary); margin-bottom: 6px; }
.chan-ref { cursor: pointer; padding: 2px 0; border-radius: 6px; transition: background 0.15s ease; }
.chan-ref:hover { background: rgba(255, 255, 255, 0.05); }
.chan-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.chan-stat { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; color: var(--text-secondary); }
.chan-stat strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.plan-dist-lbl { color: var(--text-secondary); font-size: 11px; }
.plan-dist-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 3px 6px;
  border-radius: var(--radius-sm, 8px);
}
.plan-dist-item.is-link { cursor: pointer; transition: background 0.15s ease; }
.plan-dist-item.is-link:hover { background: rgba(255, 255, 255, 0.06); }
.plan-dist-item[disabled] { cursor: default; }
.plan-dist-item b { font-variant-numeric: tabular-nums; }
.plan-dist-item i { color: var(--text-secondary); font-style: normal; font-size: 11px; }
.muted { color: var(--text-secondary); }
.autotrade-profile-hint {
  margin: 2px 0 4px;
  font-size: 10.5px;
  color: var(--text-tertiary);
}
.autotrade-expert {
  border-radius: var(--radius-md);
  padding: 0;
  margin: 2px 0 4px;
}
.autotrade-expert > :not(summary) { margin-top: 8px; }
.autotrade-expert-summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 7px 10px;
  list-style: none;
}
.autotrade-expert-summary::-webkit-details-marker { display: none; }
.autotrade-expert-summary::before { content: "▸ "; opacity: 0.6; }
.autotrade-expert[open] .autotrade-expert-summary::before { content: "▾ "; }
.autotrade-expert[open] { padding: 0 10px 10px; }

/* Оборот сделки в колонке PnL (вход/несопоставленная продажа) */
.trade-turnover { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

.player-card { flex: 1; min-height: 0; }
.signal-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.signal-item {
  display: flex;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
  font-size: 11px;
}
@media (prefers-reduced-motion: no-preference) {
  .signal-item { animation: fadeIn 0.35s var(--ease); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0,0,0,0.28);
  flex-shrink: 0;
}
.badge.ok { color: var(--ok); }
.badge.hold { color: var(--text-secondary); }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(48,209,88,0.55);
}
.api-off .status-dot {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(255,69,58,0.5);
}

@media (max-width: 1100px) {
  body.cabinet-body { overflow: auto; }
  .dash-app {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow-y: auto;
  }
  .sidebar { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .sidebar-nav { flex-direction: row; flex: none; }
  .sidebar .avatar { margin-top: 0; }
  .main-scroll { overflow: visible; }
  .main-grid {
    height: auto;
    grid-template-rows: auto;
    grid-template-areas: "strategy" "chart" "metrics" "wallet" "pairs";
  }
  .chart-wrap { min-height: 180px; }
  .dash-rail { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.billing-banner {
  padding: 10px 14px;
  margin-bottom: 8px;
  border-color: rgba(255, 69, 58, 0.45);
  background: rgba(255, 69, 58, 0.12);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.billing-banner-main {
  flex: 1;
  min-width: 0;
}
.billing-banner-main .hint { margin: 4px 0 0; }
.billing-banner-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.billing-banner-dismiss:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
}
.billing-banner:not(.is-visible) {
  display: none !important;
}
#dashboardWidgetStash {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
.overview-grid {
  position: relative;
}
.overview-hero:not(:has(> [data-widget-id]:not(.widget-hidden):not([hidden]))) {
  display: none !important;
  margin: 0 !important;
  min-height: 0 !important;
}
.pairs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pairs-table th, .pairs-table td { padding: 6px 8px; border-bottom: 0.5px solid rgba(255,255,255,0.08); }

.lk-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 4px;
  border-radius: var(--radius-md);
}
.lk-table {
  table-layout: fixed;
  min-width: 100%;
}
.lk-table--orders-compact { min-width: 480px; }
.lk-table--orders-full { min-width: 600px; }
.lk-table--trades { min-width: 620px; }
.lk-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.lk-table td.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lk-table td.col-pair {
  white-space: nowrap;
  font-weight: 600;
}
.lk-table td.col-time {
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-secondary);
}
.lk-table td.col-side,
.lk-table td.col-type {
  white-space: nowrap;
  font-size: 11px;
}
.lk-table--orders-compact th:nth-child(1),
.lk-table--orders-compact td:nth-child(1) { width: 22%; }
.lk-table--orders-compact th:nth-child(2),
.lk-table--orders-compact td:nth-child(2) { width: 14%; }
.lk-table--orders-compact th:nth-child(3),
.lk-table--orders-compact td:nth-child(3) { width: 24%; }
.lk-table--orders-compact th:nth-child(4),
.lk-table--orders-compact td:nth-child(4) { width: 20%; }
.lk-table--orders-compact th:nth-child(5),
.lk-table--orders-compact td:nth-child(5) { width: 20%; }
.lk-table--orders-full th:nth-child(1),
.lk-table--orders-full td:nth-child(1) { width: 18%; }
.lk-table--orders-full th:nth-child(2),
.lk-table--orders-full td:nth-child(2) { width: 12%; }
.lk-table--orders-full th:nth-child(3),
.lk-table--orders-full td:nth-child(3) { width: 22%; }
.lk-table--orders-full th:nth-child(4),
.lk-table--orders-full td:nth-child(4) { width: 16%; }
.lk-table--orders-full th:nth-child(5),
.lk-table--orders-full td:nth-child(5) { width: 16%; }
.lk-table--orders-full th:nth-child(6),
.lk-table--orders-full td:nth-child(6) { width: 16%; }
.lk-table--trades th:nth-child(1),
.lk-table--trades td:nth-child(1) { width: 20%; }
.lk-table--trades th:nth-child(2),
.lk-table--trades td:nth-child(2) { width: 16%; }
.lk-table--trades th:nth-child(3),
.lk-table--trades td:nth-child(3) { width: 12%; }
.lk-table--trades th:nth-child(4),
.lk-table--trades td:nth-child(4) { width: 16%; }
.lk-table--trades th:nth-child(5),
.lk-table--trades td:nth-child(5) { width: 18%; }
.lk-table--trades th:nth-child(6),
.lk-table--trades td:nth-child(6) { width: 18%; }
#tradingOrdersHost .lk-table-wrap,
#tradingHistoryHost .lk-table-wrap,
#exchangeOrdersHost .lk-table-wrap {
  max-height: 280px;
  overflow-y: auto;
}

.wallet-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: 8px; }
.wallet-strip-lbl { color: var(--text-secondary); font-size: 12px; }
.wallet-strip strong { font-size: 14px; letter-spacing: -0.02em; }
.topup-input-sm { width: 72px; padding: 6px 8px; border-radius: var(--radius-md); border: 0.5px solid var(--glass-border); background: rgba(0,0,0,0.25); color: var(--text); }
.panel-economics { grid-area: wallet; }
.billing-panel { min-height: 180px; }
.econ-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ledger-row { font-size: 11px; color: var(--text-secondary); padding: 4px 0; border-bottom: 0.5px solid rgba(255,255,255,0.06); }
.login-row { flex-wrap: wrap; }

.page-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.metrics-row-billing {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.page-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.page-panel {
  padding: 12px 14px;
  margin-top: 8px;
}
.page-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.page-status-bar .ok { color: var(--ok); }
.page-status-bar .warn { color: var(--danger); }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.detail-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.detail-cell span { color: var(--text-tertiary); }
.insight-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.insight-list li.adapt { color: var(--accent); }
.ledger-list.compact .ledger-row {
  display: grid;
  grid-template-columns: 120px 90px 90px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}
.lk-page[data-page="pairs"] .page-panel,
.lk-page[data-page="economics"] .panel-economics-full {
  flex: 0 0 auto;
}
.lk-page[data-page="economics"] {
  gap: 0;
}
.panel-economics-full .econ-pills { margin-bottom: 0; }
.overview-widget-wide { grid-column: 1 / -1; }
.overview-widget-wide .pairs-table { font-size: 12px; }
.signal-item .signal-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.density-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex-wrap: wrap;
}
.density-toggle .density-lbl { font-size: 11px; margin-right: 2px; }
.density-toggle .chip {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.density-toggle .chip.active {
  background: rgba(10, 132, 255, 0.25);
  color: var(--text);
  border-color: rgba(10, 132, 255, 0.45);
}
body.lk-density-summary .panel-chart-full { min-height: 200px; }
body.lk-density-summary .chart-wrap-tall { min-height: 160px; height: 160px; }

/* Preset widget visibility (CSS fallback — prevents ghost panels before/without JS) */
body.lk-density-summary .overview-widgets [data-widget-id="signals_preview"],
body.lk-density-summary .overview-widgets [data-widget-id="notifications"],
body.lk-density-summary .overview-widgets [data-widget-id="economics"],
body.lk-density-summary .overview-widgets [data-widget-id="pairs_preview"],
body.lk-density-summary .overview-widgets [data-widget-id="billing"],
body.lk-density-summary .overview-widgets [data-widget-id="trades_preview"],
body.lk-density-summary .overview-widgets [data-widget-id="autotrade_pulse"],
body.lk-density-summary .overview-widgets [data-widget-id="open_positions"],
body.lk-density-summary .overview-widgets [data-widget-id="equity_mini"],
body.lk-density-summary .overview-widgets [data-widget-id="bybit_equity_mini"],
body.lk-density-summary .overview-widgets [data-widget-id="daily_metrics"],
body.lk-density-summary .overview-widgets [data-widget-id="pair_scores"],
body.lk-density-summary .overview-widgets [data-widget-id="exchange_summary"],
body.lk-density-summary .overview-widgets [data-widget-id="autotrade_cta"],
html.lk-preset-summary .overview-widgets [data-widget-id="signals_preview"],
html.lk-preset-summary .overview-widgets [data-widget-id="notifications"],
html.lk-preset-summary .overview-widgets [data-widget-id="economics"],
html.lk-preset-summary .overview-widgets [data-widget-id="pairs_preview"],
html.lk-preset-summary .overview-widgets [data-widget-id="billing"],
html.lk-preset-summary .overview-widgets [data-widget-id="trades_preview"],
html.lk-preset-summary .overview-widgets [data-widget-id="autotrade_pulse"],
html.lk-preset-summary .overview-widgets [data-widget-id="open_positions"],
html.lk-preset-summary .overview-widgets [data-widget-id="equity_mini"],
html.lk-preset-summary .overview-widgets [data-widget-id="bybit_equity_mini"],
html.lk-preset-summary .overview-widgets [data-widget-id="daily_metrics"],
html.lk-preset-summary .overview-widgets [data-widget-id="pair_scores"],
html.lk-preset-summary .overview-widgets [data-widget-id="exchange_summary"],
html.lk-preset-summary .overview-widgets [data-widget-id="autotrade_cta"] {
  display: none !important;
}
body.lk-density-detailed .overview-widgets [data-widget-id="notifications"],
body.lk-density-detailed .overview-widgets [data-widget-id="economics"],
body.lk-density-detailed .overview-widgets [data-widget-id="pairs_preview"],
body.lk-density-detailed .overview-widgets [data-widget-id="billing"],
body.lk-density-detailed .overview-widgets [data-widget-id="daily_metrics"],
body.lk-density-detailed .overview-widgets [data-widget-id="exchange_summary"],
body.lk-density-detailed .overview-widgets [data-widget-id="autotrade_cta"],
body.lk-density-detailed .overview-widgets [data-widget-id="signals_preview"],
body.lk-density-detailed .overview-widgets [data-widget-id="autotrade_pulse"],
html.lk-preset-detailed .overview-widgets [data-widget-id="notifications"],
html.lk-preset-detailed .overview-widgets [data-widget-id="economics"],
html.lk-preset-detailed .overview-widgets [data-widget-id="pairs_preview"],
html.lk-preset-detailed .overview-widgets [data-widget-id="billing"],
html.lk-preset-detailed .overview-widgets [data-widget-id="daily_metrics"],
html.lk-preset-detailed .overview-widgets [data-widget-id="exchange_summary"],
html.lk-preset-detailed .overview-widgets [data-widget-id="autotrade_cta"],
html.lk-preset-detailed .overview-widgets [data-widget-id="signals_preview"],
html.lk-preset-detailed .overview-widgets [data-widget-id="autotrade_pulse"] {
  display: none !important;
}
body.lk-density-custom .overview-widgets [data-widget-id].widget-hidden,
html.lk-preset-custom .overview-widgets [data-widget-id].widget-hidden {
  display: none !important;
}

body.lk-density-summary .overview-widgets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 auto;
  overflow: visible;
}
body.lk-density-detailed .overview-widgets,
body.lk-density-custom .overview-widgets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
  overflow: visible;
  align-content: start;
  padding-bottom: 4px;
}
body.lk-density-custom .overview-widgets {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 56px;
  gap: 8px;
  position: relative;
}
body.lk-density-custom .overview-widgets .widget-drop-preview {
  pointer-events: none;
  border: 1px dashed rgba(10, 132, 255, 0.72);
  background: rgba(10, 132, 255, 0.14);
  border-radius: var(--radius-lg);
  min-height: 0;
  z-index: 1;
}
body.lk-density-custom .overview-hero.zone-empty {
  display: none !important;
  margin: 0 !important;
  min-height: 0 !important;
}
body.lk-density-custom .overview-grid [data-widget-id] {
  position: relative;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.lk-density-custom .overview-grid [data-widget-id] > :not(.card-head):not(.widget-drag-head-bar):not(.widget-resize-wrap):not(.widget-size-badge) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
body.lk-density-custom .overview-grid [data-widget-id] .chart-wrap-mini,
body.lk-density-custom .overview-grid [data-widget-id] .chart-wrap-equity-mini {
  flex: 1 1 auto;
  min-height: 28px;
  height: auto !important;
  max-height: 100%;
}
body.lk-density-custom .overview-grid [data-widget-id].widget-shape-flat .chart-wrap-mini,
body.lk-density-custom .overview-grid [data-widget-id].widget-shape-flat .chart-wrap-equity-mini {
  min-height: 24px;
}
body.lk-density-custom .overview-grid [data-widget-id].widget-shape-flat .card-head {
  padding-top: 2px;
  padding-bottom: 2px;
}
body.lk-density-custom .overview-grid [data-widget-id].widget-shape-flat .card-head h3 {
  font-size: 12px;
  line-height: 1.2;
}
body.lk-density-custom .overview-grid [data-widget-id].widget-shape-flat .stat-pills {
  margin-top: 2px;
}
body.lk-density-custom .overview-grid [data-widget-id].widget-shape-flat .stat-pills .pill .val {
  font-size: 13px;
}
body.lk-density-custom .overview-grid [data-widget-id].widget-resizing {
  outline: 1px solid rgba(10, 132, 255, 0.65);
  z-index: 4;
}
body.lk-density-custom .overview-grid [data-widget-id] .widget-size-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
body.lk-density-custom .overview-grid [data-widget-id]:hover .widget-size-badge,
body.lk-density-custom .overview-grid [data-widget-id].widget-resizing .widget-size-badge {
  opacity: 1;
}
body.lk-density-custom .overview-grid [data-widget-id="metrics_strip"] {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.lk-density-custom .overview-grid [data-widget-id="metrics_strip"] > .metric-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 8px;
}
body.lk-density-custom .overview-grid [data-widget-id="metrics_strip"] > .metric-card .val {
  font-size: 16px;
}
body.lk-density-custom .overview-grid [data-widget-id] .widget-resize-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
body.lk-density-custom .overview-grid [data-widget-id] .widget-resize-handle {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  opacity: 0.55;
  transition: opacity 0.15s var(--ease), border-color 0.15s var(--ease);
}
body.lk-density-custom .overview-grid [data-widget-id]:hover .widget-resize-handle,
body.lk-density-custom .overview-grid [data-widget-id].widget-resizing .widget-resize-handle {
  opacity: 1;
}
body.lk-density-custom .overview-grid [data-widget-id] .widget-resize-e {
  top: 35%;
  right: 0;
  width: 10px;
  height: 30%;
  min-height: 28px;
  cursor: ew-resize;
  border-right: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 0 4px 4px 0;
}
body.lk-density-custom .overview-grid [data-widget-id] .widget-resize-s {
  left: 35%;
  bottom: 0;
  width: 30%;
  min-width: 28px;
  height: 10px;
  cursor: ns-resize;
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 0 0 4px 4px;
}
body.lk-density-custom .overview-grid [data-widget-id] .widget-resize-se {
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  border-right: 2px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 0 0 4px 0;
}
body.lk-density-custom .overview-grid [data-widget-id] .widget-resize-handle:hover {
  border-color: rgba(10, 132, 255, 0.9);
}
body.dashboard-drag-enabled .overview-grid [data-widget-id] > .card-head.widget-drag-head,
body.dashboard-drag-enabled .overview-grid [data-widget-id] > .widget-drag-head-bar {
  cursor: grab;
  touch-action: none;
}
body.dashboard-drag-enabled .overview-grid [data-widget-id] > .card-head.widget-drag-head::before,
body.dashboard-drag-enabled .overview-grid [data-widget-id] > .widget-drag-head-bar::before {
  content: "⠿";
  margin-right: 6px;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
body.dashboard-drag-enabled .overview-grid [data-widget-id].widget-dragging {
  opacity: 0.72;
  outline: 1px dashed rgba(10, 132, 255, 0.55);
}
body.dashboard-drag-enabled .overview-grid [data-widget-id].widget-dragging > .card-head.widget-drag-head,
body.dashboard-drag-enabled .overview-grid [data-widget-id].widget-dragging > .widget-drag-head-bar {
  cursor: grabbing;
}
body.lk-density-summary .overview-top {
  flex-shrink: 0;
}
body.lk-density-summary .overview-metrics {
  flex-shrink: 0;
}
body.lk-density-summary .panel-strategy .portfolio-bar,
body.lk-density-summary .panel-strategy .activity-chips,
body.lk-density-detailed .panel-strategy .portfolio-bar,
body.lk-density-detailed .panel-strategy .activity-chips {
  display: none;
}
body.lk-density-summary .panel-strategy .strategy-chips,
body.lk-density-detailed .panel-strategy .strategy-chips {
  max-height: 30px;
  overflow: hidden;
  margin-bottom: 4px;
}
body.lk-density-summary .panel-strategy .stat-pills,
body.lk-density-detailed .panel-strategy .stat-pills {
  margin-top: 0;
}
body.lk-density-summary .panel-strategy,
body.lk-density-detailed .panel-strategy {
  padding: 10px 12px;
}
body.lk-density-detailed #dailyMetricsHost .pairs-table tbody tr:nth-child(n+6) {
  display: none;
}
body.lk-density-detailed .bot-status-body,
body.lk-density-summary .bot-status-body {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
body.lk-density-summary .bot-status-body.bot-status-compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.lk-density-detailed .bot-status-row,
body.lk-density-summary .bot-status-row {
  padding: 4px 6px;
  grid-template-columns: 6px 1fr;
  grid-template-rows: auto;
}
body.lk-density-detailed .bot-status-hint,
body.lk-density-summary .bot-status-hint {
  display: none;
}
.overview-pulse-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  align-items: stretch;
}
body.lk-density-detailed .overview-pulse-row {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}
.overview-pulse-row > [data-widget-id] {
  position: static !important;
  grid-column: auto !important;
  grid-row: auto !important;
  grid-area: auto !important;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
body.lk-density-detailed .overview-pulse-row .bot-status-body,
body.lk-density-summary .overview-pulse-row .bot-status-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.lk-density-detailed .overview-pulse-row .bot-status-row,
body.lk-density-summary .overview-pulse-row .bot-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  min-width: 0;
}
body.lk-density-detailed .overview-pulse-row .bot-status-dot {
  margin-top: 0;
  flex-shrink: 0;
}
body.lk-density-detailed .overview-pulse-row .bot-status-main {
  flex: 1 1 auto;
  min-width: 0;
}
body.lk-density-custom .overview-pulse-row {
  display: none !important;
}
body.lk-density-detailed [data-widget-id="trades_preview"].overview-widget-wide {
  grid-column: 1 / -1;
}
.chart-wrap-equity-mini {
  position: relative;
  min-height: 72px;
  height: 72px;
  background: linear-gradient(165deg, rgba(10, 132, 255, 0.1) 0%, rgba(142, 142, 147, 0.1) 50%, rgba(0, 0, 0, 0.16) 100%);
  border-radius: var(--radius-md);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
#dailyMetricsHost .pairs-table,
#overviewPairScoresHost .pairs-table {
  font-size: 11px;
}
.pnl-heatmap-host {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  padding: 2px 0 4px;
  max-width: 720px;
}
.pnl-heatmap-cell {
  height: 30px;
  min-height: 24px;
  max-height: 34px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.1;
  color: rgba(0, 0, 0, 0.55);
  background: rgba(142, 142, 147, 0.22);
}
.pnl-heatmap-cell.pos { background: rgba(52, 199, 89, 0.55); color: #fff; }
.pnl-heatmap-cell.neg { background: rgba(255, 59, 48, 0.5); color: #fff; }
.pnl-heatmap-cell.zero { background: rgba(142, 142, 147, 0.18); color: var(--text-tertiary); }
.pnl-heatmap-cell .hm-day { font-size: 7px; opacity: 0.8; }
.pnl-heatmap-panel {
  flex-shrink: 0;
  padding-bottom: 8px;
}
.toast-host {
  position: fixed;
  z-index: 9999;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 24px));
}
.toast {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
  background: rgba(44, 44, 46, 0.92);
  border: 0.5px solid var(--glass-border);
  color: var(--text);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast--visible {
  opacity: 1;
  transform: translateY(0);
}
.toast--success { border-color: rgba(48, 209, 88, 0.45); }
.toast--error { border-color: rgba(255, 69, 58, 0.5); }
.toast--info { border-color: rgba(10, 132, 255, 0.4); }

/* Styled confirm/prompt dialogs — site theme (replaces native confirm/prompt) */
.ui-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.ui-dialog-overlay.is-open { opacity: 1; }
.ui-dialog {
  width: min(380px, calc(100vw - 40px));
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg);
  background: rgba(28, 28, 30, 0.96);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-2);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s var(--ease);
}
.ui-dialog-overlay.is-open .ui-dialog { transform: translateY(0) scale(1); }
.ui-dialog-title { font-size: 15px; font-weight: 650; margin-bottom: 6px; color: var(--text); }
.ui-dialog-msg { font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
.ui-dialog-input {
  margin-top: 12px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 13px;
}
.ui-dialog-input:focus { outline: none; border-color: var(--accent); }
.ui-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.btn.danger { background: var(--danger, #ff453a); color: #fff; }
.btn.danger:hover { background: #ff5e54; }
.exchange-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.section-sub { margin: 12px 0 6px; font-size: 12px; }
#overviewExchangePanel .pairs-table { font-size: 12px; }

.admin-auth-panel { padding: 14px 16px; margin-bottom: 10px; max-width: 720px; }
.admin-steps { margin: 8px 0 12px 18px; line-height: 1.55; }
.admin-login-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-login-row input {
  flex: 1;
  min-width: 220px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
}
.admin-auth-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}
.admin-auth-badge.ok {
  border-color: rgba(48, 209, 88, 0.45);
  background: rgba(48, 209, 88, 0.12);
  color: var(--ok);
}
.admin-auth-badge.warn {
  border-color: rgba(255, 159, 10, 0.45);
  background: rgba(255, 159, 10, 0.12);
  color: #ffb340;
}
#adminAuthMsg.error { color: var(--danger); }
.admin-workspace[hidden] { display: none !important; }

.admin-pages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-page {
  display: none;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.admin-page.active { display: flex; }

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 10px 12px;
  margin-bottom: 4px;
}

.admin-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.admin-filters input,
.admin-filters select {
  padding: 6px 8px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  min-width: 88px;
}

.admin-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-chart-box {
  padding: 10px 12px;
  min-height: 200px;
}

.admin-chart-box canvas {
  width: 100% !important;
  height: 160px !important;
}

.admin-chart-box.wide { min-height: 220px; }

.admin-table-wrap.tall { max-height: 52vh; }

.admin-widgets-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-feed { font-size: 12px; line-height: 1.5; max-height: 220px; overflow: auto; }

.admin-feed-line {
  padding: 6px 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  .admin-charts-row,
  .admin-widgets-row { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.admin-panel-head h3 { margin: 0; }

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn.sm { padding: 6px 10px; font-size: 12px; min-height: 28px; }

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.admin-badge.ok { background: rgba(48, 209, 88, 0.22); color: #30d158; }
.admin-badge.warn { background: rgba(255, 159, 10, 0.22); color: #ff9f0a; }
.admin-badge.muted { background: var(--fill-tertiary); color: var(--text-secondary); }
.admin-badge.danger { background: rgba(255, 69, 58, 0.22); color: #ff453a; }
.admin-badge.accent { background: rgba(10, 132, 255, 0.22); color: #64d2ff; }

.admin-user-status { display: flex; flex-wrap: wrap; gap: 4px; max-width: 140px; }

.admin-user-card-panel[hidden] { display: none !important; }

body.admin-modal-open {
  overflow: hidden;
}
body.admin-body.admin-modal-open .dash-app {
  pointer-events: none;
}
body.admin-body.admin-modal-open .admin-modal-overlay {
  pointer-events: auto;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.admin-modal-overlay[hidden] {
  display: none !important;
}
.admin-modal {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.admin-modal-xl {
  width: min(1320px, 96vw);
  max-height: min(94vh, 980px);
  min-height: min(720px, 88vh);
}
.admin-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(400px, 34%);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.admin-modal-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 12px;
  border-left: 0.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
}
.admin-modal-side .glass-inset,
.admin-modal-side .admin-modal-manage {
  margin: 0;
  padding: 8px 10px;
}
.admin-modal-side .admin-user-section-title {
  margin: 0 0 6px;
  font-size: 10px;
}
.admin-modal-side .admin-manage-row {
  margin-top: 4px;
  gap: 6px;
}
.admin-modal-side .hint {
  font-size: 10px;
  line-height: 1.35;
  margin: 4px 0 0;
}
.admin-modal-side .admin-custom-symbols {
  margin-top: 4px;
}
.admin-modal-actions-compact {
  padding: 0 0 6px;
  border-bottom: 0.5px solid var(--glass-border);
  border-top: none;
  gap: 6px;
}
.admin-modal-foot-inline {
  margin-top: auto;
  padding-top: 8px;
  border-top: 0.5px solid var(--glass-border);
}
.admin-modal-foot-inline .admin-modal-actions-billing {
  padding: 6px 0 0;
}
.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 0.5px solid var(--glass-border);
}
.admin-modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.admin-modal-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.45;
  min-height: 0;
}
.admin-user-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.admin-user-panel {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  backdrop-filter: blur(12px) saturate(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
  min-width: 0;
}
.admin-user-panel-wide {
  grid-column: 1 / -1;
}
.admin-user-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 0;
}
.admin-user-stat-compact {
  padding: 6px 8px;
}
.admin-user-stat-compact .lbl {
  font-size: 10px;
  margin-bottom: 2px;
}
.admin-user-stat-compact .val {
  font-size: 13px;
  word-break: break-word;
}
.admin-user-stat-compact .val.mono-sm {
  font-size: 11px;
  font-family: ui-monospace, monospace;
}
.admin-user-tables-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.admin-user-table-box {
  min-width: 0;
  max-height: min(240px, 32vh);
  overflow: auto;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}
.admin-user-table-box .admin-user-section-title {
  margin-bottom: 6px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  padding-bottom: 4px;
  z-index: 1;
}
.admin-user-table-box .admin-inner-table {
  font-size: 10px;
}
.admin-user-table-box .admin-inner-table th,
.admin-user-table-box .admin-inner-table td {
  padding: 3px 4px 3px 0;
}
@media (max-width: 1100px) {
  .admin-user-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-user-tables-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 960px) {
  .admin-modal-xl {
    width: 100%;
    max-height: 100dvh;
    min-height: 0;
    border-radius: var(--radius-lg);
  }
  .admin-modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .admin-modal-scroll {
    overflow: visible;
    flex: none;
  }
  .admin-modal-side {
    border-left: none;
    border-top: 0.5px solid var(--glass-border);
    overflow: visible;
  }
}
@media (max-width: 640px) {
  .admin-user-layout,
  .admin-user-tables-grid {
    grid-template-columns: 1fr;
  }
  .admin-user-grid-compact {
    grid-template-columns: 1fr 1fr;
  }
}
.admin-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-top: 0.5px solid var(--glass-border);
}
.admin-modal-actions-billing {
  border-top: none;
  padding-top: 0;
  padding-bottom: 14px;
}
.admin-actions-lbl {
  width: 100%;
  margin: 0 0 4px;
  font-size: 11px;
}
.btn-icon-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-icon-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}
.admin-user-status-lg {
  max-width: none;
  margin-bottom: 14px;
}
.admin-user-section {
  margin-bottom: 14px;
}
.admin-user-section-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.admin-inner-table { width: 100%; font-size: 11px; }
.admin-inner-table .positive { color: var(--ok); }
.admin-inner-table .negative { color: var(--danger); }

.admin-user-card-body { font-size: 12px; line-height: 1.45; }
.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.admin-user-stat {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid var(--glass-border);
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
}
.admin-user-stat .lbl { color: var(--text-tertiary); font-size: 11px; margin-bottom: 4px; }
.admin-user-stat .val { font-size: 15px; font-weight: 600; }

.admin-alert {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 69, 58, 0.12);
  border: 1px solid rgba(255, 69, 58, 0.35);
  color: #ff9f9a;
  margin-bottom: 12px;
}
.admin-alert-warn {
  background: rgba(255, 159, 10, 0.12);
  border-color: rgba(255, 159, 10, 0.35);
  color: #ffb340;
}
.admin-modal-side-legend {
  margin: 0 0 4px;
  font-size: 10px;
  line-height: 1.35;
  opacity: 0.85;
}
.admin-ban-panel .admin-ban-reason {
  width: 100%;
  margin: 6px 0;
}
.admin-name-cell {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-trades { margin-top: 8px; }
.admin-user-trades table { width: 100%; font-size: 11px; }
.admin-user-trades th { color: var(--text-tertiary); font-weight: 500; text-align: left; padding: 4px 6px 4px 0; }
.admin-user-trades td { padding: 4px 6px 4px 0; border-top: 1px solid rgba(255,255,255,0.06); }

.admin-table .mono { font-variant-numeric: tabular-nums; }
.admin-table .pairs-cell { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.trading-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.trading-form label { display: flex; flex-direction: column; gap: 4px; }
.input-sm {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}
.trading-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.analyze-box {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 0.5px solid var(--glass-border);
  white-space: pre-wrap;
  font: 12px/1.45 ui-monospace, monospace;
  max-height: 200px;
  overflow: auto;
}

.api-connect-form.is-hidden,
.api-connected-box.is-hidden {
  display: none !important;
}

.api-connected-box {
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: rgba(48, 209, 88, 0.1);
  border: 0.5px solid rgba(48, 209, 88, 0.35);
}

.api-connected-badge {
  font-weight: 600;
  font-size: 14px;
  color: var(--ok);
  margin-bottom: 4px;
}

.api-connected-detail {
  margin: 0 0 10px;
}

.api-connected-actions {
  margin-top: 0;
}

.api-connect-lead {
  margin: 0 0 8px;
}

.api-tools-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 0.5px solid var(--glass-border);
}

.api-tools-block.is-dimmed {
  opacity: 0.55;
  pointer-events: none;
}

#tradeActionsBlock.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.trade-api-hint {
  margin: 0 0 10px;
}

.trade-api-hint.warn {
  color: var(--danger);
}

.lk-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  margin: 0 0 10px;
  border-radius: var(--radius-lg);
}

.lk-subnav[hidden] {
  display: none !important;
}

.lk-subnav-btn {
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.lk-subnav-btn:hover {
  color: var(--text);
  background: var(--fill-tertiary);
}

.lk-subnav-btn.active {
  color: var(--text);
  background: var(--glass-strong);
  border-color: var(--glass-border);
}

.readiness-checklist {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.readiness-checklist li {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.18);
  border: 0.5px solid var(--glass-border);
  font-size: 13px;
}

.readiness-checklist li.ok {
  border-color: rgba(48, 209, 88, 0.35);
}

.readiness-checklist li.warn {
  border-color: rgba(255, 69, 58, 0.35);
  color: var(--danger);
}

.warn-block {
  color: var(--danger);
  margin: 0 0 10px;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.interval-chips {
  display: flex;
  gap: 6px;
}

.analyze-box-tall {
  max-height: 280px;
}

.learned-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.learned-table th,
.learned-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 0.5px solid var(--glass-border);
}

.learned-table th {
  color: var(--text-secondary);
  font-weight: 500;
}

.pin-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.pin-gate[hidden] {
  display: none !important;
}

.pin-gate-card {
  width: min(360px, 92vw);
  padding: 20px 22px;
  border-radius: var(--radius-xl);
}

.pin-gate-card h3 {
  margin: 0 0 8px;
}

.pin-gate-error {
  color: var(--danger);
  margin: 8px 0 0;
}

.pin-gate-sub {
  margin: 0 0 10px;
  font-size: 12px;
}

.nav-ico.nav-notif {
  position: relative;
}

.nav-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.nav-notif-badge[hidden] {
  display: none !important;
}

.notif-panel .card-head {
  align-items: flex-start;
}

.notif-hint-bar {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(10, 132, 255, 0.1);
  border: 0.5px solid rgba(10, 132, 255, 0.25);
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.notif-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.18);
  border: 0.5px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.notif-item.unread {
  border-color: rgba(10, 132, 255, 0.35);
  background: rgba(10, 132, 255, 0.08);
}

.notif-item.system {
  border-color: rgba(255, 214, 10, 0.25);
  background: rgba(255, 214, 10, 0.06);
}

.notif-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notif-item-title {
  font-weight: 600;
  font-size: 13px;
}

.notif-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.notif-cat {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--fill-tertiary);
  color: var(--text-secondary);
  margin-right: 6px;
}

.notif-item-body {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.profile-panel .card-head {
  align-items: flex-start;
}

.profile-summary {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border: 0.5px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.15);
}

.profile-summary dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 12px;
}

.profile-summary dt {
  color: var(--text-tertiary);
}

.profile-summary dd {
  margin: 0;
  font-weight: 600;
}

.auth-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-method {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 44px;
}

.auth-method.primary {
  border-color: rgba(10, 132, 255, 0.35);
}

.auth-method-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-method.lk-provider-btn {
  cursor: default;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  justify-content: flex-start;
}

.auth-method-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--fill-tertiary);
  flex-shrink: 0;
}

.auth-method-icon-fallback {
  font-size: 14px;
}

.auth-method-body {
  flex: 1;
  min-width: 0;
}

.auth-method-title {
  font-weight: 600;
  font-size: 13px;
  margin: 0;
}

.auth-method-detail {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.auth-method-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
  font-weight: 400;
}

.auth-method-actions {
  align-self: flex-start;
}

.auth-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  align-self: flex-start;
}

.auth-status.linked { background: rgba(48, 209, 88, 0.2); color: #30d158; }
.auth-status.pending { background: rgba(255, 159, 10, 0.2); color: #ff9f0a; }
.auth-status.available { background: rgba(10, 132, 255, 0.18); color: #64d2ff; }
.auth-status.soon { background: var(--fill-tertiary); color: var(--text-tertiary); }

.admin-auth-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.admin-auth-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-auth-chip--telegram { color: #6ec8f0; border-color: rgba(42, 171, 238, 0.35); }
.admin-auth-chip--google { color: #8ab4f8; border-color: rgba(66, 133, 244, 0.35); }
.admin-auth-chip--yandex { color: #ff8a70; border-color: rgba(252, 63, 29, 0.4); }
.admin-auth-chip--email { color: #a5a3f5; border-color: rgba(94, 92, 230, 0.4); }

.admin-user-auth-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.profile-email-panel {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
}

.profile-email-panel h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.profile-email-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.profile-email-row .input-sm {
  flex: 1;
  min-width: 160px;
}

.profile-foot {
  margin: 8px 0 0;
  font-size: 11px;
}

.btn.ghost.danger-text {
  color: #ff6961;
  margin-top: 10px;
}

.profile-referral-panel {
  margin-top: 14px;
  padding: 14px 16px;
}
.profile-referral-panel h4 {
  margin: 0 0 6px;
  font-size: 15px;
}
.profile-referral-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 12px 0;
}
.profile-referral-stats strong {
  display: block;
  font-size: 18px;
  margin-top: 2px;
}
.profile-ref-code {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.profile-referral-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.profile-referral-row .input-sm {
  flex: 1;
  min-width: 0;
}
.profile-referral-foot {
  margin-top: 8px;
  font-size: 11px;
}

.admin-row-muted td {
  opacity: 0.55;
}

.avatar[role="button"] {
  cursor: pointer;
}

/* Status pills (Сделки / API / Autotrade) */
.status-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: help;
}
.status-pill-hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pairs-status-pills {
  gap: 6px;
  padding: 8px 10px;
}
.pairs-status-pills .status-pill {
  padding: 5px 10px;
  gap: 6px;
  cursor: default;
}
.pairs-status-pills .status-pill-hint {
  display: none;
}
.pairs-status-pills .status-pill-label {
  font-size: 11px;
}
.pairs-status-pills .status-pill-dot {
  width: 6px;
  height: 6px;
}
.overview-pulse-body .pulse-line {
  margin-bottom: 10px;
}
.overview-pulse-body .pulse-lbl {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}
.overview-pulse-widget {
  grid-column: span 1;
}
.glass-inset {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid var(--glass-border);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  margin: 0 18px 10px;
}
.admin-manage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.admin-custom-symbols {
  width: 100%;
  margin-top: 6px;
}
.admin-manage-row .input-sm {
  min-width: 72px;
}
.status-pill.ok {
  color: var(--text-primary);
  border-color: rgba(48, 209, 88, 0.35);
  background: rgba(48, 209, 88, 0.1);
}
.status-pill.warn {
  border-color: rgba(255, 69, 58, 0.35);
  background: rgba(255, 69, 58, 0.08);
  color: #ff9f9a;
}
.status-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}
.status-pill.ok .status-pill-dot {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.55);
}
.status-pill.warn .status-pill-dot {
  background: var(--danger);
}

/* iOS-style switch (autotrade) */
.ios-switch {
  --sw-w: 51px;
  --sw-h: 31px;
  --thumb: 27px;
  position: relative;
  width: var(--sw-w);
  height: var(--sw-h);
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  background: rgba(120, 120, 128, 0.55);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.28);
  transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.ios-switch-lg {
  --sw-w: 59px;
  --sw-h: 36px;
  --thumb: 32px;
}
.ios-switch-sm {
  --sw-w: 44px;
  --sw-h: 26px;
  --thumb: 22px;
}
.ios-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.ios-switch.is-on {
  background: #34c759;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.ios-switch.is-on .ios-switch-thumb {
  transform: translateX(calc(var(--sw-w) - var(--thumb) - 4px));
}
.ios-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.ios-switch:not(.is-on) {
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.autotrade-master-lg {
  display: flex;
  align-items: center;
  gap: 10px;
}
.autotrade-master-lg .lbl-off {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  opacity: 1;
  transition: opacity 0.2s, color 0.2s;
}
.autotrade-master-lg .lbl-on {
  font-size: 13px;
  font-weight: 600;
  color: var(--ok);
  opacity: 0.45;
}
.autotrade-master-lg:has(.ios-switch.is-on) .lbl-off {
  opacity: 0.35;
}
.autotrade-master-lg:has(.ios-switch.is-on) .lbl-on {
  opacity: 1;
}
.autotrade-master-lg:not(:has(.ios-switch.is-on)) .lbl-off {
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.portfolio-bar {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
}
.portfolio-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.portfolio-bar-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.portfolio-bar-line {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.35;
}
.portfolio-bar.is-on .portfolio-bar-line {
  color: var(--ok);
}
.ios-switch-sm {
  width: 40px;
  height: 24px;
}
.ios-switch-sm .ios-switch-thumb {
  width: 20px;
  height: 20px;
}
.portfolio-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
}
.portfolio-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.portfolio-panel-head h4 {
  margin: 0;
  font-size: 14px;
}
.portfolio-panel.is-on {
  border-color: rgba(52, 199, 89, 0.35);
}
#portfolioStatusLine {
  margin: 8px 0 0;
  font-size: 12px;
}
.portfolio-weights {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.portfolio-weight-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}
.portfolio-weight-row.is-off {
  opacity: 0.45;
}
.portfolio-weight-row .pw-name {
  font-weight: 500;
}
.portfolio-weight-row .pw-meta {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.strategy-chips.is-portfolio .chip.active {
  box-shadow: none;
}
.strategy-chips.is-portfolio .chip.active::after {
  content: " · база";
  font-size: 10px;
  opacity: 0.7;
}

.activity-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.activity-chips-panel {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.15);
  border: 0.5px solid var(--glass-border);
}
.activity-chips .chip.active {
  background: var(--accent);
  color: #fff;
}
.activity-chips-lbl {
  margin-right: 4px;
  font-size: 11px;
}

.analyze-panel {
  margin-top: 12px;
  padding: 12px 14px;
}
.analyze-panel[hidden] {
  display: none !important;
}
.analyze-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: min(50vh, 420px);
  overflow-y: auto;
  align-content: start;
}
.analyze-card {
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.analyze-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.analyze-card-pair {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.analyze-card-reason {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.analyze-card-meta {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analyze-card-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}
.analyze-card .signal-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.analyze-card .signal-tag.buy { background: rgba(48, 209, 88, 0.2); color: var(--ok); }
.analyze-card .signal-tag.sell { background: rgba(255, 69, 58, 0.2); color: var(--danger); }
.analyze-card .signal-tag.hold { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

.learn-pair-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.learn-pair-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.learn-pair-picker-lbl {
  font-size: 12px;
  color: var(--text-secondary);
}
.learn-pair-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.learn-pair-manual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.learn-pair-manual .input-sm {
  min-width: 120px;
  flex: 1;
  max-width: 200px;
}
.learn-pair-form.is-busy .learn-pair-chips,
.learn-pair-form.is-busy .learn-pair-manual {
  pointer-events: none;
  opacity: 0.7;
}
.learn-pair-form.is-busy #btnLearnRun {
  cursor: wait;
}
#learnProgress.is-running {
  border-color: rgba(10, 132, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(10, 132, 255, 0.15);
  animation: learn-progress-pulse 1.6s ease-in-out infinite;
}
@keyframes learn-progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
.lk-page[data-page="learn"].learn-busy {
  /* не блокируем весь ЛК — только форму обучения */
}

.chart-pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  align-content: start;
}
.lk-page[data-page="chart"] .chart-pairs-grid {
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 8px;
  flex: 1;
  min-height: 260px;
}
.chart-pair-card {
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}
.chart-pair-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.chart-pair-symbol {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.chart-pair-price {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.chart-pair-canvas {
  height: 132px;
  min-height: 132px;
  max-height: 132px;
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.12);
}
.chart-pair-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.lk-page[data-page="chart"] {
  overflow-y: auto;
}
.lk-page[data-page="chart"] .page-panel.panel-chart-full {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.overview-autotrade-cta .btn {
  margin-top: 8px;
  width: 100%;
}
.overview-autotrade-cta.is-on .overview-preview {
  color: var(--ok);
}

.signal-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
#signalFeedStats {
  font-size: 10px;
  margin: 0;
}

.pairs-status-pills.status-pills-bar {
  margin-bottom: 10px;
}

/* Sidebar expand: narrow icons ↔ wide column with full labels */
.sidebar-labels-toggle {
  margin-bottom: 2px;
  flex-shrink: 0;
}
.sidebar-labels-toggle .nav-svg {
  transition: transform 0.22s var(--ease);
}
.dash-app.sidebar-expanded .sidebar-labels-toggle .nav-svg {
  transform: rotate(180deg);
}
.sidebar-nav-labeled {
  width: 100%;
  gap: 4px;
}
.sidebar-nav-labeled .nav-ico .nav-label {
  display: none !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1.2;
  text-align: left;
}
.dash-app.sidebar-expanded .sidebar {
  align-items: stretch;
  padding-left: 10px;
  padding-right: 10px;
  overflow: visible;
}
.dash-app.sidebar-expanded .sidebar-nav-labeled {
  align-items: stretch;
}
.dash-app.sidebar-expanded .sidebar-nav-labeled .nav-ico {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  padding: 0 10px;
  gap: 10px;
}
.dash-app.sidebar-expanded .sidebar-nav-labeled .nav-ico .nav-label {
  display: inline !important;
}
.dash-app.sidebar-expanded .sidebar-nav-labeled .nav-ico .nav-svg {
  flex-shrink: 0;
}
.sidebar-nav-labeled .nav-ico.nav-notif .nav-notif-badge {
  top: 6px;
  right: 6px;
}
.dash-app.sidebar-expanded .sidebar-nav-labeled .nav-ico.nav-notif .nav-notif-badge {
  right: 10px;
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 16px 18px;
  margin-bottom: 10px;
}
.dash-hero-equity {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.dash-hero-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.dash-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-left: auto;
}
.dash-hero-stat .lbl {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-hero-stat strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.autotrade-hero-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--fill-tertiary);
}
.autotrade-hero-pill.is-on { background: rgba(48, 209, 88, 0.22); color: var(--ok); }
.autotrade-hero-pill.is-off { background: rgba(255, 69, 58, 0.18); color: var(--danger); }
.exposure-bar-wrap { width: 100%; }
.exposure-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.exposure-bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0a84ff, #64d2ff);
  transition: width 0.4s var(--ease);
}
.exposure-bar-fill.has-value { min-width: 3%; }
.exposure-bar-fill.warn { background: linear-gradient(90deg, #ff9f0a, #ff453a); }
.exposure-bar-wrap.is-positions .exposure-bar-fill:not(.warn) {
  background: linear-gradient(90deg, #bf5af2, #0a84ff);
}
.exposure-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}
.exposure-line:last-child { margin-bottom: 0; }
.trading-diagnosis-body .diag-section {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.trading-diagnosis-body .diag-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.trading-diagnosis-body .diag-section-title {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.trading-alert-banner {
  border-color: rgba(255, 159, 10, 0.35);
  background: rgba(255, 159, 10, 0.1);
}
.trading-alert-banner strong { color: #ff9f0a; }
.insights-summary-host {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.insights-summary-card {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.45;
}
.insights-summary-card p { margin: 0; }

.signal-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.signal-filters select { flex: 1; min-width: 0; }
.signal-filters-compact {
  margin-bottom: 4px;
}
.signal-filter-chips {
  display: flex;
  gap: 3px;
  flex: 1;
  padding: 2px;
  background: var(--fill-tertiary);
  border-radius: 999px;
}
.signal-filter-chips .chip.sm {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  text-align: center;
}
.signal-filter-chips .chip.sm.active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
}
.bot-status-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bot-status-row {
  display: grid;
  grid-template-columns: 8px 1fr;
  grid-template-rows: auto auto;
  gap: 0 8px;
  align-items: start;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: var(--fill-tertiary);
}
.bot-status-row.warn .bot-status-dot {
  background: #ff9f0a;
  box-shadow: 0 0 0 2px rgba(255, 159, 10, 0.25);
}
.bot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-top: 4px;
  box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.22);
}
.bot-status-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.bot-status-main strong { font-weight: 600; }
.bot-status-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.bot-status-hint {
  grid-column: 2;
  font-size: 10px;
  line-height: 1.35;
  margin-top: 2px;
}
.learn-status-banner .learn-status-line {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.learn-status-banner .learn-status-line:last-child {
  margin-bottom: 0;
}
.skip-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 159, 10, 0.2);
  color: #ff9f0a;
  margin-left: 4px;
}
.skip-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.skip-stat-chip {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--fill-tertiary);
  font-size: 11px;
  border: 0.5px solid transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.skip-stat-chip strong { display: block; margin-bottom: 2px; }
.settings-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.settings-card {
  text-align: left;
  border: none;
  cursor: pointer;
  padding: 14px;
  border-radius: var(--radius-lg);
  color: inherit;
  transition: transform 0.15s var(--ease), border-color 0.2s;
}
.settings-card:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.3); }
.settings-card strong { display: block; margin-bottom: 4px; }
.badge.stable { color: var(--ok); }
.badge.rollback { color: var(--danger); }
.badge.shadow { color: #bf5af2; }
.action-feed .action-kind {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 6px;
}
.lk-pages.is-loading .lk-page.active { pointer-events: none; }

.guard-reset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
}
.guard-reset-bar .hint { margin: 0; flex: 1; }
.learned-table .btn-rollback { font-size: 11px; padding: 4px 8px; }
.learned-table .btn-rollback:disabled { opacity: 0.35; cursor: not-allowed; }
.learn-always-on { font-size: 11px; padding: 4px 10px; border-radius: 999px; flex-shrink: 0; }
.admin-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
}

/* lk33 — widget tips, finance strip, trading day merge */
.card-head-chart {
  align-items: flex-start;
  gap: 8px;
}
.card-head-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pnl-spark-summary {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.pnl-spark-summary.positive { color: var(--ok); }
.pnl-spark-summary.negative { color: var(--danger); }
.strategy-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}
.status-chip.status-ok {
  background: rgba(48, 209, 88, 0.18);
  color: #5fe878;
}
.status-chip.status-warn {
  background: rgba(255, 159, 10, 0.18);
  color: #ffb340;
}
.status-chip.status-muted {
  background: rgba(142, 142, 147, 0.22);
  color: var(--text-secondary);
}
.finance-strip {
  flex-wrap: wrap;
  align-items: stretch;
}
.finance-strip > .finance-card {
  flex: 1 1 140px;
  min-width: 0;
}
.finance-card .lbl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.finance-strip-hint {
  flex: 1 1 100%;
  margin: 0;
  padding: 0 2px 2px;
  font-size: 11px;
}
.wk-tip-trigger {
  position: relative;
  cursor: help;
  text-decoration: underline dotted rgba(255, 255, 255, 0.22);
  text-underline-offset: 3px;
}
.card-head h3.wk-tip-trigger {
  display: inline;
  margin: 0;
  font: inherit;
  font-weight: 600;
}
.wk-tip-trigger:focus-visible {
  outline: 2px solid rgba(10, 132, 255, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}
.wk-tip-trigger > .wk-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 180px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(28, 28, 30, 0.96);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: normal;
  display: none;
  pointer-events: none;
}
.wk-tip-trigger:hover > .wk-popover,
.wk-tip-trigger:focus-visible > .wk-popover,
.wk-tip-trigger:focus-within > .wk-popover {
  display: block;
}
.card-head,
.widget-drag-head-bar,
.finance-card .lbl {
  position: relative;
}
.trading-day-host { padding-top: 2px; }
.trading-day-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trading-day-section {
  padding-top: 6px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
}
.trading-day-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.trading-day-section-head {
  margin-bottom: 4px;
}
.trading-day-section-head .hint {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.trading-day-signals.signal-preview-list {
  max-height: 120px;
  overflow-y: auto;
}
.trading-day-empty {
  margin: 0;
  font-size: 11px;
}
body.lk-density-summary .bot-status-compact .bot-status-hint { display: none; }
body.lk-density-summary .bot-status-compact {
  padding: 5px 8px;
}
body.lk-density-custom .overview-grid [data-widget-id="metrics_strip"] {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.lk-density-custom .overview-grid [data-widget-id="metrics_strip"] > .finance-card {
  flex: 1 1 0;
}
body.lk-density-custom .overview-grid [data-widget-id="metrics_strip"] > .finance-strip-hint {
  flex: 0 0 auto;
  font-size: 10px;
  padding: 0 4px;
}
.status-warn-text {
  color: #ffb340;
}
.settings-section-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#billingPayAllWrap[hidden],
#billingInvoicesSection[hidden] {
  display: none !important;
}

/* Autotrade — single console panel (one viewport) */
.lk-page[data-page="autotrade"] {
  overflow: hidden;
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.lk-page[data-page="autotrade"] .autotrade-console {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.autotrade-zones {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.autotrade-pult {
  padding: 12px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.mode-chips-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.mode-chips-inline .chip {
  font-size: 10px;
  padding: 4px 8px;
}
.autotrade-portfolio-summary .wk-tip-trigger {
  font-weight: 600;
  cursor: help;
}
.autotrade-monitor {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.autotrade-feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}
.autotrade-feed-row .autotrade-signals-panel,
.autotrade-feed-row .autotrade-event-log {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.autotrade-inline-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.autotrade-inline-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.autotrade-inline-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.strategy-chips-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.strategy-chips-compact .chip {
  font-size: 10px;
  padding: 4px 8px;
}
.autotrade-inline-steppers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.autotrade-inline-stepper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inline-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.inline-stepper-val {
  min-width: 52px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.autotrade-pane-hint {
  margin: -4px 0 6px;
  font-size: 10px;
}
.autotrade-skip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.autotrade-skip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.autotrade-skip-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 4px 2px 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}
.autotrade-skip-chip.active,
.autotrade-skip-chip.route-highlight {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.16);
}
.autotrade-skip-chip .skip-insights-link {
  opacity: 0.65;
  font-size: 10px;
  padding: 0 2px;
}
.autotrade-signals-panel,
.autotrade-event-log {
  padding: 10px 12px;
  border-radius: var(--radius-lg);
}
.autotrade-signals-host,
.autotrade-event-log-host {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.autotrade-event-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
}
.autotrade-event-item .event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  background: var(--text-tertiary);
}
.autotrade-event-item.level-ok .event-dot { background: var(--ok); }
.autotrade-event-item.level-warn .event-dot { background: #ff9f0a; }
.autotrade-event-item.level-error .event-dot { background: var(--danger); }
.autotrade-event-item time {
  color: var(--text-tertiary);
  font-size: 10px;
  white-space: nowrap;
}
.autotrade-cmd {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.autotrade-cmd-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.autotrade-cmd-top .autotrade-master {
  flex-shrink: 0;
}
.autotrade-cmd-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.autotrade-cmd-brand h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.autotrade-cmd-titles .hint {
  margin: 2px 0 0;
  font-size: 11px;
}
.autotrade-state-pill {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.autotrade-state-pill.is-on {
  background: rgba(48, 209, 88, 0.2);
  color: var(--ok);
}
.autotrade-state-pill.is-off {
  background: rgba(255, 69, 58, 0.16);
  color: var(--danger);
}
.autotrade-cmd-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.autotrade-cmd-metrics .pill .val {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autotrade-cmd-pills {
  margin: 0;
  padding: 0;
  gap: 6px;
}
.autotrade-cmd-pills .status-pill {
  padding: 5px 10px;
  font-size: 11px;
}
.autotrade-cmd-pills .status-pill-hint {
  max-width: 120px;
  font-size: 10px;
}
.autotrade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.autotrade-pane {
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  min-height: 0;
}
.autotrade-pane-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.autotrade-pane-body {
  font-size: 13px;
  line-height: 1.45;
}
.autotrade-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 6px;
}
.autotrade-kpi {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.autotrade-kpi .lbl {
  font-size: 10px;
  color: var(--text-tertiary);
}
.autotrade-kpi .val {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.autotrade-skip-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 6px 0 0;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  background: rgba(255, 159, 10, 0.12);
  color: #ff9f0a;
}
.autotrade-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  font-size: 12px;
}
.autotrade-limit {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.autotrade-limit .lbl { color: var(--text-tertiary); }
.autotrade-limit.warn .val { color: #ff9f0a; }
.autotrade-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.autotrade-foot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.autotrade-foot-lbl {
  font-size: 11px;
  white-space: nowrap;
}
.activity-chips-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.activity-chips-inline .chip {
  padding: 5px 10px;
  font-size: 11px;
}
.autotrade-portfolio-details {
  padding: 8px 12px;
  border-radius: var(--radius-lg);
}
.autotrade-portfolio-details[open] {
  padding-bottom: 10px;
}
.autotrade-portfolio-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}
.autotrade-portfolio-summary::-webkit-details-marker { display: none; }
.autotrade-portfolio-details .portfolio-weights {
  margin-top: 8px;
}
.autotrade-links {
  gap: 6px;
}
.autotrade-links .btn {
  padding: 6px 12px;
  font-size: 12px;
}
.autotrade-alert {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 159, 10, 0.1);
}
.autotrade-guard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
}

@media (max-width: 1100px) {
  .autotrade-zones { grid-template-columns: 1fr; }
  .analytics-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-trade-layout { grid-template-columns: 1fr; }
  .manual-score-aside {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .autotrade-grid { grid-template-columns: 1fr; }
  .autotrade-feed-row { grid-template-columns: 1fr; }
  .settings-plan-grid { grid-template-columns: 1fr; }
  .autotrade-cmd-top { flex-wrap: wrap; }
  .autotrade-cmd-metrics { width: 100%; }
  .dash-app,
  .dash-app.sidebar-expanded { grid-template-columns: 1fr; }
  .global-metrics { display: none; }
  .rail-toggle { display: none; }
  .sidebar-nav-labeled { flex-direction: row; flex-wrap: wrap; }
  .nav-label { display: none !important; }
  .sidebar-labels-toggle { display: none; }
  .settings-cards { grid-template-columns: 1fr; }
  .dash-hero-equity { font-size: 26px; }
}

/* lk50 — learning optuna + apply timeline */
.learn-optuna-spark {
  position: relative;
  height: 56px;
  margin: 8px 0 4px;
}
.learn-optuna-spark canvas {
  width: 100% !important;
  height: 56px !important;
}
.learn-job-progress {
  margin: 8px 0 12px;
}
.learn-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--fill-tertiary);
  overflow: hidden;
}
.learn-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  transition: width 0.6s var(--ease);
}
.learn-cv-hint {
  margin-top: 6px;
  font-size: 11px;
}
.learn-apply-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 4px;
}
.learn-timeline-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  margin-left: 6px;
  position: relative;
}
.learn-timeline-item:last-child {
  border-left-color: transparent;
}
.learn-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  margin-left: -6px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}
.learn-timeline-item.is-rollback .learn-timeline-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.2); }
.learn-timeline-item.is-shadow .learn-timeline-dot { background: #ffd60a; box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.2); }
.learn-timeline-body strong { display: block; font-size: 13px; }
.learn-timeline-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.learn-timeline-fitness {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  margin-top: 4px;
}

/* lk50 — insights health radar + adaptations feed */
.insights-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}
.insights-health-row {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}
.insights-radar-wrap {
  max-width: 300px;
  width: 100%;
  display: block;
  position: relative;
  height: 240px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.insights-radar-wrap:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}
.insights-radar-wrap canvas {
  width: 100% !important;
  height: 210px !important;
}
.insights-radar-cap {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.insights-radar-wrap:hover .insights-radar-cap {
  color: var(--accent);
}
.insights-health-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  align-content: center;
}
.insights-health-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  padding: 8px 10px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}
.insights-health-metric > span:first-child { color: var(--text-secondary); }
.insights-health-metric .metric-delta.positive { color: var(--ok); }
.insights-health-metric .metric-delta.negative { color: var(--danger); }
.adaptations-feed .adaptation-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 6px;
  list-style: none;
  font-size: 12px;
  line-height: 1.4;
}
.adaptations-feed .adaptation-item.improvement { border-left: 3px solid var(--ok); }
.adaptations-feed .adaptation-item.regression { border-left: 3px solid var(--danger); }
.adaptations-feed .adaptation-item.neutral { border-left: 3px solid rgba(255, 255, 255, 0.2); }
.adaptations-feed .adaptation-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .insights-health-row { grid-template-columns: 1fr; }
  .insights-grid-main {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }
  .insights-adaptations-panel {
    flex-basis: clamp(100px, 20vh, 160px);
  }
}

/* lk51 — compact horizontal layout */
.card-head-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-head-inline h3 { margin: 0; }
.card-head-inline .hint { margin: 0; }

@media (max-width: 1099px) {
  .top-strip-left {
    grid-template-columns: 1fr;
  }
  .global-metrics {
    justify-self: start;
    border-left: none;
    padding-left: 0;
  }
}
@media (min-width: 1100px) {
  .top-strip {
    flex-wrap: nowrap;
    padding: 5px 10px;
    gap: 6px;
    min-height: 0;
  }
  .top-title h1 { font-size: 15px; line-height: 1.15; }
  .top-title .sub {
    margin: 0;
    font-size: 11px;
  }
  .global-metrics {
    gap: 8px;
    flex-wrap: nowrap;
    padding-left: 8px;
    border-left: 0.5px solid rgba(255, 255, 255, 0.12);
  }
  .global-metric-val { font-size: 13px; }
  .global-metric-equity .global-metric-val { font-size: 14px; }
  .global-metric-lbl { font-size: 9px; }
  .login-row {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .wallet-strip { gap: 6px; margin-left: 0; }
  .wallet-strip-lbl { display: none; }
  .density-toggle .chip { padding: 3px 7px; font-size: 11px; }
  .density-toggle .density-lbl { display: none; }
}

.billing-banner.trading-alert-banner.is-visible,
.trading-alert-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 12px;
  margin-bottom: 6px;
}
.trading-alert-banner strong { flex-shrink: 0; }
.trading-alert-banner .hint {
  margin: 0;
  flex: 1 1 200px;
}
.trading-alert-banner .trading-actions { margin: 0; }

.strategy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px !important;
}
.strategy-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-width: 0;
}
.strategy-head-main h3 { margin: 0; }
.strategy-hint-inline { font-size: 11px; white-space: nowrap; }
.strategy-status-line { width: 100%; margin-top: 2px; }
.autotrade-master-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.strategy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}
.stat-pills-hero .pill {
  padding: 5px 8px;
  min-width: 64px;
}
.stat-pills-hero .pill .lbl { font-size: 9px; }
.stat-pills-hero .pill .val { font-size: 14px; line-height: 1.1; }
.strategy-secondary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.portfolio-bar-compact {
  flex: 1 1 180px;
  padding: 6px 10px;
  margin: 0;
}
.portfolio-bar-compact .portfolio-bar-line { margin: 2px 0 0; font-size: 10px; }
.activity-chips-compact {
  flex: 1 1 220px;
  margin: 0;
  gap: 4px;
}
.activity-chips-compact .chip { font-size: 10px; padding: 3px 7px; }

.panel-chart-mini .chart-legend-bar { margin-top: 4px; }
.chart-wrap-mini {
  min-height: 72px;
  height: 72px;
  max-height: 72px;
}

.portfolio-exposure-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.portfolio-exposure-text .exposure-line { margin-bottom: 4px; font-size: 12px; }
.portfolio-exposure-text p.hint { margin: 4px 0 0; }
.portfolio-donut-wrap {
  width: 88px;
  height: 88px;
  margin: 0;
  flex-shrink: 0;
}
.portfolio-donut-wrap canvas {
  width: 88px !important;
  height: 88px !important;
}

.trading-diagnosis-body.diag-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.trading-diagnosis-body.diag-compact .diag-section {
  margin: 0;
  padding: 8px 10px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.12);
}
.trading-diagnosis-body.diag-compact .diag-section-title { margin-bottom: 4px; }
.trading-diagnosis-body.diag-compact .exposure-line { margin-bottom: 4px; font-size: 12px; }
.trading-diagnosis-body.diag-compact .diag-foot { margin: 4px 0 0; font-size: 10px; }

.trading-day-compact .trading-day-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
}
.trading-day-compact .trading-day-stats { margin: 0; flex: 0 0 auto; }
.trading-day-compact .trading-day-pulse { flex: 1 1 160px; margin: 0; }
.trading-day-compact .trading-day-signals { margin-top: 6px; }
.trading-day-compact .trading-day-positions { margin-top: 4px; }

.finance-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
/* Сводка дня на Обзоре: 5 карточек в один ряд на широком, перенос на узком */
.overview-metrics.finance-strip {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.finance-strip-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
}

.analytics-charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 1100px) {
  .analytics-charts-row { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}
.chart-wrap-compact {
  height: 140px;
  min-height: 140px;
  max-height: 140px;
}
.chart-wrap-compact.is-empty {
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-wrap-compact.is-empty canvas { display: none; }
.chart-wrap-compact .chart-empty-hint { margin: 0; font-size: 11px; }

.insights-page-compact { padding: 12px 14px; }
.insights-page-head {
  margin-bottom: 6px;
  flex-shrink: 0;
}
.insights-health-row-compact {
  flex-shrink: 0;
  margin-bottom: 10px;
}
.insights-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.insights-grid-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.insights-scroll-block {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.1);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}
.insights-scroll-block .section-sub {
  margin: 0 0 6px;
  flex-shrink: 0;
}
.insights-scroll-host {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.insights-adaptations-panel {
  flex: 0 1 clamp(120px, 24vh, 200px);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.insights-adaptations-panel .section-sub {
  margin: 0;
  flex-shrink: 0;
}
.insights-adaptations-panel .adaptations-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.insights-dual-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (min-width: 900px) {
  .insights-dual-col { grid-template-columns: 1fr 1fr; }
}
.insights-col-block .section-sub { margin: 0 0 6px; }
.insight-list-compact li { padding: 4px 0; font-size: 12px; }
.skip-stats-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skip-stats-compact .skip-stat-chip {
  flex: 1 1 calc(50% - 6px);
  min-width: 120px;
  padding: 6px 8px;
}

@media (min-width: 1100px) {
  .autotrade-inline-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
  }
  .autotrade-inline-row:first-child { grid-column: 1 / -1; }
  .autotrade-profile-hint { grid-column: 1 / -1; }
  .autotrade-expert { grid-column: 1 / -1; }
  .autotrade-foot-row { grid-column: 1 / -1; }
  .autotrade-portfolio-details { grid-column: 1 / -1; }
  .autotrade-links { grid-column: 1 / -1; }
  .autotrade-cmd-top { align-items: center; }
  .autotrade-cmd-titles .hint { margin: 0; }
}

.manual-trade-panel .trading-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.manual-trade-panel .trading-form label { margin: 0; }
.manual-trade-panel .analyze-panel {
  flex-shrink: 0;
  max-height: 36%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.manual-trade-panel .analyze-panel:not([hidden]) {
  display: flex;
}
.manual-trade-panel .analyze-results-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
@media (max-width: 1100px) {
  .manual-bottom-row { grid-template-columns: 1fr; flex-basis: auto; max-height: 220px; }
  .manual-trade-layout { grid-template-columns: 1fr; }
}

body.lk-density-summary .strategy-secondary-row,
body.lk-density-detailed .strategy-secondary-row {
  display: none;
}
body.lk-density-summary .panel-strategy .strategy-chips,
body.lk-density-detailed .panel-strategy .strategy-chips {
  max-height: none;
  overflow: visible;
}

@media (max-width: 900px) {
  .trading-diagnosis-body.diag-compact { grid-template-columns: 1fr; }
  .portfolio-exposure-grid { grid-template-columns: 1fr; }
  body.lk-density-detailed .bot-status-body,
  body.lk-density-summary .bot-status-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-strip { grid-template-columns: 1fr 1fr; }
}

/* lk52/lk53: сброс сетки «Свой» в Сводка/Детально — без наложения виджетов */
body.lk-density-summary .overview-grid,
body.lk-density-detailed .overview-grid {
  grid-auto-rows: minmax(min-content, auto) !important;
  grid-template-rows: none !important;
}
body.lk-density-summary .overview-grid [data-widget-id],
body.lk-density-detailed .overview-grid [data-widget-id] {
  position: static !important;
  height: auto !important;
  max-height: none !important;
  z-index: auto !important;
  outline: none !important;
  overflow: hidden;
  contain: none;
  min-width: 0;
}
body.lk-density-summary .overview-grid [data-widget-id]:not(.overview-widget-wide),
body.lk-density-detailed .overview-grid [data-widget-id]:not(.overview-widget-wide) {
  grid-column: auto !important;
  grid-row: auto !important;
  grid-area: auto !important;
}
body.lk-density-summary .overview-grid [data-widget-id].overview-widget-wide,
body.lk-density-detailed .overview-grid [data-widget-id].overview-widget-wide {
  grid-column: 1 / -1 !important;
}
body.lk-density-detailed .page-grid-overview { gap: 6px; }
body.lk-density-detailed .overview-top { gap: 6px; }
body.lk-density-detailed .overview-metrics { flex-shrink: 0; }
body.lk-density-detailed .panel-strategy,
body.lk-density-summary .panel-strategy { padding: 6px 8px; }
body.lk-density-detailed .strategy-head { margin-bottom: 2px !important; }
body.lk-density-detailed .strategy-status-line {
  font-size: 10px;
  line-height: 1.25;
  max-height: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.lk-density-detailed .strategy-toolbar { gap: 4px 8px; }
body.lk-density-detailed .stat-pills-hero .pill { padding: 4px 6px; min-width: 52px; }
body.lk-density-detailed .stat-pills-hero .pill .val { font-size: 12px; }
body.lk-density-detailed .market-pulse-host {
  max-height: 108px;
  gap: 4px;
  overflow-y: auto;
}
body.lk-density-summary .market-pulse-host {
  max-height: 132px;
  overflow-y: auto;
}
body.lk-density-detailed .market-pulse-row { gap: 6px; }
body.lk-density-detailed .trading-diagnosis-body .diag-section {
  margin-bottom: 6px;
  padding-bottom: 4px;
}
body.lk-density-detailed .trading-diagnosis-body .diag-section-title {
  margin-bottom: 3px;
  font-size: 10px;
}
body.lk-density-detailed .trading-day-compact .trading-day-signals {
  max-height: 64px;
  overflow: auto;
}
body.lk-density-detailed .overview-widget .card-head.tight h3 { font-size: 12px; }
body.lk-density-detailed .overview-widget { padding: 8px 10px; gap: 4px; }
.panel-compact { padding: 8px 10px; gap: 4px; }
.panel-chart-mini .card-head.tight { margin-bottom: 2px; }
.panel-chart-mini .card-head.tight h3 { font-size: 12px; }
.trading-alert-banner { padding: 6px 10px; margin-bottom: 4px; }

/* lk56: строки вне сетки, три широких графика, без наложения hero/pulse */
body.lk-density-detailed .overview-top,
body.lk-density-summary .overview-top {
  grid-template-columns: minmax(0, 1fr) !important;
}
.page-grid-overview > .overview-hero {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.page-grid-overview > .overview-pulse-row,
.page-grid-overview > .overview-mid-row,
.page-grid-overview > .overview-charts-row,
.page-grid-overview > .overview-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
}
.page-grid-overview > .overview-pulse-row,
.page-grid-overview > .overview-mid-row,
.page-grid-overview > .overview-charts-row {
  display: grid;
  gap: 8px;
  align-items: stretch;
}
.page-grid-overview > .overview-pulse-row {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
}
.overview-strategy-pulse.panel-strategy {
  min-width: 0;
  padding: 8px 10px;
}
body.lk-density-detailed .overview-strategy-pulse .strategy-secondary-row,
body.lk-density-summary .overview-strategy-pulse .strategy-secondary-row {
  display: none;
}
body.lk-density-detailed .overview-strategy-pulse .strategy-chips {
  max-height: 28px;
  overflow: hidden;
}
.trading-day-compact .trading-day-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.trading-day-positions-scroll {
  max-height: 96px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pairs-table-compact th,
.pairs-table-compact td {
  padding: 4px 6px;
  font-size: 11px;
}
body.lk-density-detailed .overview-mid-row .trading-day-positions-scroll {
  max-height: 88px;
}
body.lk-density-detailed .overview-grid [data-widget-id="market_pulse"] .market-pulse-host {
  max-height: 160px;
}
.page-grid-overview > .overview-mid-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.page-grid-overview > .overview-mid-row > [data-widget-id]:only-child {
  grid-column: 1 / -1;
}
.page-grid-overview > .overview-charts-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.page-grid-overview > .overview-pulse-row > [data-widget-id],
.page-grid-overview > .overview-mid-row > [data-widget-id],
.page-grid-overview > .overview-charts-row > [data-widget-id] {
  position: static !important;
  grid-column: auto !important;
  grid-row: auto !important;
  grid-area: auto !important;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  contain: none;
}
body.lk-density-custom .page-grid-overview > .overview-pulse-row,
body.lk-density-custom .page-grid-overview > .overview-mid-row,
body.lk-density-custom .page-grid-overview > .overview-charts-row {
  display: none !important;
}
.overview-chart-wide { padding: 8px 10px; gap: 4px; }
.page-grid-overview > .overview-charts-row .chart-wrap-wide {
  width: 100%;
  min-width: 0;
}
.page-grid-overview > .overview-charts-row .chart-wrap-mini {
  min-height: 100px;
  height: 100px;
  max-height: none;
}
.page-grid-overview > .overview-charts-row .chart-wrap-equity-mini {
  min-height: 80px;
  height: 80px;
  max-height: 80px;
}
.page-grid-overview > .overview-charts-row .chart-wrap-wide canvas {
  width: 100% !important;
}
body.lk-density-detailed .overview-mid-row .trading-diagnosis-body.diag-compact {
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
body.lk-density-detailed .overview-mid-row .trading-day-compact .trading-day-signals {
  max-height: 72px;
}
@media (max-width: 1100px) {
  .page-grid-overview > .overview-charts-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .page-grid-overview > .overview-pulse-row,
  .page-grid-overview > .overview-mid-row {
    grid-template-columns: 1fr;
  }
}

/* admin lk71: platform economics + security */
.admin-econ-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.admin-forecast-block { font-size: 13px; line-height: 1.5; }
.admin-forecast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-bottom: 8px;
}
.admin-forecast-grid strong { display: block; font-size: 15px; }
.admin-plan-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
  font-size: 12px;
}
.admin-econ-foot { margin-top: 8px; font-size: 11px; }
.admin-alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
}
.admin-alert-item {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
}
.admin-alert-item.admin-alert-danger { border-color: rgba(255, 69, 58, 0.45); background: rgba(255, 69, 58, 0.1); }
.admin-alert-item.admin-alert-warn { border-color: rgba(255, 159, 10, 0.4); background: rgba(255, 159, 10, 0.08); }
.admin-row-warn { background: rgba(255, 159, 10, 0.06); }
.admin-page-error {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-color: rgba(255, 69, 58, 0.45);
  background: rgba(255, 69, 58, 0.12);
  border-radius: var(--radius-lg);
}
.admin-page-error[hidden] { display: none !important; }
.admin-bulk-bar {
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
@media (max-width: 1100px) {
  .admin-econ-grid { grid-template-columns: 1fr; }
}

/* Admin adm139 — прозрачность через brightness blur, не alpha */
body.admin-body .dash-app,
body.admin-body .dash-main,
body.admin-body .dash-main > .main-scroll,
body.admin-body .main-scroll,
body.admin-body .admin-workspace,
body.admin-body .admin-pages,
body.admin-body .admin-page {
  background: transparent !important;
}

body.admin-body .admin-page.active > * {
  flex-shrink: 0;
}

body.admin-body .admin-table-wrap {
  overflow: auto;
  max-height: min(36vh, 320px);
  border: 0.5px solid rgba(255, 255, 255, var(--ui-glass-border-a));
  border-radius: var(--ui-radius-xl);
  padding: 8px 10px;
  background: rgba(255, 255, 255, var(--ui-glass-alpha));
  backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  -webkit-backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  box-shadow: var(--shadow-2), inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
}

body.admin-body .admin-table-wrap.tall {
  max-height: min(44vh, 420px);
}

body.admin-body .admin-feed {
  max-height: min(32vh, 280px);
  overflow: auto;
}

body.admin-body .admin-pre {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.008);
  border-radius: var(--radius-md);
  border: 0.5px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  overflow: auto;
}

body.admin-body .admin-auth-panel {
  max-width: 720px;
}

/* admin ghost buttons — как в ЛK (.btn.ghost), без доп. затемнения */
.chip.sm {
  padding: 4px 10px;
  font-size: 11px;
}
.select-glass {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  min-width: 108px;
}
.select-glass select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 7px 28px 7px 10px;
  border-radius: 999px;
  border: 0.5px solid var(--glass-border);
  background: var(--fill-tertiary);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.select-glass select:hover,
.select-glass select:focus {
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
  background: rgba(255, 255, 255, 0.1);
}
/* Тёмная тема для нативного выпадающего списка (popup option-ов) */
.select-glass select option,
.select-glass select optgroup {
  background: #1a1c22;
  color: var(--text);
}
.select-glass::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.55;
  pointer-events: none;
}
.comm-rule-form {
  margin-bottom: 10px;
}
.comm-rule-form.glass-inset {
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comm-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  align-items: start;
}
.comm-rule-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.comm-rule-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.comm-rule-chips.mode-chips {
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
}
.input-unit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.input-unit-row .input-sm {
  width: 5.5rem;
  min-width: 4rem;
}
.input-unit {
  font-size: 11px;
  color: var(--text-secondary);
}
.input-unit strong {
  color: var(--text);
  font-weight: 600;
}

.lk-auth-gate,
.lk-guest-gate {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.lk-auth-gate[hidden],
.lk-guest-gate[hidden] {
  display: none !important;
}

.lk-auth-gate-card,
.lk-guest-gate-card {
  width: min(480px, 94vw);
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.lk-auth-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent, #0a84ff);
  background: rgba(10, 132, 255, 0.12);
}

.lk-auth-gate-card h2,
.lk-guest-gate-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.lk-auth-lead {
  margin: 0 0 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.lk-auth-steps {
  margin: 0 0 18px;
  padding-left: 1.2rem;
  line-height: 1.55;
}

.lk-auth-steps li {
  margin-bottom: 8px;
}

.lk-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.lk-auth-actions-foot {
  margin-top: 4px;
}

.lk-auth-providers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}

.lk-provider-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.lk-provider-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.lk-provider-btn:active {
  transform: scale(0.98);
}

.lk-provider-ico {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.lk-provider-ico svg {
  display: block;
}

.lk-provider-google {
  background: #fff;
  color: #1f1f1f;
  border-color: rgba(0, 0, 0, 0.08);
}

.lk-provider-google:hover {
  background: #f6f6f6;
  color: #111;
}

.lk-provider-yandex:hover {
  border-color: rgba(252, 63, 29, 0.55);
}

.lk-provider-telegram:hover {
  border-color: rgba(42, 171, 238, 0.55);
}

.lk-provider-email:hover {
  border-color: rgba(94, 92, 230, 0.55);
}

.lk-auth-email-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lk-auth-email-panel[hidden] {
  display: none !important;
}

.lk-auth-email-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lk-auth-email-panel .input-sm {
  width: 100%;
}

.auth-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 560px) {
  .lk-auth-providers,
  .auth-methods {
    grid-template-columns: 1fr;
  }
}

.lk-auth-oauth,
.lk-oauth-btn,
.lk-auth-divider {
  display: none !important;
}

.lk-auth-alt,
.lk-auth-server {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
}

.lk-auth-gate-card p,
.lk-guest-gate-card p {
  margin: 0 0 10px;
  line-height: 1.45;
}

body.lk-guest-mode .dash-app,
body.lk-guest-mode #lkPages {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

/* Admin modal / user card — LK glass tokens */
body.admin-body .admin-plan-panel {
  border-color: rgba(10, 132, 255, 0.28);
  background: rgba(10, 132, 255, 0.07);
}
body.admin-body .admin-modal-manage select.input-sm,
body.admin-body .admin-modal-manage input.input-sm {
  background: rgba(0, 0, 0, 0.22);
  border: 0.5px solid var(--glass-border);
  color: var(--text);
}
body.admin-body .select-glass select {
  background: var(--fill-tertiary);
  border: 0.5px solid var(--glass-border);
}

body.admin-body .admin-alert-item,
/* Плоские плитки (без стекла-на-стекле внутри стеклянной панели).
   Прочитанные — приглушены; непрочитанные — яркие с accent-полосой слева. */
body.admin-body .notif-item {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  border-left: 3px solid transparent;
  opacity: 0.55;
  box-shadow: none;
}
body.admin-body .notif-item:hover {
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.06);
}
body.admin-body .notif-item.unread {
  opacity: 1;
  background: rgba(10, 132, 255, 0.1);
  border-color: rgba(10, 132, 255, 0.32);
  border-left-color: var(--accent);
}
body.admin-body .notif-item.unread .notif-item-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}
body.admin-body .notif-item.system {
  border-left-color: rgba(255, 214, 10, 0.6);
}
body.admin-body .notif-item.system.unread {
  background: rgba(255, 214, 10, 0.08);
  border-color: rgba(255, 214, 10, 0.32);
}

body.admin-body .admin-row-warn {
  background: rgba(255, 159, 10, 0.08);
}

/* adm148 — admin theme panel: layout + appearance UI (LK blocks выше не трогаем) */
body.admin-body .dash-app,
body.admin-body.admin-app {
  grid-template-columns: calc(var(--ui-sidebar-col) * var(--ui-scale)) minmax(0, 1fr);
  gap: calc(var(--ui-grid-gap) * var(--ui-scale));
  padding: calc(var(--ui-app-pad-y) * var(--ui-scale)) calc(var(--ui-app-pad-x) * var(--ui-scale));
}
body.admin-body .dash-bg::before {
  background: radial-gradient(
    ellipse 85% 65% at var(--ui-bg-warm-x, 72%) 38%,
    rgba(255, 168, 92, var(--ui-overlay-warm)),
    transparent 58%
  );
}
body.admin-body .glass-inset {
  background: rgba(255, 255, 255, calc(var(--ui-glass-alpha) - 0.005));
  border-color: rgba(255, 255, 255, calc(var(--ui-glass-border-a) - 0.02));
  backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset))
    brightness(var(--ui-brightness-inset));
  -webkit-backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset))
    brightness(var(--ui-brightness-inset));
}
body.admin-body .top-strip.glass {
  backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness-strip));
  -webkit-backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness-strip));
}
body.admin-body .overview-kpi-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.admin-body .overview-kpi-panel .admin-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  grid-auto-rows: minmax(56px, auto);
  padding: 0;
  border-radius: 0;
  background: transparent;
}
/* Плоские плитки KPI — без стекла-в-стекле и острых углов.
   Составной селектор .admin-panel.overview-kpi-panel (специфичность 0,5,1)
   гарантированно перебивает общие стеклянные правила .admin-panel .admin-kpi-strip
   (0,4,1) ниже по файлу, не затрагивая KPI на других страницах (Здоровье и т.д.). */
body.admin-body .admin-panel.overview-kpi-panel .admin-kpi-strip > .metric-card,
body.admin-body .admin-panel.overview-kpi-panel .finance-strip > .metric-card,
body.admin-body .admin-panel.overview-kpi-panel .admin-kpi-strip > .metric-card.glass,
body.admin-body .admin-panel.overview-kpi-panel .finance-strip > .metric-card.glass {
  padding: 8px 10px;
  min-height: 56px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
/* Гарантируем скругление внешних панелей админки */
body.admin-body .glass.admin-panel {
  border-radius: var(--ui-radius-xl);
}
body.admin-body .overview-kpi-panel .metric-card .lbl {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-secondary);
}
body.admin-body .overview-kpi-panel .metric-card .val {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
body.admin-body .admin-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 6px;
}
body.admin-body .admin-section-head-row .admin-section-label {
  margin: 0;
}
/* Admin — одно стекло на блок: панель снаружи, таблица/лента/форма внутри без второго blur */
body.admin-body .glass.admin-panel.overview-widget > .admin-table-wrap,
body.admin-body .glass.admin-panel.overview-widget > .admin-feed,
body.admin-body .glass.admin-panel.admin-jobs-panel > .admin-table-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}
body.admin-body .glass.admin-panel.overview-widget > .comm-rule-form.glass-inset {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid rgba(255, 255, 255, calc(var(--ui-glass-border-a, 0.12) + 0.03));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.admin-body .glass.admin-panel.overview-widget > .admin-alert-list .admin-alert-item {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Инлайн-фильтр внутри стеклянной панели (напр. «Уведомления») — плоский, без стекла-на-стекле */
body.admin-body .glass.admin-panel.overview-widget > .admin-filters.glass {
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  margin: 2px 0 4px;
}
/* Шапка уведомлений: кнопка «Прочитать все» с дыханием, не липнет к краю */
body.admin-body .notif-panel .card-head {
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}
body.admin-body .notif-panel .card-head > div { min-width: 0; }
body.admin-body .notif-panel .card-head .hint { margin: 2px 0 0; }
body.admin-body .admin-section-label {
  margin: 0 0 6px;
  padding: 0 2px;
  font-size: 0.92em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
body.admin-body .admin-system-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.admin-body .metric-card .lbl {
  color: var(--text-secondary);
  font-size: 0.92em;
  line-height: 1.25;
}
body.admin-body .metric-card .val {
  font-size: 1.55em;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
body.admin-body .admin-kpi-strip > .metric-card,
body.admin-body .finance-strip > .metric-card {
  border-radius: var(--ui-radius-xl);
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
  background: rgba(255, 255, 255, var(--ui-glass-alpha));
  border: 0.5px solid rgba(255, 255, 255, var(--ui-glass-border-a));
  backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  -webkit-backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  box-shadow: var(--shadow-2), inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
}
body.admin-body .admin-panel .admin-kpi-strip > .metric-card,
body.admin-body .admin-panel .finance-strip > .metric-card {
  background: rgba(255, 255, 255, calc(var(--ui-glass-alpha) + 0.022));
  border-color: rgba(255, 255, 255, calc(var(--ui-glass-border-a) + 0.05));
  backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset))
    brightness(var(--ui-brightness-inset));
  -webkit-backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset))
    brightness(var(--ui-brightness-inset));
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.14), 0 2px 12px rgba(0, 0, 0, 0.12);
}
body.admin-body .admin-jobs-panel {
  padding: 10px 12px;
}
body.admin-body .admin-jobs-panel > .admin-table-wrap {
  max-height: min(40vh, 360px);
}
body.admin-body .admin-table-glass {
  margin: 0;
}
body.admin-body .overview-widget .admin-table-wrap.glass-inset {
  margin: 0;
}
body.admin-body .admin-table th {
  font-size: 0.88em;
  font-weight: 600;
  color: var(--text-secondary);
}
body.admin-body .admin-table td {
  font-size: 1em;
  color: var(--text);
}
body.admin-body .admin-table,
body.admin-body .admin-table-wrap .pairs-table {
  font-size: 1em;
}
body.admin-body .overview-widget .card-head h3,
body.admin-body .admin-panel > h3 {
  font-size: 1em;
  font-weight: 600;
}
/* Users list — одно стекло (панель), таблица без вложенного glass */
body.admin-body .admin-users-panel .admin-users-hint {
  margin: 0 0 8px;
  font-size: 0.88em;
}
body.admin-body .admin-users-panel .admin-table-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}
body.admin-body .admin-users-panel .admin-table tbody tr.admin-user-row {
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
body.admin-body .admin-users-panel .admin-table tbody tr.admin-user-row:hover,
body.admin-body .admin-users-panel .admin-table tbody tr.admin-user-row:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}
body.admin-body .admin-users-panel .admin-table tbody tr.admin-user-row:active {
  background: rgba(255, 255, 255, 0.1);
}
/* User card modal — как KPI/стекло ЛK, не тёмный opaque */
body.admin-body .admin-modal-overlay {
  background: rgba(6, 8, 14, 0.42);
  backdrop-filter: blur(var(--ui-blur)) saturate(1.08);
  -webkit-backdrop-filter: blur(var(--ui-blur)) saturate(1.08);
}
body.admin-body .admin-modal.glass {
  background: rgba(255, 255, 255, calc(var(--ui-glass-alpha) + 0.028));
  border-color: rgba(255, 255, 255, calc(var(--ui-glass-border-a) + 0.04));
  backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  -webkit-backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  box-shadow: var(--shadow-2), inset 0 0.5px 0 rgba(255, 255, 255, 0.14);
}
body.admin-body .admin-modal-scroll {
  font-size: calc(var(--ui-font-size) * 1);
  padding: 14px 16px 16px;
}
body.admin-body .admin-modal-head {
  padding: 16px 18px 12px;
  border-bottom-color: rgba(255, 255, 255, calc(var(--ui-glass-border-a) + 0.02));
}
body.admin-body .admin-modal-head h3 {
  font-size: calc(var(--ui-font-size) * 1.15);
  font-weight: 700;
}
body.admin-body .admin-modal-side {
  background: rgba(255, 255, 255, calc(var(--ui-glass-alpha) + 0.012));
  border-left-color: rgba(255, 255, 255, calc(var(--ui-glass-border-a) + 0.02));
  backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset)) brightness(var(--ui-brightness-inset));
  -webkit-backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset)) brightness(var(--ui-brightness-inset));
}
body.admin-body .admin-modal-side .glass-inset,
body.admin-body .admin-modal-side .admin-modal-manage {
  background: rgba(255, 255, 255, calc(var(--ui-glass-alpha) + 0.02));
  border: 0.5px solid rgba(255, 255, 255, var(--ui-glass-border-a));
  backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset)) brightness(var(--ui-brightness-inset));
  -webkit-backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset)) brightness(var(--ui-brightness-inset));
}
body.admin-body .admin-user-panel {
  background: rgba(255, 255, 255, calc(var(--ui-glass-alpha) + 0.014));
  border: 0.5px solid rgba(255, 255, 255, var(--ui-glass-border-a));
  backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset)) brightness(var(--ui-brightness-inset));
  -webkit-backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset)) brightness(var(--ui-brightness-inset));
}
body.admin-body .admin-user-section-title {
  color: var(--text-secondary);
  font-size: 0.88em;
}
body.admin-body .admin-user-stat,
body.admin-body .admin-user-stat.admin-user-stat-compact {
  background: rgba(255, 255, 255, calc(var(--ui-glass-alpha) + 0.022));
  border: 0.5px solid rgba(255, 255, 255, calc(var(--ui-glass-border-a) + 0.04));
  backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
  -webkit-backdrop-filter: blur(var(--ui-blur)) saturate(var(--ui-saturate)) brightness(var(--ui-brightness));
}
body.admin-body .admin-user-stat .lbl,
body.admin-body .admin-user-stat-compact .lbl {
  color: var(--text-secondary);
  font-size: 0.85em;
}
body.admin-body .admin-user-stat .val,
body.admin-body .admin-user-stat-compact .val {
  color: var(--text);
  font-size: 1.05em;
  font-weight: 600;
}
body.admin-body .admin-user-table-box {
  background: rgba(255, 255, 255, calc(var(--ui-glass-alpha) + 0.016));
  border-color: rgba(255, 255, 255, var(--ui-glass-border-a));
  backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset)) brightness(var(--ui-brightness-inset));
  -webkit-backdrop-filter: blur(var(--ui-blur-inset)) saturate(var(--ui-saturate-inset)) brightness(var(--ui-brightness-inset));
}
body.admin-body .admin-user-table-box .admin-user-section-title {
  background: transparent;
  backdrop-filter: none;
}
body.admin-body .admin-user-table-box .admin-inner-table {
  font-size: 0.92em;
}
body.admin-body .admin-user-status-lg {
  max-width: none;
  margin-bottom: 10px;
}

.admin-theme-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 12px;
  align-items: start;
}
.admin-theme-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-theme-row {
  display: grid;
  grid-template-columns: 120px 1fr 44px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.admin-theme-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.admin-theme-row output {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 11px;
  color: var(--text-tertiary);
}
.admin-theme-presets-lbl {
  align-self: center;
  margin-right: 2px;
}
.admin-bg-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}
.admin-bg-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: left;
  color: var(--text-secondary);
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.admin-bg-tile:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.admin-bg-tile.active {
  border-color: rgba(10, 132, 255, 0.65);
  box-shadow: 0 0 0 1px rgba(10, 132, 255, 0.35);
}
.admin-bg-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
}
.admin-bg-lbl {
  font-size: 11px;
  line-height: 1.3;
  padding: 0 2px 2px;
}
@media (max-width: 720px) {
  .admin-bg-picker {
    grid-template-columns: 1fr;
  }
}

#adminAppearancePage.admin-page {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
#adminAppearancePage.admin-page.active {
  display: flex;
}

.admin-theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  align-items: center;
}

.admin-theme-preview {
  display: grid;
  gap: 8px;
}
.admin-theme-preview .glass {
  padding: 12px 14px;
}
.admin-theme-preview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-theme-preview-metrics .metric-card {
  padding: 10px 12px;
  border-radius: var(--radius-lg);
}
@media (max-width: 900px) {
  .admin-theme-grid {
    grid-template-columns: 1fr;
  }
}

