: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, #f4f8ff 0%, #e3edf7 42%, #d3deea 100%);
  --panel: rgba(244, 249, 255, 0.9);
  --panel-strong: rgba(251, 253, 255, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.52);
  --light-panel-outer: rgba(218, 228, 240, 0.84);
  --light-panel-inner: #edf4fb;
  --light-button-surface: rgba(236, 242, 248, 0.98);
  --line-soft: rgba(48, 65, 88, 0.2);
  --line-strong: rgba(36, 52, 76, 0.3);
  --line-green: rgba(87, 145, 63, 0.34);
  --text: #101c2e;
  --muted: #5e6f86;
  --muted-strong: #27384e;
  --nav-shell: rgba(249, 252, 255, 0.92);
  --nav-chip: rgba(255, 255, 255, 0.82);
  --nav-chip-active: rgba(255, 255, 255, 0.98);
  --nav-text: #101c2e;
  --control-shell: rgba(248, 251, 255, 0.9);
  --control-chip: rgba(255, 255, 255, 0.72);
  --control-chip-active: rgba(255, 255, 255, 1);
  --control-text: #101c2e;
  --shadow: 0 24px 60px rgba(63, 84, 113, 0.2);
  --shadow-soft: 0 10px 24px rgba(63, 84, 113, 0.16);
  --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;
}

html[data-theme="light"] body.route-risks {
  background: linear-gradient(180deg, #edf4fb 0%, #dbe7f2 100%);
}

html[data-theme="light"] body.route-security {
  background: linear-gradient(180deg, #edf4fb 0%, #dbe7f2 100%);
}

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);
}

html[data-theme="light"] .route-loader::before {
  background: transparent;
}

.route-loader-panel {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.route-loader-spinner {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

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

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

@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);
}

body.route-risks .topbar-actions,
body.route-security .topbar-actions {
  right: calc(var(--page-shell-padding) + var(--board-panel-x-padding));
}

.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;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.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;
}

.topbar-ticker-error {
  border-color: rgba(255, 118, 104, 0.42);
  background: linear-gradient(135deg, rgba(118, 30, 24, 0.32), rgba(42, 16, 14, 0.18)), var(--control-shell);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px rgba(255, 118, 104, 0.08);
}

.topbar-ticker-error .topbar-ticker-item {
  color: #ffd1cb;
}

.auth-error,
.confirm-error,
.intent-audit-error,
.intent-delivery-error,
.profile-intent-error-banner,
.profile-exchange-compact-error,
.profile-exchange-validation-error,
.profile-intent-delivery-error,
.terminal-intent-cta-error,
.terminal-action-error,
.signal-intent-error,
.signal-execution-action-error {
  display: none !important;
}

@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: rgb(28, 34, 43);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: none;
  pointer-events: none;
  transition: none;
  z-index: 50;
}

html[data-theme="light"] .session-dropdown {
  background: rgb(232, 238, 246);
}

.session-menu.is-open .session-dropdown {
  opacity: 1;
  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 {
  width: min(640px, 100%);
  justify-self: start;
  align-content: start;
  gap: 14px;
  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-risk-section .profile-section-head {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.profile-security-section,
.profile-security-overview-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-security-overview-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.profile-security-overview-section > .profile-section-head,
.profile-security-overview-section > .profile-intent-error-banner,
.profile-security-overview-section > .profile-intent-notice-banner,
.profile-security-overview-section > .profile-security-grid,
.profile-security-overview-section > .profile-account-panels,
.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: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.profile-exchange-keys-panel {
  grid-column: 1 / -1;
  width: 100%;
  gap: 14px;
  padding: 20px;
  align-self: stretch;
  min-height: 0;
}

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

.profile-telegram-bind-panel {
  width: 100%;
  justify-self: start;
  gap: 14px;
  padding: 20px;
}

.profile-totp-panel {
  width: 100%;
  justify-self: start;
  gap: 14px;
  padding: 20px;
}

.profile-telegram-bind-panel .profile-section-head,
.profile-totp-panel .profile-section-head {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 30px;
}

.profile-totp-panel .profile-section-head {
  justify-content: flex-start;
}

.profile-totp-panel .profile-telegram-head-actions {
  margin-left: auto;
}

.profile-telegram-bind-panel .profile-section-title,
.profile-totp-panel .profile-section-title {
  margin: 0;
  user-select: none;
}

.profile-telegram-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-telegram-link-button {
  white-space: nowrap;
}

.profile-telegram-link-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.profile-telegram-metrics,
.profile-telegram-bind-panel .profile-security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.profile-telegram-metrics > div {
  min-width: 0;
  min-height: 60px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0 10px;
  display: grid;
  align-content: center;
}

.profile-telegram-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-telegram-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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-token-actions {
  grid-template-columns: minmax(0, 180px);
  justify-content: end;
}

.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-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.profile-compact-info-card {
  min-width: 0;
  min-height: 60px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0 10px;
  display: grid;
  align-content: center;
}

.profile-totp-compact-card {
  cursor: pointer;
}

.profile-totp-compact-card .profile-exchange-input-compact {
  min-height: 26px;
  padding: 3px 104px 3px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
}

.profile-totp-compact-card .profile-exchange-input-hint {
  right: 10px;
  font-size: 7px;
}

.profile-compact-info-card > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-compact-info-card > strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-totp-secret-card strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.profile-account-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.profile-account-panel {
  min-width: 0;
  margin-top: 0;
  gap: 12px;
  padding: 20px;
}

.profile-account-panel .profile-section-head {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-account-current-grid {
  grid-template-columns: minmax(0, 1fr);
}

.profile-account-form {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  border: 0;
  padding: 0;
  background: transparent;
  gap: 10px;
}

.profile-account-form .stats-control {
  gap: 8px;
}

.profile-account-form .panel-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.profile-account-form .stats-input {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.profile-secret-input.is-masked {
  -webkit-text-security: disc;
  text-security: disc;
}

.profile-account-action {
  justify-self: start;
  white-space: nowrap;
}

.profile-account-action:disabled {
  opacity: 0.5;
  cursor: default;
}

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

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

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

.profile-risk-grid-admin {
  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: 0;
  min-height: 60px;
  padding: 0;
  background: transparent;
  display: grid;
  grid-template-rows: 12px 34px;
  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-daily-loss {
  align-content: center;
}

.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;
}

.profile-risk-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-risk-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 18px currentColor;
}

.profile-risk-indicator-green {
  color: #95d88d;
  background: #469a19;
}

.profile-risk-indicator-red {
  color: #ff9a8d;
  background: #b23a2c;
}

.profile-risk-form-note {
  grid-column: 1 / -1;
  border-radius: 12px;
  padding: 10px 12px;
  color: #ffb8ac;
  background: rgba(178, 58, 44, 0.12);
  border: 1px solid rgba(178, 58, 44, 0.28);
  font-size: 12px;
  font-weight: 800;
}

.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;
  min-height: 30px;
  padding: 7px 12px;
  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 {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.profile-session-item-current {
  border-color: rgba(132, 204, 22, 0.32);
  background: rgba(132, 204, 22, 0.08);
}

.profile-session-list {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.profile-sessions-panel .profile-session-list {
  max-height: none;
}

.profile-sessions-panel .profile-session-item:only-child {
  min-height: 100%;
}

.profile-session-main,
.profile-session-facts-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-session-main strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-session-dots {
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-session-dot {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  appearance: none;
}

.profile-session-dot.is-active {
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.profile-session-current {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(132, 204, 22, 0.15);
  color: #d9f99d;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-session-facts {
  min-width: 0;
  display: grid;
  gap: 3px;
}

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

.profile-session-facts strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.profile-recovery-codes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-recovery-codes-head .profile-risk-form-title {
  margin: 0;
  color: var(--text);
}

.profile-recovery-codes-hide {
  flex: 0 0 auto;
}

.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 {
  min-height: 46px;
  display: grid;
  align-items: center;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  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-compact-error {
  margin-top: 6px;
  color: #ffb8ad;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.profile-exchange-input-compact {
  min-height: 22px;
  padding: 2px 0;
  background: transparent;
  font-size: 10px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: clip;
}

.profile-exchange-input-wrap {
  --profile-exchange-input-gap: 16px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: var(--profile-exchange-input-gap);
  min-height: 22px;
  padding: 2px var(--profile-exchange-input-gap);
  border: 1px solid var(--exchange-card-input-line);
  border-radius: 16px;
  background: rgba(12, 10, 7, 0.34);
  overflow: hidden;
}

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

.profile-exchange-input-hint {
  position: static;
  justify-self: end;
  color: var(--exchange-card-label);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  z-index: 2;
  padding-left: 0;
  background: transparent;
}

.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-input-wrap .profile-exchange-input-compact {
  min-width: 0;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 2px 0;
  background: transparent;
  box-shadow: none;
}

.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-risk-layout-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: 18px;
  min-height: 0;
}

.profile-risk-left-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.profile-intents-section,
.profile-profit-section {
  width: min(640px, 100%);
  justify-self: start;
  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,
.profile-profit-section .profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.profile-intents-section .profile-section-title,
.profile-profit-section .profile-section-title {
  margin: 0;
  user-select: none;
}

body.route-risks .profile-shell {
  height: calc(100vh - var(--topbar-height) - (var(--page-shell-padding) * 2));
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  padding-left: var(--board-panel-x-padding);
  padding-right: var(--board-panel-x-padding);
  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 .profile-intents-section,
body.route-risks .profile-profit-section {
  width: 100%;
}

body.route-risks .profile-risk-section {
  width: 100%;
}

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

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

html[data-theme="light"] body.route-risks .page-shell,
html[data-theme="light"] body.route-risks #appMain,
html[data-theme="light"] body.route-risks .profile-shell,
html[data-theme="light"] body.route-risks .profile-risk-layout-grid {
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] body.route-security .page-shell,
html[data-theme="light"] body.route-security #appMain,
html[data-theme="light"] body.route-security .profile-shell {
  background: transparent;
  box-shadow: none;
}

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

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

body.route-security .profile-security-overview-section {
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden auto;
}

body.route-security .profile-security-overview-section > .profile-telegram-link-panel {
  margin-top: 0;
  background: transparent;
}

body.route-security .profile-account-panel {
  background: transparent;
}

body.route-security .profile-account-current-grid,
body.route-security .profile-account-form,
body.route-security .profile-session-item {
  background: transparent;
}

body.route-security .profile-session-item-current {
  background: rgba(132, 204, 22, 0.08);
}

body.route-security .profile-exchange-keys-panel .profile-section-head {
  align-items: center;
  min-height: 24px;
  flex: 0 0 auto;
}

body.route-security .profile-exchange-keys-panel .profile-section-title {
  margin: 0;
  user-select: none;
}

body.route-security .profile-exchange-keys-panel .profile-exchange-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  flex: 1 1 auto;
  align-content: stretch;
  grid-auto-rows: minmax(34px, 1fr);
  min-height: 0;
}

body.route-security .profile-exchange-keys-panel .profile-exchange-card {
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  padding: 0 9px;
  display: grid;
  align-content: center;
}

body.route-security .profile-exchange-keys-panel .profile-exchange-card-compact {
  min-height: 0;
}

body.route-security .profile-exchange-keys-panel .profile-exchange-card-compact:hover {
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.route-security .profile-exchange-keys-panel .profile-exchange-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="light"] .profile-risk-section,
html[data-theme="light"] .profile-intents-section,
html[data-theme="light"] .profile-profit-section,
html[data-theme="light"] .profile-security-section,
html[data-theme="light"] .profile-telegram-link-panel,
html[data-theme="light"] body.route-security .profile-account-panel,
html[data-theme="light"] body.route-security .profile-exchange-keys-panel {
  border-color: rgba(44, 60, 82, 0.18);
  background:
    linear-gradient(180deg, rgba(225, 234, 244, 0.9), rgba(207, 220, 234, 0.78)),
    rgba(218, 229, 241, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] body.route-risks .profile-risk-section {
  border-color: rgba(39, 55, 78, 0.16);
  background: var(--light-panel-outer);
  box-shadow: none;
}

html[data-theme="light"] body.route-risks .profile-risk-head-actions .profile-risk-clear {
  background: var(--light-button-surface);
  color: #213247;
  box-shadow: inset 0 0 0 1px rgba(39, 55, 78, 0.08);
}

html[data-theme="light"] body.route-risks .profile-risk-head-actions .profile-risk-clear:disabled {
  background: var(--light-button-surface);
  color: rgba(33, 50, 71, 0.58);
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(39, 55, 78, 0.08);
}

html[data-theme="light"] body.route-risks .profile-intents-section,
html[data-theme="light"] body.route-risks .profile-profit-section {
  border-color: rgba(39, 55, 78, 0.16);
  background: var(--light-panel-outer);
  box-shadow: none;
}

html[data-theme="light"] body.route-security .profile-security-overview-section {
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] body.route-security .profile-security-overview-section > .profile-telegram-link-panel,
html[data-theme="light"] body.route-security .profile-account-panel,
html[data-theme="light"] body.route-security .profile-exchange-keys-panel {
  border-color: rgba(39, 55, 78, 0.16);
  background: var(--light-panel-outer);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

html[data-theme="light"] body.route-security {
  --security-inner-surface: var(--light-panel-inner);
}

html[data-theme="light"] .profile-telegram-metrics > div,
html[data-theme="light"] .profile-compact-info-card,
html[data-theme="light"] .profile-profit-metrics > div,
html[data-theme="light"] body.route-security .profile-telegram-bind-panel .profile-risk-card,
html[data-theme="light"] body.route-security .profile-totp-panel .profile-risk-card,
html[data-theme="light"] body.route-security .profile-exchange-keys-panel .profile-exchange-card,
html[data-theme="light"] body.route-security .profile-exchange-keys-panel .profile-exchange-card-compact {
  border-color: rgba(44, 60, 82, 0.16);
  background: var(--light-panel-inner);
  box-shadow: none;
}

html[data-theme="light"] body.route-risks .profile-intent-row {
  border-color: rgba(44, 60, 82, 0.16);
  background: var(--light-panel-inner);
  box-shadow: none;
}

html[data-theme="light"] body.route-risks .profile-intent-row.is-selected {
  border-color: rgba(181, 128, 22, 0.52);
  background: rgba(255, 216, 89, 0.22);
  box-shadow: 0 0 0 1px rgba(181, 128, 22, 0.12);
}

html[data-theme="light"] body.route-risks .profile-intent-pnl-green {
  color: #5fa63a;
}

html[data-theme="light"] body.route-risks .profile-intent-pnl-red {
  color: #d96b5f;
}

html[data-theme="light"] body.route-security .profile-session-item {
  border-color: rgba(44, 60, 82, 0.16);
  background: var(--security-inner-surface);
  box-shadow: none;
}

html[data-theme="light"] body.route-security .profile-session-item-current {
  border-color: rgba(78, 137, 45, 0.42);
  background:
    linear-gradient(180deg, rgba(223, 246, 213, 0.58), rgba(195, 225, 184, 0.36)),
    rgba(255, 255, 255, 0.38);
}

html[data-theme="light"] .profile-session-current {
  background: rgba(104, 166, 65, 0.2);
  color: #335f1f;
}

html[data-theme="light"] body.route-security .profile-profit-period,
html[data-theme="light"] body.route-security .profile-profit-period.is-active,
html[data-theme="light"] body.route-security .profile-profit-period[data-profile-profit-period].is-active,
html[data-theme="light"] body.route-security .profile-risk-save,
html[data-theme="light"] body.route-security .profile-risk-clear {
  background: var(--light-button-surface);
  color: #213247;
  box-shadow: inset 0 0 0 1px rgba(39, 55, 78, 0.08);
}

html[data-theme="light"] body.route-security .profile-risk-save:disabled,
html[data-theme="light"] body.route-security .profile-risk-clear:disabled,
html[data-theme="light"] body.route-security .profile-profit-period:disabled {
  opacity: 1;
}

html[data-theme="light"] body.route-security .profile-risk-save:disabled,
html[data-theme="light"] body.route-security .profile-risk-clear:disabled,
html[data-theme="light"] body.route-security .profile-profit-period:disabled {
  background: var(--light-button-surface);
  color: rgba(33, 50, 71, 0.58);
  box-shadow: inset 0 0 0 1px rgba(39, 55, 78, 0.08);
}

html[data-theme="light"] .stats-input,
html[data-theme="light"] .stats-select,
html[data-theme="light"] .profile-exchange-input {
  border-color: rgba(44, 60, 82, 0.18);
  background: rgba(255, 255, 255, 0.54);
  color: var(--text);
}

html[data-theme="light"] body.route-risks .profile-risk-card .stats-input {
  border-color: rgba(44, 60, 82, 0.16);
  background: var(--light-panel-inner);
  box-shadow: none;
}

html[data-theme="light"] .profile-risk-unit-input span,
html[data-theme="light"] .profile-exchange-input-hint {
  color: rgba(188, 112, 41, 0.82);
}

html[data-theme="light"] .profile-exchange-input-wrap {
  border-color: rgba(44, 60, 82, 0.16);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: none;
}

html[data-theme="light"] body.route-security .profile-exchange-input-wrap {
  background: var(--security-inner-surface);
}

html[data-theme="light"] .profile-exchange-input-wrap .profile-exchange-input-compact {
  border-color: transparent;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

html[data-theme="light"] body.route-security .profile-security-setup,
html[data-theme="light"] body.route-security .profile-recovery-codes,
html[data-theme="light"] body.route-security .profile-recovery-code-grid code {
  border-color: rgba(44, 60, 82, 0.16);
  background: var(--security-inner-surface);
  box-shadow: none;
}

html[data-theme="light"] body.route-security .profile-security-uri,
html[data-theme="light"] body.route-security .profile-security-secret {
  background: var(--security-inner-surface);
  color: #31455f;
  box-shadow: none;
}

html[data-theme="light"] body.route-security .profile-security-secret {
  color: var(--text);
}

html[data-theme="light"] body.route-security .profile-trade-lock-banner {
  background: rgba(255, 177, 94, 0.26);
  color: #c56f2e;
  box-shadow: inset 0 0 0 1px rgba(197, 111, 46, 0.12);
}

html[data-theme="light"] body.route-security .profile-trade-lock-banner strong {
  color: #1f3044;
}

html[data-theme="light"] body.route-security .profile-account-current-grid,
html[data-theme="light"] body.route-security .profile-account-form {
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] .profile-profit-period {
  background: var(--light-button-surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(44, 60, 82, 0.1);
}

html[data-theme="light"] .profile-profit-period.is-active {
  background: var(--light-button-surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(44, 60, 82, 0.1);
}

html[data-theme="light"] .profile-profit-period[data-profile-profit-period].is-active {
  background: var(--light-button-surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(44, 60, 82, 0.1);
}

html[data-theme="light"] .profile-profit-chart-placeholder,
html[data-theme="light"] .profile-profit-chart-wrap {
  border-color: rgba(44, 60, 82, 0.16);
  background: var(--light-panel-inner);
  box-shadow: none;
}

html[data-theme="light"] .profile-profit-axis {
  stroke: rgba(26, 39, 58, 0.58);
}

html[data-theme="light"] .profile-profit-y-tick line,
html[data-theme="light"] .profile-profit-x-tick line {
  stroke: rgba(40, 56, 80, 0.16);
}

html[data-theme="light"] .profile-profit-y-tick text,
html[data-theme="light"] .profile-profit-x-tick text,
html[data-theme="light"] .profile-profit-legend {
  fill: #5e6f86;
  color: #5e6f86;
}

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

.profile-profit-chart-placeholder {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)),
    rgba(4, 8, 13, 0.24);
}

.profile-profit-chart-empty {
  max-width: 280px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.profile-profit-periods {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.profile-profit-period {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.profile-profit-period.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

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

.profile-profit-metrics > div {
  min-width: 0;
  min-height: 60px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0 10px;
  display: grid;
  align-content: center;
}

.profile-profit-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-profit-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.profile-profit-chart-wrap {
  flex: 1;
  min-height: 0;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(4, 8, 13, 0.24);
}

.profile-profit-chart {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
}

.profile-profit-chart-bg {
  fill: transparent;
}

.profile-profit-axis {
  fill: none;
  stroke: rgba(215, 222, 232, 0.5);
  stroke-width: 2;
}

.profile-profit-y-tick line,
.profile-profit-x-tick line {
  stroke: rgba(148, 163, 184, 0.13);
  stroke-width: 1;
}

.profile-profit-y-tick text,
.profile-profit-x-tick text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-profit-y-tick text {
  text-anchor: start;
}

.profile-profit-x-tick text {
  text-anchor: middle;
}

.profile-profit-segment {
  cursor: pointer;
}

.profile-profit-segment line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  filter: none;
}

.profile-profit-segment circle {
  fill: var(--text);
  stroke: none;
  filter: none;
}

.profile-profit-segment-spread {
  color: #76e36c;
}

.profile-profit-segment-funding {
  color: #f59e3d;
}

.profile-profit-segment-both {
  color: #ad7cff;
}

.profile-profit-segment:hover line {
  stroke-width: 3;
}

.profile-profit-segment:focus {
  outline: none;
}

.profile-profit-segment.is-active line,
.profile-profit-segment.is-active circle {
  animation: profile-profit-segment-blink 0.95s ease-in-out infinite;
}

@keyframes profile-profit-segment-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.18;
  }
}

.profile-profit-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-profit-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-profit-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.profile-profit-legend-spread {
  background: #76e36c;
}

.profile-profit-legend-funding {
  background: #f59e3d;
}

.profile-profit-legend-both {
  background: #ad7cff;
}

.profile-intents-toolbar {
  display: grid;
  grid-template-columns: 30px 132px;
  align-items: center;
  justify-content: stretch;
  gap: 8px;
  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;
  width: 30px;
  height: 30px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.profile-intent-reset-icon {
  width: 22px;
  height: 22px;
  background: currentColor;
  display: block;
  mask: url("/assets/icons8-refresh.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/icons8-refresh.svg") center / contain no-repeat;
}

.profile-intents-toolbar .stats-input,
.profile-intents-toolbar .stats-select {
  border-radius: 999px;
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.15;
}

.profile-intents-toolbar .stats-select {
  text-align: center;
  text-align-last: center;
}

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

.profile-intent-header {
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) repeat(4, minmax(0, 1fr)) minmax(0, 0.5fr);
  gap: 8px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-intent-header > div {
  justify-self: center;
  text-align: center;
}

.profile-intent-header > div:first-child {
  justify-self: start;
  text-align: left;
}

.profile-intent-header > div:last-child {
  justify-self: end;
  text-align: right;
}

.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;
  align-content: start;
  grid-auto-rows: max-content;
  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, 0.5fr) repeat(4, minmax(0, 1fr)) minmax(0, 0.5fr);
  gap: 8px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.profile-intent-row.is-selected {
  border-color: rgba(255, 216, 89, 0.72);
  background: rgba(255, 216, 89, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 216, 89, 0.12), 0 0 26px rgba(255, 216, 89, 0.14);
}

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

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

.profile-intent-venues,
.profile-intent-time,
.profile-intent-delivery {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  justify-self: center;
  text-align: center;
  white-space: nowrap;
}

.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;
  justify-self: center;
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
}

.profile-intent-leverage {
  color: var(--text);
  font-weight: 800;
  justify-self: center;
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
}

.profile-intent-fee {
  color: var(--muted);
  font-weight: 800;
  justify-self: center;
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
}

.profile-intent-pnl {
  font-weight: 900;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
}

.profile-intent-pnl-green {
  color: #9fe870;
}

.profile-intent-pnl-red {
  color: #ff9a8e;
}

.profile-intent-pnl-flat {
  color: var(--muted);
}

.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 {
  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 {
  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-intent-notice-banner {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(137, 185, 151, 0.14);
  color: #bff0c6;
  font-size: 13px;
  font-weight: 700;
}

.profile-trade-lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 153, 61, 0.14);
  color: #ffd4a4;
  font-size: 13px;
  font-weight: 800;
}

.profile-trade-lock-inline {
  flex: 0 1 auto;
  margin-left: 4px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.profile-trade-lock-banner strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.profile-trade-lock-inline strong {
  font-size: 12px;
}

.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;
}

.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: 1360px) {
  .profile-risk-layout-grid {
    grid-template-columns: minmax(0, 640px);
  }

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

@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%;
  }

  .profile-account-panels {
    grid-template-columns: minmax(0, 1fr);
  }
}

@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-totp-setup-grid,
    .profile-risk-admin-grid,
    .profile-account-panels,
    .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-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;
}

.profile-password-wrap {
  width: 100%;
}

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

.profile-password-wrap input {
  padding-right: 40px;
}

.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;
}

.profile-password-wrap .auth-password-toggle {
  right: 8px;
  padding: 2px 4px;
  font-size: 12px;
}

.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(--text);
  cursor: pointer;
}

.auth-google:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.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;
}

.board-exchange-filters {
  display: contents;
}

.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(--light-panel-inner, var(--control-chip-active));
  color: var(--control-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;
}

.board-exchange-pill {
  min-width: 74px;
}

.board-strategy-pill {
  min-width: 94px;
}

.board-exchange-pill.active {
  background: rgba(8, 14, 24, 0.74);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.board-strategy-pill.active {
  background: rgba(8, 14, 24, 0.74);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 18px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .board-exchange-pill.active {
  background: rgba(24, 35, 52, 0.88);
  color: #ffffff;
  border-color: rgba(24, 35, 52, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 18px rgba(63, 84, 113, 0.18);
}

html[data-theme="light"] .board-strategy-pill.active {
  background: rgba(24, 35, 52, 0.88);
  color: #ffffff;
  border-color: rgba(24, 35, 52, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 18px rgba(63, 84, 113, 0.18);
}

.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: auto;
  -webkit-overflow-scrolling: touch;
  contain: layout paint style;
}

.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: 7px 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: 34px 13px auto;
  gap: 3px;
  align-content: center;
  content-visibility: auto;
  contain-intrinsic-size: 168px 116px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

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

html[data-theme="light"] .signal-card {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.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);
}

html[data-theme="light"] .signal-card:hover {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 12px 24px rgba(63, 84, 113, 0.16);
}

.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;
  transform: translateY(-3px);
}

.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;
}

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

.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-exchange-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.signal-exchange-pill {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.92;
}

.signal-exchange-pill-right {
  text-align: right;
}

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

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

.signal-value {
  justify-self: end;
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1;
}

.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, 840px)
    minmax(24px, 32px)
    auto
    minmax(24px, 32px)
    minmax(320px, 360px)
    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-execution-sidebar {
  grid-column: 5;
  width: 100%;
  min-width: 0;
  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;
}

.signal-trade-actions {
  position: relative;
  flex: 0 0 266px;
  width: 266px;
  min-width: 266px;
  min-height: 34px;
  margin-left: auto;
  display: grid;
  justify-items: end;
}

.signal-trade-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.signal-trade-button {
  min-width: 72px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.signal-trade-run {
  background: rgba(72, 154, 66, 0.16);
}

.signal-trade-exit {
  background: rgba(180, 63, 50, 0.20);
  border-color: rgba(255, 111, 97, 0.30);
}

.signal-trade-stop {
  background: rgba(218, 174, 28, 0.18);
  border-color: rgba(255, 213, 91, 0.30);
}

.signal-trade-button:disabled {
  opacity: 0.52;
  cursor: default;
}

.signal-trade-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.signal-trade-dot-ready {
  background: #44b43d;
  box-shadow: 0 0 0 3px rgba(68, 180, 61, 0.16);
}

.signal-trade-dot-blocked {
  background: #d05a48;
  box-shadow: 0 0 0 3px rgba(208, 90, 72, 0.16);
}

.signal-run-totp {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.signal-run-totp input {
  width: 76px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.signal-run-totp button {
  min-width: 32px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.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;
  left: auto;
  right: 18px;
  bottom: 6px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.signal-chart-fixed-stack {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.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-fixed-time {
  fill: rgba(255, 255, 255, 0.58);
  color: rgba(255, 255, 255, 0.58);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

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

.signal-chart-canvas {
  position: relative;
  width: 1280px;
  min-width: 1280px;
  height: 280px;
}

.signal-chart-canvas > .signal-chart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 100%;
  height: 100%;
}

.signal-chart-funding-marker-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.signal-chart-funding-marker-label {
  position: absolute;
  display: block;
  color: #f2a14b;
  font-size: 10px;
  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-funding-marker-label {
  text-shadow: none;
}

.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;
}

.signal-execution-panel {
  height: 520px;
  min-height: 520px;
  max-height: 520px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
  user-select: text;
}

.signal-execution-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.signal-execution-head .panel-kicker {
  margin: 0;
  line-height: 1;
}

.signal-execution-metrics-wrap {
  flex: 0 1 330px;
  min-width: min(100%, 260px);
  max-width: 330px;
  margin-top: -2px;
  padding: 0;
}

.signal-execution-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: end;
  column-gap: 16px;
  row-gap: 1px;
  width: 100%;
}

.signal-execution-metric-item {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.signal-execution-metric-label {
  color: rgba(200, 208, 222, 0.7);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-execution-metric-value {
  color: #e5ebf5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.signal-execution-metrics-fallback {
  text-align: right;
  color: #c7ceda;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.signal-execution-action-error {
  max-width: 300px;
  margin-top: 8px;
  color: #ffb8ad;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
  text-transform: none;
}

.signal-execution-counters {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.signal-execution-counters span,
.signal-execution-reset {
  min-height: 26px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.signal-execution-reset {
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.signal-execution-reset:disabled {
  opacity: 0.46;
  cursor: default;
}

.signal-execution-feed {
  min-height: 0;
  overflow-y: auto;
  display: block;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 14px;
  background: rgba(2, 7, 12, 0.54);
  color: rgba(255, 255, 255, 0.82);
  font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 11px;
  line-height: 1.55;
  scrollbar-width: thin;
}

.signal-execution-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.signal-execution-row-warn {
  color: #ffd08a;
}

.signal-execution-row-error {
  color: #ff9a8f;
}

.signal-execution-row-info {
  color: rgba(255, 255, 255, 0.82);
}

.signal-execution-time {
  flex: 0 0 auto;
  color: rgba(154, 166, 184, 0.88);
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0;
}

.signal-execution-event {
  color: currentColor;
  font-size: inherit;
  font-weight: 800;
  line-height: inherit;
}

.signal-execution-detail {
  color: rgba(209, 216, 226, 0.72);
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
}

.signal-execution-empty {
  height: 100%;
  display: grid;
  align-items: center;
  justify-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 18px;
}

.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));
}

html[data-theme="light"] .signal-chart-svg line[stroke="rgba(255,255,255,0.04)"],
html[data-theme="light"] .signal-chart-svg line[stroke="rgba(255,255,255,0.10)"],
html[data-theme="light"] .signal-chart-svg line[stroke="rgba(255,255,255,0.16)"] {
  stroke: rgba(36, 52, 76, 0.13);
}

html[data-theme="light"] .signal-chart-svg line[data-role="hover-line"] {
  stroke: rgba(36, 52, 76, 0.32);
}

html[data-theme="light"] .signal-chart-svg path[data-role="spread-upper-line"] {
  stroke: #c93f3b;
  stroke-width: 1.45;
}

html[data-theme="light"] .signal-chart-svg path[data-role="spread-lower-line"] {
  stroke: #239746;
  stroke-width: 1.45;
}

html[data-theme="light"] .signal-chart-svg path[data-role="funding-long-line"] {
  stroke: #dc7f24;
  stroke-width: 1.65;
}

html[data-theme="light"] .signal-chart-svg path[data-role="funding-short-line"] {
  stroke: #c39013;
  stroke-width: 1.65;
}

html[data-theme="light"] .signal-chart-svg text[data-role="spread-ask-label"] {
  fill: #c93f3b;
}

html[data-theme="light"] .signal-chart-svg text[data-role="spread-bid-label"] {
  fill: #239746;
}

html[data-theme="light"] .signal-chart-svg text[data-role="funding-long-label"] {
  fill: #dc7f24;
}

html[data-theme="light"] .signal-chart-svg text[data-role="funding-short-label"] {
  fill: #b98208;
}

html[data-theme="light"] .signal-chart-fixed-time {
  color: rgba(36, 52, 76, 0.58);
}

html[data-theme="light"] .signal-chart-fixed-value.is-long {
  color: #dc7f24;
}

html[data-theme="light"] .signal-chart-fixed-value.is-short {
  color: #b98208;
}

html[data-theme="light"] .signal-chart-svg path[data-role="threshold-upper-line"],
html[data-theme="light"] .signal-chart-svg path[data-role="threshold-lower-line"] {
  stroke: rgba(36, 52, 76, 0.44);
}

html[data-theme="light"] .signal-chart-funding-marker-line {
  stroke: #c98318;
  stroke-opacity: 0.72;
}

html[data-theme="light"] .signal-chart-funding-marker-label {
  color: #a76412 !important;
  opacity: 0.96 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .depth-row-head,
html[data-theme="light"] .depth-book-title {
  color: #43546b;
}

html[data-theme="light"] .depth-side-title-ask {
  color: #ce4943;
}

html[data-theme="light"] .depth-side-title-bid {
  color: #218f41;
}

html[data-theme="light"] .signal-execution-panel {
  border-color: rgba(17, 31, 49, 0.12);
  background: rgba(255, 255, 255, 0.34);
}

html[data-theme="light"] .signal-execution-row {
  color: rgba(17, 31, 49, 0.82);
  background: transparent;
}

html[data-theme="light"] .signal-execution-detail {
  color: rgba(17, 31, 49, 0.72);
}

html[data-theme="light"] .signal-execution-feed {
  border-color: rgba(17, 31, 49, 0.10);
  background: rgba(255, 255, 255, 0.38);
  color: rgba(17, 31, 49, 0.82);
}

html[data-theme="light"] .signal-execution-row-warn {
  color: #8a5a12;
}

html[data-theme="light"] .signal-execution-row-error {
  color: #b5382f;
}

html[data-theme="light"] .signal-execution-counters span,
html[data-theme="light"] .signal-execution-reset {
  background: rgba(17, 31, 49, 0.055);
}

html[data-theme="light"] .depth-row-ask {
  color: #a9342f;
  font-weight: 850;
  text-shadow: none;
}

html[data-theme="light"] .depth-row-bid {
  color: #187a38;
  font-weight: 850;
  text-shadow: none;
}

html[data-theme="light"] .depth-row::before {
  opacity: 0.72;
}

html[data-theme="light"] .depth-row-ask::before {
  background: linear-gradient(90deg, rgba(207, 70, 64, 0.34), rgba(207, 70, 64, 0.12));
}

html[data-theme="light"] .depth-row-bid::before {
  background: linear-gradient(90deg, rgba(45, 156, 74, 0.34), rgba(45, 156, 74, 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-hero-strip {
    flex-wrap: wrap;
  }

  .signal-trade-actions {
    width: 100%;
    min-width: 0;
    justify-items: start;
    margin-left: 0;
  }

  .signal-run-totp {
    right: auto;
    left: 0;
  }

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

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

  .signal-execution-panel {
    height: 420px;
    min-height: 420px;
    max-height: 420px;
  }

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

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

  .signal-chart-canvas {
    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: 4px 10px;
    grid-template-rows: 32px 13px auto;
    gap: 2px;
  }

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

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

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

  .signal-exchange-row {
    gap: 6px;
  }

  .signal-metrics {
    gap: 2px 12px;
  }

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

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