:root {
  --primary: #0066cc;
  --primary-2: #2997ff;
  --ink: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.62);
  --quiet: rgba(245, 245, 247, 0.42);
  --terminal: #050505;
  --panel: #0d0d0f;
  --panel-2: #141416;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.18);
  --gain: #7fe1a4;
  --loss: #f18b8b;
  --warn: #ffd36b;
  --cyan: #6fb7ff;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --nav-h: 44px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #000;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: auto;
  scrollbar-width: none;
}

body {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--ink);
  background: #000;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.page::-webkit-scrollbar,
.hosted-key-list::-webkit-scrollbar,
.docs-article::-webkit-scrollbar,
.docs-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
}

.mono,
code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 520px);
  gap: 1px;
  background: #000;
}

.auth-bg-video {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  filter: saturate(1.05) contrast(1.08) brightness(0.64);
}

.auth-visual,
.auth-panel {
  position: relative;
  min-height: 0;
}

.auth-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.46) 56%, rgba(0, 0, 0, 0.32)),
    linear-gradient(135deg, rgba(0, 102, 204, 0.20), rgba(127, 225, 164, 0.08) 48%, transparent 72%);
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.auth-visual::before {
  background:
    radial-gradient(circle at 16% 22%, rgba(41, 151, 255, 0.16), transparent 30%),
    radial-gradient(circle at 78% 16%, rgba(255, 179, 89, 0.12), transparent 28%),
    radial-gradient(circle at 66% 74%, rgba(127, 225, 164, 0.10), transparent 36%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.88), transparent 88%);
  filter: blur(12px);
  opacity: 0.55;
  animation: authGridBreath 7s ease-in-out infinite;
}

.auth-visual::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.30), transparent 64%),
    radial-gradient(ellipse at 54% 48%, rgba(255, 255, 255, 0.045), transparent 48%),
    radial-gradient(ellipse at 22% 88%, rgba(41, 151, 255, 0.07), transparent 42%);
  transform: translate3d(0, 0, 0);
  opacity: 0.62;
  animation: authWaveBreath 8.5s ease-in-out infinite;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  margin-bottom: 28px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 18px 48px rgba(41, 151, 255, 0.18);
}

.auth-visual h1 {
  max-width: 720px;
  margin: 12px 0 34px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-metrics {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.auth-metrics div {
  min-height: 104px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
  border-right: 1px solid var(--line);
  transition: background 180ms ease, transform 180ms ease;
}

.auth-metrics div:hover {
  background: rgba(255, 255, 255, 0.065);
  transform: translateY(-2px);
}

.auth-metrics div:last-child {
  border-right: 0;
}

.auth-metrics span {
  display: block;
  font-size: 30px;
  font-weight: 800;
}

.auth-metrics small {
  color: var(--muted);
  font-size: 12px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 34%),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tabs button {
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.auth-tabs button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.auth-tabs button.is-active {
  color: #fff;
  background: rgba(41, 151, 255, 0.22);
}

.auth-form {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(13, 13, 15, 0.74);
  backdrop-filter: blur(18px);
  padding: 26px;
  gap: 16px;
  transform: translateY(0);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.auth-form.is-active {
  display: grid;
}

.auth-form.is-active:hover,
.auth-form.is-active:focus-within {
  border-color: rgba(41, 151, 255, 0.44);
  background: rgba(16, 16, 19, 0.9);
  box-shadow: 0 26px 82px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(41, 151, 255, 0.14);
  transform: translateY(-3px);
}

.auth-form h2,
.page-heading h1,
.panel h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.auth-form h2 {
  font-size: 28px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.18);
}

.auth-form label:hover input,
.auth-form label:hover select,
.auth-form label:hover textarea {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  transform: translateY(-1px);
}

.two-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.primary-pill,
.icon-button,
.text-button,
.table-action,
.demo-row button,
.user-button {
  cursor: pointer;
}

.primary-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  background:
    linear-gradient(135deg, var(--primary), var(--primary-2)),
    var(--primary);
  color: #fff;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-pill:hover {
  background: var(--primary-2);
  box-shadow: 0 12px 34px rgba(41, 151, 255, 0.28);
  transform: translateY(-1px);
}

.primary-pill:active,
.icon-button:active,
.table-action:active {
  transform: scale(0.96);
}

.demo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.demo-row button,
.text-button,
.table-action {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(255, 255, 255, 0.06);
  padding: 9px 10px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.auth-panel .demo-row button:hover,
.auth-panel .text-button:hover,
.table-action:hover {
  border-color: rgba(41, 151, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(41, 151, 255, 0.16), rgba(127, 225, 164, 0.04)),
    rgba(255, 255, 255, 0.07);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.positive {
  color: var(--gain) !important;
}

.negative {
  color: var(--loss) !important;
}

.warning {
  color: var(--warn) !important;
}

.global-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: var(--nav-h);
  background: #000;
  color: #fff;
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  width: min(100%, 1440px);
  height: 100%;
  margin: 0 auto;
  padding: 0 18px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  min-width: 74px;
}

.brand-logo {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.nav-links a {
  height: var(--nav-h);
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
}

.nav-links a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--primary-2);
}

.user-cluster {
  min-width: 260px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.user-button {
  min-width: 184px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 5px;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.user-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.user-copy strong {
  font-size: 12px;
  line-height: 1;
}

.user-copy small {
  color: var(--muted);
  font-size: 10px;
}

.icon-button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding-top: var(--nav-h);
  background: #000;
}

.route-loader {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  z-index: 65;
  width: 100%;
  height: 2px;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.route-loader::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 36%;
  background: linear-gradient(90deg, transparent, var(--primary-2), var(--gain));
  transform: translateX(-100%);
}

.route-loader.is-active {
  opacity: 1;
}

.route-loader.is-active::before {
  animation: routeLoad 520ms cubic-bezier(0.2, 0.72, 0.16, 1) forwards;
}

.page {
  display: none;
  width: 100%;
  min-height: calc(100vh - var(--nav-h));
  overflow: visible;
}

.page.is-active {
  display: block;
  animation: pageEnter 240ms ease both;
}

.cockpit {
  width: 100%;
  height: auto;
  min-height: max(760px, calc(100vh - var(--nav-h)));
  display: flex;
  flex-direction: column;
  background: var(--terminal);
  color: #fff;
  overflow: visible;
}

.dashboard-page {
  min-height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

.dashboard-page .cockpit {
  height: calc(100vh - var(--nav-h));
  min-height: 760px;
  overflow: hidden;
}

.dashboard-page .panel,
.dashboard-page .terminal-panel,
.dashboard-page .contract-block {
  overflow: hidden;
}

.cockpit-topline {
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.topline-stats {
  display: flex;
  align-items: center;
  gap: 18px;
}

.data-feed-status {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border: 1px solid rgba(255, 211, 107, 0.32);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  color: var(--warn);
  background: rgba(255, 211, 107, 0.08);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.data-feed-status.is-live {
  color: var(--gain);
  border-color: rgba(127, 225, 164, 0.36);
  background: rgba(127, 225, 164, 0.08);
}

.live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.live-pulse span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gain);
  box-shadow: 0 0 0 rgba(127, 225, 164, 0.65);
  animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(127, 225, 164, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(127, 225, 164, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 225, 164, 0); }
}

@keyframes routeLoad {
  0% { transform: translateX(-110%); }
  70% { transform: translateX(190%); }
  100% { transform: translateX(280%); }
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes authGridBreath {
  0%, 100% { opacity: 0.46; transform: scale(1); }
  50% { opacity: 0.68; transform: scale(1.025); }
}

@keyframes authWaveBreath {
  0%, 100% { opacity: 0.48; transform: translate3d(0, 0, 0) scale(1); }
  50% { opacity: 0.70; transform: translate3d(1.5%, -1%, 0) scale(1.018); }
}

.kpi-strip {
  flex: 0 0 94px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.kpi-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.kpi-cell:last-child {
  border-right: 0;
}

.kpi-cell span,
.panel-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.kpi-cell strong {
  display: block;
  margin-top: 4px;
  font-size: 27px;
  line-height: 1;
}

.kpi-cell small {
  display: block;
  margin-top: 5px;
  color: var(--quiet);
  font-size: 12px;
}

.dashboard-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr);
}

.panel {
  min-height: 0;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01) 46%, transparent),
    var(--terminal);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: visible;
}

.page-heading,
.contract-block,
.terminal-panel,
.fund-cell,
.depth-card,
.timeframe-card,
.curve-card,
.doc-card,
.role-card,
.decision-row,
.policy-row,
.vault-row,
.tag-row,
.trade-filters,
.ledger-panel,
.positions-panel,
.whitelist-panel,
.users-panel,
.table-panel,
.positions-block,
.record-detail-grid,
.live-control,
.runtime-picker,
.strategy-state,
.source-row,
.empty-state {
  border-radius: var(--radius-sm);
}

.page-heading,
.contract-block,
.terminal-panel,
.fund-cell,
.depth-card,
.timeframe-card,
.curve-card,
.doc-card,
.role-card,
.trade-filters,
.ledger-panel,
.positions-panel,
.whitelist-panel,
.users-panel,
.table-panel,
.positions-block {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    var(--terminal);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.panel-market {
  display: flex;
  flex-direction: column;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin-top: 5px;
  font-size: 28px;
  line-height: 1.1;
}

.panel-heading h3 {
  margin-top: 3px;
  font-size: 18px;
}

.panel-heading.compact {
  margin-bottom: 12px;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.metric-badge.neutral {
  color: var(--cyan);
}

.decision-list,
.policy-stack,
.vault-list,
.tag-stack {
  display: grid;
  gap: 9px;
}

.decision-row,
.policy-row,
.vault-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.035);
}

.decision-row div,
.vault-row div {
  display: grid;
  gap: 3px;
}

.decision-row span,
.vault-row span,
.data-table td span {
  color: var(--muted);
  font-size: 12px;
}

.decision-row em,
.policy-row em,
.vault-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-list {
  display: grid;
  margin: 0;
}

.status-list div,
.contract-list div {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.status-list dt,
.contract-list dt {
  color: var(--muted);
}

.status-list dd,
.contract-list dd {
  margin: 0;
  color: #fff;
  font-weight: 700;
  text-align: right;
}

.policy-row {
  justify-content: flex-start;
}

.policy-row strong {
  flex: 1;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot.ok {
  background: var(--gain);
}

.dot.warn {
  background: var(--warn);
}

.page-heading {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 28px;
  background: var(--terminal);
  border-bottom: 1px solid var(--line);
}

.page-heading h1 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.08;
}

.page-heading p:last-child {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.market-layout,
.connect-layout {
  height: auto;
  min-height: calc(100vh - var(--nav-h) - 118px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
  padding: 16px;
}

.connect-layout.is-observer {
  grid-template-columns: minmax(0, 1fr);
}

.market-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
}

.admin-layout {
  height: auto;
  min-height: calc(100vh - var(--nav-h) - 118px);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  grid-template-rows: auto;
  align-items: start;
}

.whitelist-panel,
.api-key-panel,
.users-panel {
  grid-column: 1 / -1;
}

.table-panel {
  padding: 0;
}

.table-panel .panel-heading {
  padding: 16px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.ip-whitelist-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.ip-whitelist-form.is-readonly {
  opacity: 0.64;
}

.ip-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 12px;
}

.ip-whitelist-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ip-whitelist-form label span {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ip-whitelist-form textarea {
  min-height: 54px;
  resize: vertical;
}

.ip-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ip-form-actions .form-message {
  flex: 1;
}

.api-key-once {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(127, 225, 164, 0.28);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(127, 225, 164, 0.12), rgba(41, 151, 255, 0.06));
  color: var(--text);
}

.api-key-once code {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  color: var(--gain);
}

.table-action:disabled,
.primary-pill:disabled,
.ip-whitelist-form input:disabled,
.ip-whitelist-form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
}

.data-table td {
  color: #fff;
  font-size: 13px;
}

.data-table td strong {
  display: block;
}

.hash-chip {
  display: inline-flex;
  max-width: 100%;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
}

.table-pager {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 11px;
  background: #050505;
}

.table-pager > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-pager button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 11px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.table-pager button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(41, 151, 255, 0.58);
  background: rgba(41, 151, 255, 0.12);
}

.table-pager button:active:not(:disabled) {
  transform: translateY(0);
}

.table-pager button:disabled {
  opacity: 0.35;
}

.table-pager strong {
  color: #fff;
  font-family: var(--mono);
}

.table-action {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  gap: 7px;
}

.tag-row {
  display: grid;
  gap: 7px;
}

.tag-row div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.tag-row strong {
  color: #fff;
}

.tag-row i {
  display: block;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--primary-2);
}

.credential-form {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: visible;
}

.credential-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.credential-mode {
  display: grid;
  gap: 8px;
  color: var(--quiet);
  font-size: 12px;
}

.inline-check {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.inline-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--primary-2);
}

.inline-check span {
  display: grid;
  gap: 2px;
}

.inline-check strong {
  color: #fff;
  font-size: 12px;
}

.inline-check small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.inline-check:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 150, 243, 0.55);
  background: rgba(33, 150, 243, 0.08);
}

label.is-disabled {
  opacity: 0.56;
}

label.is-disabled input {
  cursor: not-allowed;
}

input[readonly],
textarea[readonly] {
  color: rgba(245, 245, 247, 0.72);
  background:
    linear-gradient(180deg, rgba(41, 151, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.035);
}

.strategy-switches {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.strategy-switches legend {
  padding: 0 6px;
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
}

.strategy-switches label {
  min-height: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: #fff;
  font-size: 13px;
}

.strategy-switches input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.vault-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(41, 151, 255, 0.035), rgba(255, 255, 255, 0.008) 42%, transparent),
    #070707;
}

.credential-form {
  height: 100%;
}

.connect-pane.is-active {
  flex: 1;
}

.connect-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 0 14px;
}

.connect-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    rgba(255, 255, 255, 0.028);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, color 170ms ease;
}

.connect-tabs button:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 151, 255, 0.48);
  color: #fff;
}

.connect-tabs button.is-active {
  border-color: rgba(41, 151, 255, 0.72);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.42), rgba(127, 225, 164, 0.10)),
    rgba(41, 151, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 12px 28px rgba(0, 102, 204, 0.12);
}

.connect-pane {
  display: none;
}

.connect-pane.is-active {
  display: block;
  animation: softPaneIn 180ms ease both;
}

@keyframes softPaneIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.live-control {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background:
    radial-gradient(circle at 18% 10%, rgba(41, 151, 255, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(0, 102, 204, 0.08), rgba(127, 225, 164, 0.035)),
    rgba(255, 255, 255, 0.025);
}

.live-control div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-control span,
.live-control p {
  color: var(--muted);
  font-size: 12px;
}

.live-control strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(241, 139, 139, 0.36);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  color: var(--loss);
  background:
    linear-gradient(135deg, rgba(241, 139, 139, 0.15), rgba(255, 211, 107, 0.035)),
    rgba(255, 255, 255, 0.025);
  font-size: 12px;
  letter-spacing: 0;
}

.live-control strong.positive {
  border-color: rgba(127, 225, 164, 0.44);
  color: var(--gain) !important;
  background:
    linear-gradient(135deg, rgba(127, 225, 164, 0.20), rgba(41, 151, 255, 0.07)),
    rgba(255, 255, 255, 0.028);
  box-shadow: 0 0 24px rgba(127, 225, 164, 0.09);
}

.live-control p {
  margin: 0;
  line-height: 1.55;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.runtime-picker {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.008)),
    rgba(255, 255, 255, 0.018);
}

.runtime-picker > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.runtime-picker span,
.runtime-picker strong {
  font-size: 12px;
}

.runtime-picker span {
  color: var(--muted);
}

.runtime-picker strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-checks {
  display: grid;
  gap: 8px;
}

.runtime-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
}

.runtime-checks input {
  width: 15px;
  height: 15px;
  accent-color: var(--gain);
}

.hosted-key-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  margin-bottom: 12px;
  max-height: none;
  overflow: visible;
}

.binance-event-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background:
    radial-gradient(circle at 94% 0%, rgba(127, 225, 164, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(41, 151, 255, 0.045), rgba(127, 225, 164, 0.025)),
    rgba(255, 255, 255, 0.012);
}

.binance-event-panel > p {
  margin: 0;
  padding: 0 16px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.binance-device-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 14px;
}

.binance-device-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012)),
    rgba(255, 255, 255, 0.032);
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.binance-device-card.is-stop {
  border-color: rgba(241, 139, 139, 0.24);
  background:
    linear-gradient(180deg, rgba(241, 139, 139, 0.055), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.024);
  opacity: 0.82;
}

.binance-device-delete {
  justify-self: end;
  margin-top: 2px;
}

.binance-device-card:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 151, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(41, 151, 255, 0.12), rgba(127, 225, 164, 0.045)),
    rgba(41, 151, 255, 0.075);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.20);
}

.binance-device-card > div:first-child,
.binance-device-card dl {
  display: flex;
  align-items: center;
  gap: 10px;
}

.binance-device-card > div:first-child em {
  margin-left: auto;
  color: var(--quiet);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.binance-device-card p,
.binance-device-card small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.binance-device-card dl {
  justify-content: space-between;
  margin: 0;
}

.binance-device-card dt {
  color: var(--quiet);
  font-size: 10px;
  text-transform: uppercase;
}

.binance-device-card dd {
  margin: 2px 0 0;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--loss);
  color: rgba(241, 139, 139, 0.55);
  box-shadow: 0 0 0 rgba(241, 139, 139, 0.55);
  animation: statusPulse 1.65s infinite;
}

.status-dot.live {
  background: var(--gain);
  color: rgba(127, 225, 164, 0.55);
  box-shadow: 0 0 0 rgba(127, 225, 164, 0.55);
}

.status-dot.error {
  background: var(--warn);
  color: rgba(255, 211, 107, 0.55);
  box-shadow: 0 0 0 rgba(255, 211, 107, 0.55);
}

.status-dot.stop {
  background: var(--loss);
  color: rgba(241, 139, 139, 0.55);
  box-shadow: 0 0 0 rgba(241, 139, 139, 0.55);
}

@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hosted-key-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
    rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.hosted-key-toolbar strong {
  color: #fff;
}

.hosted-key-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.hosted-key-card:hover,
.hosted-key-card.is-selected {
  border-color: rgba(41, 151, 255, 0.72);
  background:
    linear-gradient(135deg, rgba(41, 151, 255, 0.14), rgba(127, 225, 164, 0.04)),
    rgba(41, 151, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.20);
}

.hosted-key-card.is-live {
  border-color: rgba(48, 209, 88, 0.64);
  background:
    linear-gradient(135deg, rgba(127, 225, 164, 0.12), rgba(41, 151, 255, 0.04)),
    rgba(255, 255, 255, 0.032);
}

.hosted-key-card.is-observer {
  border-color: rgba(41, 151, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(41, 151, 255, 0.09), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.024);
}

.hosted-key-main,
.hosted-key-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hosted-key-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.hosted-key-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--gain);
}

.hosted-key-main div {
  min-width: 0;
}

.hosted-key-main strong,
.hosted-key-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hosted-key-main span,
.hosted-key-meta,
.hosted-key-card p {
  color: var(--muted);
  font-size: 11px;
}

.hosted-key-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.hosted-key-meta span {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.035);
}

.hosted-key-card p {
  margin: 0;
  line-height: 1.45;
}

.hosted-key-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.observer-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(41, 151, 255, 0.42);
  border-radius: var(--radius-pill);
  padding: 5px 9px;
  background:
    linear-gradient(135deg, rgba(41, 151, 255, 0.22), rgba(127, 225, 164, 0.06));
  color: #dceeff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.primary-pill.danger {
  background:
    linear-gradient(135deg, rgba(255, 69, 58, 0.98), rgba(241, 139, 139, 0.82));
  color: #fff;
}

.strategy-status {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.012);
}

.strategy-state,
.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.028);
}

.strategy-state span,
.source-row span {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-state em {
  color: var(--quiet);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.strategy-state.is-on em {
  color: var(--gain);
  border: 1px solid rgba(127, 225, 164, 0.35);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  background: linear-gradient(135deg, rgba(127, 225, 164, 0.18), rgba(41, 151, 255, 0.06));
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

.role-matrix {
  height: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
}

.role-card {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.role-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-card span,
.status-pill {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  color: var(--quiet);
  font-size: 11px;
}

.role-card span.is-on,
.status-pill {
  color: var(--gain);
  border-color: rgba(127, 225, 164, 0.42);
  background: rgba(127, 225, 164, 0.08);
}

.status-pill.sell {
  color: var(--loss);
  border-color: rgba(255, 126, 126, 0.44);
  background: rgba(255, 126, 126, 0.08);
}

.status-pill.won {
  color: var(--gain);
  border-color: rgba(127, 225, 164, 0.48);
  background: rgba(127, 225, 164, 0.09);
}

.status-pill.lost {
  color: var(--loss);
  border-color: rgba(255, 126, 126, 0.44);
  background: rgba(255, 126, 126, 0.08);
}

.status-pill.trade {
  color: var(--cyan);
  border-color: rgba(41, 151, 255, 0.4);
  background: rgba(41, 151, 255, 0.08);
}

.contract-grid {
  height: auto;
  min-height: calc(100vh - var(--nav-h) - 118px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contract-block {
  min-height: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--terminal);
  overflow: visible;
}

.contract-block.wide {
  grid-column: 1 / -1;
}

.contract-block h3 {
  margin: 0 0 14px;
}

pre {
  height: auto;
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.04);
}

.docs-layout {
  height: auto;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 230px;
  align-items: start;
  background: var(--terminal);
}

.docs-sidebar,
.docs-toc {
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #050505;
  overflow: visible;
  position: sticky;
  top: var(--nav-h);
}

.docs-toc {
  border-right: 0;
  border-left: 1px solid var(--line);
  padding: 28px 18px;
}

.docs-brand {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.docs-brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.docs-brand div {
  display: grid;
  gap: 2px;
}

.docs-brand strong {
  font-size: 13px;
}

.docs-brand span {
  color: var(--quiet);
  font-size: 11px;
}

.docs-search {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.docs-search span {
  display: none;
}

.docs-search input {
  height: 34px;
  border-radius: var(--radius-pill);
  font-size: 12px;
}

.docs-nav {
  height: auto;
  padding: 12px 10px 18px;
  overflow: visible;
}

.docs-nav p {
  margin: 18px 8px 8px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.docs-nav button,
.docs-toc button,
.docs-footer button {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.docs-nav button:hover,
.docs-toc button:hover,
.docs-footer button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
}

.docs-nav button:active,
.docs-toc button:active,
.docs-footer button:active {
  transform: scale(0.985);
}

.docs-nav button.is-active,
.docs-toc button.is-active {
  color: #fff;
  background: rgba(41, 151, 255, 0.16);
  box-shadow: inset 2px 0 0 var(--primary-2);
}

.docs-article {
  min-width: 0;
  height: auto;
  overflow: visible;
  padding: 22px min(5vw, 64px) 48px;
  scroll-behavior: smooth;
}

.docs-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  border: 1px solid rgba(41, 151, 255, 0.24);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--muted);
  background: rgba(41, 151, 255, 0.08);
  font-size: 12px;
}

.docs-banner span {
  flex: 0 0 auto;
  border: 1px solid rgba(127, 225, 164, 0.36);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  color: var(--gain);
  font-weight: 800;
}

.docs-banner strong {
  color: rgba(245, 245, 247, 0.8);
  font-size: 12px;
}

.docs-breadcrumb {
  margin-top: 24px;
  color: var(--quiet);
  font-size: 12px;
}

.docs-hero {
  padding: 18px 0 28px;
  border-bottom: 1px solid var(--line);
}

.docs-hero h1 {
  max-width: 820px;
  margin: 8px 0 13px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.docs-hero p:last-of-type {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.docs-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.doc-section {
  max-width: 860px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 18px);
}

.doc-section h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.doc-section p {
  max-width: 780px;
  margin: 0 0 14px;
  color: rgba(245, 245, 247, 0.72);
}

.doc-section pre {
  height: auto;
  max-height: none;
  margin-top: 12px;
}

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

.doc-card-grid div {
  display: grid;
  gap: 8px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.doc-card-grid span {
  color: var(--muted);
  font-size: 12px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
}

.doc-table th,
.doc-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.doc-table th {
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
}

.doc-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-flow span {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 800;
}

.doc-flow i {
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

.docs-footer {
  max-width: 860px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 24px 0 4px;
}

.docs-footer button {
  min-height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.docs-toc strong {
  display: block;
  margin-bottom: 12px;
  color: #fff;
  font-size: 13px;
}

.docs-toc button {
  min-height: 28px;
  padding-left: 10px;
  font-size: 12px;
}

.profile-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.72);
}

#adminUserPanel {
  align-items: flex-start;
  overflow: hidden;
}

.profile-panel.is-open {
  display: flex;
}

.profile-card {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.encrypt-card {
  width: min(760px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
}

.credential-detail-card {
  width: min(900px, 100%);
  max-height: min(840px, 92vh);
  overflow: auto;
}

.credential-detail-card.is-readonly label {
  opacity: 0.74;
}

#adminUserForm {
  width: min(860px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

#adminUserForm .observer-assignment-list {
  max-height: min(210px, 28vh);
}

.observer-assignment-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(41, 151, 255, 0.26);
  border-radius: var(--radius-sm);
  padding: 14px;
  background:
    radial-gradient(circle at 96% 0%, rgba(41, 151, 255, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}

.observer-assignment-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.observer-assignment-grid > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.observer-assignment-grid > div > strong {
  color: #fff;
  font-size: 12px;
}

.observer-assignment-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding-right: 2px;
}

.observer-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.026);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.observer-option:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 151, 255, 0.58);
  background:
    linear-gradient(135deg, rgba(41, 151, 255, 0.13), rgba(127, 225, 164, 0.035)),
    rgba(255, 255, 255, 0.032);
}

.observer-option input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--gain);
}

.observer-option span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.observer-option strong,
.observer-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.observer-option strong {
  color: #fff;
  font-size: 12px;
}

.observer-option small {
  color: var(--muted);
  font-size: 11px;
}

.confirm-card {
  width: min(460px, 100%);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028)),
    rgba(12, 12, 14, 0.96);
}

.confirm-copy {
  margin: 0;
  color: rgba(245, 245, 247, 0.76);
  line-height: 1.65;
  font-size: 14px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.vault-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.vault-detail-item {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.2);
}

.vault-detail-item.is-wide {
  grid-column: 1 / -1;
}

.vault-detail-item span {
  color: var(--quiet);
  font-size: 10px;
  text-transform: uppercase;
}

.vault-detail-item strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-note {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(127, 225, 164, 0.28);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(127, 225, 164, 0.06);
}

.security-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.config-output {
  display: grid;
  gap: 10px;
}

.config-output div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-output span {
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
}

.chart-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  pointer-events: none;
  min-width: 150px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: #fff;
  background: rgba(8, 8, 9, 0.92);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  font-size: 12px;
}

.fund-strip {
  flex: 0 0 82px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid var(--line);
  background: #040404;
}

.fund-cell {
  min-width: 0;
  padding: 11px 14px;
  border-right: 1px solid var(--line);
}

.fund-cell:last-child {
  border-right: 0;
}

.fund-cell span {
  display: block;
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
}

.fund-cell strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(17px, 2vw, 25px);
  line-height: 1;
  white-space: nowrap;
  transition: color 180ms ease, opacity 180ms ease;
}

.fund-cell small {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 0.72fr;
  grid-template-rows: 174px minmax(0, 1fr) 230px;
  background: #000;
}

.terminal-panel {
  padding: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #030303;
  background-size: 100% 23px;
}

.terminal-title {
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  border-bottom: 1px solid var(--line);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.terminal-title em {
  color: var(--quiet);
  font-style: normal;
  font-size: 11px;
  white-space: nowrap;
}

.panel-depth,
.panel-edge,
.panel-kelly {
  min-height: 0;
}

.particle-stage {
  grid-column: 1 / -1;
  position: relative;
  min-height: 0;
}

.particle-stage canvas {
  height: calc(100% - 31px);
}

.particle-readout {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(8px);
}

.particle-readout span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
}

.particle-readout b {
  color: #fff;
}

.panel-log,
.panel-pnl,
.panel-status {
  min-height: 0;
}

.panel-pnl canvas,
.panel-edge canvas {
  height: calc(100% - 31px);
}

.depth-stack {
  height: 106px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.depth-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  color: #fff;
  background: transparent;
  text-align: left;
  transition: background 160ms ease, transform 160ms ease;
}

.depth-card:last-child {
  border-right: 0;
}

.depth-card:hover,
.vault-row:hover,
.role-card:hover,
.table-action:hover,
.user-button:hover,
.icon-button:hover,
.demo-row button:hover {
  background: rgba(255, 255, 255, 0.075);
}

.depth-card:active,
.vault-row:active,
.role-card:active,
.table-action:active,
.user-button:active,
.icon-button:active {
  transform: scale(0.985);
}

.depth-card.is-triggered {
  box-shadow: inset 0 0 0 1px rgba(127, 225, 164, 0.34);
}

.depth-head {
  display: grid;
  gap: 2px;
}

.depth-head strong {
  font-size: 17px;
  line-height: 1;
}

.depth-head span,
.depth-head i {
  color: var(--quiet);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.depth-card.is-triggered .depth-head i {
  color: var(--gain);
}

.depth-bars {
  position: relative;
  height: 5px;
  display: flex;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
}

.depth-bars span {
  transition: width 220ms ease;
}

.depth-bars .bid {
  background: rgba(127, 225, 164, 0.78);
}

.depth-bars .ask {
  background: rgba(241, 139, 139, 0.68);
}

.depth-card dl,
.kelly-row dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  margin: 0;
}

.depth-card dl div,
.kelly-row dl div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--quiet);
  font-size: 10px;
}

.depth-card dd,
.depth-card dt,
.kelly-row dd,
.kelly-row dt {
  margin: 0;
  transition: color 180ms ease, opacity 180ms ease;
}

.news-tape {
  height: calc(100% - 137px);
  display: grid;
  align-content: start;
  overflow: hidden;
}

.news-row {
  display: grid;
  grid-template-columns: 44px 54px 1fr;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.news-row strong {
  color: #fff;
}

.news-row em {
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-row.is-hot span {
  color: var(--gain);
}

.kelly-list {
  height: calc(100% - 31px);
  overflow: hidden;
}

.kelly-row {
  position: relative;
  min-height: 54px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.kelly-row strong {
  display: block;
  font-size: 14px;
}

.kelly-row span {
  display: block;
  color: var(--quiet);
  font-size: 10px;
}

.kelly-row.is-triggered {
  background: rgba(127, 225, 164, 0.06);
}

.kelly-row.is-triggered::before,
.depth-card.is-triggered::before {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gain);
  box-shadow: 0 0 0 rgba(127, 225, 164, 0.65);
  animation: livePulse 1.5s infinite;
}

.depth-card.is-triggered::before {
  top: 10px;
  right: 10px;
}

.engine-log {
  height: calc(100% - 31px);
  margin: 0;
  padding: 7px 0;
  list-style: none;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.engine-log li {
  display: grid;
  grid-template-columns: 66px 58px 1fr;
  gap: 8px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
}

.engine-log time {
  color: var(--quiet);
}

.engine-log strong {
  color: #fff;
}

.engine-log span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-status {
  height: calc(100% - 31px);
  display: grid;
  align-content: start;
  margin: 0;
  padding: 6px 10px;
}

.bot-status div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
}

.bot-status dt {
  color: var(--quiet);
}

.bot-status dd {
  margin: 0;
  color: #fff;
  font-weight: 800;
}

.trade-stats {
  min-height: 76px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: #040404;
}

.trades-page {
  overflow: visible;
}

.trades-page .page-heading {
  min-height: 98px;
  padding: 18px 22px;
}

.trades-page .trade-filters {
  min-height: 48px;
  padding: 6px 12px;
}

.trades-page .trade-stats {
  min-height: 64px;
}

.trade-curve-panel.panel {
  height: 412px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.curve-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.curve-head h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.curve-range {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.035);
}

.curve-range button {
  min-width: 42px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.curve-range button:hover,
.curve-range button.is-active {
  color: #fff;
  background: rgba(41, 151, 255, 0.28);
  transform: translateY(-1px);
}

.curve-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.curve-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 12px 14px 10px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 46%),
    var(--terminal);
}

.curve-card:last-child {
  border-right: 0;
}

.curve-card > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.curve-card span {
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
}

.curve-card strong {
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.curve-card canvas {
  min-height: 0;
  height: 244px;
}

.trade-filters {
  height: 58px;
  display: grid;
  grid-template-columns: 150px 150px 220px minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  color: rgba(245, 245, 247, 0.82);
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
}

.platform-chip.is-polymarket {
  border-color: rgba(41, 151, 255, 0.28);
  color: #9fd0ff;
  background: linear-gradient(135deg, rgba(41, 151, 255, 0.18), rgba(255, 255, 255, 0.03));
}

.platform-chip.is-binance {
  border-color: rgba(255, 204, 102, 0.28);
  color: #ffcc66;
  background: linear-gradient(135deg, rgba(255, 204, 102, 0.16), rgba(255, 255, 255, 0.03));
}

.trade-filters label {
  display: grid;
  gap: 4px;
}

.trade-filters span {
  color: var(--quiet);
  font-size: 10px;
  text-transform: uppercase;
}

.trade-filters select {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #080808;
  color: var(--text);
  padding: 0 10px;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.trade-filters select:hover,
.trade-filters select:focus {
  border-color: rgba(41, 151, 255, 0.55);
  background: #0d1115;
  transform: translateY(-1px);
  outline: none;
}

.trades-layout {
  height: auto;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1.15fr) minmax(230px, 0.55fr);
}

.dense-table th,
.dense-table td {
  padding: 10px 12px;
  font-size: 12px;
}

.dense-table {
  table-layout: fixed;
}

.dense-table th,
.dense-table td {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dense-table th {
  white-space: nowrap;
}

.dense-table td {
  white-space: nowrap;
}

.dense-table tr.is-expanded > td {
  background: rgba(41, 151, 255, 0.045);
}

.row-expand {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-top: 6px;
  border: 1px solid rgba(41, 151, 255, 0.34);
  border-radius: var(--radius-pill);
  padding: 0 8px;
  color: var(--cyan);
  background: rgba(41, 151, 255, 0.08);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.row-expand:hover {
  border-color: rgba(41, 151, 255, 0.64);
  background: rgba(41, 151, 255, 0.15);
  transform: translateY(-1px);
}

.row-expand[aria-expanded="true"] {
  color: #fff;
  background: rgba(41, 151, 255, 0.22);
}

.dense-table .detail-row td {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(41, 151, 255, 0.055), rgba(255, 255, 255, 0.018)),
    #050505;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 14px 16px 16px;
}

.record-detail-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.035);
}

.record-detail-grid dt {
  margin-bottom: 5px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.record-detail-grid dd {
  margin: 0;
  color: rgba(245, 245, 247, 0.86);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ledger-panel,
.positions-panel,
.trade-side {
  min-height: 0;
  overflow: visible;
}

.outcome-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
}

.tf-pill {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  border: 1px solid rgba(41, 151, 255, 0.36);
  border-radius: var(--radius-pill);
  padding: 3px 7px;
  color: var(--cyan) !important;
  font-size: 11px;
}

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

.positions-block {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.positions-block > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeframe-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.timeframe-card strong {
  font-size: 20px;
}

.timeframe-card span {
  color: var(--muted);
  font-size: 12px;
}

.timeframe-card em {
  font-style: normal;
  font-size: 18px;
  font-weight: 800;
}

.timeframe-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.timeframe-card dl div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: rgba(255, 255, 255, 0.028);
}

.timeframe-card dt {
  color: var(--quiet);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.timeframe-card dd {
  margin: 2px 0 0;
  color: rgba(245, 245, 247, 0.82);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeframe-card i {
  display: block;
  height: 5px;
  border-radius: var(--radius-pill);
  background: currentColor;
  color: var(--gain);
}

.page-heading,
.panel,
.terminal-panel,
.contract-block,
.fund-cell,
.depth-card,
.curve-card,
.timeframe-card,
.doc-card,
.role-card,
.decision-row,
.policy-row,
.vault-row,
.tag-row,
.trade-filters,
.ledger-panel,
.positions-panel,
.whitelist-panel,
.users-panel,
.table-panel,
.positions-block,
.record-detail-grid,
.data-table,
.dense-table,
.profile-card {
  border-radius: var(--radius-sm);
}

.page-heading,
.terminal-panel,
.contract-block,
.fund-cell,
.depth-card,
.curve-card,
.timeframe-card,
.doc-card,
.role-card,
.trade-filters,
.ledger-panel,
.positions-panel,
.whitelist-panel,
.users-panel,
.table-panel,
.positions-block,
.record-detail-grid {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
    radial-gradient(circle at 100% 0%, rgba(41, 151, 255, 0.055), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.terminal-panel {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  background-repeat: repeat, no-repeat;
  background-size: 100% 23px, auto;
}

.tap-flash {
  animation: tapFlash 360ms ease;
}

@keyframes tapFlash {
  0% { box-shadow: inset 0 0 0 0 rgba(41, 151, 255, 0.0); }
  35% { box-shadow: inset 0 0 0 999px rgba(41, 151, 255, 0.12); }
  100% { box-shadow: inset 0 0 0 0 rgba(41, 151, 255, 0.0); }
}

@media (prefers-reduced-motion: reduce) {
  .route-loader.is-active::before,
  .page.is-active,
  .tap-flash,
  .live-pulse span {
    animation: none;
  }
}

@media (max-width: 900px) {
  .nav-inner {
    gap: 12px;
    padding-inline: 12px;
  }

  .brand-mark {
    min-width: 42px;
  }

  .nav-links {
    gap: 18px;
  }

  .user-cluster {
    min-width: 206px;
  }

  .user-button {
    min-width: 146px;
  }

  .fund-cell {
    padding: 10px 12px;
  }

  .fund-cell strong {
    font-size: 20px;
  }

  .terminal-title {
    padding-inline: 9px;
    font-size: 11px;
  }

  .terminal-title em {
    display: none;
  }

  .depth-card {
    padding: 8px 7px;
  }

  .depth-head span {
    display: none;
  }

  .depth-card dl {
    grid-template-columns: 1fr;
  }

  .depth-card dl div:nth-child(2),
  .depth-card dl div:nth-child(3) {
    display: none;
  }

  .kelly-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-inline: 8px;
  }

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

  .page-heading {
    height: 108px;
    padding: 20px 16px;
  }

  .page-heading h1 {
    font-size: 30px;
  }

  .page-heading p:last-child {
    max-width: 520px;
  }

  .trades-layout {
    height: auto;
    min-height: 360px;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) 230px;
  }

  .trade-stats {
    height: 64px;
  }

  .curve-card strong {
    font-size: 19px;
  }

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

  .docs-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }

  .docs-article {
    padding-inline: 28px;
  }

  .doc-card-grid {
    grid-template-columns: 1fr;
  }

  .ledger-panel .dense-table th:nth-child(4),
  .ledger-panel .dense-table td:nth-child(4),
  .ledger-panel .dense-table th:nth-child(7),
  .ledger-panel .dense-table td:nth-child(7),
  .ledger-panel .dense-table th:nth-child(8),
  .ledger-panel .dense-table td:nth-child(8),
  .positions-panel .dense-table th:nth-child(4),
  .positions-panel .dense-table td:nth-child(4),
  .positions-panel .dense-table th:nth-child(5),
  .positions-panel .dense-table td:nth-child(5),
  .positions-panel .dense-table th:nth-child(6),
  .positions-panel .dense-table td:nth-child(6) {
    display: none;
  }
}

@media (max-width: 700px) {
  html,
  body {
    overflow: auto;
  }

  .auth-screen,
  .dashboard-grid,
  .ops-grid,
  .market-layout,
  .connect-layout,
  .admin-layout,
  .contract-grid,
  .docs-layout,
  .trades-layout {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .page,
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .global-nav {
    position: sticky;
  }

  .nav-inner {
    gap: 10px;
    padding: 0 12px;
  }

  .nav-links {
    gap: 12px;
    font-size: 11px;
  }

  .user-cluster {
    min-width: 0;
  }

  .user-copy {
    display: none;
  }

  .kpi-strip,
  .fund-strip,
  .trade-stats,
  .trade-filters,
  .curve-grid,
  .auth-metrics,
  .two-field {
    grid-template-columns: 1fr;
  }

  .page-heading {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .trade-filters {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-curve-panel.panel {
    height: auto;
  }

  .curve-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .curve-range {
    width: 100%;
    overflow-x: auto;
  }

  .curve-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .vault-detail-grid {
    grid-template-columns: 1fr;
  }

  #adminUserForm {
    width: min(100%, 620px);
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .observer-assignment-grid {
    grid-template-columns: 1fr;
  }

  #adminUserForm .observer-assignment-list {
    max-height: 180px;
  }

  .docs-sidebar,
  .docs-article {
    height: auto;
    overflow: visible;
  }

  .docs-nav {
    height: auto;
    max-height: 320px;
  }

  .docs-footer {
    grid-template-columns: 1fr;
  }

  .auth-visual,
  .auth-panel {
    padding: 28px;
  }
}
