:root {
  color-scheme: dark;
  --page-shell-padding: 16px;
  --topbar-height: 88px;
  --board-panel-x-padding: 18px;
  --content-edge-inset: calc(var(--page-shell-padding) + var(--board-panel-x-padding));
  --home-shift-x: 8px;
  --shifted-content-edge-inset: calc(var(--content-edge-inset) + var(--home-shift-x));
  --bg: radial-gradient(circle at top, #25313d 0%, #11161c 38%, #090b0f 100%);
  --panel: rgba(18, 24, 31, 0.72);
  --panel-strong: rgba(14, 19, 26, 0.82);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line-soft: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --line-green: rgba(137, 185, 151, 0.22);
  --text: #f5f7fb;
  --muted: #95a2b3;
  --muted-strong: #d7dee8;
  --red: #b23a2c;
  --yellow: #bda632;
  --green: #469a19;
  --purple: #6b41b1;
  --nav-shell: rgba(255, 255, 255, 0.78);
  --nav-chip: rgba(255, 255, 255, 0.66);
  --nav-chip-active: rgba(255, 255, 255, 0.96);
  --nav-text: #0d1420;
  --control-shell: rgba(255, 255, 255, 0.08);
  --control-chip: rgba(255, 255, 255, 0.06);
  --control-chip-active: rgba(255, 255, 255, 0.18);
  --control-text: var(--text);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.18);
  --backdrop-saturate: 180%;
  --scrollbar-thumb: rgba(255, 255, 255, 0.22);
  --scrollbar-track: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: radial-gradient(circle at top, #eef4ff 0%, #dde7f3 38%, #ced7e2 100%);
  --panel: rgba(255, 255, 255, 0.68);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --panel-soft: rgba(19, 31, 52, 0.035);
  --line-soft: rgba(23, 37, 60, 0.11);
  --line-strong: rgba(23, 37, 60, 0.16);
  --line-green: rgba(115, 160, 127, 0.24);
  --text: #132033;
  --muted: #607188;
  --muted-strong: #314155;
  --nav-shell: rgba(255, 255, 255, 0.84);
  --nav-chip: rgba(255, 255, 255, 0.74);
  --nav-chip-active: rgba(255, 255, 255, 0.98);
  --nav-text: #132033;
  --control-shell: rgba(255, 255, 255, 0.58);
  --control-chip: rgba(255, 255, 255, 0.34);
  --control-chip-active: rgba(255, 255, 255, 0.9);
  --control-text: #132033;
  --shadow: 0 24px 60px rgba(50, 73, 101, 0.18);
  --shadow-soft: 0 10px 24px rgba(50, 73, 101, 0.14);
  --scrollbar-thumb: rgba(19, 32, 51, 0.24);
  --scrollbar-track: rgba(19, 32, 51, 0.05);
}

html.theme-booting *,
html.theme-booting *::before,
html.theme-booting *::after {
  transition: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  color: var(--text);
  font-family: "SF Pro Display", "SF Pro Text", "Segoe UI", Inter, sans-serif;
  background: var(--bg);
  transition: background 220ms ease, color 220ms ease;
}

body.route-home {
  height: 100vh;
  overflow: hidden;
}

body.route-signal {
  overflow-y: auto;
  overflow-x: hidden;
}

body.route-statistics {
  overflow: auto;
}

body.route-backtest {
  overflow: auto;
}

body.route-profile {
  overflow: hidden;
}

body.route-risks {
  height: 100vh;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.route-risks::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body.route-confirm {
  overflow: auto;
}

body.signal-bootstrap-pending #appMain {
  visibility: hidden;
}

button,
a,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  min-height: 100vh;
  padding: var(--page-shell-padding);
  padding-top: calc(var(--page-shell-padding) + var(--topbar-height));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  overflow-x: hidden;
  position: relative;
}

.route-loader {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 180ms ease;
}

.route-loader.visible {
  opacity: 1;
}

.route-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 14, 0.18);
}

.route-loader-panel {
  position: relative;
  min-width: 196px;
  height: 52px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(18, 24, 31, 0.68);
  backdrop-filter: blur(26px) saturate(var(--backdrop-saturate));
  -webkit-backdrop-filter: blur(26px) saturate(var(--backdrop-saturate));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

html[data-theme="light"] .route-loader-panel {
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 36px rgba(50, 73, 101, 0.16);
}

.route-loader-spinner {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: -11px;
}

.route-loader-spinner span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 5px;
  border-radius: 999px;
  background: var(--muted-strong);
  transform-origin: center 8px;
  opacity: 0.16;
  animation: macLoaderFade 1s linear infinite;
}

.route-loader-spinner span:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg) translateY(-6px); animation-delay: -0.916s; }
.route-loader-spinner span:nth-child(2) { transform: translate(-50%, -50%) rotate(30deg) translateY(-6px); animation-delay: -0.833s; }
.route-loader-spinner span:nth-child(3) { transform: translate(-50%, -50%) rotate(60deg) translateY(-6px); animation-delay: -0.75s; }
.route-loader-spinner span:nth-child(4) { transform: translate(-50%, -50%) rotate(90deg) translateY(-6px); animation-delay: -0.666s; }
.route-loader-spinner span:nth-child(5) { transform: translate(-50%, -50%) rotate(120deg) translateY(-6px); animation-delay: -0.583s; }
.route-loader-spinner span:nth-child(6) { transform: translate(-50%, -50%) rotate(150deg) translateY(-6px); animation-delay: -0.5s; }
.route-loader-spinner span:nth-child(7) { transform: translate(-50%, -50%) rotate(180deg) translateY(-6px); animation-delay: -0.416s; }
.route-loader-spinner span:nth-child(8) { transform: translate(-50%, -50%) rotate(210deg) translateY(-6px); animation-delay: -0.333s; }
.route-loader-spinner span:nth-child(9) { transform: translate(-50%, -50%) rotate(240deg) translateY(-6px); animation-delay: -0.25s; }
.route-loader-spinner span:nth-child(10) { transform: translate(-50%, -50%) rotate(270deg) translateY(-6px); animation-delay: -0.166s; }
.route-loader-spinner span:nth-child(11) { transform: translate(-50%, -50%) rotate(300deg) translateY(-6px); animation-delay: -0.083s; }
.route-loader-spinner span:nth-child(12) { transform: translate(-50%, -50%) rotate(330deg) translateY(-6px); animation-delay: 0s; }

.route-loader-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

@keyframes macLoaderFade {
  0% { opacity: 1; }
  100% { opacity: 0.16; }
}

body.route-home .page-shell {
  height: 100vh;
  gap: 9px;
}

body.route-home .brand-block,
body.route-signal .brand-block,
body.route-profile .brand-block,
body.route-confirm .brand-block,
body.route-statistics .brand-block,
body.route-backtest .brand-block,
body.route-auth .brand-block {
  padding-left: calc(var(--board-panel-x-padding) + var(--home-shift-x));
}

body.route-home .topbar-center,
body.route-signal .topbar-center,
body.route-profile .topbar-center,
body.route-confirm .topbar-center,
body.route-statistics .topbar-center,
body.route-backtest .topbar-center,
body.route-auth .topbar-center {
  transform: translateX(calc(-50% + var(--home-shift-x)));
}

body.route-home .topbar-actions,
body.route-signal .topbar-actions,
body.route-profile .topbar-actions,
body.route-confirm .topbar-actions,
body.route-statistics .topbar-actions,
body.route-backtest .topbar-actions,
body.route-auth .topbar-actions {
  right: calc(var(--content-edge-inset) + 4px);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
  padding: var(--page-shell-padding) var(--page-shell-padding) 10px;
  background: linear-gradient(180deg, rgba(12, 16, 22, 0.94), rgba(12, 16, 22, 0.78) 72%, rgba(12, 16, 22, 0));
}

html[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(233, 239, 247, 0.96), rgba(233, 239, 247, 0.82) 72%, rgba(233, 239, 247, 0));
}

.brand-block {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  min-height: 58px;
  width: auto;
  padding-left: var(--board-panel-x-padding);
  justify-self: start;
}

.brand-title {
  display: inline-flex;
  align-items: center;
  gap: 0.36em;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-wordmark-logo {
  display: inline-flex;
  height: 1.76em;
  width: auto;
  aspect-ratio: 99.52 / 233.87;
  color: #0f1218;
  flex: 0 0 auto;
  transform: translateY(0.08em);
}

html[data-theme="light"] .brand-wordmark-logo {
  color: #10151f;
}

.brand-wordmark-logo svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.brand-meta {
  display: none;
}

.topbar-ticker {
  position: fixed;
  top: 29px;
  height: 42px;
  left: 50%;
  right: auto;
  width: clamp(420px, 38vw, 820px);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--control-shell);
  backdrop-filter: blur(22px) saturate(var(--backdrop-saturate));
  -webkit-backdrop-filter: blur(22px) saturate(var(--backdrop-saturate));
  box-shadow: var(--shadow-soft);
  padding: 0 16px;
  z-index: 32;
  transform: translateX(-50%);
  opacity: 1;
  pointer-events: auto;
  --ticker-runway: 852px;
}

.topbar-ticker-track {
  position: absolute;
  left: 100%;
  top: 50%;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: topbarTickerScroll 18s linear infinite;
  transform: translateY(-50%);
}

.topbar-ticker-item {
  color: var(--control-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

@keyframes topbarTickerScroll {
  from {
    transform: translate(0, -50%);
  }
  to {
    transform: translate(calc(-100% - var(--ticker-runway, 320px)), -50%);
  }
}

.topbar-center {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 40;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  pointer-events: auto;
  padding-top: 18px;
}

.topbar-actions {
  position: fixed;
  top: 29px;
  right: var(--content-edge-inset);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.session-menu[hidden] {
  display: none;
}

.session-menu {
  position: relative;
  display: inline-flex;
}

.session-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 178px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--control-shell);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 50;
}

.session-menu:hover .session-dropdown,
.session-menu:focus-within .session-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.session-dropdown-item {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.session-dropdown-item:hover {
  background: rgba(132, 204, 22, 0.18);
}

.session-dropdown-danger:hover {
  background: rgba(220, 38, 38, 0.2);
}

.profile-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 36px;
  border: 1px solid var(--line-soft);
  background: var(--control-shell);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(20px) saturate(var(--backdrop-saturate));
  -webkit-backdrop-filter: blur(20px) saturate(var(--backdrop-saturate));
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.profile-button:hover {
  transform: translateY(-1px);
}

.profile-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.nav-drawer {
  position: relative;
  display: flex;
  justify-content: center;
}

.topbar-center {
  display: none;
}

body.role-admin .topbar-center {
  display: block;
}

.main-nav {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--nav-shell);
  backdrop-filter: blur(22px) saturate(var(--backdrop-saturate));
  -webkit-backdrop-filter: blur(22px) saturate(var(--backdrop-saturate));
  box-shadow: var(--shadow);
  transform: translateY(calc(-100% - 18px));
  opacity: 0.02;
  transition: transform 240ms ease, opacity 200ms ease;
  pointer-events: none;
}

.topbar-center:hover .main-nav,
.topbar-center:focus-within .main-nav {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.nav-link {
  border: 0;
  background: var(--nav-chip);
  color: var(--nav-text);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.nav-link.active {
  color: var(--nav-text);
  background: var(--nav-chip-active);
  box-shadow: inset 0 0 0 1px rgba(19, 32, 51, 0.22), 0 8px 18px rgba(255, 255, 255, 0.18);
}

.nav-link:disabled {
  cursor: default;
  opacity: 0.7;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--control-shell);
  backdrop-filter: blur(22px) saturate(var(--backdrop-saturate));
  -webkit-backdrop-filter: blur(22px) saturate(var(--backdrop-saturate));
  box-shadow: var(--shadow-soft);
}

.theme-option {
  min-width: 66px;
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  background: transparent;
  color: var(--control-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease, color 180ms ease;
}

.theme-option.active,
html[data-theme="light"] .theme-option[data-theme-mode="light"],
html[data-theme="dark"] .theme-option[data-theme-mode="dark"] {
  background: var(--control-chip-active);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.theme-option:hover,
.nav-link:hover,
.social-link:hover {
  transform: translateY(-1px);
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 36px;
  border: 1px solid var(--line-soft);
  background: var(--control-shell);
  color: var(--text);
  backdrop-filter: blur(20px) saturate(var(--backdrop-saturate));
  -webkit-backdrop-filter: blur(20px) saturate(var(--backdrop-saturate));
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#appMain {
  min-height: 0;
  display: grid;
  height: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.panel {
  border: 1px solid var(--line-green);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px) saturate(var(--backdrop-saturate));
  box-shadow: var(--shadow);
}

.auth-shell {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  padding: 48px 0 24px;
}

.profile-shell {
  min-height: calc(100vh - var(--topbar-height) - (var(--page-shell-padding) * 2));
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 0 calc(var(--content-edge-inset) + 4px) 20px calc(var(--content-edge-inset) + var(--home-shift-x));
  box-sizing: border-box;
  overflow: hidden auto;
}

.confirm-shell {
  min-height: calc(100vh - var(--topbar-height) - (var(--page-shell-padding) * 2));
  display: grid;
  place-items: start center;
  padding: 20px var(--content-edge-inset) 40px;
}

.confirm-card {
  width: min(760px, 100%);
  border-radius: 28px;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at top right, rgba(255, 177, 94, 0.18), transparent 38%),
    linear-gradient(180deg, var(--panel-strong), rgba(11, 16, 22, 0.88));
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 20px;
}

.confirm-header {
  display: grid;
  gap: 10px;
}

.confirm-badge {
  justify-self: start;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confirm-badge-green {
  background: rgba(70, 154, 25, 0.18);
  color: #baf28d;
}

.confirm-badge-yellow {
  background: rgba(189, 166, 50, 0.18);
  color: #f1df7d;
}

.confirm-badge-red {
  background: rgba(178, 58, 44, 0.18);
  color: #ffb2a7;
}

.confirm-title {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.confirm-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.confirm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.confirm-metric {
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.confirm-metric-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confirm-metric-value {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.confirm-meta {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 13px;
}

.confirm-telegram-card,
.intent-delivery-drawer {
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.confirm-telegram-grid,
.intent-delivery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.confirm-telegram-error,
.intent-delivery-error {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(178, 58, 44, 0.12);
  color: #ffb8ad;
  display: grid;
  gap: 6px;
}

.intent-delivery-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.intent-delivery-drawer summary::-webkit-details-marker {
  display: none;
}

.intent-delivery-item {
  display: grid;
  gap: 6px;
}

.intent-delivery-value {
  color: var(--muted-strong);
  font-size: 13px;
  word-break: break-word;
}

.intent-delivery-drawer-compact {
  padding: 10px 12px;
  gap: 10px;
}

.intent-delivery-drawer-compact summary {
  font-size: 12px;
}

.intent-audit-block {
  display: grid;
  gap: 10px;
}

.intent-audit-export-link {
  justify-self: start;
  color: #d9f99d;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.intent-audit-timeline {
  display: grid;
  gap: 10px;
}

.intent-audit-section {
  display: grid;
  gap: 10px;
}

.intent-audit-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.intent-audit-section-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.intent-audit-section-head-toggle {
  cursor: pointer;
  list-style: none;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  align-items: center;
}

.intent-audit-section-head-toggle::-webkit-details-marker {
  display: none;
}

.intent-audit-section-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intent-audit-section-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.intent-audit-section-toggle-meta {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intent-audit-section-list {
  display: grid;
  gap: 10px;
}

.intent-audit-row {
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 8px;
}

.intent-audit-row-milestone {
  border-color: rgba(212, 165, 116, 0.28);
  background:
    linear-gradient(180deg, rgba(212, 165, 116, 0.12), rgba(212, 165, 116, 0.03)),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.intent-audit-rail {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.intent-audit-rail-milestone {
  background: linear-gradient(180deg, #f2c078 0%, #b98638 100%);
}

.intent-audit-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.intent-audit-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.intent-audit-fact {
  display: grid;
  gap: 4px;
}

.intent-audit-fact-value {
  color: var(--muted-strong);
  font-size: 13px;
  word-break: break-word;
}

.intent-audit-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.intent-audit-event {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.intent-audit-category {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intent-audit-category-milestone {
  color: #f2c078;
}

.intent-audit-payload summary {
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.intent-audit-payload pre {
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.intent-audit-empty,
.intent-audit-error {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
}

.intent-audit-empty {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.intent-audit-error {
  background: rgba(178, 58, 44, 0.12);
  color: #ffb8ad;
}

.confirm-payload {
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.confirm-payload summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.confirm-payload pre {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.confirm-form {
  display: grid;
  gap: 14px;
}

.confirm-field {
  display: grid;
  gap: 8px;
}

.confirm-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.confirm-field input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  outline: none;
}

.confirm-actions {
  display: flex;
  gap: 12px;
}

.confirm-primary,
.confirm-secondary,
.confirm-link-button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
}

.confirm-primary {
  background: linear-gradient(135deg, #f2a75c, #d96b3b);
  color: #140d08;
  box-shadow: 0 14px 32px rgba(217, 107, 59, 0.28);
}

.confirm-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.confirm-link-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 14px;
}

.confirm-primary:disabled,
.confirm-secondary:disabled {
  opacity: 0.55;
  cursor: default;
}

.confirm-error {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(178, 58, 44, 0.16);
  color: #ffb8ad;
  font-size: 13px;
  font-weight: 700;
}

.confirm-execution-note,
.confirm-locked-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(70, 154, 25, 0.12);
  color: var(--muted-strong);
}

.profile-exchange-list {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.profile-section {
  width: min(1180px, 100%);
  display: grid;
  gap: 14px;
}

.profile-keys-section,
.profile-risk-section,
.profile-intents-section,
.profile-security-section,
.profile-security-overview-section,
.profile-keys-section .profile-exchange-list {
  width: 100%;
}

.profile-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.profile-section-title {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.profile-risk-section {
  align-content: start;
  gap: 14px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--line-soft);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--shadow);
}

.profile-security-section,
.profile-security-overview-section {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(132, 204, 22, 0.18);
  background:
    radial-gradient(circle at top right, rgba(132, 204, 22, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(16, 28, 16, 0.94), rgba(13, 14, 18, 0.9));
  box-shadow: var(--shadow);
}

.profile-security-overview-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  border-color: rgba(94, 234, 212, 0.2);
  background:
    radial-gradient(circle at top right, rgba(94, 234, 212, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(10, 26, 27, 0.95), rgba(13, 14, 18, 0.9));
}

.profile-security-overview-section > .profile-section-head,
.profile-security-overview-section > .profile-intent-error-banner,
.profile-security-overview-section > .profile-security-grid,
.profile-security-overview-section > .profile-exchange-audit-drawer {
  grid-column: 1 / -1;
}

.profile-security-overview-section .profile-section-title {
  margin: 0;
  line-height: 1;
}

.profile-telegram-link-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(94, 234, 212, 0.18);
  border-radius: 20px;
  background: rgba(4, 14, 18, 0.52);
}

.profile-exchange-keys-panel {
  grid-column: 1 / -1;
  width: 100%;
}

.profile-exchange-keys-panel .profile-exchange-list {
  width: 100%;
}

.profile-telegram-bind-panel {
  width: 100%;
  justify-self: start;
}

.profile-telegram-bind-panel .profile-security-grid,
.profile-totp-panel .profile-security-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-telegram-bind-panel .profile-risk-card,
.profile-totp-panel .profile-risk-card {
  min-height: auto;
  padding: 14px;
  align-content: start;
}

.profile-telegram-bind-panel .profile-risk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: auto;
}

.profile-telegram-bind-panel .profile-risk-save,
.profile-totp-panel .profile-risk-save {
  width: 100%;
  padding: 14px;
}

.profile-totp-compact-wrap {
  width: 100%;
}

.profile-totp-compact-card {
  width: 100%;
}

.profile-security-setup-compact {
  gap: 10px;
}

.profile-totp-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 2px;
}

.profile-totp-qr-image {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #fff;
  padding: 10px;
  box-sizing: border-box;
}

.profile-telegram-status-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.04);
}

.profile-telegram-status-dot-red {
  background: #b23a2c;
}

.profile-telegram-status-dot-green {
  background: #469a19;
}

.profile-risk-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.profile-risk-grid-admin,
.profile-risk-grid-personal {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.profile-security-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-risk-card {
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  min-height: 78px;
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  align-content: center;
  gap: 8px;
}

.profile-risk-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-risk-card strong {
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.03em;
}

.profile-risk-card .stats-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 42px 6px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.profile-risk-card .stats-input::-webkit-outer-spin-button,
.profile-risk-card .stats-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.profile-risk-card .stats-input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.admin-stats-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.admin-stats-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.76);
  backdrop-filter: blur(8px);
}

.admin-stats-panel {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 48px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  border-radius: 28px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(14, 22, 34, 0.98), rgba(9, 15, 24, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.admin-stats-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.admin-stats-panel-body {
  overflow: auto;
  padding: 18px 22px 24px;
}

.admin-stats-panel .stats-page {
  padding: 0;
}

.admin-stats-panel .stats-page-embedded {
  gap: 18px;
}

.admin-stats-launch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
}

.profile-risk-unit-input {
  position: relative;
  display: block;
  min-width: 0;
}

.profile-risk-unit-input span {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  color: rgba(255, 212, 164, 0.82);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-transform: uppercase;
}

.profile-risk-save-cell {
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 78px;
  align-content: stretch;
}

.profile-risk-save-card {
  width: 100%;
  height: 100%;
  min-height: 78px;
  border-radius: 16px;
  padding: 0;
  display: grid;
  place-items: center;
}

.profile-risk-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-risk-form {
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-risk-form-title {
  grid-column: 1 / -1;
  color: #ffd4a4;
  font-size: 13px;
  font-weight: 900;
}

.profile-risk-save,
.profile-risk-clear {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.profile-risk-save {
  background: linear-gradient(135deg, #f2a75c, #d96b3b);
  color: #140d08;
}

.profile-risk-clear {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.profile-risk-save:disabled,
.profile-risk-clear:disabled {
  opacity: 0.5;
  cursor: default;
}

.profile-session-item {
  gap: 8px;
}

.profile-session-revoke-button {
  justify-self: start;
  padding: 8px 12px;
}

.profile-risk-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-security-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: auto;
}

.profile-security-setup,
.profile-recovery-codes {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.28);
}

.profile-security-uri,
.profile-security-secret {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.5);
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.profile-security-secret {
  color: var(--text);
}

.profile-recovery-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.profile-recovery-code-grid code {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(132, 204, 22, 0.12);
  color: #d9f99d;
  letter-spacing: 0.08em;
}

.profile-exchange-card {
  border-radius: 12px;
  padding: 8px 9px;
  background: linear-gradient(180deg, var(--exchange-card-bg-start), var(--exchange-card-bg-end));
  box-shadow: inset 0 0 0 1px var(--exchange-card-line);
}

.profile-exchange-card-red {
  --exchange-card-bg-start: rgba(178, 58, 44, 0.24);
  --exchange-card-bg-end: rgba(118, 30, 24, 0.18);
  --exchange-card-line: rgba(255, 128, 112, 0.18);
  --exchange-card-accent: #ffb2a7;
  --exchange-card-label: rgba(255, 200, 196, 0.92);
  --exchange-card-input-line: rgba(255, 150, 136, 0.2);
}

.profile-exchange-card-yellow {
  --exchange-card-bg-start: rgba(255, 153, 61, 0.24);
  --exchange-card-bg-end: rgba(255, 116, 31, 0.18);
  --exchange-card-line: rgba(255, 170, 86, 0.16);
  --exchange-card-accent: #ffb15e;
  --exchange-card-label: rgba(255, 208, 162, 0.92);
  --exchange-card-input-line: rgba(255, 190, 126, 0.18);
}

.profile-exchange-card-green {
  --exchange-card-bg-start: rgba(70, 154, 25, 0.24);
  --exchange-card-bg-end: rgba(42, 112, 20, 0.18);
  --exchange-card-line: rgba(132, 204, 22, 0.2);
  --exchange-card-accent: #baf28d;
  --exchange-card-label: rgba(214, 255, 184, 0.9);
  --exchange-card-input-line: rgba(132, 204, 22, 0.2);
}

.profile-exchange-title {
  color: var(--exchange-card-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  min-height: 22px;
  display: flex;
  align-items: center;
}

.profile-exchange-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
}

.profile-exchange-card-compact {
  min-height: 38px;
  padding: 8px 10px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.profile-exchange-card-compact:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px var(--exchange-card-line), 0 10px 30px rgba(0, 0, 0, 0.18);
}

.profile-exchange-state-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.profile-exchange-state-dot-red {
  background: #ff8f86;
}

.profile-exchange-state-dot-yellow {
  background: #ffbf66;
}

.profile-exchange-state-dot-green {
  background: #8fe16b;
}

.profile-exchange-input-compact {
  min-height: 22px;
  padding: 2px 58px 2px 7px;
  background: rgba(12, 10, 7, 0.34);
  font-size: 10px;
}

.profile-exchange-input-wrap {
  position: relative;
}

.profile-exchange-input-inline {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-exchange-input-hint {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  color: var(--exchange-card-label);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
  white-space: nowrap;
}

.profile-exchange-input-inline-spacer {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 22px;
}

.profile-exchange-field {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.profile-exchange-field span {
  color: var(--exchange-card-label);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.profile-exchange-input {
  width: 100%;
  border: 1px solid var(--exchange-card-input-line);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(12, 10, 7, 0.24);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  outline: none;
  box-sizing: border-box;
}

.profile-exchange-save {
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 177, 94, 0.16);
  color: #ffd4a4;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.profile-exchange-validate {
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.profile-exchange-attest {
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(70, 154, 25, 0.16);
  color: #cbe9b5;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.profile-exchange-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.profile-exchange-validation {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.profile-exchange-attestation-note {
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(70, 154, 25, 0.12);
  color: #cbe9b5;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 700;
}

.profile-exchange-validation-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.profile-exchange-validation-pill {
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 223, 193, 0.92);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.profile-exchange-validation-warnings {
  display: grid;
  gap: 4px;
}

.profile-exchange-validation-warning,
.profile-exchange-validation-error {
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 10px;
  line-height: 1.4;
}

.profile-exchange-validation-warning {
  background: rgba(255, 198, 120, 0.12);
  color: #ffd8a7;
}

.profile-exchange-validation-error {
  background: rgba(178, 58, 44, 0.16);
  color: #ffb8ad;
}

.profile-exchange-audit-drawer {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.profile-exchange-audit-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 10px;
  font-weight: 800;
  color: var(--text);
}

.profile-exchange-audit-drawer summary::-webkit-details-marker {
  display: none;
}

.profile-exchange-audit-summary {
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 700;
}

.profile-exchange-audit-list {
  display: grid;
  gap: 6px;
}

.profile-exchange-audit-item {
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 4px;
}

.profile-exchange-audit-time {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.profile-exchange-audit-event {
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
}

.profile-exchange-audit-payload summary {
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 700;
}

.profile-exchange-audit-payload pre {
  margin: 6px 0 0;
  color: var(--muted-strong);
  font-size: 9px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-exchange-audit-empty {
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10px;
}

.profile-logout-button {
  width: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  justify-self: center;
}

.profile-intents-section {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line-soft);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--shadow);
}

.profile-intents-section .profile-section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
}

.profile-intents-section .profile-section-title {
  margin: 0;
}

body.route-risks .profile-shell {
  height: calc(100vh - var(--topbar-height) - (var(--page-shell-padding) * 2));
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

body.route-risks .profile-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body.route-risks .page-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

body.route-risks #appMain {
  overflow: hidden;
}

body.route-risks .profile-intents-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.profile-intents-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1.25fr) minmax(160px, 0.9fr) minmax(160px, 0.9fr) minmax(108px, 0.45fr);
  align-items: end;
  justify-content: stretch;
  gap: 12px;
  min-width: 0;
}

.profile-intents-toolbar > .stats-control {
  min-width: 0;
}

.profile-intent-search-control {
  min-width: 0;
}

.profile-intent-reset-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.profile-intents-toolbar .stats-input,
.profile-intents-toolbar .stats-select {
  border-radius: 999px;
}

.profile-intent-reset-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.profile-intent-header {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(110px, 0.6fr) minmax(132px, 0.7fr) minmax(170px, 0.9fr) auto;
  gap: 12px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-intent-header-sort {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-intent-header-sort.is-active {
  color: var(--text);
}

.profile-intents-list {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.profile-intents-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.profile-intent-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(110px, 0.6fr) minmax(132px, 0.7fr) minmax(170px, 0.9fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
}

.profile-intent-main,
.profile-intent-delivery {
  display: grid;
  gap: 4px;
}

.profile-intent-symbol {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-intent-venues,
.profile-intent-time,
.profile-intent-delivery {
  color: var(--muted);
  font-size: 12px;
}

.profile-intent-ttl {
  font-size: 11px;
  font-weight: 800;
}

.profile-intent-ttl-green {
  color: #baf28d;
}

.profile-intent-ttl-yellow {
  color: #f1df7d;
}

.profile-intent-ttl-red {
  color: #ffb2a7;
}

.profile-intent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-intent-size {
  font-weight: 800;
}

.profile-intent-delivery-error {
  color: #ffb8ad;
}

.profile-intent-open {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255, 177, 94, 0.16);
  color: #ffd4a4;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.profile-intent-approve {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f2a75c, #d96b3b);
  color: #140d08;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.profile-intent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-intent-reject,
.profile-intent-page-button {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.profile-intent-reject:disabled,
.profile-intent-page-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.profile-intent-error-banner {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(178, 58, 44, 0.14);
  color: #ffb8ad;
  font-size: 13px;
  font-weight: 700;
}

.profile-intents-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px dashed var(--line-soft);
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.profile-intents-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.terminal-intent-cta {
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 177, 94, 0.2);
  background: linear-gradient(180deg, rgba(255, 177, 94, 0.1), rgba(255, 255, 255, 0.03));
  padding: 16px;
  display: grid;
  gap: 12px;
}

.terminal-intent-cta-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.terminal-intent-cta-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.terminal-intent-cta-meta {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 13px;
}

.terminal-intent-cta-link {
  color: var(--text);
  word-break: break-all;
}

.terminal-intent-cta-error {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(178, 58, 44, 0.12);
  color: #ffb8ad;
  font-size: 13px;
}

.terminal-intent-cta-actions {
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .profile-exchange-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-intents-section .profile-section-head,
  .profile-intents-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-intent-header,
  .profile-intent-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .profile-risk-grid,
  .profile-security-grid,
  .profile-risk-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-security-overview-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-telegram-bind-panel {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .confirm-card {
    padding: 22px;
  }

  .confirm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .confirm-shell {
    padding-inline: 0;
  }

  .confirm-card {
    border-radius: 22px;
    padding: 18px;
  }

  .confirm-grid,
  .confirm-telegram-grid,
  .intent-delivery-grid,
    .intent-audit-facts,
    .profile-risk-grid,
    .profile-security-grid,
    .profile-security-actions,
    .profile-recovery-code-grid,
    .profile-risk-admin-grid,
    .profile-risk-form,
    .profile-intent-header,
    .profile-intent-row {
      grid-template-columns: minmax(0, 1fr);
    }

  .confirm-actions,
  .confirm-execution-note,
  .confirm-locked-note,
  .terminal-intent-cta-head,
  .profile-section-head,
  .profile-intents-toolbar,
  .terminal-intent-cta-actions,
  .profile-intents-pagination,
  .profile-intent-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-exchange-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-risk-actions {
    flex-direction: column;
  }
}

.auth-card {
  width: min(460px, calc(100vw - 40px));
  padding: 28px;
  margin-inline: auto;
  text-align: center;
}

.auth-title {
  margin: 8px 0 10px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.auth-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
  text-align: left;
}

.auth-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap input {
  padding-right: 52px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 0;
  padding: 4px 6px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: var(--text);
}

html[data-theme="light"] .auth-field input {
  background: rgba(255, 255, 255, 0.55);
}

.auth-submit,
.auth-switch-link,
.auth-google {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.auth-submit {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.auth-switch-link {
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.auth-google {
  background: var(--panel-strong);
  color: var(--muted);
  cursor: not-allowed;
}

.auth-error {
  color: #ff8d8d;
  font-size: 13px;
  font-weight: 700;
}

.auth-note {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.panel-kicker {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.board-panel {
  height: 100%;
  min-height: 0;
  padding: 16px var(--board-panel-x-padding) 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.route-home .board-panel {
  padding-top: 11px;
  padding-left: calc(var(--board-panel-x-padding) + var(--home-shift-x));
}

.board-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 14px;
}

.board-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 10px;
}

.board-legend,
.timeframe-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legend-pill,
.timeframe-pill,
.status-pill,
.action-chip {
  min-width: 68px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.timeframe-pill,
.action-chip {
  background: var(--panel-soft);
  color: var(--muted-strong);
}

.action-chip.active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.action-chip:disabled {
  opacity: 0.55;
  cursor: wait;
}

.timeframe-pill.active {
  background: var(--control-chip-active);
  color: var(--text);
}

.legend-pill.red,
.status-pill.red {
  background: rgba(178, 58, 44, 0.2);
  color: #ffd8d2;
}

.legend-pill.yellow,
.status-pill.yellow {
  background: rgba(189, 166, 50, 0.2);
  color: #fff6cf;
}

.legend-pill.green,
.status-pill.green {
  background: rgba(70, 154, 25, 0.22);
  color: #dbffca;
}

.legend-pill.purple,
.status-pill.purple {
  background: rgba(107, 65, 177, 0.24);
  color: #e3d6ff;
}

.board-legend .legend-pill {
  background: var(--nav-shell);
  color: var(--nav-text);
  border-color: var(--line-strong);
}

.board-mode-pill {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.board-mode-pill.active {
  border-color: rgba(19, 32, 51, 0.22);
  box-shadow: inset 0 0 0 1px rgba(19, 32, 51, 0.22);
}

.board-mode-pill-favorites {
  min-width: 116px;
}

.drop-target-active {
  box-shadow: 0 0 0 2px rgba(96, 157, 255, 0.55), 0 14px 30px rgba(96, 157, 255, 0.18);
  transform: translateY(-1px);
}

.board-summary,
.signal-summary-grid {
  display: grid;
  gap: 10px;
}

.board-summary {
  grid-template-columns: repeat(2, minmax(148px, 1fr));
}

.stat-card,
.metric-card {
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel-strong);
}

.stat-label,
.metric-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value,
.metric-value {
  margin-top: 6px;
  font-size: 23px;
  line-height: 1.1;
  font-weight: 800;
}

.stat-note,
.metric-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
}

.signal-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  grid-auto-rows: 116px;
  gap: 12px;
  align-content: start;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 6px 18px 0;
  scroll-padding-bottom: 18px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  contain: layout paint style;
  will-change: scroll-position;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.signal-board::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.signal-card {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  height: 116px;
  min-height: 0;
  padding: 12px;
  border-radius: 8px;
  border: 0;
  outline: none;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 120ms ease;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 7px;
  align-content: center;
  transform: translateZ(0);
  backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .signal-card {
  color: #11150f;
}

.signal-card:hover {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0, 0, 0, 0.24);
}

.signal-card-dragging {
  opacity: 0.34;
}

.signal-card-drag-ghost {
  position: fixed;
  z-index: 120;
  left: 0;
  top: 0;
  margin: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-2deg) scale(1.03);
  will-change: transform;
  backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 26px rgba(0, 0, 0, 0.24);
}

.favorites-trash-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(18px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  min-width: 112px;
  padding: 10px 14px 12px;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(var(--backdrop-saturate));
  -webkit-backdrop-filter: blur(20px) saturate(var(--backdrop-saturate));
  box-shadow: var(--shadow);
  text-align: center;
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 160ms ease;
}

body.home-drag-active .favorites-trash-dock {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.favorites-trash-icon {
  font-size: 22px;
  line-height: 1;
}

.favorites-trash-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--muted-strong);
}

.signal-card.red {
  background: linear-gradient(180deg, rgba(208, 74, 55, 0.96), rgba(168, 45, 33, 0.92));
}

.signal-card.yellow {
  background: linear-gradient(180deg, rgba(210, 190, 77, 0.96), rgba(168, 144, 40, 0.92));
  color: #11150f;
}

.signal-card.green {
  background: linear-gradient(180deg, rgba(95, 188, 46, 0.96), rgba(59, 139, 22, 0.92));
}

.signal-card.purple {
  background: linear-gradient(180deg, rgba(123, 80, 198, 0.96), rgba(88, 50, 156, 0.92));
}

.signal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.signal-symbol {
  margin: 0;
  max-width: calc(100% - 52px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}

.signal-logo {
  width: 34px;
  height: 34px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  transform: translateX(-10px);
}

.signal-logo-image {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.signal-logo-fallback {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.signal-route {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-metrics {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  align-items: baseline;
  margin-top: 2px;
}

.signal-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.92;
}

.signal-value {
  justify-self: end;
  font-size: 13px;
  font-weight: 900;
}

.signal-page {
  display: grid;
  gap: 14px;
  align-content: start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding-inline: var(--board-panel-x-padding);
}

body.route-signal .signal-page {
  padding-left: calc(var(--board-panel-x-padding) + var(--home-shift-x));
}

.signal-content-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 960px)
    minmax(24px, 32px)
    auto
    minmax(0, 1fr);
  column-gap: 0;
  align-items: start;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
}

.signal-charts-column {
  grid-column: 1;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.signal-depth-sidebar {
  grid-column: 3;
  width: 100%;
  min-width: 0;
  max-width: none;
  display: flex;
  justify-content: center;
  align-self: center;
  overflow: hidden;
}

.signal-hero {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.signal-hero-logo-toggle,
.signal-toggle {
  min-width: 88px;
}

.signal-hero-logo-toggle {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.signal-hero-collapsed {
  padding: 0;
  min-height: 0;
  height: auto;
  display: block;
  width: 100%;
  justify-self: stretch;
}

.signal-hero-collapsed-toggle {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.signal-hero-logo {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.signal-hero-logo-collapsed {
  width: 44px;
  height: 44px;
}

.signal-hero-logo .signal-logo-image,
.signal-hero-logo .signal-logo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.signal-hero-logo .signal-logo-image {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.signal-hero-logo .signal-logo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.signal-hero-inline {
  overflow: visible;
}

.signal-hero-strip {
  display: flex;
  align-items: center;
  gap: 26px;
}

.signal-hero-symbol-block {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.signal-hero-drawer {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  width: auto;
  display: grid;
  gap: 16px;
}

.signal-heading {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  margin: 0;
}

.signal-hero-symbol {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--text);
}

.signal-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.signal-summary-grid-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 34px;
  align-items: center;
}

.signal-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.signal-intent-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f2a75c, #d96b3b);
  color: #170d07;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(217, 107, 59, 0.22);
}

.signal-intent-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.signal-intent-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.signal-intent-error {
  width: 100%;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(178, 58, 44, 0.16);
  color: #ffb8ad;
  font-size: 12px;
  font-weight: 700;
}

.metric-card-inline {
  min-height: 0;
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  width: auto;
  min-width: 0;
}

.metric-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.metric-card-inline .metric-label {
  font-size: 10px;
  line-height: 1;
}

.metric-card-inline .metric-value {
  margin-top: 0;
  font-size: 14px;
  line-height: 1.24;
  white-space: nowrap;
}

.metric-card-inline .metric-note {
  display: none;
}


.chart-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  overflow: hidden;
}

.chart-plain {
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  overflow: hidden;
}

.chart-svg {
  width: 100%;
  height: 280px;
  display: block;
  border: 0;
  background: transparent;
}

.chart-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chart-scroll::-webkit-scrollbar {
  display: none;
}

.signal-chart-frame {
  position: relative;
}

.signal-chart-fixed {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;
  pointer-events: none;
}

.signal-chart-fixed-stack {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.signal-chart-fixed-value {
  color: rgba(255, 255, 255, 0.98);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] .signal-chart-fixed-value {
  color: rgba(21, 28, 39, 0.96);
  text-shadow: none;
}

.signal-chart-fixed-value.is-long {
  color: #f2a14b;
}

.signal-chart-fixed-value.is-short {
  color: #f6d46d;
}

.signal-chart-svg {
  width: 1280px;
  min-width: 1280px;
}

.funding-chart-block {
  display: grid;
  gap: 8px;
}

.depth-panel {
  border: 0;
  background: transparent;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  display: inline-grid;
  gap: 12px;
}

.depth-books {
  display: grid;
  gap: 14px;
}

.depth-book {
  display: grid;
  gap: 10px;
  width: fit-content;
  padding-top: 0;
  border-top: 0;
}

.depth-book-grid {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
  min-height: 520px;
  min-width: 340px;
  width: fit-content;
}

.depth-section {
  display: grid;
  align-content: start;
  gap: 6px;
}

.depth-book:first-child {
  border-top: 0;
  padding-top: 0;
}

.depth-book-title {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.depth-side {
  display: grid;
  gap: 4px;
}

.depth-side-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.depth-side-title-ask {
  color: #ff7f7f;
}

.depth-side-title-bid {
  color: #7fff74;
}

.depth-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 8px;
  overflow: hidden;
}

.depth-row::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--depth-fill, 0%);
  pointer-events: none;
  opacity: 0.34;
}

.depth-row > div {
  position: relative;
  z-index: 1;
}

.depth-row-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.depth-row-ask {
  color: #ffc4c4;
  text-shadow: 0 0 10px rgba(255, 110, 110, 0.16);
}

.depth-row-ask::before {
  background: linear-gradient(90deg, rgba(255, 92, 92, 0.34), rgba(255, 92, 92, 0.12));
}

.depth-row-bid {
  color: #c8ffc2;
  text-shadow: 0 0 10px rgba(111, 255, 137, 0.16);
}

.depth-row-bid::before {
  background: linear-gradient(90deg, rgba(96, 255, 96, 0.34), rgba(96, 255, 96, 0.12));
}

.chart-empty {
  height: 280px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}

.page-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
}

.stats-page {
  display: grid;
  gap: 18px;
  align-content: start;
}

.backtest-live-page {
  display: grid;
  gap: 18px;
  align-content: start;
}

.backtest-live-head {
  display: grid;
}

.backtest-live-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.backtest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.backtest-sidebar,
.sim-panel {
  display: grid;
  gap: 14px;
}

.sim-panel {
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
}

.sim-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.backtest-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.backtest-results-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trade-tape-grid {
  display: grid;
  gap: 14px;
}

.trade-tape {
  display: grid;
  gap: 8px;
}

.trade-tape-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.trade-row {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.trade-row-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 0;
}

.trade-row-buy {
  color: #c8ffc2;
}

.trade-row-sell {
  color: #ffc4c4;
}

.backtest-step-row {
  grid-template-columns: 0.4fr 1.8fr 0.8fr 0.7fr 0.8fr;
}

.stats-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
}

.stats-control {
  display: grid;
  gap: 8px;
}

.stats-input,
.stats-select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  outline: none;
}

.stats-chart-section {
  display: grid;
  gap: 12px;
}

.stats-automation {
  display: grid;
  gap: 18px;
}

.stats-automation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-execution-row {
  grid-template-columns: 0.8fr 0.8fr 1fr 1fr 1fr 1fr 0.9fr;
}

.stats-trend-row {
  grid-template-columns: 0.7fr 0.7fr 1fr 1fr 1fr 0.8fr 1fr 1fr 1fr;
}

.stats-timeframe-row {
  justify-content: flex-end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats-section {
  display: grid;
  gap: 10px;
}

.stats-table {
  display: grid;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-table-row {
  display: grid;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  align-items: center;
  font-size: 12px;
}

.stats-table-row:first-child {
  border-top: 0;
}

.stats-table-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-table-row:not(.stats-table-head) {
  color: var(--text);
  font-weight: 700;
}

.stats-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}

.stats-section:first-of-type .stats-table-row {
  grid-template-columns: 1.4fr 0.8fr 1fr 1fr 1fr 1fr;
}

.stats-section:last-of-type .stats-table-row {
  grid-template-columns: 1.2fr 0.9fr 0.9fr 0.8fr 1fr 1fr 1fr 1fr;
}

.stats-summary-row {
  grid-template-columns: 1.4fr 0.8fr 1fr 1fr 1fr 1fr;
}

.stats-summary-pair-row {
  grid-template-columns: 1.15fr 0.85fr 0.85fr 0.7fr 0.9fr 0.9fr 0.9fr 0.9fr;
}

.stats-actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .topbar-center,
  .topbar-ticker,
  .topbar-actions {
    justify-self: start;
  }

  .topbar-ticker {
    position: static;
    left: auto !important;
    right: auto !important;
    width: 100%;
    transform: none;
    margin-top: 8px;
  }

  .topbar-actions {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
  }

  .topbar-center {
    position: static;
    transform: none;
    pointer-events: auto;
  }

  .nav-drawer {
    padding-top: 0;
  }

  .nav-drawer-handle {
    display: none;
  }

  .main-nav {
    transform: none;
    opacity: 1;
    pointer-events: auto;
    justify-self: start;
  }

  .board-header,
  .chart-head {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .board-summary,
  .signal-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.route-home,
  body.route-signal,
  body.route-statistics {
    height: auto;
    overflow: auto;
  }

  .page-shell {
    min-height: 100vh;
    padding: 12px;
    padding-top: calc(12px + var(--topbar-height));
  }

  .brand-title {
    font-size: 30px;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .theme-switch {
    order: 1;
  }

  .board-panel,
  .signal-hero,
  .chart-panel {
    padding: 14px;
  }

  .signal-page {
    width: 100%;
  }

  .signal-content-grid {
    grid-template-columns: 1fr;
  }

  .signal-charts-column,
  .signal-depth-sidebar {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .chart-plain,
  .chart-panel {
    width: 100%;
  }

  .signal-chart-svg {
    width: 960px;
    min-width: 960px;
  }

  .board-summary,
  .signal-summary-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-controls {
    grid-template-columns: 1fr;
  }

  .backtest-grid,
  .sim-controls,
  .backtest-live-grid,
  .backtest-status-grid,
  .backtest-results-grid,
  .backtest-step-row,
  .trade-row {
    grid-template-columns: 1fr;
  }

  .stats-automation-grid,
  .stats-summary-row,
  .stats-summary-pair-row,
  .stats-execution-row,
  .stats-trend-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-section:first-of-type .stats-table-row,
  .stats-section:last-of-type .stats-table-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 104px;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .signal-card {
    height: 104px;
    padding: 10px;
  }

  .signal-logo {
    width: 32px;
    height: 32px;
  }

  .signal-logo-image {
    width: 28px;
    height: 28px;
  }

  .signal-symbol {
    font-size: 18px;
  }

  .signal-value {
    font-size: 13px;
  }

  .signal-heading {
    font-size: 30px;
  }
}
